Closed xkr47 closed 6 years ago
This example fails on the String y = x; line with the error that x is String?:
String y = x;
String?
value x = "" of String?; try { assert (exists x); } catch(e) { throw Exception("Noo", e); } String y = x; print(y);
Since the catch block never exits normally, I would have thought the code block below should inherit the narrowing actions of the try block?
catch
Nono, the effect of narrowing is always limited to the block to which the assert statement belongs. And I definitely don't want to change that.
assert
:bowing_man:
This example fails on the
String y = x;
line with the error that x isString?
:Since the
catch
block never exits normally, I would have thought the code block below should inherit the narrowing actions of the try block?