square / anvil

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

Gracefully handle module name resolution in KSP #947

Closed ZacSweers closed 3 months ago

ZacSweers commented 3 months ago

Due to lack of upstream support in KSP + a bug in the K2 analysis API around exposing module names for mangling, we can't properly support non-public APIs in KSP2. This catches those cases and gracefully offers a error message of advice to make it public instead. Previously this would just hard crash at runtime with a ClassNotFoundException