mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Added limit for the number of non-typed declarations to evaluate.
This commit is contained in:
parent
5a139af3b5
commit
12c90eb4f3
@ -18277,6 +18277,17 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
|
||||
let declIndexToConsider: number | undefined;
|
||||
|
||||
// Limit the number of declarations to explore.
|
||||
const maxDeclsToConsider = 16;
|
||||
if (decls.length > maxDeclsToConsider) {
|
||||
return {
|
||||
type: UnknownType.create(),
|
||||
isIncomplete: false,
|
||||
includesVariableDecl: false,
|
||||
isRecursiveDefinition: false,
|
||||
};
|
||||
}
|
||||
|
||||
// If the caller has requested that we use only the last decl, we
|
||||
// will use only the last one, but we'll ignore decls that are in
|
||||
// except clauses.
|
||||
|
Loading…
Reference in New Issue
Block a user