DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.56k stars 33 forks source link

Missing parens in some `if`s #1593

Closed edemaine closed 1 week ago

edemaine commented 1 week ago

Examples:

if (do x) return false
if (for x of y then x) return false

These end up with missing parentheses around the if condition, because ParenthesizedExpression strips them. For example, the first one becomes:

if (()=>{{ return x }})() return false

but should be

if ((()=>{{ return x }})()) return false