make it work with AssignmentRestElement

This commit is contained in:
Klaus Meinhardt
2018-07-31 10:21:40 +02:00
parent 090326be6a
commit 51b752bbda
7 changed files with 32 additions and 25 deletions
+1 -1
View File
@@ -21066,7 +21066,7 @@ namespace ts {
else {
checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
const type = isTupleType(sourceType) ?
getArrayLiteralType((sourceType.typeArguments || emptyArray).slice(elementIndex, getTypeReferenceArity(sourceType))) :
sliceTupleType(sourceType, elementIndex) :
createArrayType(elementType);
return checkDestructuringAssignment(restExpression, type, checkMode);
}