Rest assignment element allows nested destructuring (fixes #2156)

This commit is contained in:
Jason Freeman
2015-04-10 12:11:28 -07:00
parent e9f5acce75
commit f84ebba852
17 changed files with 135 additions and 4 deletions

View File

@@ -7634,7 +7634,7 @@ module ts {
}
else {
if (i === elements.length - 1) {
checkReferenceAssignment((<SpreadElementExpression>e).expression, createArrayType(elementType), contextualMapper);
checkDestructuringAssignment((<SpreadElementExpression>e).expression, createArrayType(elementType), contextualMapper);
}
else {
error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);