Make lenses genration more resilient with KSP >= 1.9.x #855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.