summaryrefslogtreecommitdiff
path: root/test/files/pos/t2712-3.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2016-05-20 12:49:25 +0100
committerMiles Sabin <miles@milessabin.com>2016-05-24 08:46:40 +0100
commit892a6d6878accb67e3fe68aefaa256396db05a90 (patch)
tree89024c06147fddf825904bc5891e1ee2cbf4c2d1 /test/files/pos/t2712-3.scala
parent207e32df30fd733e4dd1cb28fb8cb5c3153c21a6 (diff)
downloadscala-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-3.scala')
-rw-r--r--test/files/pos/t2712-3.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/files/pos/t2712-3.scala b/test/files/pos/t2712-3.scala
new file mode 100644
index 0000000000..46445f9289
--- /dev/null
+++ b/test/files/pos/t2712-3.scala
@@ -0,0 +1,24 @@
+package test
+
+object Test1 {
+ class Foo[T, F[_]]
+ def meh[M[_[_]], F[_]](x: M[F]): M[F] = x
+ meh(new Foo[Int, List]) // solves ?M = [X[_]]Foo[Int, X[_]] ?A = List ...
+}
+
+object Test2 {
+ trait TC[T]
+ class Foo[F[_], G[_]]
+ def meh[G[_[_]]](g: G[TC]) = ???
+ meh(new Foo[TC, TC]) // solves ?G = [X[_]]Foo[TC, X]
+}
+
+object Test3 {
+ trait TC[F[_]]
+ trait TC2[F[_]]
+ class Foo[F[_[_]], G[_[_]]]
+ new Foo[TC, TC2]
+
+ def meh[G[_[_[_]]]](g: G[TC2]) = ???
+ meh(new Foo[TC, TC2]) // solves ?G = [X[_[_]]]Foo[TC, X]
+}