Skip to content

Commit 38f1d50

Browse files
committed
add test
1 parent da20e0c commit 38f1d50

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/warn/i24246.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- [E029] Pattern Match Exhaustivity Warning: tests/warn/i24246.scala:8:2 ----------------------------------------------
2+
8 | x match { // warn
3+
| ^
4+
| match may not be exhaustive.
5+
|
6+
| It would fail on pattern case: ZZ
7+
|
8+
| longer explanation available when compiling with `-explain`

tests/warn/i24246.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
trait X
2+
3+
sealed trait Y
4+
case object YY extends Y, X
5+
case object ZZ extends Y, X
6+
7+
def foo[A <: X & Y](x: A): Unit =
8+
x match { // warn
9+
case YY => ()
10+
}

0 commit comments

Comments
 (0)