From 78177cfc2cce27a731dd635fc25f6d84a94c0171 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 14 Apr 2016 17:16:53 -0700 Subject: [PATCH 1/3] permit global augmentations to introduce new names --- src/compiler/checker.ts | 13 +++---- .../moduleAugmentationGlobal4.errors.txt | 25 ------------- .../moduleAugmentationGlobal4.symbols | 26 ++++++++++++++ .../reference/moduleAugmentationGlobal4.types | 26 ++++++++++++++ .../moduleAugmentationGlobal5.errors.txt | 28 --------------- .../moduleAugmentationGlobal5.symbols | 28 +++++++++++++++ .../reference/moduleAugmentationGlobal5.types | 28 +++++++++++++++ .../newNamesInGlobalAugmentations1.js | 22 ++++++++++++ .../newNamesInGlobalAugmentations1.symbols | 34 ++++++++++++++++++ .../newNamesInGlobalAugmentations1.types | 35 +++++++++++++++++++ .../newNamesInGlobalAugmentations1.ts | 17 +++++++++ 11 files changed, 221 insertions(+), 61 deletions(-) delete mode 100644 tests/baselines/reference/moduleAugmentationGlobal4.errors.txt create mode 100644 tests/baselines/reference/moduleAugmentationGlobal4.symbols create mode 100644 tests/baselines/reference/moduleAugmentationGlobal4.types delete mode 100644 tests/baselines/reference/moduleAugmentationGlobal5.errors.txt create mode 100644 tests/baselines/reference/moduleAugmentationGlobal5.symbols create mode 100644 tests/baselines/reference/moduleAugmentationGlobal5.types create mode 100644 tests/baselines/reference/newNamesInGlobalAugmentations1.js create mode 100644 tests/baselines/reference/newNamesInGlobalAugmentations1.symbols create mode 100644 tests/baselines/reference/newNamesInGlobalAugmentations1.types create mode 100644 tests/cases/compiler/newNamesInGlobalAugmentations1.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 187a53b12ef..53c9b066caf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15596,6 +15596,9 @@ namespace ts { case SyntaxKind.InterfaceDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.TypeAliasDeclaration: + if (isGlobalAugmentation) { + return; + } const symbol = getSymbolOfNode(node); if (symbol) { // module augmentations cannot introduce new names on the top level scope of the module @@ -15604,14 +15607,8 @@ namespace ts { // 2. main check - report error if value declaration of the parent symbol is module augmentation) let reportError = !(symbol.flags & SymbolFlags.Merged); if (!reportError) { - if (isGlobalAugmentation) { - // global symbol should not have parent since it is not explicitly exported - reportError = symbol.parent !== undefined; - } - else { - // symbol should not originate in augmentation - reportError = isExternalModuleAugmentation(symbol.parent.declarations[0]); - } + // symbol should not originate in augmentation + reportError = isExternalModuleAugmentation(symbol.parent.declarations[0]); } if (reportError) { error(node, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt deleted file mode 100644 index fd3444f56b1..00000000000 --- a/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -tests/cases/compiler/f1.ts(3,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/f2.ts(3,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. - - -==== tests/cases/compiler/f1.ts (1 errors) ==== - - declare global { - interface Something {x} - ~~~~~~~~~ -!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. - } - export {}; -==== tests/cases/compiler/f2.ts (1 errors) ==== - - declare global { - interface Something {y} - ~~~~~~~~~ -!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. - } - export {}; -==== tests/cases/compiler/f3.ts (0 errors) ==== - import "./f1"; - import "./f2"; - - \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.symbols b/tests/baselines/reference/moduleAugmentationGlobal4.symbols new file mode 100644 index 00000000000..f9cdac3fc2e --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal4.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/f1.ts === + +declare global { +>global : Symbol(, Decl(f1.ts, 0, 0)) + + interface Something {x} +>Something : Symbol(Something, Decl(f1.ts, 1, 16), Decl(f2.ts, 1, 16)) +>x : Symbol(Something.x, Decl(f1.ts, 2, 25)) +} +export {}; +=== tests/cases/compiler/f2.ts === + +declare global { +>global : Symbol(, Decl(f2.ts, 0, 0)) + + interface Something {y} +>Something : Symbol(Something, Decl(f1.ts, 1, 16), Decl(f2.ts, 1, 16)) +>y : Symbol(Something.y, Decl(f2.ts, 2, 25)) +} +export {}; +=== tests/cases/compiler/f3.ts === +import "./f1"; +No type information for this code.import "./f2"; +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.types b/tests/baselines/reference/moduleAugmentationGlobal4.types new file mode 100644 index 00000000000..e3e780d69ff --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal4.types @@ -0,0 +1,26 @@ +=== tests/cases/compiler/f1.ts === + +declare global { +>global : any + + interface Something {x} +>Something : Something +>x : any +} +export {}; +=== tests/cases/compiler/f2.ts === + +declare global { +>global : any + + interface Something {y} +>Something : Something +>y : any +} +export {}; +=== tests/cases/compiler/f3.ts === +import "./f1"; +No type information for this code.import "./f2"; +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt deleted file mode 100644 index 4f1f9133760..00000000000 --- a/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -tests/cases/compiler/f1.d.ts(4,19): error TS2665: Module augmentation cannot introduce new names in the top level scope. -tests/cases/compiler/f2.d.ts(3,19): error TS2665: Module augmentation cannot introduce new names in the top level scope. - - -==== tests/cases/compiler/f3.ts (0 errors) ==== - /// - /// - import "A"; - import "B"; - - -==== tests/cases/compiler/f1.d.ts (1 errors) ==== - - declare module "A" { - global { - interface Something {x} - ~~~~~~~~~ -!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. - } - } -==== tests/cases/compiler/f2.d.ts (1 errors) ==== - declare module "B" { - global { - interface Something {y} - ~~~~~~~~~ -!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. - } - } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.symbols b/tests/baselines/reference/moduleAugmentationGlobal5.symbols new file mode 100644 index 00000000000..27548b05ef2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal5.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/f3.ts === +/// +No type information for this code./// +No type information for this code.import "A"; +No type information for this code.import "B"; +No type information for this code. +No type information for this code. +No type information for this code.=== tests/cases/compiler/f1.d.ts === + +declare module "A" { + global { +>global : Symbol(, Decl(f1.d.ts, 1, 20)) + + interface Something {x} +>Something : Symbol(Something, Decl(f1.d.ts, 2, 12), Decl(f2.d.ts, 1, 12)) +>x : Symbol(Something.x, Decl(f1.d.ts, 3, 29)) + } +} +=== tests/cases/compiler/f2.d.ts === +declare module "B" { + global { +>global : Symbol(, Decl(f2.d.ts, 0, 20)) + + interface Something {y} +>Something : Symbol(Something, Decl(f1.d.ts, 2, 12), Decl(f2.d.ts, 1, 12)) +>y : Symbol(Something.y, Decl(f2.d.ts, 2, 29)) + } +} diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.types b/tests/baselines/reference/moduleAugmentationGlobal5.types new file mode 100644 index 00000000000..b2e6139eb26 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal5.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/f3.ts === +/// +No type information for this code./// +No type information for this code.import "A"; +No type information for this code.import "B"; +No type information for this code. +No type information for this code. +No type information for this code.=== tests/cases/compiler/f1.d.ts === + +declare module "A" { + global { +>global : any + + interface Something {x} +>Something : Something +>x : any + } +} +=== tests/cases/compiler/f2.d.ts === +declare module "B" { + global { +>global : any + + interface Something {y} +>Something : Something +>y : any + } +} diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.js b/tests/baselines/reference/newNamesInGlobalAugmentations1.js new file mode 100644 index 00000000000..5dc04f2f4aa --- /dev/null +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/newNamesInGlobalAugmentations1.ts] //// + +//// [f1.d.ts] + +export {}; + +declare global { + interface SymbolConstructor { + observable: symbol; + } + class Cls {x} + let [a, b]: number[]; +} + +//// [main.ts] + +Symbol.observable; +new Cls().x + +//// [main.js] +Symbol.observable; +new Cls().x; diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols new file mode 100644 index 00000000000..be8ec6aa14d --- /dev/null +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/f1.d.ts === + +export {}; + +declare global { +>global : Symbol(, Decl(f1.d.ts, 1, 10)) + + interface SymbolConstructor { +>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(f1.d.ts, 3, 16)) + + observable: symbol; +>observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) + } + class Cls {x} +>Cls : Symbol(Cls, Decl(f1.d.ts, 6, 5)) +>x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) + + let [a, b]: number[]; +>a : Symbol(a, Decl(f1.d.ts, 8, 9)) +>b : Symbol(b, Decl(f1.d.ts, 8, 11)) +} + +=== tests/cases/compiler/main.ts === + +Symbol.observable; +>Symbol.observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) +>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) + +new Cls().x +>new Cls().x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) +>Cls : Symbol(Cls, Decl(f1.d.ts, 6, 5)) +>x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) + diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.types b/tests/baselines/reference/newNamesInGlobalAugmentations1.types new file mode 100644 index 00000000000..8d5baf19d08 --- /dev/null +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/f1.d.ts === + +export {}; + +declare global { +>global : any + + interface SymbolConstructor { +>SymbolConstructor : SymbolConstructor + + observable: symbol; +>observable : symbol + } + class Cls {x} +>Cls : Cls +>x : any + + let [a, b]: number[]; +>a : number +>b : number +} + +=== tests/cases/compiler/main.ts === + +Symbol.observable; +>Symbol.observable : symbol +>Symbol : SymbolConstructor +>observable : symbol + +new Cls().x +>new Cls().x : any +>new Cls() : Cls +>Cls : typeof Cls +>x : any + diff --git a/tests/cases/compiler/newNamesInGlobalAugmentations1.ts b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts new file mode 100644 index 00000000000..78cd1ec5c13 --- /dev/null +++ b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts @@ -0,0 +1,17 @@ +// @target: es6 + +// @filename: f1.d.ts +export {}; + +declare global { + interface SymbolConstructor { + observable: symbol; + } + class Cls {x} + let [a, b]: number[]; +} + +// @filename: main.ts + +Symbol.observable; +new Cls().x \ No newline at end of file From 0f323ea74a99e4a07525ff55ce21c76163769ccf Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 14 Apr 2016 17:57:17 -0700 Subject: [PATCH 2/3] allow top level 'import x = identifier | qname' in module augmentations --- src/compiler/binder.ts | 2 +- src/compiler/checker.ts | 4 +- .../newNamesInGlobalAugmentations1.js | 8 +++- .../newNamesInGlobalAugmentations1.symbols | 43 +++++++++++++------ .../newNamesInGlobalAugmentations1.types | 21 +++++++++ .../newNamesInGlobalAugmentations1.ts | 7 ++- 6 files changed, 69 insertions(+), 16 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9311aa7cc26..0d71abcf123 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)) { + if (node.kind === SyntaxKind.ExportSpecifier || (node.kind === SyntaxKind.ImportEqualsDeclaration && (hasExportModifier || container.flags & NodeFlags.ExportContext))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 53c9b066caf..3690c24e19b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15572,7 +15572,9 @@ namespace ts { break; case SyntaxKind.ImportEqualsDeclaration: if ((node).moduleReference.kind !== SyntaxKind.StringLiteral) { - error((node).name, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + if (!isGlobalAugmentation) { + error((node).name, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } break; } // fallthrough diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.js b/tests/baselines/reference/newNamesInGlobalAugmentations1.js index 5dc04f2f4aa..053fe46fd42 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.js +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.js @@ -4,19 +4,25 @@ export {}; +declare module M.M1 { + export let x: number; +} declare global { interface SymbolConstructor { observable: symbol; } class Cls {x} let [a, b]: number[]; + import X = M.M1.x; } //// [main.ts] Symbol.observable; -new Cls().x +new Cls().x +let c = a + b + X; //// [main.js] Symbol.observable; new Cls().x; +let c = a + b + X; diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols index be8ec6aa14d..eab27b632eb 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols @@ -2,33 +2,52 @@ export {}; +declare module M.M1 { +>M : Symbol(M, Decl(f1.d.ts, 1, 10)) +>M1 : Symbol(M1, Decl(f1.d.ts, 3, 17)) + + export let x: number; +>x : Symbol(x, Decl(f1.d.ts, 4, 14)) +} declare global { ->global : Symbol(, Decl(f1.d.ts, 1, 10)) +>global : Symbol(, Decl(f1.d.ts, 5, 1)) interface SymbolConstructor { ->SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(f1.d.ts, 3, 16)) +>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(f1.d.ts, 6, 16)) observable: symbol; ->observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) +>observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 7, 33)) } class Cls {x} ->Cls : Symbol(Cls, Decl(f1.d.ts, 6, 5)) ->x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) +>Cls : Symbol(Cls, Decl(f1.d.ts, 9, 5)) +>x : Symbol(Cls.x, Decl(f1.d.ts, 10, 15)) let [a, b]: number[]; ->a : Symbol(a, Decl(f1.d.ts, 8, 9)) ->b : Symbol(b, Decl(f1.d.ts, 8, 11)) +>a : Symbol(a, Decl(f1.d.ts, 11, 9)) +>b : Symbol(b, Decl(f1.d.ts, 11, 11)) + + 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)) +>x : Symbol(X, Decl(f1.d.ts, 4, 14)) } === tests/cases/compiler/main.ts === Symbol.observable; ->Symbol.observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) +>Symbol.observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 7, 33)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) ->observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 4, 33)) +>observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 7, 33)) new Cls().x ->new Cls().x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) ->Cls : Symbol(Cls, Decl(f1.d.ts, 6, 5)) ->x : Symbol(Cls.x, Decl(f1.d.ts, 7, 15)) +>new Cls().x : Symbol(Cls.x, Decl(f1.d.ts, 10, 15)) +>Cls : Symbol(Cls, Decl(f1.d.ts, 9, 5)) +>x : Symbol(Cls.x, Decl(f1.d.ts, 10, 15)) + +let c = a + b + X; +>c : Symbol(c, Decl(main.ts, 3, 3)) +>a : Symbol(a, Decl(f1.d.ts, 11, 9)) +>b : Symbol(b, Decl(f1.d.ts, 11, 11)) +>X : Symbol(X, Decl(f1.d.ts, 11, 25)) diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.types b/tests/baselines/reference/newNamesInGlobalAugmentations1.types index 8d5baf19d08..e1331709d2f 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.types +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.types @@ -2,6 +2,13 @@ export {}; +declare module M.M1 { +>M : typeof M +>M1 : typeof M1 + + export let x: number; +>x : number +} declare global { >global : any @@ -18,6 +25,12 @@ declare global { let [a, b]: number[]; >a : number >b : number + + import X = M.M1.x; +>X : number +>M : typeof M +>M1 : typeof M.M1 +>x : number } === tests/cases/compiler/main.ts === @@ -33,3 +46,11 @@ new Cls().x >Cls : typeof Cls >x : any +let c = a + b + X; +>c : number +>a + b + X : number +>a + b : number +>a : number +>b : number +>X : number + diff --git a/tests/cases/compiler/newNamesInGlobalAugmentations1.ts b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts index 78cd1ec5c13..22102353250 100644 --- a/tests/cases/compiler/newNamesInGlobalAugmentations1.ts +++ b/tests/cases/compiler/newNamesInGlobalAugmentations1.ts @@ -3,15 +3,20 @@ // @filename: f1.d.ts export {}; +declare module M.M1 { + export let x: number; +} declare global { interface SymbolConstructor { observable: symbol; } class Cls {x} let [a, b]: number[]; + import X = M.M1.x; } // @filename: main.ts Symbol.observable; -new Cls().x \ No newline at end of file +new Cls().x +let c = a + b + X; \ No newline at end of file From 6f3f690a8d7409db87ef4a5ab322f83f305ce26c Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Fri, 15 Apr 2016 11:31:26 -0700 Subject: [PATCH 3/3] revert back fix for implicit exports of imports --- src/compiler/binder.ts | 2 +- tests/baselines/reference/newNamesInGlobalAugmentations1.js | 2 +- .../baselines/reference/newNamesInGlobalAugmentations1.symbols | 2 +- tests/baselines/reference/newNamesInGlobalAugmentations1.types | 2 +- tests/cases/compiler/newNamesInGlobalAugmentations1.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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