diff --git a/tests/patmat/t4661b.check b/tests/patmat/t4661b.check new file mode 100644 index 000000000000..50b0c4da452e --- /dev/null +++ b/tests/patmat/t4661b.check @@ -0,0 +1,2 @@ +10: Pattern Match Exhaustivity: _: c.Foo +13: Match case Unreachable diff --git a/tests/patmat/t4661b.scala b/tests/patmat/t4661b.scala new file mode 100644 index 000000000000..84bb802036da --- /dev/null +++ b/tests/patmat/t4661b.scala @@ -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 + } +}