Closed
Description
The following:
class A { type T = Int; val x: T = 1 }
class B extends A { override type T = String }
object O {
val b: B = new B
val s: String = b.x
}
Compiles without any error.
RefChecks.scala mentions:
// types don't need to have their bounds in an overriding relationship
// since we automatically form their intersection when selecting.
Should b.x have the type "Int | String" ?
CC @odersky @DarkDimius @namin .