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 @@ -1124,7 +1124,7 @@ namespace ts {
1124
1124
return undefined;
1125
1125
}
1126
1126
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
1128
1128
// name with variable meaning
1129
1129
// For example,
1130
1130
// declare module foo {
@@ -1135,8 +1135,9 @@ namespace ts {
1135
1135
// block-scoped variable and namespace module. However, only when we
1136
1136
// try to resolve name in /*1*/ which is used in variable position,
1137
1137
// 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))) {
1140
1141
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
1141
1142
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
1142
1143
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
You can’t perform that action at this time.
0 commit comments