Skip to content

Commit 8375e3a

Browse files
committed
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[_,_]`.
1 parent 9da40cb commit 8375e3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/pos/i1181b.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Foo[A]
2+
3+
object Test {
4+
def foo[M[_,_]](x: M[Int,Int]) = x
5+
6+
type Alias[X,Y] = Foo[X]
7+
val x: Alias[Int,Int] = new Foo[Int]
8+
9+
foo[Alias](x) // ok
10+
foo(x)
11+
}

0 commit comments

Comments
 (0)