diff --git a/tests/patmat/i12808.scala b/tests/patmat/i12808.scala new file mode 100644 index 000000000000..b0c5aad78a64 --- /dev/null +++ b/tests/patmat/i12808.scala @@ -0,0 +1,10 @@ +import scala.reflect.Typeable + +case class Err1() +case class Err2() + +def handleError[A: Typeable, B: Typeable](x: Either[A | B, Nothing]): Unit = + x match // false alarm warning: It would fail on pattern case: Left(_) + case Left(e: A) => println("A") + case Left(_: B) => println("B") + case Right(_) => println("Nothing")