Closed jvasileff closed 9 years ago
The following produces incorrect results at runtime:
Float toFloat(Integer|Float x) => if (is Float x) then x else if (false) then x.float else x.float; print(toFloat(1)); // "<null>"
The same happens if false is replaced with true.
false
true
Confirmed.
The problem is not really with flow typing but with the if expression.
if
Thanks, that was quick!
The following produces incorrect results at runtime:
The same happens if
false
is replaced withtrue
.