1 2 3 4 5 6 7 8 9 10 11 12
class X extends Raw[X] { override def t = this def exxx = 0 } object Test extends App { def c(s: X) = { val raw = s.raw raw.t.exxx // java.lang.ClassCastException: java.lang.String cannot be cast to X } c(new X()) }