ralf
04/17/2025, 5:57 AMCaused by: ksp.org.jetbrains.kotlin.analysis.api.lifetime.KaInvalidLifetimeOwnerAccessException: Access to invalid ksp.org.jetbrains.kotlin.analysis.api.platform.lifetime.KotlinAlwaysAccessibleLifetimeToken@33adf999: PSI has changed since creation
at ksp.org.jetbrains.kotlin.analysis.api.fir.symbols.KaFirNamedFunctionSymbol.getPsi(KaFirNamedFunctionSymbol.kt:247)
at com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.toContainingFile(util.kt:237)
at com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl$containingFile$2.invoke(AbstractKSDeclarationImpl.kt:79)
at com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl$containingFile$2.invoke(AbstractKSDeclarationImpl.kt:78)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
at com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl.getContainingFile(AbstractKSDeclarationImpl.kt:78)
at me.tatarka.kotlin.ast.KSAstProvider.addOriginatingElement(KSAst.kt:94)
at me.tatarka.inject.compiler.KmpComponentCreateGenerator.generate(KmpComponentCreateGenerator.kt:27)
at me.tatarka.inject.compiler.ksp.ProcessKmpComponentCreateKt.generateKmpComponentCreateFiles(ProcessKmpComponentCreate.kt:40)
at me.tatarka.inject.compiler.ksp.InjectProcessor.finish(InjectProcessor.kt:113)
I can reproduce this consistently in unit tests for all platforms where I define the function in commonTest
@KmpComponentCreate
expect fun createTestComponent(
coroutineScope: CoroutineScope,
coroutineDispatcher: CoroutineDispatcher,
): TestComponent
This happens only with KSP 2, there’s no issue with KSP 1 obviously.eygraber
04/17/2025, 10:01 AMralf
04/17/2025, 2:06 PMeygraber
04/17/2025, 2:08 PMralf
04/17/2025, 2:11 PMralf
04/17/2025, 2:11 PMeygraber
04/17/2025, 2:12 PMeygraber
04/17/2025, 2:12 PMDaniel Weidensdörfer
04/22/2025, 6:35 PMeygraber
04/22/2025, 6:37 PMDaniel Weidensdörfer
04/22/2025, 6:37 PMeygraber
04/22/2025, 6:37 PMDaniel Weidensdörfer
04/22/2025, 6:41 PMDaniel Weidensdörfer
04/22/2025, 6:45 PMeygraber
04/22/2025, 6:46 PMralf
04/22/2025, 6:48 PM