Skip to content

Commit 567b91f

Browse files
committed
Refine tests
1 parent 5c5d155 commit 567b91f

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

tests/neg/i2771.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ trait D { type M >: B }
55

66
object Test {
77
def test(x: C with D): Unit = {
8-
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L takes type parameters
9-
f(new B { type L[F[_]] = F[F] })(1) // error: F takes type parameters (follow-on-error)
8+
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L has wrong kind
9+
f(new B { type L[F[_]] = F[F] })(1) // error: F has wrong kind
1010
}
1111

1212
type LB[F[_]]
@@ -17,8 +17,8 @@ object Test {
1717
foo[Int]() // an error would be raised later, during PostTyper.
1818

1919
def bar[X, Y]() = ()
20-
bar[List, Int]() // error: List takes type parameters
20+
bar[List, Int]() // error: List has wrong kind
2121

22-
bar[Y = List, X = Int]() // error: List takes type parameters
22+
bar[Y = List, X = Int]() // error: List has wrong kind
2323

2424
}

tests/neg/i2771b.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait D { type M >: B }
55

66
object Test {
77
def test(x: C with D): Unit = {
8-
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L takes type parameters
9-
f(new B { type L[F[_[_]]] = F[F] })(1) // error: F takes type parameters
8+
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L has wrong kind
9+
f(new B { type L[F[_[_]]] = F[F] })(1) // error: F has wrong kind
1010
}
1111
}

tests/neg/i2771c.scala

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
trait A { type L[X[_]] }
2+
trait B { type L }
3+
trait C { type M <: A }
4+
trait D { type M >: B }
5+
6+
object Test {
7+
def test(x: D with C): Unit = {
8+
def f(y: x.M)(z: y.L[y.L]) = z // error: y.L has wrong kind
9+
new B { type L[F[_[_]]] = F[F] } // error: F has wrong kind
10+
}
11+
}

0 commit comments

Comments
 (0)