Skip to content
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

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Conversation

rochala
Copy link
Contributor

@rochala rochala commented Feb 3, 2025

Fixes #22232

Work also done by @hamzaremmal, @julian-a-avar-c and @nmcb

@@ -1190,7 +1191,7 @@ object RefChecks {
}
}
.exists
if !target.typeSymbol.isOpaqueAlias && hidden
if hidden
Copy link
Contributor

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! 🥲

Copy link
Member

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

Copy link
Contributor

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.

@KacperFKorban KacperFKorban merged commit 7d79c56 into scala:main Feb 24, 2025
29 checks passed
KacperFKorban pushed a commit that referenced this pull request Mar 10, 2025
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.
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn universal extensions on opaque type
5 participants