You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 87.10%. The percentage of expected errors that received a diagnostic held steady at 77.81%.
The reason will be displayed to describe this comment to others. Learn more.
Kinda unfortunate that we have to re-match on self here inside this match arm, where a bunch of types will never match here. But I guess it's hard to structure this otherwise without if let guards, which are still experimental. We could extract the "fallback" handling below into a function/method/closure so we could easily reuse it in two different branches, but maybe that's not worth it.
I'll note for posterity that privileging enum members over other attributes results in behavior that doesn't match runtime in the weird case where you have a mixin enum type (like IntEnum, where members are also subclasses of int), and then you also define an enum member that overrides a real attribute of the mixin class (e.g. an IntEnum with a member named numerator or denominator). In this case at runtime MyWeirdIntEnum.numerator.numerator actually accesses the real int attribute numerator on the enum value MyWeirdIntEnum.numerator, whereas in this PR you'd get back the enum member again.
But a) this case is invalid, and once we improve our Liskov checking we should emit a Liskov violation on it, and b) other type checkers all do the same. So I think this behavior is fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes astral-sh/ty#2977.