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:
Wesley Wigham
2019-11-21 10:57:55 -08:00
committed by GitHub
parent 0d993ac592
commit a6d44aa52e
6 changed files with 214 additions and 4 deletions

View File

@@ -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();