Fixed a crash when computing flow type of destructured never (#57586)

This commit is contained in:
Mateusz Burzyński
2024-03-01 01:00:36 +01:00
committed by GitHub
parent e089896be4
commit af0424c010
5 changed files with 88 additions and 1 deletions

View File

@@ -43214,7 +43214,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function getIteratedTypeOrElementType(use: IterationUse, inputType: Type, sentType: Type, errorNode: Node | undefined, checkAssignability: boolean): Type | undefined {
const allowAsyncIterables = (use & IterationUse.AllowsAsyncIterablesFlag) !== 0;
if (inputType === neverType) {
reportTypeNotIterableError(errorNode!, inputType, allowAsyncIterables); // TODO: GH#18217
if (errorNode) {
reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
}
return undefined;
}