-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: remove generic and generic check from TypedAttribute #3504
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3504 +/- ##
==========================================
- Coverage 90.34% 90.34% -0.01%
==========================================
Files 464 464
Lines 58052 58037 -15
Branches 5550 5549 -1
==========================================
- Hits 52448 52434 -14
Misses 4177 4177
+ Partials 1427 1426 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why it was added in the first place? I'm wondering why it wasn't just using OO, is it for precise placement of the type
variable in the list of parameters? It feels like that should be possible by redeclaring the type property at the desired index. Do you feel like that would be worth a go? It would also decouple the dense stuff, I have a feeling.
I'm not really sure why it was there, and @math-fehr wasn't sure either. I kind of feel that enforcing that the type appear as a parameter at all rather than just as an interface method on I'm actually really struggling to get all the variances correct on dense PR atm so any suggestions on sorting this stuff would be good. |
Would you like me to have a go at my own suggestion? |
Go for it. I'm starting to wonder if the generic parameter on |
My attempt was a failure, let's go back to this idea. Is there any way to keep the unit test deleted here? So we keep the fact that the type is indeed the same as the |
What do you mean? |
Like to make the check work differently, instead of looking for the parameter of the |
I would prefer just to remove the generic parameter on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a comment but otherwise nice!
@superlopuh you happy with this (and the next PR)? |
Oh this is a case where I think I'm only happy with this together with the next PR, as after this PR we can declare something as typed with a certain type, but remove the code that verifies this at runtime. If TypedAttribute is no longer generic then this PR is dead code elimination. |
Should I merge the 2 PRs? |
I would recommend mergint them in one go, yep |
Great, I'm just merging main into the second one to update |
That did not work... |
e0224a8
to
dffa305
Compare
…ct#3504) `TypedAttribute` was using some needlessly complicated python generic typing, which was making other changes difficult. This commit removes this.
As discussed in #3492, this check feels unnecessary and is unwanted for making
DenseIntOrFPElementsAttr
aTypedAttribute