Feature Request: Allow to verify `KotlinModifiers`
We have a list of Java Related modifiers in the com.tngtech.archunit.core.domain.JavaModifier class.
It would be helpful to have a similar class for Kotlin to be able to filter by Kotlin modifiers such as operator:
val publicMethods = javaClass
.methods
.filter { it.modifiers.contains(KotlinModifier.OPERATOR) }
I'm not sure if this is possible (but I'm happy to be proven wrong :wink:). Because in the end ArchUnit reads those modifiers from the bytecode. And the bytecode has only modifier flags that the JVM understands (and that map back to the Java modifiers we know). You can check here for access flags for example. We can just map these back to Java nicely, but Kotlin can't just introduce new bytecode concepts, so I would guess if this is available in the compiled code at all, then it could only be in the Kotlin metadata :thinking: But I have no idea what exactly is coded in there and if it would include this (happy to learn if somebody knows more there :slightly_smiling_face:).
I think https://github.com/JetBrains/kotlin/blob/master/libraries/kotlinx-metadata/jvm/ReadMe.md should be somehow utilized here probably in form of some Kotlin addon.