File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3408,6 +3408,10 @@ module ts {
3408
3408
return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"));
3409
3409
}
3410
3410
3411
+ function createIterableType(elementType: Type): Type {
3412
+ return globalIterableType !== emptyObjectType ? createTypeReference(<GenericType>globalIterableType, [elementType]) : emptyObjectType;
3413
+ }
3414
+
3411
3415
function createArrayType(elementType: Type): Type {
3412
3416
// globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if
3413
3417
// user code augments the Array type with call or construct signatures that have an array type as the return type.
@@ -9268,10 +9272,7 @@ module ts {
9268
9272
// Now even though we have extracted the iteratedType, we will have to validate that the type
9269
9273
// passed in is actually an Iterable.
9270
9274
if (expressionForError && iteratedType) {
9271
- let completeIterableType = globalIterableType !== emptyObjectType
9272
- ? createTypeReference(<GenericType>globalIterableType, [iteratedType])
9273
- : emptyObjectType;
9274
- checkTypeAssignableTo(iterable, completeIterableType, expressionForError);
9275
+ checkTypeAssignableTo(iterable, createIterableType(iteratedType), expressionForError);
9275
9276
}
9276
9277
9277
9278
return iteratedType;
You can’t perform that action at this time.
0 commit comments