From 447901367a03184e1352c84557c6aba60e070fd4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 29 Sep 2016 15:03:56 -0700 Subject: [PATCH] Report error on both declaration and reference when CFA can't determine type --- src/compiler/checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4e07b14a794..3d89b98ea3b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9153,6 +9153,7 @@ namespace ts { if (flowType === autoType) { if (compilerOptions.noImplicitAny) { error(declaration.name, Diagnostics.Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol)); + error(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(anyType)); } return anyType; }