Smart Casting for the win :smile: <https://imgur....
# random
j
Smart Casting for the win 😄 https://imgur.com/a/vEXgn
e
Multiple violations of Kotlin code style detected
j
yeah, but why doesn't IntelliJ complain about it? This is from the Kotlin Puzzlers, slightly adapted. Was wondering if there's maybe a use-case here for Union Types in the future using Smart Casts
m
Because the smart cast is correct. It could give a warning that the if-expression is always false though.
j
Anyways, probably not code any sane person would write 😛
p
could x ne reassigned to lets say 0.0 after this?
also, a question to jetbrains guys: do these smart casts add any overhead?
c
More like dumb typing