I just tried updating to Kotlin 2.0 with ksp, I'm ...
# ksp
d
I just tried updating to Kotlin 2.0 with ksp, I'm using Kotlin Inject, and a perfectly working project before the update is now causing me this crash:
Copy code
[ksp] java.lang.IllegalArgumentException: Error type '<ERROR TYPE>' is not resolvable in the current round of processing.
	at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName(KsTypes.kt:61)
	at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName(KsTypes.kt:182)
	at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName$default(KsTypes.kt:179)
	at me.tatarka.kotlin.ast.KSAstType.toTypeName(KSAst.kt:460)
	at me.tatarka.kotlin.ast.AstParam.toParameterSpec(Ast.kt:224)
	at me.tatarka.inject.compiler.InjectGenerator.generateInjectComponent(InjectGenerator.kt:105)
	at me.tatarka.inject.compiler.InjectGenerator.generate(InjectGenerator.kt:60)
	at me.tatarka.inject.compiler.ksp.InjectProcessor.process(InjectProcessor.kt:64)
	at me.tatarka.inject.compiler.ksp.InjectProcessor.finish(InjectProcessor.kt:77)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$12$1.invoke(KotlinSymbolProcessingExtension.kt:346)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$12$1.invoke(KotlinSymbolProcessingExtension.kt:345)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:414)
	at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:345)
I was missing an import on a type in the constructor of a ksp processed class... it's a pity that there's no better log to tell the end-user about the real problem...
(I update my micrometer prometheus dependency and they changed the class's package in the new version...)
e
There's a fix in 0.7.0-SNAPSHOT that may or may not help with the error message here if you want to test
d
Thanks, maybe I'll try it. It's the second time I fell into this trap and wasted a bunch of time because of it...
381 Views