зеркало из https://github.com/microsoft/pyright.git
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:
Родитель
1ab7801331
Коммит
e5889207ff
|
@ -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 },
|
||||
|
|
Загрузка…
Ссылка в новой задаче