Permalink
Browse files

Add test for t5579 in pending/pos

  • Loading branch information...
phaller committed May 7, 2012
1 parent ea25648 commit 5d5c7801d6d3e1214fed571dde79eae8cb6f1d0e
Showing with 29 additions and 0 deletions.
  1. +29 −0 test/pending/pos/t5579.scala
@@ -0,0 +1,29 @@
import language.existentials
class Result[+A]
case class Success[A](x: A) extends Result[A]
class Apply[A]
object Apply {
def apply[A](f: Int => Result[A]): Apply[A] = new Apply[A]
}
object TestUnit {
//Error is here:
def goo = Apply { i =>
i match {
case 1 => Success(Some(1))
case _ => Success(None)
}
}
//If type is defined explicitly (which I wanted from compiler to infer), then all is ok
def foo = Apply[t forSome { type t >: Some[Int] with None.type <: Option[Int] }] { i =>
i match {
case 1 => Success(Some(1))
case _ => Success(None)
}
}
}

0 comments on commit 5d5c780

Please sign in to comment.