Skip to content
Browse files

SI-8045 type inference of extracted value

Test case for SI-8045, fixed by the preceding commits.
  • Loading branch information...
1 parent def46a9 commit 1696145f7642b309b326942f7a25bde3587d7449 @paulp paulp committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 test/files/pos/t8045.scala
View
17 test/files/pos/t8045.scala
@@ -0,0 +1,17 @@
+object Test extends App {
+ case class Number(i: Int)
+
+ object UnliftNumber {
+ def unapply(t: Any): Option[Number] = t match {
+ case i: Int => Some(Number(i))
+ case _ => None
+ }
+ }
+
+ def eval(expr: Any): Option[Number] = expr match {
+ case UnliftNumber(n) => Some(n)
+ case _ => None
+ }
+
+ println(eval(1))
+}

0 comments on commit 1696145

Please sign in to comment.
Something went wrong with that request. Please try again.