Set symbol/flags only on (fresh) object spreads
If you spread any into an object, the type is any, which should not be changed.
This commit is contained in:
parent
c76a3a6fef
commit
8dc1747db7
1 changed files with 5 additions and 2 deletions
|
@ -11638,8 +11638,11 @@ namespace ts {
|
|||
if (propertiesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true);
|
||||
}
|
||||
if (spread.flags & TypeFlags.Object) {
|
||||
// only set the symbol and flags if this is a (fresh) object type
|
||||
spread.flags |= propagatedFlags;
|
||||
spread.symbol = node.symbol;
|
||||
}
|
||||
return spread;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue