aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-11 14:02:38 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 16:16:16 +0200
commita200695677237922fdf6f995c690cb0108ec2fc4 (patch)
tree5c596d3534f0ba8bf6a5c50daf5a3886eff71143 /tests/neg
parent540b38cbd769cee3e8bc72530829e65f7e87cddb (diff)
downloaddotty-a200695677237922fdf6f995c690cb0108ec2fc4.tar.gz
dotty-a200695677237922fdf6f995c690cb0108ec2fc4.tar.bz2
dotty-a200695677237922fdf6f995c690cb0108ec2fc4.zip
Fix SI-2712
Allows partially instantiated types as type constrictors when inferring higher-kinded types.
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i94-nada.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/neg/i94-nada.scala b/tests/neg/i94-nada.scala
new file mode 100644
index 000000000..8ca104e06
--- /dev/null
+++ b/tests/neg/i94-nada.scala
@@ -0,0 +1,11 @@
+trait Test1 {
+ trait Monad[MX] {
+ def x: MX
+ }
+ sealed abstract class Either[A,B]
+ case class Left[A,B](x: A) extends Either[A,B] with Monad[A]
+ case class Right[A,B](x: B) extends Either[A,B] with Monad[B]
+ def flatMap[FX,FY,M[FMX]<:Monad[FMX]](m: M[FX], f: FX => M[FY]): M[FY] = f(m.x)
+ println(flatMap(Left(1), {x: Int => Left(x)})) // error: Left does not conform to [X] -> Monad[X]
+
+}