-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disable distribution of intersection types over applied types #23441
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
Conversation
2daa02b
to
6171b84
Compare
7bf9c7d
to
6b20da7
Compare
And add minimization
Instead of AppliedType of OrTypes, which relied on the distribution of AndTypes when inheriting multiple context bound companions of the same name
6b20da7
to
73214ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be conservative I'd make the main change in distributeAnd conditional on a source version or a -Y flag. That would give applications that critically rely on the unsoundness a way out.
This reverts commit 0441af0 to resolve merge conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for squeezing these changes in your busy schedule!
Fixes soundness issue #23435
Note in particular that this implies we cannot (indirectly) inherit multiple instantiations of the same trait. E.g., see tests/neg/conflicting-inst-basetypes.scala.
The impact on the community-build appears to be rather reasonable, tweaks are required:
The changes should be relatively well regrouped by commit for review.