Report error on both declaration and reference when CFA can't determine type

This commit is contained in:
Anders Hejlsberg 2016-09-29 15:03:56 -07:00
parent 52d2aa5b60
commit 447901367a

View File

@ -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;
}