AnyValno longer exists at runtime. Only at compile time. In other words, it is simply a "compiler" trick to treat JVM primitives as first-class objects.
However, the method isInstanceOfis executed at run time, so it cannot work. Therefore, a compiler error.
source
share