Why IntDef in Kotlin is not exhaustive? The next piece of code requires me to add an else branch, but I don't see why should I. I tried to put annotation wherever I could, but no luck.
Is it possible somehow, or do I have to use sealed class for desired behavior?
@IntDef({AWAIT, FAILED, SENT, SEEN})
@Retention(AnnotationRetention.SOURCE)
annotation class Status
companion object {
const val AWAIT = 0;
const val FAILED = 1;
const val SENT = 2;
const val SEEN = 3;
}
@Status val status = AWAIT
when (status) { // THIS is red underlined cause it is "not" exhaustive
AWAIT -> {}
FAILED -> {}
SENT -> {}
SEEN -> {}
}