Skip to content

Commit 2428e65

Browse files
committed
change the references to the error message
1 parent aa9fa90 commit 2428e65

8 files changed

Lines changed: 53 additions & 53 deletions

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13452,7 +13452,7 @@ namespace ts {
1345213452
// Checks for ambient external modules.
1345313453
if (isAmbientExternalModule) {
1345413454
if (!isGlobalSourceFile(node.parent)) {
13455-
error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules);
13455+
error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);
1345613456
}
1345713457
if (isExternalModuleNameRelative(node.name.text)) {
1345813458
error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name);

tests/baselines/reference/ambientErrors.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializ
1010
tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts.
1111
tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts.
1212
tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts.
13-
tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules.
13+
tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
1414
tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name.
1515
tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
1616

@@ -88,7 +88,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
8888
module M2 {
8989
declare module 'nope' { }
9090
~~~~~~
91-
!!! error TS2435: Ambient modules cannot be nested in other modules.
91+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
9292
}
9393

9494
// Ambient external module with a string literal name that isn't a top level external module name

tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules.
1+
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
22
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'.
33

44

@@ -9,7 +9,7 @@ tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): err
99

1010
declare module "ext" {
1111
~~~~~
12-
!!! error TS2435: Ambient modules cannot be nested in other modules.
12+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
1313
export class C { }
1414
}
1515

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules.
1+
tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
22

33

44
==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (1 errors) ====
55
module M {
66
export declare module "M" { }
77
~~~
8-
!!! error TS2435: Ambient modules cannot be nested in other modules.
8+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules.
1+
tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
22

33

44
==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (1 errors) ====
55
export declare module "M" { }
66
~~~
7-
!!! error TS2435: Ambient modules cannot be nested in other modules.
7+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.

tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided.
22
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find module 'externalModule'.
3-
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules.
3+
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
44
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'.
55

66

@@ -12,7 +12,7 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): er
1212
!!! error TS2307: Cannot find module 'externalModule'.
1313
declare module "m1" {
1414
~~~~
15-
!!! error TS2435: Ambient modules cannot be nested in other modules.
15+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
1616
import im2 = require("externalModule");
1717
~~~~~~~~~~~~~~~~
1818
!!! error TS2307: Cannot find module 'externalModule'.

tests/baselines/reference/privacyGloImportParseErrors.errors.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules.
2-
tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules.
1+
tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
2+
tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
33
tests/cases/compiler/privacyGloImportParseErrors.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'.
44
tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module.
55
tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS2307: Cannot find module 'm1_M3_public'.
@@ -11,9 +11,9 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(82,43): error TS1147: Import
1111
tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in a namespace cannot reference a module.
1212
tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in a namespace cannot reference a module.
1313
tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
14-
tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules.
15-
tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules.
16-
tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules.
14+
tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
15+
tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
16+
tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
1717
tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in a namespace cannot reference a module.
1818
tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a namespace cannot reference a module.
1919

@@ -42,7 +42,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor
4242

4343
export declare module "m1_M3_public" {
4444
~~~~~~~~~~~~~~
45-
!!! error TS2435: Ambient modules cannot be nested in other modules.
45+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
4646
export function f1();
4747
export class c1 {
4848
}
@@ -52,7 +52,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor
5252

5353
declare module "m1_M4_private" {
5454
~~~~~~~~~~~~~~~
55-
!!! error TS2435: Ambient modules cannot be nested in other modules.
55+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
5656
export function f1();
5757
export class c1 {
5858
}
@@ -179,19 +179,19 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor
179179
~~~~~~~
180180
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
181181
~~~~~
182-
!!! error TS2435: Ambient modules cannot be nested in other modules.
182+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
183183
}
184184
}
185185

186186
module m2 {
187187
module "abc2" {
188188
~~~~~~
189-
!!! error TS2435: Ambient modules cannot be nested in other modules.
189+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
190190
}
191191
}
192192
module "abc3" {
193193
~~~~~~
194-
!!! error TS2435: Ambient modules cannot be nested in other modules.
194+
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
195195
}
196196
}
197197

0 commit comments

Comments
 (0)