Skip to content

Commit 99c5c09

Browse files
committed
Properly finalize evolving array type in getTypeAtFlowCall
1 parent 35d4a06 commit 99c5c09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20360,7 +20360,7 @@ namespace ts {
2036020360
const predicate = getTypePredicateOfSignature(signature);
2036120361
if (predicate && (predicate.kind === TypePredicateKind.AssertsThis || predicate.kind === TypePredicateKind.AssertsIdentifier)) {
2036220362
const flowType = getTypeAtFlowNode(flow.antecedent);
20363-
const type = getTypeFromFlowType(flowType);
20363+
const type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType));
2036420364
const narrowedType = predicate.type ? narrowTypeByTypePredicate(type, predicate, flow.node, /*assumeTrue*/ true) :
2036520365
predicate.kind === TypePredicateKind.AssertsIdentifier && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) :
2036620366
type;

0 commit comments

Comments
 (0)