Scala works hard to unify primitive types and reference types at the language level, but once you drop down to the Java / JVM / bytecode / reflection level, that niceness disappears and you must always be aware of the difference.
Note that Class[Int] isn’t even a valid Java/JVM type — Java generics don’t allow primitive types as type parameters.
There’s auto-boxing at play. If you store a primitive into a collection, it is automatically boxed (in bytecode scala.runtime.BoxesRunTime.boxToInteger and scala.runtime.BoxesRunTime.boxToDouble is called for your code). So, at runtime the 1 int literal is really a java.lang.Integer inside the List and the compiler generates instanceof checks for the case clause matching for java.lang.Integer. It’s magic.
I wonder whether the semantics of “inside a List” is something the programmer can understand, or whether it’s subject to optimization. For example, in the code below, x is an element of a List, is it thus dependably boxed? It appears the elements of this List are susceptible to isInstance. This seems to also work for Array, Vector, and Seq.
x => classOf[java.lang.Integer].isInstance(x)
--> List(1, 2)