From f548147623ddbe2b15cd272479fdd09ec991d14a Mon Sep 17 00:00:00 2001 From: Abel Nieto Date: Wed, 15 Aug 2018 12:54:39 -0400 Subject: [PATCH] Add additional test case for #4661 The test case comes from #4660, which is a related bug. --- tests/patmat/t4661b.check | 2 ++ tests/patmat/t4661b.scala | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/patmat/t4661b.check create mode 100644 tests/patmat/t4661b.scala 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 + } +}