Properly analyze switch statement bypass control flow (#35087)

* Properly analyze switch statement bypass control flow

* Add regression test

* Accept new baselines
This commit is contained in:
Anders Hejlsberg
2019-11-13 09:22:18 -08:00
committed by GitHub
parent aa39080ac7
commit 38db7ae59e
6 changed files with 147 additions and 2 deletions

View File

@@ -19333,7 +19333,7 @@ namespace ts {
}
}
if (bypassFlow) {
const flowType = getTypeAtFlowNode(bypassFlow.antecedent);
const flowType = getTypeAtFlowNode(bypassFlow);
const type = getTypeFromFlowType(flowType);
// If the bypass flow contributes a type we haven't seen yet and the switch statement
// isn't exhaustive, process the bypass flow type. Since exhaustiveness checks increase