Skip to content

Fix #8750: Strip opaque refinements when checking self type #8751

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

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 20, 2020

Strip opaque refinements when checking that a class is instantiatable

Strip opaque refinements when checking that a class is instantiatable
// Create a synthetic singleton type instance, and check whether
// it conforms to the self type of the class as seen from that instance.
val stp = SkolemType(tp)
val selfType = cls.asClass.givenSelfType.asSeenFrom(stp, cls)
val selfType =
cls.asClass.givenSelfType.stripOpaques.asSeenFrom(stp, cls)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe stripOpaque should be a boolean parameter of givenSelfTypes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's safer to keep givenSelfType as is. It's really just when checking that we need to strip the refinements.

@odersky odersky merged commit b3f2aee into scala:master Apr 20, 2020
@odersky odersky deleted the fix-#8750 branch April 20, 2020 09:50
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.

2 participants