Closed
Description
object Foo {
class A
val a1 = new A()
val a2 = new A()
def f(x: A, y: x.type) = ()
f(a1, a1) // ok
f(a1, a2) // error (as expected)
f(new A(), new A()) // error (*** but passes unexpectedly)
f(new A(), a1) // error (*** but passes unexpectedly)
def g(x: A)(y: x.type) = ()
g(a1)(a1) // ok
g(a1)(a2) // error (as expected)
g(new A())(new A()) // error (*** but passes unexpectedly)
g(new A())(a1) // error (*** but passes unexpectedly)
}
Note that while this also affects the version featuring dependencies within a single parameter group (f()
above), the problem seems to be independent of the recent PR #2079: The problem with g()
existed even in commits before #2079 was merged.