From 2428e65ac3590869f4e1932c259bedb4e4527469 Mon Sep 17 00:00:00 2001 From: yaoyao Date: Thu, 1 Oct 2015 10:05:40 +0800 Subject: [PATCH] change the references to the error message --- src/compiler/checker.ts | 2 +- .../reference/ambientErrors.errors.txt | 4 +- ...alModuleInAnotherExternalModule.errors.txt | 4 +- ...tExternalModuleInsideNonAmbient.errors.txt | 4 +- ...eInsideNonAmbientExternalModule.errors.txt | 4 +- ...eingExternalModuleWithNoResolve.errors.txt | 4 +- .../privacyGloImportParseErrors.errors.txt | 20 +++--- .../privacyImportParseErrors.errors.txt | 64 +++++++++---------- 8 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ca18446c76c..ca02d6abe42 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13452,7 +13452,7 @@ namespace ts { // Checks for ambient external modules. if (isAmbientExternalModule) { if (!isGlobalSourceFile(node.parent)) { - error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); + error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); } if (isExternalModuleNameRelative(node.name.text)) { error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index a0ded21299c..5e257c2de3f 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -10,7 +10,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializ tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name. tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -88,7 +88,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export module M2 { declare module 'nope' { } ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } // Ambient external module with a string literal name that isn't a top level external module name diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt index 79f37c4764e..0e508470b13 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'. @@ -9,7 +9,7 @@ tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): err declare module "ext" { ~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export class C { } } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index 87aae44840e..7e4ac795d0d 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (1 errors) ==== module M { export declare module "M" { } ~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt index 763317ecc0c..e5905aaaf8f 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. ==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (1 errors) ==== export declare module "M" { } ~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. \ No newline at end of file +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. \ No newline at end of file diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt index e46ff8bea13..74f532d0c1e 100644 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find module 'externalModule'. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'. @@ -12,7 +12,7 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): er !!! error TS2307: Cannot find module 'externalModule'. declare module "m1" { ~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. import im2 = require("externalModule"); ~~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'externalModule'. diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index d6d24ebcb30..236418a10ae 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. 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 tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a namespace cannot reference a module. @@ -42,7 +42,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor export declare module "m1_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -52,7 +52,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor declare module "m1_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -179,19 +179,19 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 06277c63b23..5bae45f405c 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,48 +1,48 @@ -tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot find module 'm1_M3_public'. tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS2307: Cannot find module 'm2_M3_public'. tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS2307: Cannot find module 'm2_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(218,34): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(238,34): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(251,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(252,40): error TS2307: Cannot find module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(258,45): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(261,39): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(264,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(277,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(287,46): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(290,40): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(293,41): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(306,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(328,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules. -tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient modules cannot be nested in other modules. +tests/cases/compiler/privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(341,25): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(344,29): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import declarations in a namespace cannot reference a module. @@ -73,7 +73,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m1_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -83,7 +83,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "m1_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -173,7 +173,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "m2_M3_public" { ~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -183,7 +183,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "m2_M4_private" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -263,7 +263,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M2_public" { ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -283,7 +283,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "glo_M4_private" { ~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); export class c1 { } @@ -350,7 +350,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "use_glo_M1_public" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. import use_glo_M1_public = glo_M1_public; export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; export var use_glo_M1_public_v2_public: use_glo_M1_public; @@ -391,7 +391,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "use_glo_M3_private" { ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. import use_glo_M3_private = glo_M3_private; export var use_glo_M3_private_v1_public: { new (): use_glo_M3_private.c1; }; export var use_glo_M3_private_v2_public: use_glo_M3_private; @@ -431,25 +431,25 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "anotherParseError" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. module m2 { declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } @@ -457,25 +457,25 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. module m2 { declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module m2 { module "abc2" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules. +!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } }