Explain writeSpreadType a little better

This commit is contained in:
Nathan Shively-Sanders 2016-10-24 09:40:10 -07:00
parent 24300932cf
commit a94fb2f5a3

View File

@ -2338,6 +2338,8 @@ namespace ts {
inObjectTypeLiteral = saveInObjectTypeLiteral;
}
if (type.right.symbol === container) {
// if type.right was written as part of the spread type, don't surround with ...{ }.
// this gives { a: number, ... T } instead of { ...{ a: number }, ...T }
const saveInObjectTypeLiteral = inObjectTypeLiteral;
inObjectTypeLiteral = true;
writeObjectLiteralType(resolveStructuredTypeMembers(type.right));