mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed performance regression due to a recent change in the code flow engine when attempting to evaluate whether call is a NoReturn.
This commit is contained in:
parent
04da48b2dd
commit
152c10116e
@ -1569,10 +1569,7 @@ export function getCodeFlowEngine(
|
||||
let symbol: Symbol | undefined;
|
||||
if (isModule(subtype)) {
|
||||
symbol = ModuleType.getField(subtype, memberName);
|
||||
} else if (isInstantiableClass(subtype)) {
|
||||
const classMemberInfo = lookUpClassMember(subtype, memberName);
|
||||
symbol = classMemberInfo ? classMemberInfo.symbol : undefined;
|
||||
} else if (isClassInstance(subtype)) {
|
||||
} else if (isClass(subtype)) {
|
||||
const classMemberInfo = lookUpClassMember(subtype, memberName);
|
||||
symbol = classMemberInfo ? classMemberInfo.symbol : undefined;
|
||||
}
|
||||
@ -1583,7 +1580,9 @@ export function getCodeFlowEngine(
|
||||
|
||||
// We want to limit the evaluation to declared types only, so
|
||||
// we use getDeclaredTypeOfSymbol rather than getEffectiveTypeOfSymbol.
|
||||
return getDeclaredTypeOfSymbol(symbol, /* isBeyondExecutionScope */ true) ?? UnknownType.create();
|
||||
// Set isBeyondExecutionScope to false so we don't attempt to infer
|
||||
// the symbol type. This can lead to very bad performance.
|
||||
return getDeclaredTypeOfSymbol(symbol, /* isBeyondExecutionScope */ false) ?? UnknownType.create();
|
||||
});
|
||||
|
||||
if (!isNever(declaredTypeOfSymbol)) {
|
||||
|
Loading…
Reference in New Issue
Block a user