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
This is a bit of an odd scenario but it makes sense in our actual project.
The failing scenario:
class Decor @Inject constructor() {
interface Factory {
fun create(): Decor
}
}
interface DecorStubSubcomponent {
@Subcomponent.Builder
interface Builder
@Module
class Install(val configure: Builder.() -> Unit) {
@Provides
fun provideDecorComponentFactory(builder: Builder): Decor.Factory = object : Decor.Factory {
override fun create(): Decor = with(builder) {
configure()
Decor()
}
}
}
}
Fails with:
e: [ksp] dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException$UnexpectedException:
Validation trace:
=> element (CLASS): repro.ksp.issue5.InjectedClass
Stack trace:
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction
[ elided for brevity ]
Caused by: dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException$UnexpectedException:
Validation trace:
=> element (CLASS): repro.ksp.issue5.InjectedClass
at dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException.from(DaggerSuperficialValidation.java:527)
at dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException.access$100(DaggerSuperficialValidation.java:491)
at dagger.internal.codegen.base.DaggerSuperficialValidation.validateElement(DaggerSuperficialValidation.java:299)
at dagger.internal.codegen.processingstep.SuperficialValidator.validationExceptionsUncached(SuperficialValidator.java:58)
at dagger.internal.codegen.processingstep.SuperficialValidator.throwIfNearestEnclosingTypeNotValid(SuperficialValidator.java:47)
at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.lambda$process$0(TypeCheckingProcessingStep.java:92)
at com.google.common.collect.SingletonImmutableBiMap.forEach(SingletonImmutableBiMap.java:70)
at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:72)
at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:49)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.XProcessingStep.process(XProcessingStep.kt:57)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:134)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspBasicAnnotationProcessor.process(KspBasicAnnotationProcessor.kt:62)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing$execute$1$1.invoke(KotlinSymbolProcessing.kt:553)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing$execute$1$1.invoke(KotlinSymbolProcessing.kt:551)
at ksp.com.google.devtools.ksp.common.IncrementalContextBase.closeFilesOnException(IncrementalContextBase.kt:409)
at com.google.devtools.ksp.impl.KotlinSymbolProcessing.execute(KotlinSymbolProcessing.kt:551)
at com.google.devtools.ksp.impl.KSPLoader$Companion.loadAndRunKSP(KSPLoader.kt:37)
at com.google.devtools.ksp.impl.KSPLoader.loadAndRunKSP(KSPLoader.kt)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at com.google.devtools.ksp.gradle.KspAAWorkerAction.execute(KspAATask.kt:525)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
[ elided for brevity ]
Caused by: java.lang.IllegalStateException: unexpected jvm signature V
at dagger.spi.internal.shaded.androidx.room.compiler.processing.javac.kotlin.JvmDescriptorUtilsKt.typeNameFromJvmSignature(JvmDescriptorUtils.kt:106)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:99)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:182)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:64)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName$resolveTypeName(KSTypeJavaPoetExt.kt:143)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:145)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:172)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KSTypeJavaPoetExtKt.asJTypeName(KSTypeJavaPoetExt.kt:154)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.DefaultKspType.resolveJTypeName(DefaultKspType.kt:43)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType$xTypeName$2.invoke(KspType.kt:90)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType$xTypeName$2.invoke(KspType.kt:69)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType.getXTypeName(KspType.kt:69)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType.access$getXTypeName(KspType.kt:49)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType$typeName$2.invoke(KspType.kt:61)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType$typeName$2.invoke(KspType.kt:61)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at dagger.spi.internal.shaded.androidx.room.compiler.processing.ksp.KspType.getTypeName(KspType.kt:61)
at dagger.internal.codegen.xprocessing.XTypes.toStableString(XTypes.java:496)
at dagger.internal.codegen.xprocessing.XElements.toStableString(XElements.java:346)
at dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException.getMessageForElement(DaggerSuperficialValidation.java:637)
at dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException.append(DaggerSuperficialValidation.java:547)
at dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException.access$200(DaggerSuperficialValidation.java:491)
at dagger.internal.codegen.base.DaggerSuperficialValidation.validateElement(DaggerSuperficialValidation.java:299)
at dagger.internal.codegen.base.DaggerSuperficialValidation.validateElements(DaggerSuperficialValidation.java:250)
at dagger.internal.codegen.base.DaggerSuperficialValidation.validateElement(DaggerSuperficialValidation.java:285)
... 45 more
The text was updated successfully, but these errors were encountered:
Hey, thanks for filing this and all the other issues. I just wanted to let you know, for KSP2 we're still working on supporting this. You can see an update about that here: #2349 (comment)
So you're likely to find a lot of different bugs still as so far we've already found a lot of failures via XProcessing's unit tests (the underlying library we use to support KSP) and are just starting to now look at running our own unit tests in Dagger with KSP2 now that those are getting fixed. Also, with that said, I'm not sure when we're going to be able to go through these specific cases you're filing as we're prioritizing getting our tests passing first and I'm hoping a lot of these could be covered by those tests as well.
Anyway, just wanted to let you know and also still say that we appreciate the effort you've put into filing all of these issues!
Thanks @Chang-Eric! I figured as much but wanted to get some test cases from our project registered so that they were available as test subjects as work proceeded on your side of the fence. We're very much looking forward to the move to KSP2 so wanted to be proactive to do our part in things.
Dagger: 2.52
KSP: 2.0.21-1.0.26
This is a bit of an odd scenario but it makes sense in our actual project.
The failing scenario:
Fails with:
Stack trace:
The text was updated successfully, but these errors were encountered: