You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java allows classes to be defined in their own separate file (the norm), or nested classes (both inner and static), or instantiated as anonymous inner classes.
When Resolvers are instantiated as anonymous inner classes, and assigned to a field, Kotlin throws an exception when the program is run.
I have not found a similar issue in this repo.
Expected behavior
There should be no difference whether or not Resolvers are defined in their own class files, as nested classes, or instantiated as anonymous inner classes.
Actual behavior
When Resolvers are defined as anonymous inner classes Kotlin fails with the following error:
Exception in thread "main" kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Unresolved class: class example.graphql.HelloWorld$1
at kotlin.reflect.jvm.internal.KClassImpl.reportUnresolvedClass(KClassImpl.kt:328)
at kotlin.reflect.jvm.internal.KClassImpl.access$reportUnresolvedClass(KClassImpl.kt:44)
...
...
Description
Java allows classes to be defined in their own separate file (the norm), or nested classes (both inner and static), or instantiated as anonymous inner classes.
When Resolvers are instantiated as anonymous inner classes, and assigned to a field, Kotlin throws an exception when the program is run.
I have not found a similar issue in this repo.
Expected behavior
There should be no difference whether or not Resolvers are defined in their own class files, as nested classes, or instantiated as anonymous inner classes.
Actual behavior
When Resolvers are defined as anonymous inner classes Kotlin fails with the following error:
Steps to reproduce the bug
This code reproduces the bug:
This may be an issue native to Kotlin. JetBrains has an ongoing thread about a similar issue: https://youtrack.jetbrains.com/issue/KT-41373/KotlinReflectionInternalError-Unresolved-class-when-inspecting-anonymous-Java-class
The text was updated successfully, but these errors were encountered: