Open jschneider opened 8 months ago
Is it possible to provide a reproduce repo for this issue? That would greatly help with investigation.
The bug still exists with 2.0.0-Beta4-1.0.18
Last working version: 1.9.20-1.0.13
I have a monorepo here, which I can not share. But I am more than willing to help debugging this issue? (Remote Session / Screen share / ...)
This might be the same issue. Contains a link to a reproducer repo:
https://github.com/google/ksp/issues/1630#issuecomment-1837303260
I investigated a bit further. I can reproduce the exception with a very simple visitor:
Overwriting all visit methods and calling the super method.
class LoggerVisitor(val codeGenerator: CodeGenerator) : KSTopDownVisitor<Int, Unit>() {
...
override fun visitTypeReference(typeReference: KSTypeReference, data: Int) {
log("${indent(data)}visitTypeReference: $typeReference $data") //this line is the problem!
super.visitTypeReference(typeReference, data + 1)
}
}
Removing "valueArgument" from the log statement solves the exception. Therefore, I suspect the toString() method might be the problem.
Seeing this issue here when using room (only on iOS). Can be reproduced using this PR https://github.com/joreilly/BikeShare/pull/225
Uinsg kotlin = "2.0.20" ksp = "2.0.20-1.0.25"
ERROR: Rewrite at slice LEXICAL_SCOPE key: ANNOTATION_ENTRY old value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@7bd01c44@2077236292 new value: org.jetbrains.kotlin.resolve.scopes.LexicalScope$Base@334b6715@860579605
<File name: AppDatabase.kt, Physical: true>
<ELEMENT>@Database(entities = [Network::class], version = 1)</ELEMENT>
@ConstructedBy(AppDatabaseCtor::class)
abstract class AppDatabase : RoomDatabase() {
abstract fun bikeShareDao(): BikeShareDao
}
I'm also using ksp for kotlin-inject in this project so that's perhaps a factor
So, changing to following order seems to work around the issue
dependencies {
ksp(libs.androidx.room.compiler)
ksp(libs.kotlininject.compiler)
}
Hey guys, this exception still happens for me with:
last version without this bug:
This is the same(?) issue: https://github.com/google/ksp/issues/1591
But it is not fixed for me.
The exception can be provoked by marking methods with @JsExport
Full Stacktrace: