diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-13 12:08:27 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-13 12:08:27 +0200 |
commit | 73a93505c432b410ae39fb3c4d6168b2e49832ce (patch) | |
tree | 53d45141a7b93682bea6430b0fb6ab28c3c3fad3 /tests/pending/run/existentials.scala | |
parent | 89bacb9c25a58454ff1878e67f7ea07ffc8c269f (diff) | |
download | dotty-73a93505c432b410ae39fb3c4d6168b2e49832ce.tar.gz dotty-73a93505c432b410ae39fb3c4d6168b2e49832ce.tar.bz2 dotty-73a93505c432b410ae39fb3c4d6168b2e49832ce.zip |
Running rewrite tool on run tests.
Diffstat (limited to 'tests/pending/run/existentials.scala')
-rw-r--r-- | tests/pending/run/existentials.scala | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/pending/run/existentials.scala b/tests/pending/run/existentials.scala index bdd6fb93e..d900e7ad9 100644 --- a/tests/pending/run/existentials.scala +++ b/tests/pending/run/existentials.scala @@ -4,9 +4,9 @@ import scala.language.reflectiveCalls class Foo { class Line { case class Cell[T](var x: T) - def f[T](x: Any): Cell[t1] forSome { type t1 } = x match { case y: Cell[t] => y } + def f[T](x: Any): Line.this.Cell[_] = x match { case y: Cell[t] => y } - var x: Cell[T] forSome { type T } = new Cell(1) + var x: Line.this.Cell[_]Line.this.Cell[_] = new Cell(1) println({ x = new Cell("abc"); x }) } } @@ -34,13 +34,13 @@ object LUB { def y = C("abc") var coinflip: Boolean = _ def z = if (coinflip) x else y - def zz: C[_1] forSome { type _1 >: Int with java.lang.String } = z + def zz: C[_ >: Int with String] = z def zzs: C[_ >: Int with java.lang.String] = z } object Bug1189 { case class Cell[T](x: T) - type U = Cell[T1] forSome { type T1 } + type U = Bug1189.Cell[_] def f(x: Any): U = x match { case y: Cell[_] => y } var x: U = Cell(1) @@ -56,16 +56,16 @@ object Bug1189 { object Test extends App { val x = { class I; class J; (new C(new I), new C(new J)) } - val y: (C[X], C[Y]) forSome { type X; type Y } = x + val y: (C[X], C[Y]) forSome { type X; type Y }(C[X], C[Y]) forSome { type X; type Y } = x - def foo(x : Counter[T] { def name : String } forSome { type T }) = x match { + def foo(x : Counter[T]{def name: String} forSome { type T }) = x match { case ctr: Counter[t] => val c = ctr.newCounter println(ctr.name+" "+ctr.get(ctr.inc(ctr.inc(c)))) case _ => } - def fooW(x : Counter[T] { def name : String } forSome { type T }) = x match { + def fooW(x : Counter[T]{def name: String} forSome { type T }) = x match { case ctr: Counter[t] => val c = ctr.newCounter println(ctr.name+" "+ctr.get(ctr.inc(ctr.inc(c)))) @@ -86,7 +86,7 @@ object Test extends App { def name = "Float" } - var ex: Counter[T] forSome { type T } = _ + var ex: Counter[_]Counter[_] = _ ex = ci ex = cf @@ -109,7 +109,9 @@ trait SubFooBar[B <: Option[_]] extends FooBar[B] object Test1 { - var pc: List[Product with (Counter[T] forSome { type T })] = List() + var pc: List[Product with (Product with Counter[T] forSome { + type T +})] = List() def f() = pc pc = f() } |