diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index b45af24d4d1..b7852a64d04 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -551,6 +551,9 @@ namespace ts { case SyntaxKind.CaseBlock: bindCaseBlock(node); break; + case SyntaxKind.CaseClause: + bindCaseClause(node); + break; case SyntaxKind.LabeledStatement: bindLabeledStatement(node); break; @@ -989,6 +992,14 @@ namespace ts { } } + function bindCaseClause(node: CaseClause): void { + const saveCurrentFlow = currentFlow; + currentFlow = preSwitchCaseFlow; + bind(node.expression); + currentFlow = saveCurrentFlow; + forEach(node.statements, bind); + } + function pushActiveLabel(name: string, breakTarget: FlowLabel, continueTarget: FlowLabel): ActiveLabel { const activeLabel = { name,