aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
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]
+
+}