diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-05-27 17:58:17 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-05-27 17:58:17 +1000 |
commit | 6b2037a2161de650fdbb010ba1da23d843247234 (patch) | |
tree | a6cffc611df52861a7917493c88a67d9e58ad72c /test/files/pos/t2712-7.scala | |
parent | 79ec0f31e611d37d5c50a966a4cd6bf24d96cda6 (diff) | |
parent | bf478084fdf65c7bd156e2e6f04a96bfadf6986b (diff) | |
download | scala-6b2037a2161de650fdbb010ba1da23d843247234.tar.gz scala-6b2037a2161de650fdbb010ba1da23d843247234.tar.bz2 scala-6b2037a2161de650fdbb010ba1da23d843247234.zip |
Merge pull request #5102 from milessabin/2.12.x
SI-2712 Add support for partial unification of type constructors
Diffstat (limited to 'test/files/pos/t2712-7.scala')
-rw-r--r-- | test/files/pos/t2712-7.scala | 15 |
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) +} |