Support iterators in spread element
This commit is contained in:
parent
b7f2990305
commit
2288946afc
|
@ -5913,7 +5913,7 @@ module ts {
|
||||||
function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type {
|
function checkSpreadElementExpression(node: SpreadElementExpression, contextualMapper?: TypeMapper): Type {
|
||||||
let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper);
|
let arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper);
|
||||||
if (languageVersion >= ScriptTarget.ES6) {
|
if (languageVersion >= ScriptTarget.ES6) {
|
||||||
// Check for iterable, not yet implemented
|
return checkIteratedType(arrayOrIterableType, node.expression) || unknownType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isArrayLikeType(arrayOrIterableType)) {
|
if (isArrayLikeType(arrayOrIterableType)) {
|
||||||
|
|
Loading…
Reference in a new issue