Added conformance tests for async generators

This commit is contained in:
Ron Buckton
2016-11-17 23:17:42 -08:00
parent df303c9530
commit e53263edbb
423 changed files with 2611 additions and 1383 deletions

View File

@@ -17301,7 +17301,9 @@ namespace ts {
// Now even though we have extracted the iteratedType, we will have to validate that the type
// passed in is actually an Iterable.
if (errorNode && elementType) {
checkTypeAssignableTo(asyncIterable, createAsyncIterableType(elementType), errorNode);
const asyncIterableType = createAsyncIterableType(elementType);
const iterableType = createIterableType(elementType);
checkTypeAssignableTo(asyncIterable, getUnionType([asyncIterableType, iterableType], /*subtypeReduction*/ true), errorNode);
}
return elementType || anyType;