diff options
author | odersky <odersky@gmail.com> | 2015-06-19 10:31:33 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-06-19 10:31:33 +0200 |
commit | c89e85c45ad3f0398990526572f071f35e781baf (patch) | |
tree | e2c327b77bc1abc00716c52fd08e89caf2de3802 /tests | |
parent | 2ce159fa1707c1e57e22af9b2fe5a87fee94ee8d (diff) | |
parent | 310615e717262243aa899959c3178d7465af74a7 (diff) | |
download | dotty-c89e85c45ad3f0398990526572f071f35e781baf.tar.gz dotty-c89e85c45ad3f0398990526572f071f35e781baf.tar.bz2 dotty-c89e85c45ad3f0398990526572f071f35e781baf.zip |
Merge pull request #599 from dotty-staging/add/existential-skolemization
Tighten comparison of skolem types
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/i0583-skolemize.scala | 27 | ||||
-rw-r--r-- | tests/neg/projections.scala | 7 | ||||
-rw-r--r-- | tests/pos/i583a.scala | 20 |
3 files changed, 47 insertions, 7 deletions
diff --git a/tests/neg/i0583-skolemize.scala b/tests/neg/i0583-skolemize.scala new file mode 100644 index 000000000..e0bb99e5d --- /dev/null +++ b/tests/neg/i0583-skolemize.scala @@ -0,0 +1,27 @@ +import scala.collection.mutable.ListBuffer + +object Test1 { + + class Box[T](x: T) + def box[T](x: T) = new Box[T](x) + + class C[T] { def x: T = ???; def x_=(y: T): Unit = ??? } + + val c: C[Int] = ??? + val d: C[Float] = ??? + + val xs: List[C[_]] = List(c, d) + + xs(0).x = xs(1).x + +} +object Test { + def main(args: Array[String]): Unit = { + val f: ListBuffer[Int] = ListBuffer(1,2) + val g: ListBuffer[Double] = ListBuffer(3.0,4.0) + val lb: ListBuffer[ListBuffer[_]] = ListBuffer(f, g) + lb(0)(0) = lb(1)(0) + val x: Int = f(0) + } +} + diff --git a/tests/neg/projections.scala b/tests/neg/projections.scala deleted file mode 100644 index 5d80e1151..000000000 --- a/tests/neg/projections.scala +++ /dev/null @@ -1,7 +0,0 @@ -class projections { - - class Lambda { type Arg; type Apply } - - var x: (Lambda { type Apply = Int }) # Apply = _ // error: illegal prefix - -} diff --git a/tests/pos/i583a.scala b/tests/pos/i583a.scala new file mode 100644 index 000000000..a97a3998b --- /dev/null +++ b/tests/pos/i583a.scala @@ -0,0 +1,20 @@ +object Test1 { + + class Box[B](x: B) + + class C { + type T + val box: Box[T] = ??? + def f(x: T): T = ??? + def x: T = ??? + } + + def c: C = new C + + val b = c.box + + val f = c.f _ + +} + + |