Tracks the TypeScript compatibility batch for nullish-coalescing literal precision and reachable conditional-assignment flow, as part of #66 and #548.
Two independent checker gaps affected the pinned Zod project:
??widened a literal fallback before forming the result union. Optional literal unions such as("input" | "output" | undefined) ?? "output"therefore becamestring | "input" | "output"and failed their declared property types. Nullish coalescing now preserves the fallback's fresh literal type while leaving the surrounding context free to widen the completed expression.- Function-local
ifflow only propagated a narrow subset of exhaustive assignments. Nested and partial branches could leave an annotated mutable literal union stuck at its initializer, while an exiting branch was still treated as reachable. Conditional flow now joins every reachable identifier assignment, preserves the incoming type on a missing branch, excludesreturn/throw/break/continuepaths, and keeps contextually accepted constructor assignments on their declared non-nullish collection type.
Implemented in fd4339d.
Validation:
- Type checker: 4,387/4,387 tests pass in ReleaseFast.
- Full ReleaseFast build with JSC: 50/50 steps pass.
- Pinned Zod v4.5.2 core oracle: 30 diagnostics -> 25, removing five expected false positives with zero additions.
- Official TypeScript 6.0.2 focused oracles agree on literal fallback unions, partial branch joins, and exiting-branch flow.
- Focused formatting, diff, and Pickier checks pass.