diff options
author | Miles Sabin <miles@milessabin.com> | 2016-05-20 12:49:25 +0100 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2016-05-24 08:46:40 +0100 |
commit | 892a6d6878accb67e3fe68aefaa256396db05a90 (patch) | |
tree | 89024c06147fddf825904bc5891e1ee2cbf4c2d1 /test/files/pos/t2712-2.scala | |
parent | 207e32df30fd733e4dd1cb28fb8cb5c3153c21a6 (diff) | |
download | scala-892a6d6878accb67e3fe68aefaa256396db05a90.tar.gz scala-892a6d6878accb67e3fe68aefaa256396db05a90.tar.bz2 scala-892a6d6878accb67e3fe68aefaa256396db05a90.zip |
SI-2712 Add support for higher order unification
Diffstat (limited to 'test/files/pos/t2712-2.scala')
-rw-r--r-- | test/files/pos/t2712-2.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/pos/t2712-2.scala b/test/files/pos/t2712-2.scala new file mode 100644 index 0000000000..39f22dd92a --- /dev/null +++ b/test/files/pos/t2712-2.scala @@ -0,0 +1,25 @@ +package test + +// See: https://github.com/milessabin/si2712fix-demo/issues/3 +object Test { + trait A[T1, T2] { } + trait B[T1, T2] { } + class C[T] extends A[T, Long] with B[T, Double] + class CB extends A[Boolean, Long] with B[Boolean, Double] + + trait A2[T] + trait B2[T] + class C2[T] extends A2[T] with B2[T] + class CB2 extends A2[Boolean] with B2[Boolean] + + def meh[M[_], A](x: M[A]): M[A] = x + + val m0 = meh(new C[Boolean]) + m0: C[Boolean] + val m1 = meh(new CB) + m1: A[Boolean, Long] + val m2 = meh(new C2[Boolean]) + m2: C2[Boolean] + val m3 = meh(new CB2) + m3: A2[Boolean] +} |