Fix crash in getAwaitedType (#54107)

This commit is contained in:
Ron Buckton
2023-05-03 15:40:51 -04:00
committed by GitHub
parent e18c93511b
commit f9a7cbfe7b
6 changed files with 128 additions and 1 deletions
+1 -1
View File
@@ -2036,7 +2036,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
getGlobalIterableType: getGlobalAsyncIterableType,
getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType,
getGlobalGeneratorType: getGlobalAsyncGeneratorType,
resolveIterationType: getAwaitedType,
resolveIterationType: (type, errorNode) => getAwaitedType(type, errorNode, Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member),
mustHaveANextMethodDiagnostic: Diagnostics.An_async_iterator_must_have_a_next_method,
mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,
mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property,