Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/neg/i2887a.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait A { type L[G[F[_],_],H[F[_],_]] }
trait B { type L[F[_],_] }
trait C { type M <: A }
trait D { type M >: B }

object Test {
def test(x: C with D): Unit = {
def foo(a: A, b: B)(z: a.L[b.L,b.L]) = z
def bar(y: x.M, b: B) = foo(y, b)
def baz(b: B) = bar(b, b)
baz(new B { type L[F[_],X] = F[X] })(1) // error
}
}
13 changes: 13 additions & 0 deletions tests/neg/i2887b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait A { type S[X[_] <: [_] => Any, Y[_]] <: [_] => Any; type I[_] } // error // error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are errors in this file. The syntax of type lambdas is now [_] =>> rather than [_] =>.

trait B { type S[X[_],Y[_]]; type I[_] <: [_] => Any } // error
trait C { type M <: B }
trait D { type M >: A }

object Test {
def test(x: C with D): Unit = {
def foo(a: A, b: B)(z: a.S[b.I,a.I][b.S[a.I,a.I]]) = z // error
def bar(a: A, y: x.M) = foo(a,y)
def baz(a: A) = bar(a, a)
baz(new A { type S[X[_] <: [_] => Any, Y[_]] = [Z] => X[Z][Y[Z]]; type I[X] = X })(1) // error // error
}
}
13 changes: 13 additions & 0 deletions tests/neg/i2887c.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait A { type S[X[_,_], Y[_],_]; type I[_] }
trait B { type S[X[_],Y[_]]; type I[_,_] }
trait C { type M <: B }
trait D { type M >: A }

object Test {
def test(x: C with D): Unit = {
def foo(a: A, b: B)(z: a.S[b.I,a.I,b.S[a.I,a.I]]) = z
def bar(a: A, y: x.M) = foo(a,y)
def baz(a: A) = bar(a, a)
baz(new A { type S[X[_,_], Y[_], Z] = X[Z,Y[Z]]; type I[X] = X })(1) // error
}
}