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
{{ message }}
Repository navigation
Resolvers instantiated as anonymous inner classes cannot be resolved by Kotlin #714
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)
...
...
Fixed upstream in Kotlin 1.9.20 (KT-41373). graphql-java-tools 14.0.0 and later ship with Kotlin 2.x (#788), and resolvers written as anonymous Java classes work. A regression test was added in 349d56a (ResolverMethodsTest).
Activity
Add regression tests for fixed issues
oryan-block commentedon Oct 3, 2026
Fixed upstream in Kotlin 1.9.20 (KT-41373). graphql-java-tools 14.0.0 and later ship with Kotlin 2.x (#788), and resolvers written as anonymous Java classes work. A regression test was added in 349d56a (
ResolverMethodsTest).