File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15780,9 +15780,6 @@ namespace ts {
15780
15780
15781
15781
function getTypeAtSwitchClause(flow: FlowSwitchClause): FlowType {
15782
15782
const expr = flow.switchStatement.expression;
15783
- if (containsMatchingReferenceDiscriminant(reference, expr)) {
15784
- return declaredType;
15785
- }
15786
15783
const flowType = getTypeAtFlowNode(flow.antecedent);
15787
15784
let type = getTypeFromFlowType(flowType);
15788
15785
if (isMatchingReference(reference, expr)) {
@@ -15797,6 +15794,9 @@ namespace ts {
15797
15794
else if (expr.kind === SyntaxKind.TypeOfExpression && isMatchingReference(reference, (expr as TypeOfExpression).expression)) {
15798
15795
type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
15799
15796
}
15797
+ else if (containsMatchingReferenceDiscriminant(reference, expr)) {
15798
+ type = declaredType;
15799
+ }
15800
15800
return createFlowType(type, isIncomplete(flowType));
15801
15801
}
15802
15802
You can’t perform that action at this time.
0 commit comments