Why isn't the compiler happy with `val num: UInt =...
# announcements
d
Why isn't the compiler happy with
val num: UInt = 5
?
h
does it require a deliberate casting from int to unsigned int? kotlin does not like autocasting between number types...
d
It requires a literal.
val num: UInt = 5U
.
It's a constant though. So I thought it'd take it.
h
do you mean immutable, or is it qualified with
const
? (sorry, semantics)
d
Oh, I mean
5U
is like a number literal. "Hard coded".