Have you thought about moving to Kotlin Symbol Processing as a way to work around the library with the compiler api you are encountering? https://kotlinlang.org/docs/ksp-overview.html