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
we try to handle @LensForType this annotation in out ksp. It refer another Console class which is defined in module2/Console.kt like
data class Console(
val brand: String,
val type: String,
) {
companion object
}
when our ksp runs we check Console class should be data class and all params in primary constructor should be val, but it failed when using ksp2, while it does work when using ksp1.
In ksp2 if Console.kt is also defined in module1(as -source-roots like ConsoleLens.kt), it also works. It failed to our check when Console.kt is defined in -libraries as a klib, this happen both via gradle build and command line build.
After debug isVal we find in KSValueParameterImpl.kt
kotlin version 2.1.0
ksp version 2.1.0-1.0.28
we have a
module1/ConsoleLens.kt
, in which we have awe try to handle
@LensForType
this annotation in out ksp. It refer another Console class which is defined inmodule2/Console.kt
likewhen our ksp runs we check Console class should be data class and all params in primary constructor should be val, but it failed when using ksp2, while it does work when using ksp1.
In ksp2 if
Console.kt
is also defined in module1(as-source-roots
likeConsoleLens.kt
), it also works. It failed to our check whenConsole.kt
is defined in-libraries
as a klib, this happen both via gradle build and command line build.After debug
isVal
we find in KSValueParameterImpl.ktktValueParameterSymbol (came from
-libraries
klib) it selfisVal
is true, butktValueParameterSymbol.psi
is null so finally it returns false.Any way to get
ktValueParameterSymbol.psi
non null? or any change should we apply to out ksp2 command? Thanks a lot.ps out ksp2 command is like
The text was updated successfully, but these errors were encountered: