Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
This issue proposes the implementation of context-aware compiler inspection, which includes dynamic type narrowing, to allow the user to perform certain actions that logically conclude certain type constraints and circumstances. This would entail adding local symbol tables that keep track of these type narrowing and logical assertions, such as if (typeof x == num) { // in this scope 'x' is of type 'num' }.
Exact behaviour / changes you want
Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
This issue proposes the implementation of context-aware compiler inspection, which includes dynamic type narrowing, to allow the user to perform certain actions that logically conclude certain type constraints and circumstances. This would entail adding local symbol tables that keep track of these type narrowing and logical assertions, such as
if (typeof x == num) { // in this scope 'x' is of type 'num' }.Exact behaviour / changes you want