-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #10108: Distinguish between soft and hard union types #10112
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
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
640e6a0
Fix #10108: Keep an `isSoft` flag in OrTypes
odersky c5b491f
Fix conditions when to add an AndType in CrossCastAnd
odersky cde7d7d
Treat soft and hard unions differently when widening
odersky d9c7e57
Drop asymmetric widening
odersky e407f38
Remove asymmetric option in code and comments
odersky 3a5f934
Drop CrossCastAnd
odersky b8155d8
Drop unreachable case in doctest
odersky 35801a1
Fix exhaustivity checks
liufengyun 0463200
Refactor flatten to be lazy
liufengyun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ object TestGADT { | |
def f[A <: Seq[_], B, Foo >: A => B](v: Root[Foo], u: Root[Foo]) = (v, u) match { | ||
case (C3(), C3()) => | ||
} | ||
f(C3[Seq[_], Long](), C4[Seq[_], Long]()) | ||
// The following line no longer type checks | ||
// f(C3[Seq[_], Long](), C4[Seq[_], Long]()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case shows that this PR improves over the previous handling of union types 👍 |
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
That explains the mystery of the added lines, I suppose? Good catch!
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.
Yes, most failures come from this change. The test case
i8922c.scala
andi4030.scala
are due to type inference change.