Skip to content

Commit d6a4b99

Browse files
committed
Fix failing test
1 parent a597fbd commit d6a4b99

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
object Test {
2+
sealed abstract class Foo[T]
3+
case object Bar1 extends Foo[Int]
4+
case object Bar2 extends Foo[String]
5+
case object Bar3 extends Foo[AnyRef]
6+
7+
def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
8+
case (Bar1, Bar1) => () // error // error
9+
case (Bar2, Bar3) => ()
10+
case (Bar3, _) => ()
11+
}
12+
13+
}

tests/patmat/exhausting.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
32: Pattern Match Exhaustivity: List(_, _*)
44
39: Pattern Match Exhaustivity: Bar3
55
44: Pattern Match Exhaustivity: (Bar2, Bar2)
6-
50: Pattern Match Exhaustivity: (Bar2, Bar2)
6+
49: Pattern Match Exhaustivity: (Bar2, Bar2)

tests/patmat/exhausting.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ object Test {
4242
}
4343
// fails for: (Bar2, Bar2)
4444
def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match {
45-
case (Bar1, Bar1) => ()
4645
case (Bar2, Bar3) => ()
4746
case (Bar3, _) => ()
4847
}

0 commit comments

Comments
 (0)