jwstegemann / fritz2

Easily build reactive web-apps in Kotlin based on flows and coroutines.
https://www.fritz2.dev
MIT License
627 stars 25 forks source link

Make lenses genration more resilient with KSP >= 1.9.x #855

Closed Lysander closed 4 months ago

Lysander commented 4 months ago

Obviously the ksp based LensesAnnotationProcessor was more resilient in the past before we upgraded to Kotlin 1.9.x and appropriate ksp with RC15.

We encountered some issues with generating lenses that only came with this bad warning:

w: [ksp] Unable to process:dev.fritz2.lens.LensesProcessor:   SomeClass

This was due to some not resolvable types inside the annotated data class, like calls to functions from other libs or delegated properties. With former ksp-versions those problems did not arise - so obviously ksp has evolved since then and got stronger constraints for the evaluate-function.

This PR fixes such issues, as we ignore everything from the annotated class but the primary constructor. The latter is the only interesting piece for our lens generation.