Fixed bug that causes infinite recursion and memory exhaustion under certain circumstances involving recursive type aliases where the type alias is used as a type argument. This addresses #8670.

This commit is contained in:
Eric Traut 2024-08-06 16:39:26 -06:00
Родитель 1ab7801331
Коммит e5889207ff
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -4065,6 +4065,12 @@ export function createTypeEvaluator(
return typeArg;
}
// Don't expand recursive type aliases because they can
// cause infinite recursion.
if (isTypeVar(typeArg) && typeArg.shared.recursiveAlias) {
return typeArg;
}
const filteredTypeArg = mapSubtypesExpandTypeVars(
typeArg,
{ conditionFilter },