Fixed regression.

This commit is contained in:
Eric Traut 2019-11-15 19:22:20 -08:00
parent f7d7cb1ade
commit f1eea47014

View File

@ -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();