mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 02:35:48 -05:00
Map stale empty object type in union into fresh empty object type after spread is complete (#34839)
* Map stale empty object type in union into fresh empty object type after spread is complete * Accept minor baseline diff
This commit is contained in:
@@ -22090,8 +22090,13 @@ namespace ts {
|
||||
if (spread !== emptyObjectType) {
|
||||
if (propertiesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);
|
||||
propertiesArray = [];
|
||||
propertiesTable = createSymbolTable();
|
||||
hasComputedStringProperty = false;
|
||||
hasComputedNumberProperty = false;
|
||||
}
|
||||
return spread;
|
||||
// remap the raw emptyObjectType fed in at the top into a fresh empty object literal type, unique to this use site
|
||||
return mapType(spread, t => t === emptyObjectType ? createObjectLiteralType() : t);
|
||||
}
|
||||
|
||||
return createObjectLiteralType();
|
||||
|
||||
Reference in New Issue
Block a user