mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed a bug that can result in infinite recursion (and a subsequent crash) when a class instance is called and the class defines a __getattr__
method. This addresses https://github.com/microsoft/pyright/issues/4798.
This commit is contained in:
parent
1af9bf8715
commit
575adcb29a
@ -9440,7 +9440,14 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
|
||||
return returnType;
|
||||
} else {
|
||||
const memberType = getTypeOfObjectMember(errorNode, expandedSubtype, '__call__')?.type;
|
||||
const memberType = getTypeOfObjectMember(
|
||||
errorNode,
|
||||
expandedSubtype,
|
||||
'__call__',
|
||||
/* usage */ undefined,
|
||||
/* diag */ undefined,
|
||||
MemberAccessFlags.SkipAttributeAccessOverride
|
||||
)?.type;
|
||||
|
||||
if (memberType) {
|
||||
const functionResult = validateCallArguments(
|
||||
|
Loading…
Reference in New Issue
Block a user