mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Fix crash caused by cyclic defaults (#30532)
This commit is contained in:
@@ -5474,9 +5474,6 @@ namespace ts {
|
||||
}
|
||||
return type;
|
||||
}
|
||||
if (declaration.kind === SyntaxKind.ExportAssignment) {
|
||||
return widenTypeForVariableLikeDeclaration(checkExpressionCached((<ExportAssignment>declaration).expression), declaration);
|
||||
}
|
||||
|
||||
// Handle variable, parameter or property
|
||||
if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) {
|
||||
@@ -5487,7 +5484,10 @@ namespace ts {
|
||||
return reportCircularityError(symbol);
|
||||
}
|
||||
let type: Type | undefined;
|
||||
if (isInJSFile(declaration) &&
|
||||
if (declaration.kind === SyntaxKind.ExportAssignment) {
|
||||
type = widenTypeForVariableLikeDeclaration(checkExpressionCached((<ExportAssignment>declaration).expression), declaration);
|
||||
}
|
||||
else if (isInJSFile(declaration) &&
|
||||
(isCallExpression(declaration) || isBinaryExpression(declaration) || isPropertyAccessExpression(declaration) && isBinaryExpression(declaration.parent))) {
|
||||
type = getWidenedTypeFromAssignmentDeclaration(symbol);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user