-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix attribute type resolution with multiple inheritance #18415
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
Changes from 4 commits
e8ccf89
f04fd93
4d6bdf4
503c145
44ccc38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -706,3 +706,29 @@ class C34(B3, B4): ... | |
| class C41(B4, B1): ... | ||
| class C42(B4, B2): ... | ||
| class C43(B4, B3): ... | ||
|
|
||
| [case testMultipleInheritanceExplcitDiamondResolution] | ||
| # Adapted from #14279 | ||
| class A: | ||
| class M: | ||
| pass | ||
|
|
||
| class B0(A): | ||
| class M(A.M): | ||
| pass | ||
|
|
||
| class B1(A): | ||
| class M(A.M): | ||
| pass | ||
|
|
||
| class C(B0,B1): | ||
| class M(B0.M, B1.M): | ||
| pass | ||
|
|
||
| class D0(B0): | ||
| pass | ||
| class D1(B1): | ||
| pass | ||
|
|
||
| class D(D0,D1,C): | ||
| pass | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we expect an error for something like:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We certainly should expect an error there as such an override violates LSP. But overrides are checked elsewhere, I'm only modifying inherited attributes compatibility checks in this PR. |
||
Uh oh!
There was an error while loading. Please reload this page.