mirror of
https://github.com/microsoft/pyright.git
synced 2024-11-10 00:26:21 +03:00
Fixed regression.
This commit is contained in:
parent
f7d7cb1ade
commit
f1eea47014
@ -7670,11 +7670,6 @@ export function createTypeEvaluator(importLookup: ImportLookup): TypeEvaluator {
|
||||
}
|
||||
|
||||
function getEffectiveTypeOfSymbol(symbol: Symbol): Type {
|
||||
// If there's a declared type, it takes precedence.
|
||||
if (symbol.hasTypedDeclarations()) {
|
||||
return getDeclaredTypeOfSymbol(symbol) || UnknownType.create();
|
||||
}
|
||||
|
||||
// Is there an undeclared type associated with the
|
||||
// symbol (used for synthesized classes)?
|
||||
const undeclaredType = symbol.getUndeclaredType();
|
||||
@ -7682,6 +7677,12 @@ export function createTypeEvaluator(importLookup: ImportLookup): TypeEvaluator {
|
||||
return undeclaredType;
|
||||
}
|
||||
|
||||
// If there's a declared type, it takes precedence over
|
||||
// inferred types.
|
||||
if (symbol.hasTypedDeclarations()) {
|
||||
return getDeclaredTypeOfSymbol(symbol) || UnknownType.create();
|
||||
}
|
||||
|
||||
// Infer the type.
|
||||
const typesToCombine: Type[] = [];
|
||||
const isPrivate = symbol.isPrivateMember();
|
||||
|
Loading…
Reference in New Issue
Block a user