From f1eea47014d8cc6b7228b3e279c793b2893e6309 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 15 Nov 2019 19:22:20 -0800 Subject: [PATCH] Fixed regression. --- server/src/analyzer/typeEvaluator.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/src/analyzer/typeEvaluator.ts b/server/src/analyzer/typeEvaluator.ts index 81c702544..a2397bb6a 100644 --- a/server/src/analyzer/typeEvaluator.ts +++ b/server/src/analyzer/typeEvaluator.ts @@ -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();