https://kotlinlang.org logo
#kotlin-inject
Title
# kotlin-inject
d

dave08

03/26/2024, 12:46 PM
@evant It seems like we can't use
@IntoMap
for an abstract class with a type parameter, even if I use
Pair<String, Foo<*>>
as the return type?
@eygraber By any chance to you know about this problem? I'm just stuck on this and it seems like @evant is not available...
It seems like it's a more general problem not being able to inject things with a star projection...
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(KsTypes.kt:167)
	at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName(KsTypes.kt:66)
	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.toString(KSAst.kt:455)
	at java.base/java.lang.String.valueOf(String.java:4220)
	at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
	at me.tatarka.inject.compiler.TypeKey.toString(TypeKey.kt:25)
	at java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:453)
	at java.base/java.lang.StringConcatHelper.simpleConcat(StringConcatHelper.java:408)
	at me.tatarka.inject.compiler.TypeResultResolver.cannotFind(TypeResultResolver.kt:560)
	at me.tatarka.inject.compiler.TypeResultResolver.resolveParamsLegacy(TypeResultResolver.kt:164)
	at me.tatarka.inject.compiler.TypeResultResolver.resolveParams(TypeResultResolver.kt:70)
	at me.tatarka.inject.compiler.TypeResultResolver.access$resolveParams(TypeResultResolver.kt:17)
	at me.tatarka.inject.compiler.TypeResultResolver$Constructor$1.invoke(TypeResultResolver.kt:452)
	at me.tatarka.inject.compiler.TypeResultResolver$Constructor$1.invoke(TypeResultResolver.kt:448)
	at me.tatarka.inject.compiler.TypeResultResolver$withCycleDetection$result$1.invoke(TypeResultResolver.kt:537)
	at me.tatarka.inject.compiler.TypeResultResolver$withCycleDetection$result$1.invoke(TypeResultResolver.kt:535)
	at me.tatarka.inject.compiler.CycleDetector.check(CycleDetector.kt:53)
	at me.tatarka.inject.compiler.TypeResultResolver.withCycleDetection(TypeResultResolver.kt:535)
	at me.tatarka.inject.compiler.TypeResultResolver.Constructor(TypeResultResolver.kt:448)
	at me.tatarka.inject.compiler.TypeResultResolver.constructor(TypeResultResolver.kt:379)
	at me.tatarka.inject.compiler.TypeResultResolver.findType(TypeResultResolver.kt:236)
	at me.tatarka.inject.compiler.TypeResultResolver.resolveOrNull(TypeResultResolver.kt:49)
	at me.tatarka.inject.compiler.TypeResultResolver.resolve(TypeResultResolver.kt:39)
	at me.tatarka.inject.compiler.TypeResultResolver.access$resolve(TypeResultResolver.kt:17)
	at me.tatarka.inject.compiler.TypeResultResolver$Provider$result$1.invoke(TypeResultResolver.kt:396)
	at me.tatarka.inject.compiler.TypeResultResolver$Provider$result$1.invoke(TypeResultResolver.kt:395)
	at me.tatarka.inject.compiler.TypeResultResolver$withCycleDetection$result$1.invoke(TypeResultResolver.kt:537)
	at me.tatarka.inject.compiler.TypeResultResolver$withCycleDetection$result$1.invoke(TypeResultResolver.kt:535)
	at me.tatarka.inject.compiler.CycleDetector.check(CycleDetector.kt:53)
	at me.tatarka.inject.compiler.TypeResultResolver.withCycleDetection(TypeResultResolver.kt:535)
	at me.tatarka.inject.compiler.TypeResultResolver.Provider(TypeResultResolver.kt:395)
	at me.tatarka.inject.compiler.TypeResultResolver.resolveAll(TypeResultResolver.kt:30)
	at me.tatarka.inject.compiler.InjectGenerator.generateInjectComponent(InjectGenerator.kt:140)
	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.process(InjectProcessor.kt:52)
It seems like this is the problem? https://github.com/evant/kotlin-inject/issues/316
Nope, it was an error in my code, that I didn't use <*> in all of the occurences of the use of that base class. But that's a funny error for this kind of problem...