From 04ec346ef2b61cdd976cb954a04af6ab7fa71c7a Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Mon, 14 Jun 2021 09:12:20 +0200 Subject: [PATCH] Fix #12808: Add test --- tests/patmat/i12808.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/patmat/i12808.scala 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")