Skip to content

Defend against AliasingBounds #23668

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

Fixes #23666

Not sure if dealias should do this already.

This commit is a placeholder that makes the test pass.

@som-snytt som-snytt marked this pull request as ready for review August 5, 2025 20:47
@som-snytt
Copy link
Contributor Author

Ready for review in the sense of open to suggestions.

@som-snytt
Copy link
Contributor Author

I appreciate the Odersky PR that says "we need a better solution". This is such a PR, if only it had a PR label.

@@ -1166,7 +1166,9 @@ object RefChecks {
def targetOfHiddenExtension: Symbol =
val target =
val target0 = explicitInfo.firstParamTypes.head // required for extension method, the putative receiver
target0.dealiasKeepOpaques.typeSymbol.info
target0.dealiasKeepOpaques.typeSymbol.info match
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of weird since dealias does skip aliasing bounds. It would be good to get an explanation what exactly goes wrong here. What's the type of target0.dealiasKeepOpaques in the failing test? What is its info? Is there an opaque type involved?

@odersky odersky assigned som-snytt and unassigned odersky Aug 6, 2025
@som-snytt som-snytt marked this pull request as draft August 6, 2025 15:05
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.

Crash when type alias has extension method with the same name as the underlying type
2 participants