Closed
Description
Compiler version
3.0.1
Minimized code
class A { class B }
val a1 = new A
val a2 = new A
val b: Any = new a1.B
b match {
case _: a2.B => println("match")
case _ => println("no match")
}
class X { class Y[Q] }
val x1 = new X
val x2 = new X
val y: Any = new x1.Y[Int]
y match {
case _: x2.Y[_] => println("match")
case _ => println("no match")
}
Output
no match
match
Expectation
no match
no match
Whether or not an inner class is polymorphic shouldn't make a difference here. This behavior also differs from Scala 2. As far as I can see in the commit history this change doesn't seem to be a conscious decision.