The reason for the first result is that the method getClasshas the following signature in Java
public final Class<?> getClass()
Scala. , getClass T,
public final Class<? extends T> getClass()
. , ,
public final Class<? extends Receiver> getClass()
- getClass. , Snoracle Java getClass, , Java. , - T, , T.class (java) classOf[T] (scala). , , .
" " "" , . desugar x.asInstanceOf[T] to classOf[T].cast(x).
, , , . , , , , . , , JVM.
, .