-
Notifications
You must be signed in to change notification settings - Fork 528
Make trait properties and methods first class node citizens #1370
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
Make trait properties and methods first class node citizens #1370
Conversation
Aah I guess I could keep BC here still if really needed ;) Oh and sorry for the title rename. I messed it up.. |
347e751
to
fecbc7c
Compare
fecbc7c
to
b694a3f
Compare
b694a3f
to
42e024a
Compare
I added a new virtual node
I guess my first intuition would be to kind of decorate a UPDATE: I was so focused on |
c19dd15
to
8c74303
Compare
8c74303
to
9eee131
Compare
Nice, thank you! |
This is basically the refactoring I had in mind in #1362
The current state is already a bit weird IMO, in general trait props and methods were ignored when gathering class nodes. Then recently I added trait props to a dedicated array, just to use them also via uninitialized props checks. I did not add them to the normal props because that would lead to annoying new errors via
UnusedPrivatePropertyRule
.Then just yesterday I added trait property promotion usage to the normal property usage, but ignoring other potential trait prop usages elsewhere. And trait methods are still completely ignored.
So what does this do different now?
Trait props and methods are gathered together with their class counterparts. And rules just use that. Additionally the information if the prop or method came from a trait is also remembered and only that is used to skip trait props / methods in those 2
UnusedPrivate*
rules, that were annoying.I think in the long-run this makes more sense and avoids more weird trait problems. But maybe the details could be modified a bit. WDYT?