functions returning never are not treated the same as raw throw calls in control-flow analysis #9655
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
TypeScript Version: 2.0.0-beta
Code
Expected behavior:
s += '' is allowed because all terminating (non-throwing) branches assign to s.
In general, I am working under the assumption that calling functions that returning never are equivalent to raw throw calls during control-flow analysis.
Actual behavior:
ERROR(21,3): : Variable 's' is used before being assigned.
The text was updated successfully, but these errors were encountered: