square / anvil

A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
Apache License 2.0
1.29k stars 76 forks source link

Fix missing `KSPropertySetter` in member injection code gen #899

Closed ZacSweers closed 4 months ago

ZacSweers commented 4 months ago

While KSClassDeclaration.getAllProperties() covers our cases when we generate, I discovered an edge case when a class has only @set:Inject properties. In this case, our KSP filter actually misses these because they come through as KSPropertySetter. This fixes that by checking for both it and KSPropertyDeclaration.