Skip to content

Commit

Permalink
Fix scala#12808: Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jun 14, 2021
1 parent b7aae46 commit 04ec346
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/patmat/i12808.scala
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 04ec346

Please sign in to comment.