summaryrefslogtreecommitdiff
path: root/test/files/pos/t2712-7.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t2712-7.scala')
-rw-r--r--test/files/pos/t2712-7.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/pos/t2712-7.scala b/test/files/pos/t2712-7.scala
new file mode 100644
index 0000000000..d9c5243f13
--- /dev/null
+++ b/test/files/pos/t2712-7.scala
@@ -0,0 +1,15 @@
+package test
+
+// Cats Xor, Scalaz \/, scala.util.Either
+sealed abstract class Xor[+A, +B] extends Product with Serializable
+object Xor {
+ final case class Left[+A](a: A) extends (A Xor Nothing)
+ final case class Right[+B](b: B) extends (Nothing Xor B)
+}
+
+object TestXor {
+ import Xor._
+ def meh[F[_], A, B](fa: F[A])(f: A => B): F[B] = ???
+ meh(new Right(23): Xor[Boolean, Int])(_ < 13)
+ meh(new Left(true): Xor[Boolean, Int])(_ < 13)
+}