Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Runtime NoClassDefFoundError when casting to subtype of AnyKind #159

Open
Baccata opened this issue Jun 26, 2017 · 0 comments
Open

Runtime NoClassDefFoundError when casting to subtype of AnyKind #159

Baccata opened this issue Jun 26, 2017 · 0 comments

Comments

@Baccata
Copy link

Baccata commented Jun 26, 2017

Running def foo0[F <: AnyKind]: F = null.asInstanceOf[F] with the option -Ykind-polymorphism results in this runtime error :

[error] (run-main-1) java.lang.NoClassDefFoundError: scala/AnyKind
java.lang.NoClassDefFoundError: scala/AnyKind
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
Caused by: java.lang.ClassNotFoundException: scala.AnyKind
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)

Bumped into this exception whilst running this example from the TLS project

Full reproducible example here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant