diff --git a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt index 7453c04cd0..5e504f3817 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt @@ -377,6 +377,9 @@ private fun KSAnnotation.createInvocationHandler(clazz: Class<*>): InvocationHan if (result !is Array<*>) { val value = { result.asArray(method, clazz) } cache.getOrPut(Pair(method.returnType, value), value) + } else if (method.returnType == result::class.java) { + val value = { result } + cache.getOrPut(Pair(method.returnType, value), value) } else { throw IllegalStateException("unhandled value type, $ExceptionMessage") }