Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
abgruszecki committed May 27, 2021
1 parent 10fe537 commit fd45c69
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 13 additions & 0 deletions tests/neg/gadt-contradictory-pattern.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
object Test {
sealed abstract class Foo[T]
case object Bar1 extends Foo[Int]
case object Bar2 extends Foo[String]
case object Bar3 extends Foo[AnyRef]

def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
case (Bar1, Bar1) => () // error // error
case (Bar2, Bar3) => ()
case (Bar3, _) => ()
}

}
2 changes: 1 addition & 1 deletion tests/patmat/exhausting.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
32: Pattern Match Exhaustivity: List(_, _*)
39: Pattern Match Exhaustivity: Bar3
44: Pattern Match Exhaustivity: (Bar2, Bar2)
50: Pattern Match Exhaustivity: (Bar2, Bar2)
49: Pattern Match Exhaustivity: (Bar2, Bar2)
1 change: 0 additions & 1 deletion tests/patmat/exhausting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ object Test {
}
// fails for: (Bar2, Bar2)
def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
case (Bar1, Bar1) => ()
case (Bar2, Bar3) => ()
case (Bar3, _) => ()
}
Expand Down

0 comments on commit fd45c69

Please sign in to comment.