-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Warn universal extensions on opaque types #22502
Conversation
@@ -1190,7 +1191,7 @@ object RefChecks { | |||
} | |||
} | |||
.exists | |||
if !target.typeSymbol.isOpaqueAlias && hidden | |||
if hidden |
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.
That line keeps getting shorter and shorter! 🥲
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 mean, it makes sense to say: if the extension method is hidden, then emit a warning
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.
It's so simple when you put it like that.
Fixes #22705 Fixes #22706 Fixes #22727 Follow-up to #22502 by inserting a `dealias` when arriving at `target` type. Refactored the body of `hidden` to make it easier to read. Adjusted the doc for the same reason. As a reminder to self, the original reason for special handling of aliases was due to subclassing, but overrides are excluded. (One could restore that warning for edge cases.) The long doc explaining the handling of leading implicits is moved to the end (as an appendix). Despite best efforts, I was unable to make the doc longer than the code.
Fixes #22232
Work also done by @hamzaremmal, @julian-a-avar-c and @nmcb