How can I switch on a Byte
value? The obvious way would be:
fun foo(b: Byte): Boolean {
return when(b) {
0 -> true
else -> false
}
}
but that fails at compile time with
src/ByteSwitch.kt:3:5: error: incompatible types: kotlin.Int and kotlin.Byte
0 -> true
^
Is there a way to make that 0
be a byte literal?