Closed ZacSweers closed 4 years ago
In 1.3.70 KAPT will have better logging regarding this. To figure out what is causing it to fail, you can create a breakpoint in https://github.com/JetBrains/kotlin/blob/a9686c94474c9d442db61b45f60e6ff326fdb7db/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/incremental/incrementalProcessors.kt#L119 (this is tag v1.3.61).
I've figured it out. This is a bug in JavaPoet, where calling TypeSpec#toBuilder()
leaves out the originating elements.
Fixes #233
I think before this Just Worked because the generated adapter was a nested type of a class that did have its originating element set, but when it's top-level it does need it set anyway. This sets it for both just to be doubly sure.
CC @gavra0