Skip to content

Commit 61cba97

Browse files
authored
Merge pull request #4950 from abeln/unreachable2
Add additional test case for #4661
2 parents 01c5eac + f548147 commit 61cba97

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/patmat/t4661b.check

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
10: Pattern Match Exhaustivity: _: c.Foo
2+
13: Match case Unreachable

tests/patmat/t4661b.scala

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class C {
2+
trait Foo
3+
class One extends Foo
4+
class Two extends Foo
5+
class Bla extends One
6+
}
7+
8+
class Test(val c: C) {
9+
import c._
10+
def test(f: Foo) = f match { // not exhaustive
11+
case f: One =>
12+
case f: Two =>
13+
case f: Bla => // unreachable case
14+
}
15+
}

0 commit comments

Comments
 (0)