Skip to content

Commit e1d799f

Browse files
committed
Remove object literal freshness in control flow based array types
1 parent 8c6b858 commit e1d799f

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
@@ -20633,7 +20633,7 @@ namespace ts {
2063320633
// we defer subtype reduction until the evolving array type is finalized into a manifest
2063420634
// array type.
2063520635
function addEvolvingArrayElementType(evolvingArrayType: EvolvingArrayType, node: Expression): EvolvingArrayType {
20636-
const elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node));
20636+
const elementType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)));
2063720637
return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
2063820638
}
2063920639

0 commit comments

Comments
 (0)