Open MarkAmeryCurative opened 1 year ago
I would imagine this is because ksp runs (its own task) before the actual kotlin compilation (where compiler plugins run). I am not sure what a solution would look like here tbh
Kapt also runs before actual Kotlin compilation, but somehow manages to respect allopen
. So looking at Kapt's code and seeing how they manage it might inspire a solution.
I'm seeing the same issue.
Just ran into this issue as well. It's been a bit over half a year, has there been any progress on this issue? 🙏
Still encountering this issue, any updates on this?
I don't understand why this is considered an issue. KSP processes kotlin symbols, by definition. The allopen plugin is about generating open classes in bytecode, but these classes are not open in Kotlin sources as far as I know. So why should KSP consider these classes open?
If you use the allopen plugin to mark a class and its members as open, KSP doesn't seem to recognise that you've done so, at least when used in conjunction with Micronaut AOP.
For a minimal example:
Create a new Micronaut project, with the
micronaut-aop
feature, using Micronaut Launch.Define and use an AOP method annotation:
Mark the class as open using allopen in build.gradle.kts:
Try to compile
I've created a demo project at https://github.com/MarkAmeryCurative/ksp-aop-bug-demo you can use to see the bug in action. Just clone the project and run
./gradlew compileKotlin
, and you'll see this error:i.e. KSP sees the class as non-open even though it's being opened with
allopen
.