Fixed a bug that results in incorrect type evaluation when assigning a function with a NoReturn return type to a Callable[..., T].

This commit is contained in:
Eric Traut 2024-04-13 18:39:18 -07:00
parent 5c480848ce
commit 00d8f81a1c

View File

@ -25514,11 +25514,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
effectiveFlags |= AssignTypeFlags.RetainLiteralsForTypeVar;
}
if (isNever(srcReturnType)) {
// We'll allow any function that returns NoReturn to match any
// function return type, consistent with other type checkers.
isReturnTypeCompatible = true;
} else if (
if (
assignType(
destReturnType,
srcReturnType,