File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1124,7 +1124,7 @@ namespace ts {
11241124 return undefined;
11251125 }
11261126
1127- // Only check for block-scoped variable if we are looking for the
1127+ // Only check for block-scoped variable if we have an error location and are looking for the
11281128 // name with variable meaning
11291129 // For example,
11301130 // declare module foo {
@@ -1135,8 +1135,9 @@ namespace ts {
11351135 // block-scoped variable and namespace module. However, only when we
11361136 // try to resolve name in /*1*/ which is used in variable position,
11371137 // we want to check for block-scoped
1138- if (meaning & SymbolFlags.BlockScopedVariable ||
1139- ((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value)) {
1138+ if (errorLocation &&
1139+ (meaning & SymbolFlags.BlockScopedVariable ||
1140+ ((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value))) {
11401141 const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
11411142 if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
11421143 checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
You can’t perform that action at this time.
0 commit comments