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

Generate opaque proxies also for base classes #14668

Merged
merged 1 commit into from Mar 14, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 11, 2022

Fixes #14656

@prolativ
Copy link
Contributor

Just to make this clear (because the name of the PR made me wonder):
This PR does NOT intend to make an opaque type transparent in the scopes of subtypes of a class/trait defining the opaque type, right? Because that would change the current language specification if I got this right.
https://docs.scala-lang.org/scala3/reference/other-new-features/opaques-details.html

Inside the scope of the alias definition, the alias is transparent: T is treated as a normal alias of R. Outside its scope, the alias is treated as the abstract type

@odersky
Copy link
Contributor Author

odersky commented Mar 11, 2022

Good point! Yes, we have to modify this logic. We have to only create proxies for the base class where the inline method is located, not for all of them.

@odersky
Copy link
Contributor Author

odersky commented Mar 11, 2022

Correction: We already only take opaque types into account that come from a class enclosing the inlined method. So that looks correct to me.

@odersky odersky merged commit 09a4ce3 into scala:main Mar 14, 2022
@odersky odersky deleted the fix-14656 branch March 14, 2022 08:36
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
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.

Opaque type weirdness: (self$proxy1 : Any) Required: BigDecimalNewType_this.Type
3 participants