https://kotlinlang.org logo
#announcements
Title
# announcements
d

dalexander

06/15/2017, 12:10 PM
Should
Copy code
val b: Byte = 3
when(b) { 1 -> {} }
compile? It currently fails with the message “Incompatible types, Int and Byte” because it treats 1 as an int literal, and there’s no way to specify byte literals. Asking here before I file a ticket (it also fails for Shorts).
r

radityagumay

06/15/2017, 5:30 PM
dalexander: you should cast int into byte