diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-07-18 09:13:32 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-07-18 09:38:29 +0100 |
commit | 8375e3a1ea9b0c13efb3188c844fe2a0c180c11e (patch) | |
tree | dd7776586722ef94aa697c63400163a861cb2d2b | |
parent | 9da40cb84d613bcea3a0e0890b2e53129fe60bc6 (diff) | |
download | dotty-8375e3a1ea9b0c13efb3188c844fe2a0c180c11e.tar.gz dotty-8375e3a1ea9b0c13efb3188c844fe2a0c180c11e.tar.bz2 dotty-8375e3a1ea9b0c13efb3188c844fe2a0c180c11e.zip |
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[_,_]`.
-rw-r--r-- | tests/pos/i1181b.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pos/i1181b.scala b/tests/pos/i1181b.scala new file mode 100644 index 000000000..7694aed0b --- /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) +} |