The "no warning" behavior is not specific to numer...
# javascript
a
The "no warning" behavior is not specific to numeric values. Other impossible casts behave similarly (e.g.
"" as Int
). All you get at the moment is IDEA highlighting
as
yellow and showing a popup "This cast can never succeed". Not sure why. I don't think we should make
x
hold
0
though. If anything, an exception should be thrown to make it consistent with Kotlin/JVM and Kotlin/Native IMHO we might have to introduce boxing for numeric types at some point. Otherwise the subtle differences in behaviour might get really painful with multiplatform projects.