Second question - if I write `val foo = 0x1u` it's...
# announcements
m
Second question - if I write
val foo = 0x1u
it's treated as
Int
. Is there a way to make it something else without providing a type? For example:
Copy code
val foo: UByte = 0x1u

when(foo) {
    0x1u -> {} // doesn't work because 0x1u is treated as an Int
}
I can do
0x1.toUByte()
but it's ugly. Is there maybe something like
0x1ub
suffix or sth like that?
Makes sense, not sure if adding unsigned types to Kotlin was worth the effort. It's still a pain to code low level stuff that operates on bytes and bits.