Support simple check in if
for discriminated unions with true
/false
discriminant
#24843
Closed
4 tasks done
Search Terms
discriminated true false if
Suggestion
Use Cases
Having discriminated union with
true
/false
discriminant:we can treat them differently using verbose comparison in
if
:With simple check:
ts doesn't recognize
Rectangle
inelse
branch:Property 'height' does not exist on type 'Square'
Examples
Would be nice to be able to do simple
if(s.kind)
check.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: