summaryrefslogtreecommitdiff
path: root/test/files/neg/t5189b.scala
diff options
context:
space:
mode:
authorAleksandar Prokopec <axel22@gmail.com>2012-04-02 13:16:09 +0200
committerAleksandar Prokopec <axel22@gmail.com>2012-04-02 13:16:09 +0200
commitde3bd754676fbed0b6c69ca3d676b72bc276e925 (patch)
tree1d18a7f8c193fda503d63d286ddcf561842d1091 /test/files/neg/t5189b.scala
parentc14766c1affe968788c77fea45ae042d71038472 (diff)
parentf7535f72903f083b2444fb1d0b73363efa5482e9 (diff)
downloadscala-de3bd754676fbed0b6c69ca3d676b72bc276e925.tar.gz
scala-de3bd754676fbed0b6c69ca3d676b72bc276e925.tar.bz2
scala-de3bd754676fbed0b6c69ca3d676b72bc276e925.zip
Merge branch 'master' into feature/collection-concurrent
Conflicts: src/library/scala/collection/JavaConversions.scala src/library/scala/collection/JavaConverters.scala Add one test for concurrent map conversion.
Diffstat (limited to 'test/files/neg/t5189b.scala')
-rw-r--r--test/files/neg/t5189b.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t5189b.scala b/test/files/neg/t5189b.scala
index 1750f14084..7c1871dc97 100644
--- a/test/files/neg/t5189b.scala
+++ b/test/files/neg/t5189b.scala
@@ -5,8 +5,21 @@ class TestPos {
def unwrap[T](x: AbsWrapperCov[T]): T = x match {
case Wrapper/*[_ <: T ]*/(x) => x // _ <: T, which is a subtype of T
}
+
+ def unwrapOption[T](x: Option[T]): T = x match {
+ case Some(xs) => xs
+ }
+
+
+ case class Down[+T](x: T)
+ case class Up[-T](f: T => Unit)
+
+ def f1[T](x1: Down[T])(x2: Up[T]) = ((x1, x2)) match {
+ case (Down(x), Up(f)) => f(x)
+ }
}
+
object TestNeg extends App {
class AbsWrapperCov[+A]
case class Wrapper[B](x: Wrapped[B]) extends AbsWrapperCov[B]
@@ -33,6 +46,11 @@ object TestNeg extends App {
// val w = new Wrapped(new A)
// unwrap[Any](Wrapper(w)).cell = new B
// w.cell.imNotAB
+
+ def unwrapOption[T](x: Option[T]): T = x match {
+ case Some(xs) => xs.foo // the error message should not refer to a skolem (testing extrapolation)
+ }
+
}
// class TestPos1 {