Skip to content

Commit

Permalink
Merge pull request #4950 from abeln/unreachable2
Browse files Browse the repository at this point in the history
Add additional test case for #4661
  • Loading branch information
liufengyun committed Aug 15, 2018
2 parents 01c5eac + f548147 commit 61cba97
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/patmat/t4661b.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
10: Pattern Match Exhaustivity: _: c.Foo
13: Match case Unreachable
15 changes: 15 additions & 0 deletions tests/patmat/t4661b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class C {
trait Foo
class One extends Foo
class Two extends Foo
class Bla extends One
}

class Test(val c: C) {
import c._
def test(f: Foo) = f match { // not exhaustive
case f: One =>
case f: Two =>
case f: Bla => // unreachable case
}
}

0 comments on commit 61cba97

Please sign in to comment.