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

Normalize reference to undet param in stabilizer #10760

Merged
merged 1 commit into from May 8, 2024
Merged

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Apr 19, 2024

Details in the ticket.

Fixes scala/bug#12987.

@scala-jenkins scala-jenkins added this to the 2.13.15 milestone Apr 19, 2024
@lrytz lrytz requested a review from retronym April 19, 2024 13:30
case t: AliasTypeRef if t.pre.termSymbol == vsym && context.undetparams.contains(t.normalize.typeSymbol) =>
t.normalize
case t => t
})
Copy link
Member Author

Choose a reason for hiding this comment

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

In short, given a method def m(b: FT, o: Option[I]): Int and a stabilizer is inserted at some call site stabilizer$1.m(b, None)

If FT is a type parameter, stabilizer$1.m has a MethodType where the parameter type FT is subsituted by asSeenFrom.

If FT is a type member, the parameter type ends up being AliasNoArgsTypeRef(stabilizer$1.type, FT), which is equivalent in theory, but instantiateTypeParams doesn't see through this alias.

More details in scala/bug#12987.

@lrytz
Copy link
Member Author

lrytz commented May 8, 2024

... also a pragmatic fix :)

@lrytz lrytz merged commit ab41073 into scala:2.13.x May 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants