Skip to content

Commit 2ab3e5c

Browse files
committed
Update tests to use new PolyType syntax.
1 parent d1cd209 commit 2ab3e5c

7 files changed

+20
-20
lines changed

tests/neg/existentials.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object TestList {
22

3-
var x: ([X] -> List[List[X]])[_] = List(List(1)) // error: unreducible
4-
var y: ([X] -> List[Seq[X]])[_] = List(List(1)) // error: unreducible
3+
var x: ([X] => List[List[X]])[_] = List(List(1)) // error: unreducible
4+
var y: ([X] => List[Seq[X]])[_] = List(List(1)) // error: unreducible
55

66
x = x
77
y = y
@@ -15,8 +15,8 @@ object TestList {
1515
}
1616
object TestSet {
1717

18-
var x: ([Y] -> Set[Set[Y]])[_] = Set(Set("a")) // error: unreducible
19-
var y: ([Y] -> Set[Iterable[Y]])[_] = Set(Set("a")) // error: unreducible
18+
var x: ([Y] => Set[Set[Y]])[_] = Set(Set("a")) // error: unreducible
19+
var y: ([Y] => Set[Iterable[Y]])[_] = Set(Set("a")) // error: unreducible
2020

2121
x = x
2222
y = y
@@ -36,14 +36,14 @@ class TestX {
3636
def cmp: T => Boolean = (x == _)
3737
}
3838

39-
val x: ([Y] -> C[C[Y]])[_] = new C(new C("a")) // error: unreducible
39+
val x: ([Y] => C[C[Y]])[_] = new C(new C("a")) // error: unreducible
4040

4141
type CC[X] = C[C[X]]
4242
val y: CC[_] = ??? // error: unreducible
4343

4444
type D[X] <: C[X]
4545

46-
type DD = [X] -> D[D[X]]
46+
type DD = [X] => D[D[X]]
4747
val z: DD[_] = ??? // error: unreducible
4848

4949
val g = x.get

tests/neg/hk-bounds.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ class Baz[C] extends Bar[C]
55
object Test1 {
66
type Alias[F[X] <: Foo[X]] = F[Int]
77

8-
val x: Alias[Bar] = new Bar[Int] // error: Type argument [X0] -> Bar[X0] does not conform to upper bound [X0] -> Foo[X0]
8+
val x: Alias[Bar] = new Bar[Int] // error: Type argument [X0] => Bar[X0] does not conform to upper bound [X0] => Foo[X0]
99

1010
def foo[F[X] <: Foo[X]] = ()
11-
foo[Bar] // error: Type argument [X0] -> Bar[X0] does not conform to upper bound [X0] -> Foo[X0]
11+
foo[Bar] // error: Type argument [X0] => Bar[X0] does not conform to upper bound [X0] => Foo[X0]
1212

1313
def bar[B[X] >: Bar[X]] = ()
1414
bar[Bar] // ok
15-
bar[Baz] // // error: Type argument [X0] -> Baz[X0] does not conform to lower bound [X0] -> Bar[X0]
16-
bar[Foo] // error: Type argument [X0] -> Foo[X0] does not conform to lower bound [X0] -> Bar[X0]
15+
bar[Baz] // // error: Type argument [X0] => Baz[X0] does not conform to lower bound [X0] => Bar[X0]
16+
bar[Foo] // error: Type argument [X0] => Foo[X0] does not conform to lower bound [X0] => Bar[X0]
1717

1818
def baz[B[X] >: Baz[X]] = ()
1919
baz[Bar] //ok
2020
baz[Baz] //ok
21-
baz[Foo] // error: Type argument [X0] -> Foo[X0] does not conform to lower bound [X0] -> Baz[X0]
21+
baz[Foo] // error: Type argument [X0] => Foo[X0] does not conform to lower bound [X0] => Baz[X0]
2222

2323
}
2424
object Test2 {
2525
type Alias[F[X] <: Foo[X]] = F[Int]
2626

2727
def foo[M[_[_]], A[_]]: M[A] = null.asInstanceOf[M[A]]
2828

29-
val x = foo[Alias, Bar] // error: Type argument Test2.Alias does not conform to upper bound [X0 <: [X0] -> Any] -> Any
29+
val x = foo[Alias, Bar] // error: Type argument Test2.Alias does not conform to upper bound [X0 <: [X0] => Any] -> Any
3030

3131
}

tests/pos/i1181c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ trait Bar[DD[_,_]] {
44
val x: DD[Int, Int]
55
}
66

7-
trait Baz extends Bar[[X,Y] -> Foo[X]] {
7+
trait Baz extends Bar[[X,Y] => Foo[X]] {
88
def foo[M[_,_]](x: M[Int, Int]) = x
99

1010
foo(x)

tests/pos/nestedLambdas.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class Test {
22

3-
type T = [X] -> [Y] -> (X, Y)
3+
type T = [X] => [Y] => (X, Y)
44

5-
type A[X] = [Y] -> (X, Y)
5+
type A[X] = [Y] => (X, Y)
66

77
type B[X] = (X, X)
88

tests/pos/t2421_delitedsl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ trait DeliteDSL {
1515
import scala.collection.Traversable
1616
class DeliteCollection[T](val xs: Traversable[T]) {
1717
// must use existential in bound of P, instead of T itself, because we cannot both have:
18-
// Test.x below: DeliteCollection[T=Int] -> P=DeliteInt <: Forcible[T=Int], as T=Int <~< P=DeliteInt
19-
// Test.xAlready below: DeliteCollection[T=DeliteInt] -> P=DeliteInt <: Forcible[T=DeliteInt], as T=DeliteInt <~< P=DeliteInt
18+
// Test.x below: DeliteCollection[T=Int] => P=DeliteInt <: Forcible[T=Int], as T=Int <~< P=DeliteInt
19+
// Test.xAlready below: DeliteCollection[T=DeliteInt] => P=DeliteInt <: Forcible[T=DeliteInt], as T=DeliteInt <~< P=DeliteInt
2020
// this would required DeliteInt <: Forcible[Int] with Forcible[DeliteInt]
2121

2222
def headProxy[P <: Forcible[_]](implicit w: T <~< P): P = xs.head

tests/pos/tcpoly_bounds1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object foo extends Foo[MyPair]
77

88

99
trait Monad[m[x <: Bound[x]], Bound[x], a] // TODO: variances!
10-
trait ListMonad[a] extends Monad[List, [X] -> Any, a] // Dotty difference: Any is not a legal argument for hk type.
10+
trait ListMonad[a] extends Monad[List, [X] => Any, a] // Dotty difference: Any is not a legal argument for hk type.
1111

1212
trait MyOrdered[a]
1313
trait MySet[x <: MyOrdered[x]]

tests/pos/tcpoly_overloaded.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] {
1111

1212
trait Test {
1313
def moo: MList[Int]
14-
class MList[T](el: T) extends Monad[T, List, [X] -> Any] {
14+
class MList[T](el: T) extends Monad[T, List, [X] => Any] {
1515
def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_],
1616
Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]]
1717
(f: T => Result[S]): Result[S] = sys.error("foo")
@@ -21,5 +21,5 @@ trait Test {
2121
def flatMap[S]
2222
(f: T => List[S], foo: Int): List[S] = sys.error("foo")
2323
}
24-
val l: MList[String] = moo.flatMap[String, List, [X] -> Any, MList]((x: Int) => new MList("String"))
24+
val l: MList[String] = moo.flatMap[String, List, [X] => Any, MList]((x: Int) => new MList("String"))
2525
}

0 commit comments

Comments
 (0)