arrow-meta
arrow-meta copied to clipboard
[BUG] Unrecognized modifier when annotation is commented out
Describe the bug
When a class has multiple annotations but one is commented out the comment is still considered as entry and running the code throws java.lang.IllegalStateException: Unrecognized modifier: //@SerializeWithStrategy(SerializationStrategy.KebabCase)
See branch-reproducer for precise setup
To Reproduce Steps to reproduce the behavior:
- Go to https://github.com/paranoidmonoid/kotlin-serial-name/tree/reproducer-unrecognized-modifier
- Run Main
- See console output
Expected behavior The commented lines are ignored
Environment (please complete the following information):
- KOTLIN_VERSION=1.5.31
- JVM_TARGET_VERSION=1.8
- ARROW_VERSION=1.0.0
- ARROW_META_VERSION=1.5.0-RC-SNAPSHOT
- Kotlin: 212-1.5.31-release-546-IJ4638.7
@paranoidmonoid could you try with an updated version of the Kotlin compiler? Unfortunately we get the entries directly from the compiler AST, so I see little we can do ourselves to fix the problem (but if in a new Kotlin version the problem persists, I'm more than happy to raise it myself to the Jetbrains people if you prefer not to).