Object literal freshness errors with spreads

Previously, object literals with spreads in them would not issue object
literal freshness errors.  Fixes #13878
This commit is contained in:
Nathan Shively-Sanders
2017-02-06 08:47:11 -08:00
parent 501084a93c
commit 3e142f8e52
4 changed files with 31 additions and 0 deletions

View File

@@ -11864,6 +11864,8 @@ namespace ts {
if (spread.flags & TypeFlags.Object) {
// only set the symbol and flags if this is a (fresh) object type
spread.flags |= propagatedFlags;
spread.flags |= TypeFlags.FreshLiteral;
(spread as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral;
spread.symbol = node.symbol;
}
return spread;