Contextually type object spread expressions

so `x = { ... { a: "a" } }` will be equivalent to `{ a: "a" }`.
This commit is contained in:
Nathan Shively-Sanders
2017-04-24 15:43:10 -07:00
parent a0abadbcbe
commit 213812ab22

View File

@@ -12728,6 +12728,8 @@ namespace ts {
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment:
return getContextualTypeForObjectLiteralElement(<ObjectLiteralElementLike>parent);
case SyntaxKind.SpreadAssignment:
return getApparentTypeOfContextualType(parent.parent as ObjectLiteralExpression);
case SyntaxKind.ArrayLiteralExpression:
return getContextualTypeForElementExpression(node);
case SyntaxKind.ConditionalExpression: