diff options
author | Martin Odersky <odersky@gmail.com> | 2016-08-17 14:34:20 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-08-17 15:37:14 -0700 |
commit | b31d59985737d54c912c988ce26175ccaae80606 (patch) | |
tree | 7719186e433d37620ef8c92ab70613cf68e1a844 /tests/pending | |
parent | 5f598e8094c1dba3c6cf302383088f4f00626222 (diff) | |
download | dotty-b31d59985737d54c912c988ce26175ccaae80606.tar.gz dotty-b31d59985737d54c912c988ce26175ccaae80606.tar.bz2 dotty-b31d59985737d54c912c988ce26175ccaae80606.zip |
Harden copmpareHkApply for ill-typed programs
Turn assertion into test. Without this, neg/tcpoly_overloaded.scala fails.
Diffstat (limited to 'tests/pending')
-rw-r--r-- | tests/pending/pos/tcpoly_bounds1.scala | 14 | ||||
-rw-r--r-- | tests/pending/pos/tcpoly_overloaded.scala | 25 |
2 files changed, 0 insertions, 39 deletions
diff --git a/tests/pending/pos/tcpoly_bounds1.scala b/tests/pending/pos/tcpoly_bounds1.scala deleted file mode 100644 index 63263cb15..000000000 --- a/tests/pending/pos/tcpoly_bounds1.scala +++ /dev/null @@ -1,14 +0,0 @@ -class Foo[t[x]<: Tuple2[Int, x]] - -// -class MyPair[z](a: Int, b: z) extends Tuple2[Int, z](a,b) - -object foo extends Foo[MyPair] - - -trait Monad[m[x <: Bound[x]], Bound[x], a] // TODO: variances! -trait ListMonad[a] extends Monad[List, Any, a] - -trait MyOrdered[a] -trait MySet[x <: MyOrdered[x]] -trait SetMonad[a <: MyOrdered[a]] extends Monad[MySet, MyOrdered, a] diff --git a/tests/pending/pos/tcpoly_overloaded.scala b/tests/pending/pos/tcpoly_overloaded.scala deleted file mode 100644 index 4f6334685..000000000 --- a/tests/pending/pos/tcpoly_overloaded.scala +++ /dev/null @@ -1,25 +0,0 @@ -trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] { - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], - Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S]): Result[S] - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], - Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S], foo: String): Result[S] - def flatMap[S <: Bound[S]] - (f: T => MyType[S], foo: Int): MyType[S] -} - -trait Test { - def moo: MList[Int] - class MList[T](el: T) extends Monad[T, List, 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") - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], - Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S], foo: String): Result[S] = sys.error("foo") - def flatMap[S] - (f: T => List[S], foo: Int): List[S] = sys.error("foo") - } - val l: MList[String] = moo.flatMap[String, List, Any, MList]((x: Int) => new MList("String")) -} |