Asked in multiplatform but this channel is more ac...
# compose-desktop
l
Asked in multiplatform but this channel is more active Is there any way to anotate a class in common module with java-only lib anotations? expected/actual didnt work because the anotation has enum inside and i couldnt get it to work
r
I haven't actually tried this so YMMV, but I think you could create a common annotation with https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-optional-expectation/
a
I know that kvision has managed that somehow with their Spring annotations in Kotlin common code
l
I’ve used optional expectation for android-specific annotations, like Keep in common code. It works well, and as a plus, you only need to actualize it on the platforms you care about.
l
Optional expectations work partly, the main problem was typealiasing the enum inside the annotation It has to be done in 2 separate expect/actual statements