Skip to content

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 9 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.junit.Test
class PatmatExhaustivityTest {
val testsDir = "tests/patmat"
// stop-after: patmatexhaust-huge.scala crash compiler
val options = List("-color:never", "-Ystop-after:crossCast", "-Ycheck-all-patmat", "-classpath", TestConfiguration.basicClasspath)
val options = List("-color:never", "-Ystop-after:explicitSelf", "-Ycheck-all-patmat", "-classpath", TestConfiguration.basicClasspath)
Copy link
Contributor Author

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!

Copy link
Contributor

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 and i4030.scala are due to type inference change.


private def compile(files: Seq[String]): Seq[String] = {
val stringBuffer = new StringWriter()
Expand Down
3 changes: 2 additions & 1 deletion tests/patmat/i4030.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]())
Copy link
Contributor

Choose a reason for hiding this comment

The 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 👍

}