-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[red-knot] Find conflicting declarations for attribute in class methods #16240
base: main
Are you sure you want to change the base?
Conversation
a5a946a
to
e712ec8
Compare
I put this back in draft as it doesn't seem finished. |
Just for additional context, I suggested splitting the implementation into two parts: (1) collect all conflicting declared types so we would in principle be able to emit a diagnostic — assuming we could do it from anywhere, and (2) actually create a new diagnostic and make the required changes to be able to emit it. But even part (1) doesn't seem finished, so keeping this in draft seems fine. @smokyabdulrahman Let us know if you need additional help to proceed here. |
Hey @sharkdp, |
We identified two spots in the linked issue. If I understand it correctly, you solved it for one of these, but the more difficult one would be in the change to the loop logic. I can go into more details tomorrow, if that would help.
The infrastructure for emitting diagnostics from The important thing for part 1 would be to get the semantics correct, i.e. to identify two or three test cases that would clearly show that we would be able to generate the right diagnostic messages. If that sounds too complicated, I'm also okay with leaving that open for a bit longer, and revisit it once the diagnostics infrastructure is in place. |
This is being tracked in #16298 |
Summary
Handling one more case for class attributes: checking for conflicting declarations for class attributes in methods.
part of #15964
Test Plan
No test for now