Closed
Description
This might be a known problem. The following code compiles in dotc
and produces run-time exception. Scalac compiler rejects the code.
class Box[T](var v: T)
object Test {
def main(args: Array[String]): Unit = {
val s = new Box[String]("")
val i = new Box[Int](3)
var box: Box[_] = s
val sv = box.v
box = i
box.v = sv
val c: Int = i.v
}
}