summaryrefslogtreecommitdiff
path: root/test/files/run/t1048.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t1048.scala')
-rw-r--r--test/files/run/t1048.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/t1048.scala b/test/files/run/t1048.scala
new file mode 100644
index 0000000000..5eaeaa25c6
--- /dev/null
+++ b/test/files/run/t1048.scala
@@ -0,0 +1,21 @@
+final case class W[A](v: A)
+
+object E {
+ def unapply(w: W[Any]): Option[Any] = None
+}
+
+object Bug {
+ def bug[A](e: Either[W[_], A]) = e match {
+ case Left(E(x)) => 1
+ case Right(x) => 2
+ case _ => 3
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ println(Bug.bug(Left(W(5))))
+ println(Bug.bug(Right(5)))
+ }
+}
+