mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Added conformance tests for async generators
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user