mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
TypeScript accepts parentheses and non-null assertions around the reference an assignment, a `++`/`--` update or a for-in/of head writes (`(x) = 1`, `h.sums[k]! += 10`), and both are erased at run time. The compiler now reads its source files with the AstFile writeTargets option: the writer's `left`, `operand` or `initializer` is the reference itself and the reference's `parent` is the writer, so lowering and every analysis of a binding's or member's writes see one shape. The reference keeps its own source span. Files read without the option, such as type nodes from the checker and the AST conformance tests, keep TypeScript's exact tree. Fixes #1625 Co-authored-by: ejc3 <1694850+ejc3@users.noreply.github.com>