diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-10 13:48:46 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-10-12 16:13:49 +0200 |
commit | 9e74d72d3638f70285aff88c53bab6cc57223d16 (patch) | |
tree | f354c07cba6a589474d4a9a6a528ec21e32702b9 | |
parent | d8127d2f0f31913cca7eb60a721b25974b3bfde6 (diff) | |
download | dotty-9e74d72d3638f70285aff88c53bab6cc57223d16.tar.gz dotty-9e74d72d3638f70285aff88c53bab6cc57223d16.tar.bz2 dotty-9e74d72d3638f70285aff88c53bab6cc57223d16.zip |
Update tests to use new PolyType syntax.
-rw-r--r-- | tests/neg/existentials.scala | 12 | ||||
-rw-r--r-- | tests/neg/hk-bounds.scala | 12 | ||||
-rw-r--r-- | tests/pos/i1181c.scala | 2 | ||||
-rw-r--r-- | tests/pos/nestedLambdas.scala | 4 | ||||
-rw-r--r-- | tests/pos/t2421_delitedsl.scala | 4 | ||||
-rw-r--r-- | tests/pos/tcpoly_bounds1.scala | 2 | ||||
-rw-r--r-- | tests/pos/tcpoly_overloaded.scala | 4 |
7 files changed, 20 insertions, 20 deletions
diff --git a/tests/neg/existentials.scala b/tests/neg/existentials.scala index 4798504d9..351febc79 100644 --- a/tests/neg/existentials.scala +++ b/tests/neg/existentials.scala @@ -1,7 +1,7 @@ object TestList { - var x: ([X] -> List[List[X]])[_] = List(List(1)) // error: unreducible - var y: ([X] -> List[Seq[X]])[_] = List(List(1)) // error: unreducible + var x: ([X] => List[List[X]])[_] = List(List(1)) // error: unreducible + var y: ([X] => List[Seq[X]])[_] = List(List(1)) // error: unreducible x = x y = y @@ -15,8 +15,8 @@ object TestList { } object TestSet { - var x: ([Y] -> Set[Set[Y]])[_] = Set(Set("a")) // error: unreducible - var y: ([Y] -> Set[Iterable[Y]])[_] = Set(Set("a")) // error: unreducible + var x: ([Y] => Set[Set[Y]])[_] = Set(Set("a")) // error: unreducible + var y: ([Y] => Set[Iterable[Y]])[_] = Set(Set("a")) // error: unreducible x = x y = y @@ -36,14 +36,14 @@ class TestX { def cmp: T => Boolean = (x == _) } - val x: ([Y] -> C[C[Y]])[_] = new C(new C("a")) // error: unreducible + val x: ([Y] => C[C[Y]])[_] = new C(new C("a")) // error: unreducible type CC[X] = C[C[X]] val y: CC[_] = ??? // error: unreducible type D[X] <: C[X] - type DD = [X] -> D[D[X]] + type DD = [X] => D[D[X]] val z: DD[_] = ??? // error: unreducible val g = x.get diff --git a/tests/neg/hk-bounds.scala b/tests/neg/hk-bounds.scala index db6712d72..628d200c2 100644 --- a/tests/neg/hk-bounds.scala +++ b/tests/neg/hk-bounds.scala @@ -5,20 +5,20 @@ class Baz[C] extends Bar[C] object Test1 { type Alias[F[X] <: Foo[X]] = F[Int] - val x: Alias[Bar] = new Bar[Int] // error: Type argument [X0] -> Bar[X0] does not conform to upper bound [X0] -> Foo[X0] + val x: Alias[Bar] = new Bar[Int] // error: Type argument [X0] => Bar[X0] does not conform to upper bound [X0] => Foo[X0] def foo[F[X] <: Foo[X]] = () - foo[Bar] // error: Type argument [X0] -> Bar[X0] does not conform to upper bound [X0] -> Foo[X0] + foo[Bar] // error: Type argument [X0] => Bar[X0] does not conform to upper bound [X0] => Foo[X0] def bar[B[X] >: Bar[X]] = () bar[Bar] // ok - bar[Baz] // // error: Type argument [X0] -> Baz[X0] does not conform to lower bound [X0] -> Bar[X0] - bar[Foo] // error: Type argument [X0] -> Foo[X0] does not conform to lower bound [X0] -> Bar[X0] + bar[Baz] // // error: Type argument [X0] => Baz[X0] does not conform to lower bound [X0] => Bar[X0] + bar[Foo] // error: Type argument [X0] => Foo[X0] does not conform to lower bound [X0] => Bar[X0] def baz[B[X] >: Baz[X]] = () baz[Bar] //ok baz[Baz] //ok - baz[Foo] // error: Type argument [X0] -> Foo[X0] does not conform to lower bound [X0] -> Baz[X0] + baz[Foo] // error: Type argument [X0] => Foo[X0] does not conform to lower bound [X0] => Baz[X0] } object Test2 { @@ -26,6 +26,6 @@ object Test2 { def foo[M[_[_]], A[_]]: M[A] = null.asInstanceOf[M[A]] - val x = foo[Alias, Bar] // error: Type argument Test2.Alias does not conform to upper bound [X0 <: [X0] -> Any] -> Any + val x = foo[Alias, Bar] // error: Type argument Test2.Alias does not conform to upper bound [X0 <: [X0] => Any] -> Any } diff --git a/tests/pos/i1181c.scala b/tests/pos/i1181c.scala index 940629259..58bd99766 100644 --- a/tests/pos/i1181c.scala +++ b/tests/pos/i1181c.scala @@ -4,7 +4,7 @@ trait Bar[DD[_,_]] { val x: DD[Int, Int] } -trait Baz extends Bar[[X,Y] -> Foo[X]] { +trait Baz extends Bar[[X,Y] => Foo[X]] { def foo[M[_,_]](x: M[Int, Int]) = x foo(x) diff --git a/tests/pos/nestedLambdas.scala b/tests/pos/nestedLambdas.scala index 58be1ae2f..2e96fa225 100644 --- a/tests/pos/nestedLambdas.scala +++ b/tests/pos/nestedLambdas.scala @@ -1,8 +1,8 @@ class Test { - type T = [X] -> [Y] -> (X, Y) + type T = [X] => [Y] => (X, Y) - type A[X] = [Y] -> (X, Y) + type A[X] = [Y] => (X, Y) type B[X] = (X, X) diff --git a/tests/pos/t2421_delitedsl.scala b/tests/pos/t2421_delitedsl.scala index 554702a03..22f1ecd85 100644 --- a/tests/pos/t2421_delitedsl.scala +++ b/tests/pos/t2421_delitedsl.scala @@ -15,8 +15,8 @@ trait DeliteDSL { import scala.collection.Traversable class DeliteCollection[T](val xs: Traversable[T]) { // must use existential in bound of P, instead of T itself, because we cannot both have: - // Test.x below: DeliteCollection[T=Int] -> P=DeliteInt <: Forcible[T=Int], as T=Int <~< P=DeliteInt - // Test.xAlready below: DeliteCollection[T=DeliteInt] -> P=DeliteInt <: Forcible[T=DeliteInt], as T=DeliteInt <~< P=DeliteInt + // Test.x below: DeliteCollection[T=Int] => P=DeliteInt <: Forcible[T=Int], as T=Int <~< P=DeliteInt + // Test.xAlready below: DeliteCollection[T=DeliteInt] => P=DeliteInt <: Forcible[T=DeliteInt], as T=DeliteInt <~< P=DeliteInt // this would required DeliteInt <: Forcible[Int] with Forcible[DeliteInt] def headProxy[P <: Forcible[_]](implicit w: T <~< P): P = xs.head diff --git a/tests/pos/tcpoly_bounds1.scala b/tests/pos/tcpoly_bounds1.scala index 9831e0b99..fc05e18d8 100644 --- a/tests/pos/tcpoly_bounds1.scala +++ b/tests/pos/tcpoly_bounds1.scala @@ -7,7 +7,7 @@ object foo extends Foo[MyPair] trait Monad[m[x <: Bound[x]], Bound[x], a] // TODO: variances! -trait ListMonad[a] extends Monad[List, [X] -> Any, a] // Dotty difference: Any is not a legal argument for hk type. +trait ListMonad[a] extends Monad[List, [X] => Any, a] // Dotty difference: Any is not a legal argument for hk type. trait MyOrdered[a] trait MySet[x <: MyOrdered[x]] diff --git a/tests/pos/tcpoly_overloaded.scala b/tests/pos/tcpoly_overloaded.scala index 573eaadcb..f272590f7 100644 --- a/tests/pos/tcpoly_overloaded.scala +++ b/tests/pos/tcpoly_overloaded.scala @@ -11,7 +11,7 @@ trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] { trait Test { def moo: MList[Int] - class MList[T](el: T) extends Monad[T, List, [X] -> Any] { + class MList[T](el: T) extends Monad[T, List, [X] => Any] { def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] (f: T => Result[S]): Result[S] = sys.error("foo") @@ -21,5 +21,5 @@ trait Test { def flatMap[S] (f: T => List[S], foo: Int): List[S] = sys.error("foo") } - val l: MList[String] = moo.flatMap[String, List, [X] -> Any, MList]((x: Int) => new MList("String")) + val l: MList[String] = moo.flatMap[String, List, [X] => Any, MList]((x: Int) => new MList("String")) } |