Closed
Description
#999 changed the way asSeenFrom
works and it introduced a bug:
class Contra[-T]
class Foo {
val foo: Contra[this.type] = new Contra[this.type]
}
object Test {
def test: Unit = {
val e1 = new Foo
val f1: Contra[Foo] = e1.foo // error, as expected
var e2 = new Foo
val f2: Contra[Foo] = e2.foo // should be an error but now succeeds
}
}
The problem is that we removed this line:
val m = if (isLegalPrefix(pre)) null else new AsSeenFromMap(pre, cls)
but asSeenFrom#toPrefix
still assumes that the prefix is always legal when the map is null.
Metadata
Metadata
Assignees
Labels
No labels