From 311b7de861bd2f4137e3503483177a1588cfdd12 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 6 May 2011 04:32:39 +0000 Subject: Finally figured out what was going on with a ce... Finally figured out what was going on with a certain class of exhaustiveness checking bugs. Hey moors, you can put away your pins, puppets, and magic sauces. Closes #3098, no review. --- test/files/pos/bug4020.scala | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/files/pos/bug4020.scala (limited to 'test/files/pos/bug4020.scala') diff --git a/test/files/pos/bug4020.scala b/test/files/pos/bug4020.scala new file mode 100644 index 0000000000..f976460191 --- /dev/null +++ b/test/files/pos/bug4020.scala @@ -0,0 +1,25 @@ +class A { + sealed trait Foo +} + +object a1 extends A { + case class Foo1(i: Int) extends Foo +} + +object a2 extends A { + case class Foo2(i: Int) extends Foo +} + +class B { + def mthd(foo: a2.Foo) = { + foo match { + case a2.Foo2(i) => i + + // Note: This case is impossible. In fact, scalac + // will (correctly) report an error if it is uncommented, + // but a warning if it is commented. + + // case a1.Foo1(i) => i + } + } +} \ No newline at end of file -- cgit v1.2.3