1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class Foo[T] abstract class A { type T <: Foo[T] def x: T; } abstract class B { def a: A; val y = a.x; } abstract class A2 { type T <: String def x: Array[T] } abstract class B2 { def a: A2; val y: Array[String] = a.x; }