mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Skip block scope check with no error location
An example of a symbol with no error location is a global symbol like Promise.
This commit is contained in:
parent
b94c51360b
commit
cc87e29e13
@ -1124,7 +1124,7 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Only check for block-scoped variable if we are looking for the
|
||||
// Only check for block-scoped variable if we have an error location and are looking for the
|
||||
// name with variable meaning
|
||||
// For example,
|
||||
// declare module foo {
|
||||
@ -1135,8 +1135,9 @@ namespace ts {
|
||||
// block-scoped variable and namespace module. However, only when we
|
||||
// try to resolve name in /*1*/ which is used in variable position,
|
||||
// we want to check for block-scoped
|
||||
if (meaning & SymbolFlags.BlockScopedVariable ||
|
||||
((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value)) {
|
||||
if (errorLocation &&
|
||||
(meaning & SymbolFlags.BlockScopedVariable ||
|
||||
((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value))) {
|
||||
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
|
||||
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
|
||||
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user