Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
When elements of an union are distinguished by a boolean, VSCode's Typescript plugin can only do type elimination if I branch by "== true" and not if I just branch by the boolean.
This is because Typescript treats booleans as an union of the constants "true" and "false", and compile-time elimination can only be done if I use syntax that makes sense with unions. Logical evaluation, for some reason, doesn't.
The fact that this issue can even appear is deeply concerning.
rant
true
typescript
type elimination
union
branching
boolean
false