Skip to content

Commit

Permalink
Better test for scala#1181
Browse files Browse the repository at this point in the history
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[_,_]`.
  • Loading branch information
smarter committed Jul 18, 2016
1 parent 9da40cb commit 8375e3a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/pos/i1181b.scala
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 8375e3a

Please sign in to comment.