From 8375e3a1ea9b0c13efb3188c844fe2a0c180c11e Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 18 Jul 2016 09:13:32 +0100 Subject: [PATCH] Better test for #1181 Now that we implement partial higher-order unification (SI-2712 fix) i1181.scala will compile even if `Alias[Int]` gets dealiased to `(Int, Int)` because we can unify the latter with `M[_]` where `M = [X] -> (Int, X)`. The new test will only succeed if `Alias[Int, Int]` is not dealiased because we will never unify `Foo[Int]` with `M[_,_]`. --- tests/pos/i1181b.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/pos/i1181b.scala diff --git a/tests/pos/i1181b.scala b/tests/pos/i1181b.scala new file mode 100644 index 000000000000..7694aed0b770 --- /dev/null +++ b/tests/pos/i1181b.scala @@ -0,0 +1,11 @@ +class Foo[A] + +object Test { + def foo[M[_,_]](x: M[Int,Int]) = x + + type Alias[X,Y] = Foo[X] + val x: Alias[Int,Int] = new Foo[Int] + + foo[Alias](x) // ok + foo(x) +}