Is there some sneaky way to use eg. @IntDef annota...
# android
k
Is there some sneaky way to use eg. @IntDef annotation for fun return type in Kotlin? I checked out the topic a little bit, found Kotlin target annotations enum etc., but seems like they are not handled by lint in Android Studio. Can someone confirm on that or am I missing sth?
a
Wouldn't an inline class be a better solution ?
2
s
Pretty sure if you use a regular enum, R8 will convert it to an int at compile time, if you are not using any of the fancy enum features
👍 1
k
Maybe I misdescribed my intentions, I meant @IdRes. They seem to be incompatible when mixing Kotlin with Java.