diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-11 14:02:38 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 16:16:16 +0200 |
commit | a200695677237922fdf6f995c690cb0108ec2fc4 (patch) | |
tree | 5c596d3534f0ba8bf6a5c50daf5a3886eff71143 /tests/pos/t2712-7.scala | |
parent | 540b38cbd769cee3e8bc72530829e65f7e87cddb (diff) | |
download | dotty-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/pos/t2712-7.scala')
-rw-r--r-- | tests/pos/t2712-7.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/t2712-7.scala b/tests/pos/t2712-7.scala new file mode 100644 index 000000000..d9c5243f1 --- /dev/null +++ b/tests/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) +} |