Skip to content

Commit 4479013

Browse files
committed
Report error on both declaration and reference when CFA can't determine type
1 parent 52d2aa5 commit 4479013

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9153,6 +9153,7 @@ namespace ts {
91539153
if (flowType === autoType) {
91549154
if (compilerOptions.noImplicitAny) {
91559155
error(declaration.name, Diagnostics.Variable_0_implicitly_has_type_any_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol));
9156+
error(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(anyType));
91569157
}
91579158
return anyType;
91589159
}

0 commit comments

Comments
 (0)