The rule is: If the compiler cannot be 100% sure t...
# announcements
j
The rule is: If the compiler cannot be 100% sure that the value of a
val
does not change between 2 retrievals of that
val
, smart casting is not allowed. Because of multi-threading, and functions that can change the value of the
val
invoked on the same thread, about the only way to guarantee that a value of a
val
(or
var
for that matter) does not change, is to use a local
val