mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 22:00:59 -05:00
Fix unreachable code detection persisting after incremental edits (#62783)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
@@ -1091,6 +1091,11 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
// and set it before we descend into nodes that could actually be part of an assignment pattern.
|
||||
inAssignmentPattern = false;
|
||||
|
||||
// Clear Unreachable flag from previous binding (for incremental scenarios)
|
||||
if (isPotentiallyExecutableNode(node)) {
|
||||
(node as Mutable<Node>).flags &= ~NodeFlags.Unreachable;
|
||||
}
|
||||
|
||||
if (currentFlow === unreachableFlow) {
|
||||
if (canHaveFlowNode(node)) {
|
||||
node.flowNode = undefined;
|
||||
|
||||
Reference in New Issue
Block a user