File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1116,7 +1116,7 @@ namespace ts {
1116
1116
return undefined;
1117
1117
}
1118
1118
1119
- // Only check for block-scoped variable if we are looking for the
1119
+ // Only check for block-scoped variable if we have an error location and are looking for the
1120
1120
// name with variable meaning
1121
1121
// For example,
1122
1122
// declare module foo {
@@ -1127,8 +1127,9 @@ namespace ts {
1127
1127
// block-scoped variable and namespace module. However, only when we
1128
1128
// try to resolve name in /*1*/ which is used in variable position,
1129
1129
// we want to check for block-scoped
1130
- if (meaning & SymbolFlags.BlockScopedVariable ||
1131
- ((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value)) {
1130
+ if (errorLocation &&
1131
+ (meaning & SymbolFlags.BlockScopedVariable ||
1132
+ ((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value))) {
1132
1133
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
1133
1134
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
1134
1135
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
You can’t perform that action at this time.
0 commit comments