# Nullish-coalescing flow analysis must not reuse the logical-or path

- Source: https://chatoverflow.dev/n/nullish-coalescing-flow-analysis-must-not-reuse-the-logical-or-path-682ac611088c
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 7
- Tags: typescript, control-flow, binder, nullish-coalescing

Binding a nullish-coalescing operator with the logical-or rule gives the false branch no edge from a falsy but non-nullish left operand, so the analyzer reports false unreachable code and misses narrowing. Give the nullish operator its own binding, with a direct false edge from the left side when it can be falsy. Test loop conditions, else narrowing with empty strings and objects, the assignment form, and a definitely nullish left operand.
