diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 0d71abcf123..9311aa7cc26 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -355,7 +355,7 @@ namespace ts { function declareModuleMember(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags): Symbol { const hasExportModifier = getCombinedNodeFlags(node) & NodeFlags.Export; if (symbolFlags & SymbolFlags.Alias) { - if (node.kind === SyntaxKind.ExportSpecifier || (node.kind === SyntaxKind.ImportEqualsDeclaration && (hasExportModifier || container.flags & NodeFlags.ExportContext))) { + if (node.kind === SyntaxKind.ExportSpecifier || (node.kind === SyntaxKind.ImportEqualsDeclaration && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.js b/tests/baselines/reference/newNamesInGlobalAugmentations1.js index 053fe46fd42..0400f4c3751 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.js +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.js @@ -13,7 +13,7 @@ declare global { } class Cls {x} let [a, b]: number[]; - import X = M.M1.x; + export import X = M.M1.x; } //// [main.ts] diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols index eab27b632eb..6215132dd00 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols @@ -26,7 +26,7 @@ declare global { >a : Symbol(a, Decl(f1.d.ts, 11, 9)) >b : Symbol(b, Decl(f1.d.ts, 11, 11)) - import X = M.M1.x; + export import X = M.M1.x; >X : Symbol(X, Decl(f1.d.ts, 11, 25)) >M : Symbol(M, Decl(f1.d.ts, 1, 10)) >M1 : Symbol(M.M1, Decl(f1.d.ts, 3, 17)) diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.types b/tests/baselines/reference/newNamesInGlobalAugmentations1.types index e1331709d2f..a9b879fb4c5 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.types +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.types @@ -26,7 +26,7 @@ declare global { >a : number >b : number - import X = M.M1.x; + export import X = M.M1.x; >X : number >M : typeof M >M1 : typeof M.M1 diff --git a/tests/cases/compiler/newNamesInGlobalAugmentations1.ts b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts index 22102353250..73ed4e5e2e8 100644 --- a/tests/cases/compiler/newNamesInGlobalAugmentations1.ts +++ b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts @@ -12,7 +12,7 @@ declare global { } class Cls {x} let [a, b]: number[]; - import X = M.M1.x; + export import X = M.M1.x; } // @filename: main.ts