From 88b137f319366001ccf03a277e9ed482a43dbdd2 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Sep 2025 23:13:04 +0000
Subject: [PATCH 01/13] Initial plan
From 7cbbb7e307949b6a6867ba08b0a08ab704d161ea Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Sep 2025 23:33:52 +0000
Subject: [PATCH 02/13] Implement TypeScript 6.0 deprecation of module keyword
for namespaces
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
---
src/compiler/checker.ts | 67 ++++++++++++++-----
src/compiler/diagnosticMessages.json | 12 ++--
.../moduleDeclarationDeprecated_error1.ts | 27 ++++++++
...eclarationDeprecated_ignoreDeprecations.ts | 31 +++++++++
...moduleDeclarationDeprecated_suggestion1.ts | 57 ++++++++--------
5 files changed, 145 insertions(+), 49 deletions(-)
create mode 100644 tests/cases/fourslash/moduleDeclarationDeprecated_error1.ts
create mode 100644 tests/cases/fourslash/moduleDeclarationDeprecated_ignoreDeprecations.ts
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 66742c94f057e..3d7e84321a59e 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -1132,13 +1132,15 @@ import {
walkUpBindingElementsAndPatterns,
walkUpOuterExpressions,
walkUpParenthesizedExpressions,
- walkUpParenthesizedTypes,
- walkUpParenthesizedTypesAndGetParentAndChild,
- WhileStatement,
- WideningContext,
- WithStatement,
- WriterContextOut,
- YieldExpression,
+ walkUpParenthesizedTypes,
+ walkUpParenthesizedTypesAndGetParentAndChild,
+ Version,
+ versionMajorMinor,
+ WhileStatement,
+ WideningContext,
+ WithStatement,
+ WriterContextOut,
+ YieldExpression,
} from "./_namespaces/ts.js";
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
import * as performance from "./_namespaces/ts.performance.js";
@@ -47992,16 +47994,47 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
}
- if (isIdentifier(node.name)) {
- checkCollisionsForDeclarationName(node, node.name);
- if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {
- const sourceFile = getSourceFileOfNode(node);
- const pos = getNonModifierTokenPosOfNode(node);
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
- suggestionDiagnostics.add(
- createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead),
- );
- }
+ if (isIdentifier(node.name)) {
+ checkCollisionsForDeclarationName(node, node.name);
+ if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {
+ const sourceFile = getSourceFileOfNode(node);
+ const pos = getNonModifierTokenPosOfNode(node);
+ const span = getSpanOfTokenAtPosition(sourceFile, pos);
+
+ // Check if we should generate an error (TS 6.0+) or suggestion (older versions)
+ const currentVersion = new Version(versionMajorMinor);
+ const errorVersion = new Version("6.0");
+ const shouldError = currentVersion.compareTo(errorVersion) >= Comparison.EqualTo;
+
+ // Check if ignoreDeprecations should suppress this error
+ let shouldSuppress = false;
+ if (shouldError && compilerOptions.ignoreDeprecations) {
+ // Only valid ignoreDeprecations values: "5.0" and "6.0"
+ if (compilerOptions.ignoreDeprecations === "6.0") {
+ shouldSuppress = true;
+ }
+ }
+
+ if (shouldError && !shouldSuppress) {
+ // In TypeScript 6.0+, this is an error unless suppressed by ignoreDeprecations
+ const errorDiagnostic = createFileDiagnostic(
+ sourceFile,
+ span.start,
+ span.length,
+ Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead
+ );
+ diagnostics.add(errorDiagnostic);
+ } else {
+ // In older versions or when suppressed, keep as suggestion
+ const suggestionDiagnostic = createFileDiagnostic(
+ sourceFile,
+ span.start,
+ span.length,
+ Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead
+ );
+ suggestionDiagnostics.add(suggestionDiagnostic);
+ }
+ }
}
checkExportsOnMergedDeclarations(node);
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 22ac200a0dcee..d44e112cbbc50 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -1820,10 +1820,14 @@
"category": "Error",
"code": 1539
},
- "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
- "category": "Suggestion",
- "code": 1540,
- "reportsDeprecated": true
+ "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
+ "category": "Suggestion",
+ "code": 1540,
+ "reportsDeprecated": true
+ },
+ "The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.": {
+ "category": "Error",
+ "code": 1547
},
"Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute.": {
"category": "Error",
diff --git a/tests/cases/fourslash/moduleDeclarationDeprecated_error1.ts b/tests/cases/fourslash/moduleDeclarationDeprecated_error1.ts
new file mode 100644
index 0000000000000..9c6a6315d204d
--- /dev/null
+++ b/tests/cases/fourslash/moduleDeclarationDeprecated_error1.ts
@@ -0,0 +1,27 @@
+///
+
+// @Filename: a.ts
+////[|module|] mod1 { export let x: number }
+////declare [|module|] mod2 { export let x: number }
+////export [|module|] mod3 { export let x: number }
+////export declare [|module|] mod4 { export let x: number }
+////namespace mod5 { export let x: number }
+////declare namespace mod6 { export let x: number }
+////mod1.x = 1;
+////mod2.x = 1;
+////mod5.x = 1;
+////mod6.x = 1;
+
+// @Filename: b.ts
+////declare module "global-ambient-module" {}
+
+goTo.file("a.ts")
+const errorDiagnostics = test.ranges().map(range => ({
+ code: 1547,
+ message: "The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.",
+ range,
+}));
+verify.getSemanticDiagnostics(errorDiagnostics)
+
+goTo.file("b.ts")
+verify.getSemanticDiagnostics([])
\ No newline at end of file
diff --git a/tests/cases/fourslash/moduleDeclarationDeprecated_ignoreDeprecations.ts b/tests/cases/fourslash/moduleDeclarationDeprecated_ignoreDeprecations.ts
new file mode 100644
index 0000000000000..6ca2f2d05e22d
--- /dev/null
+++ b/tests/cases/fourslash/moduleDeclarationDeprecated_ignoreDeprecations.ts
@@ -0,0 +1,31 @@
+///
+
+// @ignoreDeprecations: 6.0
+// @Filename: a.ts
+////[|module|] mod1 { export let x: number }
+////declare [|module|] mod2 { export let x: number }
+////export [|module|] mod3 { export let x: number }
+////export declare [|module|] mod4 { export let x: number }
+////namespace mod5 { export let x: number }
+////declare namespace mod6 { export let x: number }
+////declare module "module-augmentation" {}
+////declare global {}
+////mod1.x = 1;
+////mod2.x = 1;
+////mod5.x = 1;
+////mod6.x = 1;
+
+// @Filename: b.ts
+////module "global-ambient-module" {}
+
+goTo.file("a.ts")
+const diagnostics = test.ranges().map(range => ({
+ code: 1540,
+ message: "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
+ reportsDeprecated: true as true,
+ range,
+}));
+verify.getSuggestionDiagnostics(diagnostics)
+
+goTo.file("b.ts")
+verify.getSuggestionDiagnostics([])
\ No newline at end of file
diff --git a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts b/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts
index 5554300a5a0b9..96f34910f7d04 100644
--- a/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts
+++ b/tests/cases/fourslash/moduleDeclarationDeprecated_suggestion1.ts
@@ -1,30 +1,31 @@
-///
-// @Filename: a.ts
-////[|module|] mod1 { export let x: number }
-////declare [|module|] mod2 { export let x: number }
-////export [|module|] mod3 { export let x: number }
-////export declare [|module|] mod4 { export let x: number }
-////namespace mod5 { export let x: number }
-////declare namespace mod6 { export let x: number }
-////declare module "module-augmentation" {}
-////declare global {}
-////mod1.x = 1;
-////mod2.x = 1;
-////mod5.x = 1;
-////mod6.x = 1;
-
-// @Filename: b.ts
-////module "global-ambient-module" {}
-
-goTo.file("a.ts")
-const diagnostics = test.ranges().map(range => ({
- code: 1540,
- message: "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
- reportsDeprecated: true,
- range,
-}));
-verify.getSuggestionDiagnostics(diagnostics)
-
-goTo.file("b.ts")
+///
+// @ignoreDeprecations: 6.0
+// @Filename: a.ts
+////[|module|] mod1 { export let x: number }
+////declare [|module|] mod2 { export let x: number }
+////export [|module|] mod3 { export let x: number }
+////export declare [|module|] mod4 { export let x: number }
+////namespace mod5 { export let x: number }
+////declare namespace mod6 { export let x: number }
+////declare module "module-augmentation" {}
+////declare global {}
+////mod1.x = 1;
+////mod2.x = 1;
+////mod5.x = 1;
+////mod6.x = 1;
+
+// @Filename: b.ts
+////module "global-ambient-module" {}
+
+goTo.file("a.ts")
+const diagnostics = test.ranges().map(range => ({
+ code: 1540,
+ message: "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
+ reportsDeprecated: true as true,
+ range,
+}));
+verify.getSuggestionDiagnostics(diagnostics)
+
+goTo.file("b.ts")
verify.getSuggestionDiagnostics([])
From 381d4a61bd7e33484096b8a6a997736558ba7887 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Sep 2025 23:39:48 +0000
Subject: [PATCH 03/13] Apply code formatting
---
src/compiler/checker.ts | 101 ++++++++++++++-------------
src/compiler/diagnosticMessages.json | 16 ++---
2 files changed, 59 insertions(+), 58 deletions(-)
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 3d7e84321a59e..7cedd0c48c70c 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -1123,6 +1123,8 @@ import {
VariableLikeDeclaration,
VariableStatement,
VarianceFlags,
+ Version,
+ versionMajorMinor,
visitEachChild as visitEachChildWorker,
visitNode,
visitNodes,
@@ -1132,15 +1134,13 @@ import {
walkUpBindingElementsAndPatterns,
walkUpOuterExpressions,
walkUpParenthesizedExpressions,
- walkUpParenthesizedTypes,
- walkUpParenthesizedTypesAndGetParentAndChild,
- Version,
- versionMajorMinor,
- WhileStatement,
- WideningContext,
- WithStatement,
- WriterContextOut,
- YieldExpression,
+ walkUpParenthesizedTypes,
+ walkUpParenthesizedTypesAndGetParentAndChild,
+ WhileStatement,
+ WideningContext,
+ WithStatement,
+ WriterContextOut,
+ YieldExpression,
} from "./_namespaces/ts.js";
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
import * as performance from "./_namespaces/ts.performance.js";
@@ -47994,47 +47994,48 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
}
- if (isIdentifier(node.name)) {
- checkCollisionsForDeclarationName(node, node.name);
- if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {
- const sourceFile = getSourceFileOfNode(node);
- const pos = getNonModifierTokenPosOfNode(node);
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
-
- // Check if we should generate an error (TS 6.0+) or suggestion (older versions)
- const currentVersion = new Version(versionMajorMinor);
- const errorVersion = new Version("6.0");
- const shouldError = currentVersion.compareTo(errorVersion) >= Comparison.EqualTo;
-
- // Check if ignoreDeprecations should suppress this error
- let shouldSuppress = false;
- if (shouldError && compilerOptions.ignoreDeprecations) {
- // Only valid ignoreDeprecations values: "5.0" and "6.0"
- if (compilerOptions.ignoreDeprecations === "6.0") {
- shouldSuppress = true;
- }
- }
-
- if (shouldError && !shouldSuppress) {
- // In TypeScript 6.0+, this is an error unless suppressed by ignoreDeprecations
- const errorDiagnostic = createFileDiagnostic(
- sourceFile,
- span.start,
- span.length,
- Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead
- );
- diagnostics.add(errorDiagnostic);
- } else {
- // In older versions or when suppressed, keep as suggestion
- const suggestionDiagnostic = createFileDiagnostic(
- sourceFile,
- span.start,
- span.length,
- Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead
- );
- suggestionDiagnostics.add(suggestionDiagnostic);
- }
- }
+ if (isIdentifier(node.name)) {
+ checkCollisionsForDeclarationName(node, node.name);
+ if (!(node.flags & (NodeFlags.Namespace | NodeFlags.GlobalAugmentation))) {
+ const sourceFile = getSourceFileOfNode(node);
+ const pos = getNonModifierTokenPosOfNode(node);
+ const span = getSpanOfTokenAtPosition(sourceFile, pos);
+
+ // Check if we should generate an error (TS 6.0+) or suggestion (older versions)
+ const currentVersion = new Version(versionMajorMinor);
+ const errorVersion = new Version("6.0");
+ const shouldError = currentVersion.compareTo(errorVersion) >= Comparison.EqualTo;
+
+ // Check if ignoreDeprecations should suppress this error
+ let shouldSuppress = false;
+ if (shouldError && compilerOptions.ignoreDeprecations) {
+ // Only valid ignoreDeprecations values: "5.0" and "6.0"
+ if (compilerOptions.ignoreDeprecations === "6.0") {
+ shouldSuppress = true;
+ }
+ }
+
+ if (shouldError && !shouldSuppress) {
+ // In TypeScript 6.0+, this is an error unless suppressed by ignoreDeprecations
+ const errorDiagnostic = createFileDiagnostic(
+ sourceFile,
+ span.start,
+ span.length,
+ Diagnostics.The_module_keyword_is_not_allowed_for_namespace_declarations_Use_the_namespace_keyword_instead,
+ );
+ diagnostics.add(errorDiagnostic);
+ }
+ else {
+ // In older versions or when suppressed, keep as suggestion
+ const suggestionDiagnostic = createFileDiagnostic(
+ sourceFile,
+ span.start,
+ span.length,
+ Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead,
+ );
+ suggestionDiagnostics.add(suggestionDiagnostic);
+ }
+ }
}
checkExportsOnMergedDeclarations(node);
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index d44e112cbbc50..7d6c8ba5ab364 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -1820,14 +1820,14 @@
"category": "Error",
"code": 1539
},
- "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
- "category": "Suggestion",
- "code": 1540,
- "reportsDeprecated": true
- },
- "The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.": {
- "category": "Error",
- "code": 1547
+ "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.": {
+ "category": "Suggestion",
+ "code": 1540,
+ "reportsDeprecated": true
+ },
+ "The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.": {
+ "category": "Error",
+ "code": 1547
},
"Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute.": {
"category": "Error",
From dcfee6e161499bc7456638657a4f9cc56d2e69c1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 3 Sep 2025 23:48:16 +0000
Subject: [PATCH 04/13] Update test baselines for module keyword deprecation
errors
- Updated 530+ test baseline files to include new TS1547 errors
- These errors correctly reflect the TypeScript 6.0 deprecation of module keyword for namespaces
- All errors are expected and confirm the feature is working as designed
---
...ionWithTheSameNameAndCommonRoot.errors.txt | 17 +
...ionWithTheSameNameAndCommonRoot.errors.txt | 19 +
...unctionUsingClassPrivateStatics.errors.txt | 5 +-
...ModuleWithSameNameAndCommonRoot.errors.txt | 22 +
...dsInterfaceWithInaccessibleType.errors.txt | 25 +
...arameterAndReturnTypeAnnotation.errors.txt | 21 +
...eTypesInParameterTypeAnnotation.errors.txt | 21 +
...ibleTypesInReturnTypeAnnotation.errors.txt | 21 +
...esInNestedMemberTypeAnnotations.errors.txt | 17 +
...naccessibleTypeInTypeAnnotation.errors.txt | 24 +
...hSameNameAndDifferentCommonRoot.errors.txt | 32 +
...ndEnumWithSameNameAndCommonRoot.errors.txt | 22 +
...portedAndNonExportedImportAlias.errors.txt | 11 +-
.../accessorsInAmbientContext.errors.txt | 5 +-
.../aliasesInSystemModule1.errors.txt | 5 +-
.../aliasesInSystemModule2.errors.txt | 5 +-
.../reference/ambientDeclarations.errors.txt | 85 ++
.../reference/ambientDeclarations.types | 16 +
.../reference/ambientErrors.errors.txt | 8 +-
.../ambientInsideNonAmbient.errors.txt | 30 +
.../reference/ambientInsideNonAmbient.types | 2 +
...hReservedIdentifierInDottedPath.errors.txt | 14 +-
.../reference/ambientModuleExports.errors.txt | 28 +
...bientModuleWithTemplateLiterals.errors.txt | 26 +
.../anyAssignabilityInInheritance.errors.txt | 97 ++
.../anyAssignabilityInInheritance.types | 72 +
.../anyAssignableToEveryType2.errors.txt | 139 ++
.../reference/anyAssignableToEveryType2.types | 21 +
.../reference/arrayAssignmentTest5.errors.txt | 5 +-
.../reference/arrayBestCommonTypes.errors.txt | 116 ++
.../reference/arrayBestCommonTypes.types | 16 +
.../arrowFunctionContexts.errors.txt | 11 +-
.../arrowFunctionsMissingTokens.errors.txt | 20 +-
...arsingAsAmbientExternalModule02.errors.txt | 15 +
.../assignToExistingClass.errors.txt | 5 +-
...gnmentCompatWithCallSignatures4.errors.txt | 11 +-
...tCompatWithConstructSignatures4.errors.txt | 11 +-
...ignaturesWithOptionalParameters.errors.txt | 11 +-
...ignmentCompatWithNumericIndexer.errors.txt | 5 +-
...signmentCompatWithObjectMembers.errors.txt | 94 ++
.../assignmentCompatWithObjectMembers.types | 21 +
...ignmentCompatWithObjectMembers4.errors.txt | 8 +-
...tWithObjectMembersAccessibility.errors.txt | 8 +-
...patWithObjectMembersOptionality.errors.txt | 8 +-
...atWithObjectMembersOptionality2.errors.txt | 8 +-
...ObjectMembersStringNumericNames.errors.txt | 8 +-
...signmentCompatWithStringIndexer.errors.txt | 5 +-
...ignmentCompatWithStringIndexer2.errors.txt | 5 +-
.../assignmentCompatability1.errors.txt | 18 +
.../assignmentCompatability11.errors.txt | 8 +-
.../assignmentCompatability12.errors.txt | 8 +-
.../assignmentCompatability13.errors.txt | 8 +-
.../assignmentCompatability14.errors.txt | 8 +-
.../assignmentCompatability15.errors.txt | 8 +-
.../assignmentCompatability16.errors.txt | 8 +-
.../assignmentCompatability17.errors.txt | 8 +-
.../assignmentCompatability18.errors.txt | 8 +-
.../assignmentCompatability19.errors.txt | 8 +-
.../assignmentCompatability2.errors.txt | 18 +
.../assignmentCompatability20.errors.txt | 8 +-
.../assignmentCompatability21.errors.txt | 8 +-
.../assignmentCompatability22.errors.txt | 8 +-
.../assignmentCompatability23.errors.txt | 8 +-
.../assignmentCompatability24.errors.txt | 8 +-
.../assignmentCompatability25.errors.txt | 8 +-
.../assignmentCompatability26.errors.txt | 8 +-
.../assignmentCompatability27.errors.txt | 8 +-
.../assignmentCompatability28.errors.txt | 8 +-
.../assignmentCompatability29.errors.txt | 8 +-
.../assignmentCompatability3.errors.txt | 18 +
.../assignmentCompatability30.errors.txt | 8 +-
.../assignmentCompatability31.errors.txt | 8 +-
.../assignmentCompatability32.errors.txt | 8 +-
.../assignmentCompatability33.errors.txt | 8 +-
.../assignmentCompatability34.errors.txt | 8 +-
.../assignmentCompatability35.errors.txt | 8 +-
.../assignmentCompatability36.errors.txt | 18 +
.../assignmentCompatability37.errors.txt | 8 +-
.../assignmentCompatability38.errors.txt | 8 +-
.../assignmentCompatability4.errors.txt | 18 +
.../reference/assignmentLHSIsValue.errors.txt | 5 +-
...nmentToParenthesizedIdentifiers.errors.txt | 11 +-
...syncAwaitIsolatedModules_es2017.errors.txt | 5 +-
.../asyncAwaitIsolatedModules_es5.errors.txt | 5 +-
.../asyncAwaitIsolatedModules_es6.errors.txt | 5 +-
.../reference/asyncAwait_es2017.errors.txt | 52 +
.../reference/asyncAwait_es5.errors.txt | 52 +
.../reference/asyncAwait_es6.errors.txt | 52 +
.../reference/augmentExportEquals5.errors.txt | 84 ++
.../reference/augmentExportEquals5.types | 5 +
.../reference/augmentedTypesClass3.errors.txt | 25 +
.../augmentedTypesFunction.errors.txt | 14 +-
.../augmentedTypesModules.errors.txt | 89 +-
.../binopAssignmentShouldHaveType.errors.txt | 25 +
.../binopAssignmentShouldHaveType.types | 3 +
...wiseNotOperatorWithAnyOtherType.errors.txt | 5 +-
...itwiseNotOperatorWithNumberType.errors.txt | 50 +
.../reference/bluebirdStaticThis.errors.txt | 5 +-
...atureAssignabilityInInheritance.errors.txt | 8 +-
...tureAssignabilityInInheritance3.errors.txt | 11 +-
...utReturnTypeAnnotationInference.errors.txt | 135 ++
...WithoutReturnTypeAnnotationInference.types | 9 +
.../reference/chainedImportAlias.errors.txt | 15 +
.../checkForObjectTooStrict.errors.txt | 5 +-
.../reference/circularImportAlias.errors.txt | 8 +-
.../classAndInterfaceMerge.d.errors.txt | 33 +
.../classExtendsEveryObjectType.errors.txt | 5 +-
.../classTypeParametersInStatics.errors.txt | 5 +-
.../baselines/reference/classdecl.errors.txt | 105 ++
tests/baselines/reference/classdecl.types | 16 +
.../reference/clinterfaces.errors.txt | 31 +
.../reference/cloduleTest1.errors.txt | 17 +
...duleWithPriorInstantiatedModule.errors.txt | 8 +-
.../clodulesDerivedClasses.errors.txt | 14 +-
...enModuleWithConstructorChildren.errors.txt | 35 +
...CodeGenModuleWithConstructorChildren.types | 2 +
...deGenModuleWithFunctionChildren.errors.txt | 31 +
...ionCodeGenModuleWithFunctionChildren.types | 2 +
...ionExportsRequireAndAmbientEnum.errors.txt | 73 +
...xportsRequireAndAmbientFunction.errors.txt | 22 +
...eAndAmbientFunctionInGlobalFile.errors.txt | 20 +
...nExportsRequireAndAmbientModule.errors.txt | 143 ++
.../collisionExportsRequireAndEnum.errors.txt | 16 +-
...lisionExportsRequireAndFunction.errors.txt | 8 +-
...sRequireAndFunctionInGlobalFile.errors.txt | 31 +
...tsRequireAndInternalModuleAlias.errors.txt | 11 +-
...ollisionExportsRequireAndModule.errors.txt | 52 +-
...sRequireAndUninstantiatedModule.errors.txt | 23 +
.../commentOnAmbientModule.errors.txt | 34 +
.../commentOnElidedModule1.errors.txt | 29 +
.../commentsExternalModules.errors.txt | 73 +
.../commentsExternalModules2.errors.txt | 73 +
.../commentsExternalModules3.errors.txt | 73 +
.../reference/commentsFormatting.errors.txt | 91 ++
.../reference/commentsModules.errors.txt | 163 +++
.../commentsdoNotEmitComments.errors.txt | 101 ++
.../reference/commentsdoNotEmitComments.types | 4 +
.../reference/commentsemitComments.errors.txt | 96 ++
.../reference/commentsemitComments.types | 4 +
.../complexRecursiveCollections.errors.txt | 50 +-
.../reference/complicatedPrivacy.errors.txt | 29 +-
.../compoundAssignmentLHSIsValue.errors.txt | 5 +-
...onentiationAssignmentLHSIsValue.errors.txt | 5 +-
...onstDeclarations-ambient-errors.errors.txt | 5 +-
.../constDeclarations-scopes.errors.txt | 5 +-
...constDeclarations-validContexts.errors.txt | 5 +-
.../baselines/reference/constEnums.errors.txt | 220 +++
...atureAssignabilityInInheritance.errors.txt | 8 +-
...tureAssignabilityInInheritance3.errors.txt | 11 +-
...ctorArgWithGenericCallSignature.errors.txt | 20 +
.../constructorOverloads4.errors.txt | 5 +-
...torWithIncompleteTypeAnnotation.errors.txt | 5 +-
.../reference/contextualTyping.errors.txt | 8 +-
.../reference/convertKeywordsYes.errors.txt | 5 +-
.../reference/covariance1.errors.txt | 23 +
.../reference/declFileGenericType.errors.txt | 45 +
.../reference/declFileGenericType2.errors.txt | 101 ++
.../declFileInternalAliases.errors.txt | 24 +
...declFileTypeAnnotationTupleType.errors.txt | 23 +
...otationVisibilityErrorAccessors.errors.txt | 108 ++
...ibilityErrorParameterOfFunction.errors.txt | 53 +
...bilityErrorReturnTypeOfFunction.errors.txt | 65 +
.../declFileTypeofInAnonymousType.errors.txt | 27 +
...ithClassReferredByExtendsClause.errors.txt | 52 +
...ithErrorsInInputDeclarationFile.errors.txt | 8 +-
...rsInInputDeclarationFileWithOut.errors.txt | 8 +-
...ThatHasItsContainerNameConflict.errors.txt | 44 +
...leNameConflictsInExtendsClause3.errors.txt | 52 +
.../baselines/reference/declInput4.errors.txt | 21 +
...tructuringObjectLiteralPattern2.errors.txt | 19 +
.../declarationEmitNameConflicts.errors.txt | 80 ++
.../declarationEmitNameConflicts2.errors.txt | 42 +
.../declarationEmitNameConflicts2.types | 1 +
...ationEmitNameConflictsWithAlias.errors.txt | 18 +
...eclarationEmitNameConflictsWithAlias.types | 3 +-
...clarationMapsWithoutDeclaration.errors.txt | 5 +-
.../declarationsAndAssignments.errors.txt | 5 +-
...ModuleWithExportAssignedFundule.errors.txt | 30 +
...thAnyOtherTypeInvalidOperations.errors.txt | 5 +-
...ratorWithUnsupportedBooleanType.errors.txt | 5 +-
...eratorWithUnsupportedStringType.errors.txt | 5 +-
.../deleteOperatorWithAnyOtherType.errors.txt | 5 +-
.../deleteOperatorWithNumberType.errors.txt | 5 +-
.../deleteOperatorWithStringType.errors.txt | 5 +-
...sallowLineTerminatorBeforeArrow.errors.txt | 5 +-
.../reference/dottedModuleName2.errors.txt | 70 +
.../reference/downlevelLetConst16.errors.txt | 14 +-
.../duplicateAnonymousInners1.errors.txt | 34 +
.../duplicateSymbolsExportMatching.errors.txt | 44 +-
.../duplicateVariablesWithAny.errors.txt | 5 +-
.../reference/enumAssignability.errors.txt | 5 +-
.../enumAssignabilityInInheritance.errors.txt | 8 +-
.../enumAssignmentCompat3.errors.txt | 5 +-
...sNotASubtypeOfAnythingButNumber.errors.txt | 8 +-
.../reference/enumMerging.errors.txt | 96 ++
.../reference/enumMergingErrors.errors.txt | 29 +-
.../reference/es6ClassTest.errors.txt | 5 +-
.../reference/es6ExportAll.errors.txt | 22 +
.../reference/es6ExportAllInEs5.errors.txt | 22 +
.../reference/es6ExportClause.errors.txt | 24 +
.../reference/es6ExportClauseInEs5.errors.txt | 24 +
.../es6ExportEqualsInterop.errors.txt | 17 +-
.../es6ImportEqualsDeclaration2.errors.txt | 23 +
...mportInIndirectExportAssignment.errors.txt | 15 +
.../es6ModuleClassDeclaration.errors.txt | 121 ++
.../es6ModuleFunctionDeclaration.errors.txt | 37 +
.../es6ModuleInternalImport.errors.txt | 31 +
.../reference/es6ModuleLet.errors.txt | 25 +
.../es6ModuleVariableStatement.errors.txt | 25 +
.../reference/escapedIdentifiers.errors.txt | 128 ++
...AnnotationAndInvalidInitializer.errors.txt | 8 +-
.../reference/exportAlreadySeen.errors.txt | 14 +-
.../exportAssignClassAndModule.errors.txt | 22 +
...exportAssignmentCircularModules.errors.txt | 32 +
.../exportAssignmentCircularModules.types | 6 +
.../exportAssignmentInternalModule.errors.txt | 16 +
.../exportAssignmentInternalModule.types | 2 +
...xportAssignmentTopLevelEnumdule.errors.txt | 21 +
...portDeclarationInInternalModule.errors.txt | 8 +-
.../reference/exportImportAlias.errors.txt | 98 ++
.../exportImportAndClodule.errors.txt | 31 +
...tCanSubstituteConstEnumForValue.errors.txt | 76 ++
...ierReferencingOuterDeclaration2.errors.txt | 5 +-
...ierReferencingOuterDeclaration4.errors.txt | 10 +-
.../baselines/reference/extension.errors.txt | 8 +-
.../externalModuleResolution.errors.txt | 20 +
.../externalModuleResolution2.errors.txt | 21 +
.../reference/for-inStatements.errors.txt | 5 +-
.../reference/forStatements.errors.txt | 52 +
tests/baselines/reference/forStatements.types | 2 +
.../baselines/reference/funClodule.errors.txt | 11 +-
tests/baselines/reference/funcdecl.errors.txt | 77 ++
tests/baselines/reference/funcdecl.types | 5 +
.../functionOverloadErrors.errors.txt | 5 +-
...tedClassIsUsedBeforeDeclaration.errors.txt | 15 +
.../generatedContextualTyping.errors.txt | 74 +-
...edMethodWithOverloadedArguments.errors.txt | 20 +-
...lWithGenericSignatureArguments2.errors.txt | 8 +-
...loadedConstructorTypedArguments.errors.txt | 57 +
...oadedConstructorTypedArguments2.errors.txt | 8 +-
...verloadedFunctionTypedArguments.errors.txt | 53 +
...WithOverloadedFunctionTypedArguments.types | 8 +
...erloadedFunctionTypedArguments2.errors.txt | 8 +-
...opertyInheritanceSpecialization.errors.txt | 102 ++
...assPropertyInheritanceSpecialization.types | 1 +
...ithFunctionTypedMemberArguments.errors.txt | 8 +-
...ithObjectTypeArgsAndConstraints.errors.txt | 69 +
.../genericClassWithStaticFactory.errors.txt | 147 ++
.../genericClassesRedeclaration.errors.txt | 8 +-
.../genericOfACloduleType1.errors.txt | 21 +
.../genericOfACloduleType2.errors.txt | 27 +
...rsiveImplicitConstructorErrors3.errors.txt | 8 +-
tests/baselines/reference/giant.errors.txt | 98 +-
.../heterogeneousArrayLiterals.errors.txt | 140 ++
.../reference/ifDoWhileStatements.errors.txt | 8 +-
...faceExtendingClassWithPrivates2.errors.txt | 8 +-
...implicitAnyInAmbientDeclaration.errors.txt | 5 +-
.../baselines/reference/importDecl.errors.txt | 88 ++
.../importOnAliasedIdentifiers.errors.txt | 19 +
.../importedModuleAddToGlobal.errors.txt | 11 +-
.../reference/incompatibleExports1.errors.txt | 8 +-
...thAnyOtherTypeInvalidOperations.errors.txt | 5 +-
...WithNumberTypeInvalidOperations.errors.txt | 5 +-
...ratorWithUnsupportedBooleanType.errors.txt | 5 +-
...eratorWithUnsupportedStringType.errors.txt | 5 +-
...anceOfGenericConstructorMethod2.errors.txt | 23 +
...nheritedModuleMembersForClodule.errors.txt | 5 +-
.../initializersInDeclarations.errors.txt | 5 +-
.../reference/innerAliases.errors.txt | 17 +-
.../reference/innerModExport1.errors.txt | 5 +-
.../reference/instanceofOperator.errors.txt | 5 +-
.../reference/instantiatedModule.errors.txt | 72 +
.../interfaceAssignmentCompat.errors.txt | 5 +-
.../interfaceDeclaration3.errors.txt | 11 +-
.../interfaceWithMultipleBaseTypes.errors.txt | 5 +-
...lassInsideLocalModuleWithExport.errors.txt | 29 +
...sInsideLocalModuleWithoutExport.errors.txt | 27 +
...lModuleWithoutExportAccessError.errors.txt | 11 +-
...sInsideTopLevelModuleWithExport.errors.txt | 17 +
...EnumInsideLocalModuleWithExport.errors.txt | 22 +
...lModuleWithoutExportAccessError.errors.txt | 8 +-
...duleInsideLocalModuleWithExport.errors.txt | 25 +
...zedModuleInsideLocalModuleWithExport.types | 1 +
.../baselines/reference/intrinsics.errors.txt | 5 +-
.../invalidAssignmentsToVoid.errors.txt | 5 +-
.../invalidBooleanAssignments.errors.txt | 5 +-
.../invalidInstantiatedModule.errors.txt | 8 +-
...ModuleWithStatementsOfEveryKind.errors.txt | 47 +-
.../invalidModuleWithVarStatements.errors.txt | 20 +-
.../reference/invalidNestedModules.errors.txt | 29 +-
.../invalidNumberAssignments.errors.txt | 5 +-
.../invalidStringAssignments.errors.txt | 5 +-
.../invalidUndefinedAssignments.errors.txt | 5 +-
.../invalidUndefinedValues.errors.txt | 37 +
.../reference/invalidUndefinedValues.types | 15 +
.../reference/invalidVoidValues.errors.txt | 5 +-
.../baselines/reference/ipromise2.errors.txt | 30 +
tests/baselines/reference/ipromise2.types | 10 +
.../baselines/reference/ipromise4.errors.txt | 25 +
tests/baselines/reference/ipromise4.types | 10 +
.../isDeclarationVisibleNodeKinds.errors.txt | 98 ++
.../isDeclarationVisibleNodeKinds.types | 8 +
.../jsxElementsAsIdentifierNames.errors.txt | 21 +
.../jsxElementsAsIdentifierNames.types | 8 +-
...jsxFactoryIdentifierAsParameter.errors.txt | 18 +
.../jsxFactoryIdentifierAsParameter.types | 4 +-
...ryIdentifierWithAbsentParameter.errors.txt | 5 +-
...oryQualifiedNameResolutionError.errors.txt | 5 +-
.../reference/jsxParsingError1.errors.txt | 5 +-
.../reference/lambdaPropSelf.errors.txt | 5 +-
.../letDeclarations-scopes.errors.txt | 5 +-
.../letDeclarations-validContexts.errors.txt | 8 +-
.../baselines/reference/libMembers.errors.txt | 5 +-
...icalNotOperatorWithAnyOtherType.errors.txt | 5 +-
...ogicalNotOperatorWithNumberType.errors.txt | 5 +-
...ogicalNotOperatorWithStringType.errors.txt | 5 +-
.../mergeClassInterfaceAndModule.errors.txt | 30 +
.../reference/mergeThreeInterfaces.errors.txt | 84 ++
.../mergeThreeInterfaces2.errors.txt | 94 ++
.../reference/mergedDeclarations1.errors.txt | 22 +
.../mergedModuleDeclarationCodeGen.errors.txt | 30 +
.../mergedModuleDeclarationCodeGen.types | 1 +
...mergedModuleDeclarationCodeGen4.errors.txt | 43 +
.../mergedModuleDeclarationCodeGen4.types | 4 +
.../metadataOfClassFromModule.errors.txt | 17 +
.../reference/metadataOfClassFromModule.types | 1 +
.../methodContainingLocalFunction.errors.txt | 56 +
.../methodContainingLocalFunction.types | 1 +
.../missingTypeArguments3.errors.txt | 47 +
.../reference/missingTypeArguments3.types | 2 +
.../reference/mixedExports.errors.txt | 31 +
tests/baselines/reference/mixedExports.types | 2 +
.../reference/moduleExports1.errors.txt | 11 +-
...uleMemberWithoutTypeAnnotation1.errors.txt | 67 +
.../moduleMemberWithoutTypeAnnotation1.types | 5 +
...uleMemberWithoutTypeAnnotation2.errors.txt | 26 +
.../moduleMemberWithoutTypeAnnotation2.types | 4 +
.../reference/moduleMerge.errors.txt | 32 +
.../reference/moduleProperty1.errors.txt | 8 +-
.../reference/moduleProperty2.errors.txt | 8 +-
.../reference/moduleScopingBug.errors.txt | 38 +
...eWithImportDeclarationInsideIt3.errors.txt | 14 +-
...eWithImportDeclarationInsideIt5.errors.txt | 14 +-
.../moduleVisibilityTest1.errors.txt | 83 ++
.../reference/moduleVisibilityTest1.types | 3 +
.../moduleVisibilityTest2.errors.txt | 17 +-
...moduleWithStatementsOfEveryKind.errors.txt | 73 +
.../baselines/reference/moduledecl.errors.txt | 313 +++++
tests/baselines/reference/moduledecl.types | 39 +-
.../reference/multiModuleClodule1.errors.txt | 27 +
.../newNamesInGlobalAugmentations1.errors.txt | 27 +
.../newNamesInGlobalAugmentations1.types | 2 +
.../reference/newOperator.errors.txt | 5 +-
...citAnyParametersInAmbientModule.errors.txt | 5 +-
...noImplicitAnyParametersInModule.errors.txt | 5 +-
...SubtypeOfEverythingButUndefined.errors.txt | 100 ++
...ullIsSubtypeOfEverythingButUndefined.types | 9 +
.../reference/parserRealSource1.errors.txt | 8 +-
.../reference/parserRealSource10.errors.txt | 5 +-
.../reference/parserRealSource11.errors.txt | 5 +-
.../reference/parserRealSource12.errors.txt | 8 +-
.../reference/parserRealSource13.errors.txt | 8 +-
.../reference/parserRealSource14.errors.txt | 5 +-
.../reference/parserRealSource2.errors.txt | 5 +-
.../reference/parserRealSource3.errors.txt | 5 +-
.../reference/parserRealSource4.errors.txt | 5 +-
.../reference/parserRealSource5.errors.txt | 5 +-
.../reference/parserRealSource6.errors.txt | 5 +-
.../reference/parserRealSource7.errors.txt | 5 +-
.../reference/parserRealSource8.errors.txt | 5 +-
.../reference/parserRealSource9.errors.txt | 5 +-
.../reference/parserharness.errors.txt | 35 +-
.../reference/parserindenter.errors.txt | 5 +-
.../plusOperatorWithAnyOtherType.errors.txt | 5 +-
.../privacyAccessorDeclFile.errors.txt | 1071 +++++++++++++++
...ivacyCannotNameAccessorDeclFile.errors.txt | 142 ++
.../privacyCannotNameAccessorDeclFile.js | 71 -
...rivacyCannotNameVarTypeDeclFile.errors.txt | 105 ++
.../privacyCannotNameVarTypeDeclFile.js | 81 --
...CheckAnonymousFunctionParameter.errors.txt | 22 +
...heckAnonymousFunctionParameter2.errors.txt | 23 +
.../reference/privacyClass.errors.txt | 136 ++
...ivacyClassExtendsClauseDeclFile.errors.txt | 13 +-
...cyClassImplementsClauseDeclFile.errors.txt | 103 ++
.../reference/privacyFunc.errors.txt | 234 ++++
tests/baselines/reference/privacyFunc.types | 3 +
...CannotNameParameterTypeDeclFile.errors.txt | 161 +++
...FunctionCannotNameParameterTypeDeclFile.js | 121 --
...ionCannotNameReturnTypeDeclFile.errors.txt | 168 +++
...acyFunctionCannotNameReturnTypeDeclFile.js | 81 --
...rivacyFunctionParameterDeclFile.errors.txt | 698 ++++++++++
...ivacyFunctionReturnTypeDeclFile.errors.txt | 1205 +++++++++++++++++
.../reference/privacyGetter.errors.txt | 216 +++
.../reference/privacyGloClass.errors.txt | 66 +
.../reference/privacyGloFunc.errors.txt | 539 ++++++++
.../baselines/reference/privacyGloFunc.types | 6 +
.../reference/privacyGloGetter.errors.txt | 94 ++
.../reference/privacyGloImport.errors.txt | 185 +++
.../privacyGloImportParseErrors.errors.txt | 32 +-
.../reference/privacyGloInterface.errors.txt | 128 ++
.../reference/privacyGloVar.errors.txt | 86 ++
.../reference/privacyImport.errors.txt | 395 ++++++
.../privacyImportParseErrors.errors.txt | 62 +-
.../reference/privacyInterface.errors.txt | 279 ++++
...yInterfaceExtendsClauseDeclFile.errors.txt | 103 ++
...ternalReferenceImportWithExport.errors.txt | 179 +++
...nalReferenceImportWithoutExport.errors.txt | 179 +++
...ternalReferenceImportWithExport.errors.txt | 120 ++
...nalReferenceImportWithoutExport.errors.txt | 120 ++
...TypeParameterOfFunctionDeclFile.errors.txt | 447 ++++++
...cyTypeParametersOfClassDeclFile.errors.txt | 163 +++
...peParametersOfInterfaceDeclFile.errors.txt | 199 +++
.../baselines/reference/privacyVar.errors.txt | 183 +++
.../reference/privacyVarDeclFile.errors.txt | 437 ++++++
...ateStaticNotAccessibleInClodule.errors.txt | 5 +-
...teStaticNotAccessibleInClodule2.errors.txt | 5 +-
.../declarationsExportNamespace.errors.txt | 16 +
.../declarationsExportNamespace.errors.txt | 16 +
...ionsMultipleTimesMultipleImport.errors.txt | 37 +
...ionsMultipleTimesMultipleImport.errors.txt | 37 +
.../propertyNamesWithStringLiteral.errors.txt | 22 +
...tedStaticNotAccessibleInClodule.errors.txt | 5 +-
.../reExportAliasMakesInstantiated.errors.txt | 35 +
.../reference/reachabilityChecks1.errors.txt | 32 +-
.../reference/recursiveBaseCheck.errors.txt | 5 +-
.../reference/recursiveBaseCheck2.errors.txt | 17 +-
.../recursiveClassReferenceTest.errors.txt | 41 +-
.../reference/recursiveMods.errors.txt | 32 +
.../recursiveTypeComparison2.errors.txt | 5 +-
...arationWhenInBaseTypeResolution.errors.txt | 200 ++-
.../reuseInnerModuleMember.errors.txt | 25 +
tests/baselines/reference/selfRef.errors.txt | 5 +-
...rceMap-StringLiteralWithNewLine.errors.txt | 19 +
...ilesWithFileEndingWithInterface.errors.txt | 25 +
...ipleFilesWithFileEndingWithInterface.types | 4 +
...(usedefineforclassfields=false).errors.txt | 32 +-
...s(usedefineforclassfields=true).errors.txt | 32 +-
.../reference/subtypesOfAny.errors.txt | 142 ++
tests/baselines/reference/subtypesOfAny.types | 2 +
.../subtypesOfTypeParameter.errors.txt | 8 +-
...OfTypeParameterWithConstraints2.errors.txt | 166 +++
...typesOfTypeParameterWithConstraints2.types | 7 +
...rameterWithRecursiveConstraints.errors.txt | 8 +-
.../reference/subtypesOfUnion.errors.txt | 8 +-
.../subtypingWithCallSignatures3.errors.txt | 127 ++
.../subtypingWithCallSignatures3.types | 23 +
...aturesWithSpecializedSignatures.errors.txt | 8 +-
...btypingWithConstructSignatures3.errors.txt | 129 ++
.../subtypingWithConstructSignatures3.types | 23 +
...aturesWithSpecializedSignatures.errors.txt | 8 +-
...ignaturesWithOptionalParameters.errors.txt | 11 +-
...ignaturesWithOptionalParameters.errors.txt | 11 +-
.../subtypingWithNumericIndexer2.errors.txt | 5 +-
.../subtypingWithObjectMembers.errors.txt | 5 +-
.../subtypingWithObjectMembers2.errors.txt | 8 +-
.../subtypingWithObjectMembers3.errors.txt | 8 +-
.../subtypingWithObjectMembers5.errors.txt | 8 +-
...WithObjectMembersAccessibility2.errors.txt | 8 +-
...ingWithObjectMembersOptionality.errors.txt | 79 ++
.../subtypingWithStringIndexer3.errors.txt | 5 +-
.../superAccessInFatArrow1.errors.txt | 21 +
.../reference/switchStatements.errors.txt | 5 +-
.../symbolDeclarationEmit12.errors.txt | 5 +-
.../reference/symbolProperty55.errors.txt | 16 +
.../reference/symbolProperty56.errors.txt | 16 +
.../reference/symbolProperty56.types | 6 +-
.../systemModuleConstEnums.errors.txt | 17 +
.../reference/systemModuleConstEnums.types | 3 +
...leConstEnumsSeparateCompilation.errors.txt | 17 +
...mModuleConstEnumsSeparateCompilation.types | 3 +
.../reference/thisBinding.errors.txt | 5 +-
...InInvalidContextsExternalModule.errors.txt | 5 +-
...ect-literal-getters-and-setters.errors.txt | 22 +
...e-object-literal-getters-and-setters.types | 3 +
.../reference/throwStatements.errors.txt | 91 ++
.../baselines/reference/throwStatements.types | 10 +
.../tsxAttributeInvalidNames.errors.txt | 5 +-
.../tsxAttributeResolution2.errors.txt | 5 +-
.../tsxAttributeResolution4.errors.txt | 5 +-
.../tsxAttributeResolution6.errors.txt | 5 +-
.../tsxAttributeResolution7.errors.txt | 5 +-
.../reference/tsxDynamicTagName2.errors.txt | 5 +-
.../reference/tsxDynamicTagName3.errors.txt | 5 +-
.../tsxElementResolution13.errors.txt | 17 +
.../reference/tsxElementResolution13.types | 2 +
.../tsxElementResolution15.errors.txt | 5 +-
.../tsxElementResolution19.errors.txt | 23 +
.../reference/tsxElementResolution19.types | 3 +-
.../tsxElementResolution4.errors.txt | 5 +-
.../tsxElementResolution7.errors.txt | 11 +-
tests/baselines/reference/tsxEmit1.errors.txt | 46 +
tests/baselines/reference/tsxEmit1.types | 20 +
.../reference/tsxPreserveEmit3.errors.txt | 20 +
.../reference/tsxPreserveEmit3.types | 1 +
.../reference/tsxReactEmit1.errors.txt | 47 +
tests/baselines/reference/tsxReactEmit1.types | 21 +
.../reference/tsxReactEmit4.errors.txt | 5 +-
.../tsxReactEmitWhitespace2.errors.txt | 22 +
.../reference/tsxReactEmitWhitespace2.types | 1 +
...erfacesWithDifferentConstraints.errors.txt | 17 +-
...iasDoesntMakeModuleInstantiated.errors.txt | 16 +
...ypeAliasDoesntMakeModuleInstantiated.types | 1 +
...eGuardsInFunctionAndModuleBlock.errors.txt | 97 ++
.../reference/typeGuardsInModule.errors.txt | 105 ++
.../reference/typeResolution.errors.txt | 137 ++
.../baselines/reference/typeResolution.types | 6 +
.../reference/typeValueConflict2.errors.txt | 11 +-
.../reference/typeofAnExportedType.errors.txt | 8 +-
.../typeofOperatorWithAnyOtherType.errors.txt | 5 +-
.../typeofOperatorWithBooleanType.errors.txt | 5 +-
.../typeofOperatorWithNumberType.errors.txt | 5 +-
.../typeofOperatorWithStringType.errors.txt | 5 +-
.../baselines/reference/typeofThis.errors.txt | 5 +-
...yExternalModuleStillHasInstance.errors.txt | 5 +-
.../undefinedIsSubtypeOfEverything.errors.txt | 130 ++
.../undefinedIsSubtypeOfEverything.types | 3 +
.../reference/underscoreMapFirst.errors.txt | 54 +
.../reference/underscoreMapFirst.types | 4 +
.../reference/underscoreTest1.errors.txt | 5 +-
...IfEveryConstituentTypeIsSubtype.errors.txt | 8 +-
.../unspecializedConstraints.errors.txt | 5 +-
tests/baselines/reference/vardecl.errors.txt | 116 ++
tests/baselines/reference/vardecl.types | 33 +
...rResolvedDuringContextualTyping.errors.txt | 14 +-
.../voidOperatorWithAnyOtherType.errors.txt | 5 +-
.../voidOperatorWithStringType.errors.txt | 50 +
.../voidOperatorWithStringType.types | 14 +
.../reference/withExportDecl.errors.txt | 70 +
.../baselines/reference/withExportDecl.types | 10 +
tests/baselines/reference/witness.errors.txt | 5 +-
530 files changed, 20621 insertions(+), 621 deletions(-)
create mode 100644 tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
create mode 100644 tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
create mode 100644 tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt
create mode 100644 tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.errors.txt
create mode 100644 tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt
create mode 100644 tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt
create mode 100644 tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt
create mode 100644 tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt
create mode 100644 tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.errors.txt
create mode 100644 tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt
create mode 100644 tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt
create mode 100644 tests/baselines/reference/ambientDeclarations.errors.txt
create mode 100644 tests/baselines/reference/ambientInsideNonAmbient.errors.txt
create mode 100644 tests/baselines/reference/ambientModuleExports.errors.txt
create mode 100644 tests/baselines/reference/ambientModuleWithTemplateLiterals.errors.txt
create mode 100644 tests/baselines/reference/anyAssignabilityInInheritance.errors.txt
create mode 100644 tests/baselines/reference/anyAssignableToEveryType2.errors.txt
create mode 100644 tests/baselines/reference/arrayBestCommonTypes.errors.txt
create mode 100644 tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatWithObjectMembers.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatability1.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatability2.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatability3.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatability36.errors.txt
create mode 100644 tests/baselines/reference/assignmentCompatability4.errors.txt
create mode 100644 tests/baselines/reference/asyncAwait_es2017.errors.txt
create mode 100644 tests/baselines/reference/asyncAwait_es5.errors.txt
create mode 100644 tests/baselines/reference/asyncAwait_es6.errors.txt
create mode 100644 tests/baselines/reference/augmentExportEquals5.errors.txt
create mode 100644 tests/baselines/reference/augmentedTypesClass3.errors.txt
create mode 100644 tests/baselines/reference/binopAssignmentShouldHaveType.errors.txt
create mode 100644 tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt
create mode 100644 tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt
create mode 100644 tests/baselines/reference/chainedImportAlias.errors.txt
create mode 100644 tests/baselines/reference/classAndInterfaceMerge.d.errors.txt
create mode 100644 tests/baselines/reference/classdecl.errors.txt
create mode 100644 tests/baselines/reference/clinterfaces.errors.txt
create mode 100644 tests/baselines/reference/cloduleTest1.errors.txt
create mode 100644 tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.errors.txt
create mode 100644 tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndAmbientEnum.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndAmbientFunction.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.errors.txt
create mode 100644 tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt
create mode 100644 tests/baselines/reference/commentOnAmbientModule.errors.txt
create mode 100644 tests/baselines/reference/commentOnElidedModule1.errors.txt
create mode 100644 tests/baselines/reference/commentsExternalModules.errors.txt
create mode 100644 tests/baselines/reference/commentsExternalModules2.errors.txt
create mode 100644 tests/baselines/reference/commentsExternalModules3.errors.txt
create mode 100644 tests/baselines/reference/commentsFormatting.errors.txt
create mode 100644 tests/baselines/reference/commentsModules.errors.txt
create mode 100644 tests/baselines/reference/commentsdoNotEmitComments.errors.txt
create mode 100644 tests/baselines/reference/commentsemitComments.errors.txt
create mode 100644 tests/baselines/reference/constEnums.errors.txt
create mode 100644 tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt
create mode 100644 tests/baselines/reference/covariance1.errors.txt
create mode 100644 tests/baselines/reference/declFileGenericType.errors.txt
create mode 100644 tests/baselines/reference/declFileGenericType2.errors.txt
create mode 100644 tests/baselines/reference/declFileInternalAliases.errors.txt
create mode 100644 tests/baselines/reference/declFileTypeAnnotationTupleType.errors.txt
create mode 100644 tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt
create mode 100644 tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt
create mode 100644 tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt
create mode 100644 tests/baselines/reference/declFileTypeofInAnonymousType.errors.txt
create mode 100644 tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.errors.txt
create mode 100644 tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.errors.txt
create mode 100644 tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.errors.txt
create mode 100644 tests/baselines/reference/declInput4.errors.txt
create mode 100644 tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.errors.txt
create mode 100644 tests/baselines/reference/declarationEmitNameConflicts.errors.txt
create mode 100644 tests/baselines/reference/declarationEmitNameConflicts2.errors.txt
create mode 100644 tests/baselines/reference/declarationEmitNameConflictsWithAlias.errors.txt
create mode 100644 tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.errors.txt
create mode 100644 tests/baselines/reference/dottedModuleName2.errors.txt
create mode 100644 tests/baselines/reference/duplicateAnonymousInners1.errors.txt
create mode 100644 tests/baselines/reference/enumMerging.errors.txt
create mode 100644 tests/baselines/reference/es6ExportAll.errors.txt
create mode 100644 tests/baselines/reference/es6ExportAllInEs5.errors.txt
create mode 100644 tests/baselines/reference/es6ExportClause.errors.txt
create mode 100644 tests/baselines/reference/es6ExportClauseInEs5.errors.txt
create mode 100644 tests/baselines/reference/es6ImportEqualsDeclaration2.errors.txt
create mode 100644 tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.errors.txt
create mode 100644 tests/baselines/reference/es6ModuleClassDeclaration.errors.txt
create mode 100644 tests/baselines/reference/es6ModuleFunctionDeclaration.errors.txt
create mode 100644 tests/baselines/reference/es6ModuleInternalImport.errors.txt
create mode 100644 tests/baselines/reference/es6ModuleLet.errors.txt
create mode 100644 tests/baselines/reference/es6ModuleVariableStatement.errors.txt
create mode 100644 tests/baselines/reference/escapedIdentifiers.errors.txt
create mode 100644 tests/baselines/reference/exportAssignClassAndModule.errors.txt
create mode 100644 tests/baselines/reference/exportAssignmentCircularModules.errors.txt
create mode 100644 tests/baselines/reference/exportAssignmentInternalModule.errors.txt
create mode 100644 tests/baselines/reference/exportAssignmentTopLevelEnumdule.errors.txt
create mode 100644 tests/baselines/reference/exportImportAlias.errors.txt
create mode 100644 tests/baselines/reference/exportImportAndClodule.errors.txt
create mode 100644 tests/baselines/reference/exportImportCanSubstituteConstEnumForValue.errors.txt
create mode 100644 tests/baselines/reference/externalModuleResolution.errors.txt
create mode 100644 tests/baselines/reference/externalModuleResolution2.errors.txt
create mode 100644 tests/baselines/reference/forStatements.errors.txt
create mode 100644 tests/baselines/reference/funcdecl.errors.txt
create mode 100644 tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.errors.txt
create mode 100644 tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt
create mode 100644 tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.errors.txt
create mode 100644 tests/baselines/reference/genericClassPropertyInheritanceSpecialization.errors.txt
create mode 100644 tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.errors.txt
create mode 100644 tests/baselines/reference/genericClassWithStaticFactory.errors.txt
create mode 100644 tests/baselines/reference/genericOfACloduleType1.errors.txt
create mode 100644 tests/baselines/reference/genericOfACloduleType2.errors.txt
create mode 100644 tests/baselines/reference/heterogeneousArrayLiterals.errors.txt
create mode 100644 tests/baselines/reference/importDecl.errors.txt
create mode 100644 tests/baselines/reference/importOnAliasedIdentifiers.errors.txt
create mode 100644 tests/baselines/reference/inheritanceOfGenericConstructorMethod2.errors.txt
create mode 100644 tests/baselines/reference/instantiatedModule.errors.txt
create mode 100644 tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.errors.txt
create mode 100644 tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.errors.txt
create mode 100644 tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.errors.txt
create mode 100644 tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.errors.txt
create mode 100644 tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt
create mode 100644 tests/baselines/reference/invalidUndefinedValues.errors.txt
create mode 100644 tests/baselines/reference/ipromise2.errors.txt
create mode 100644 tests/baselines/reference/ipromise4.errors.txt
create mode 100644 tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt
create mode 100644 tests/baselines/reference/jsxElementsAsIdentifierNames.errors.txt
create mode 100644 tests/baselines/reference/jsxFactoryIdentifierAsParameter.errors.txt
create mode 100644 tests/baselines/reference/mergeClassInterfaceAndModule.errors.txt
create mode 100644 tests/baselines/reference/mergeThreeInterfaces.errors.txt
create mode 100644 tests/baselines/reference/mergeThreeInterfaces2.errors.txt
create mode 100644 tests/baselines/reference/mergedDeclarations1.errors.txt
create mode 100644 tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt
create mode 100644 tests/baselines/reference/mergedModuleDeclarationCodeGen4.errors.txt
create mode 100644 tests/baselines/reference/metadataOfClassFromModule.errors.txt
create mode 100644 tests/baselines/reference/methodContainingLocalFunction.errors.txt
create mode 100644 tests/baselines/reference/missingTypeArguments3.errors.txt
create mode 100644 tests/baselines/reference/mixedExports.errors.txt
create mode 100644 tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.errors.txt
create mode 100644 tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.errors.txt
create mode 100644 tests/baselines/reference/moduleMerge.errors.txt
create mode 100644 tests/baselines/reference/moduleScopingBug.errors.txt
create mode 100644 tests/baselines/reference/moduleVisibilityTest1.errors.txt
create mode 100644 tests/baselines/reference/moduleWithStatementsOfEveryKind.errors.txt
create mode 100644 tests/baselines/reference/moduledecl.errors.txt
create mode 100644 tests/baselines/reference/multiModuleClodule1.errors.txt
create mode 100644 tests/baselines/reference/newNamesInGlobalAugmentations1.errors.txt
create mode 100644 tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.errors.txt
create mode 100644 tests/baselines/reference/privacyAccessorDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyCannotNameAccessorDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyCannotNameVarTypeDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyCheckAnonymousFunctionParameter.errors.txt
create mode 100644 tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.errors.txt
create mode 100644 tests/baselines/reference/privacyClass.errors.txt
create mode 100644 tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyFunc.errors.txt
create mode 100644 tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyGetter.errors.txt
create mode 100644 tests/baselines/reference/privacyGloClass.errors.txt
create mode 100644 tests/baselines/reference/privacyGloFunc.errors.txt
create mode 100644 tests/baselines/reference/privacyGloGetter.errors.txt
create mode 100644 tests/baselines/reference/privacyGloImport.errors.txt
create mode 100644 tests/baselines/reference/privacyGloInterface.errors.txt
create mode 100644 tests/baselines/reference/privacyGloVar.errors.txt
create mode 100644 tests/baselines/reference/privacyImport.errors.txt
create mode 100644 tests/baselines/reference/privacyInterface.errors.txt
create mode 100644 tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt
create mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt
create mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt
create mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt
create mode 100644 tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt
create mode 100644 tests/baselines/reference/privacyVar.errors.txt
create mode 100644 tests/baselines/reference/privacyVarDeclFile.errors.txt
create mode 100644 tests/baselines/reference/project/declarationsExportNamespace/amd/declarationsExportNamespace.errors.txt
create mode 100644 tests/baselines/reference/project/declarationsExportNamespace/node/declarationsExportNamespace.errors.txt
create mode 100644 tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.errors.txt
create mode 100644 tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.errors.txt
create mode 100644 tests/baselines/reference/propertyNamesWithStringLiteral.errors.txt
create mode 100644 tests/baselines/reference/reExportAliasMakesInstantiated.errors.txt
create mode 100644 tests/baselines/reference/recursiveMods.errors.txt
create mode 100644 tests/baselines/reference/reuseInnerModuleMember.errors.txt
create mode 100644 tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt
create mode 100644 tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt
create mode 100644 tests/baselines/reference/subtypesOfAny.errors.txt
create mode 100644 tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt
create mode 100644 tests/baselines/reference/subtypingWithCallSignatures3.errors.txt
create mode 100644 tests/baselines/reference/subtypingWithConstructSignatures3.errors.txt
create mode 100644 tests/baselines/reference/subtypingWithObjectMembersOptionality.errors.txt
create mode 100644 tests/baselines/reference/superAccessInFatArrow1.errors.txt
create mode 100644 tests/baselines/reference/symbolProperty55.errors.txt
create mode 100644 tests/baselines/reference/symbolProperty56.errors.txt
create mode 100644 tests/baselines/reference/systemModuleConstEnums.errors.txt
create mode 100644 tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.errors.txt
create mode 100644 tests/baselines/reference/this_inside-object-literal-getters-and-setters.errors.txt
create mode 100644 tests/baselines/reference/throwStatements.errors.txt
create mode 100644 tests/baselines/reference/tsxElementResolution13.errors.txt
create mode 100644 tests/baselines/reference/tsxElementResolution19.errors.txt
create mode 100644 tests/baselines/reference/tsxEmit1.errors.txt
create mode 100644 tests/baselines/reference/tsxPreserveEmit3.errors.txt
create mode 100644 tests/baselines/reference/tsxReactEmit1.errors.txt
create mode 100644 tests/baselines/reference/tsxReactEmitWhitespace2.errors.txt
create mode 100644 tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.errors.txt
create mode 100644 tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.errors.txt
create mode 100644 tests/baselines/reference/typeGuardsInModule.errors.txt
create mode 100644 tests/baselines/reference/typeResolution.errors.txt
create mode 100644 tests/baselines/reference/undefinedIsSubtypeOfEverything.errors.txt
create mode 100644 tests/baselines/reference/underscoreMapFirst.errors.txt
create mode 100644 tests/baselines/reference/vardecl.errors.txt
create mode 100644 tests/baselines/reference/voidOperatorWithStringType.errors.txt
create mode 100644 tests/baselines/reference/withExportDecl.errors.txt
diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
new file mode 100644
index 0000000000000..9ec8f6892e982
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
@@ -0,0 +1,17 @@
+module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== module.d.ts (1 errors) ====
+ declare module Point {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var Origin: { x: number; y: number; }
+ }
+
+==== function.d.ts (0 errors) ====
+ declare function Point(): { x: number; y: number; }
+
+==== test.ts (0 errors) ====
+ var cl: { x: number; y: number; }
+ var cl = Point();
+ var cl = Point.Origin;
\ No newline at end of file
diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
new file mode 100644
index 0000000000000..7495c0262ac02
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt
@@ -0,0 +1,19 @@
+module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== module.d.ts (1 errors) ====
+ declare module Point {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var Origin: { x: number; y: number; }
+ }
+
+==== function.ts (0 errors) ====
+ function Point() {
+ return { x: 0, y: 0 };
+ }
+
+==== test.ts (0 errors) ====
+ var cl: { x: number; y: number; }
+ var cl = Point();
+ var cl = Point.Origin;
\ No newline at end of file
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt
index 10513ef9e6d1e..657b00c0a0b79 100644
--- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt
@@ -1,7 +1,8 @@
+ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,24): error TS2341: Property 'sfn' is private and only accessible within class 'clodule'.
-==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ====
+==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (2 errors) ====
class clodule {
id: string;
value: T;
@@ -10,6 +11,8 @@ ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics
}
module clodule {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// error: duplicate identifier expected
export function fn(x: T, y: T): number {
return clodule.sfn('a');
diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt
new file mode 100644
index 0000000000000..6f4a62e8a4561
--- /dev/null
+++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt
@@ -0,0 +1,22 @@
+EnumAndModuleWithSameNameAndCommonRoot.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== EnumAndModuleWithSameNameAndCommonRoot.ts (1 errors) ====
+ enum enumdule {
+ Red, Blue
+ }
+
+ module enumdule {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ export class Point {
+ constructor(public x: number, public y: number) { }
+ }
+ }
+
+ var x: enumdule;
+ var x = enumdule.Red;
+
+ var y: { x: number; y: number };
+ var y = new enumdule.Point(0, 0);
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.errors.txt b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.errors.txt
new file mode 100644
index 0000000000000..985692c906f87
--- /dev/null
+++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.errors.txt
@@ -0,0 +1,25 @@
+ExportClassWhichExtendsInterfaceWithInaccessibleType.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportClassWhichExtendsInterfaceWithInaccessibleType.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ interface Point {
+ x: number;
+ y: number;
+
+ fromOrigin(p: Point): number;
+ }
+
+ export class Point2d implements Point {
+ constructor(public x: number, public y: number) { }
+
+ fromOrigin(p: Point) {
+ return 1;
+ }
+ }
+ }
+
+
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt
new file mode 100644
index 0000000000000..54701a22f12e4
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt
@@ -0,0 +1,21 @@
+ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ export class Point {
+ x: number;
+ y: number;
+ }
+
+ export class Line {
+ constructor(public start: Point, public end: Point) { }
+ }
+
+ export function fromOrigin(p: Point): Line {
+ return new Line({ x: 0, y: 0 }, p);
+ }
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt
new file mode 100644
index 0000000000000..7d5cd6241ba16
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt
@@ -0,0 +1,21 @@
+ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ class Point {
+ x: number;
+ y: number;
+ }
+
+ export class Line {
+ constructor(public start: Point, public end: Point) { }
+ }
+
+ export function fromOrigin(p: Point): Line {
+ return new Line({ x: 0, y: 0 }, p);
+ }
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt
new file mode 100644
index 0000000000000..825bf9de95483
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt
@@ -0,0 +1,21 @@
+ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ export class Point {
+ x: number;
+ y: number;
+ }
+
+ class Line {
+ constructor(public start: Point, public end: Point) { }
+ }
+
+ export function fromOrigin(p: Point): Line {
+ return new Line({ x: 0, y: 0 }, p);
+ }
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt
new file mode 100644
index 0000000000000..aabf8bdff6f93
--- /dev/null
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt
@@ -0,0 +1,17 @@
+ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ class Point {
+ constructor(public x: number, public y: number) { }
+ }
+
+ export var UnitSquare : {
+ top: { left: Point, right: Point },
+ bottom: { left: Point, right: Point }
+ } = null;
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.errors.txt b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.errors.txt
new file mode 100644
index 0000000000000..57429a19ff3dd
--- /dev/null
+++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.errors.txt
@@ -0,0 +1,24 @@
+ExportVariableWithInaccessibleTypeInTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ExportVariableWithInaccessibleTypeInTypeAnnotation.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ export interface Point {
+ x: number;
+ y: number;
+ }
+
+ // valid since Point is exported
+ export var Origin: Point = { x: 0, y: 0 };
+
+ interface Point3d extends Point {
+ z: number;
+ }
+
+ // invalid Point3d is not exported
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+ }
+
\ No newline at end of file
diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt
new file mode 100644
index 0000000000000..a67478b1a01b5
--- /dev/null
+++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt
@@ -0,0 +1,32 @@
+function.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+module.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+module.ts(2,12): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== function.ts (1 errors) ====
+ module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export function Point() {
+ return { x: 0, y: 0 };
+ }
+ }
+
+==== module.ts (2 errors) ====
+ module B {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export module Point {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var Origin = { x: 0, y: 0 };
+ }
+ }
+
+==== test.ts (0 errors) ====
+ var fn: () => { x: number; y: number };
+ var fn = A.Point;
+
+ var cl: { x: number; y: number; }
+ var cl = B.Point.Origin;
+
\ No newline at end of file
diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt
new file mode 100644
index 0000000000000..6ffddf6efd119
--- /dev/null
+++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt
@@ -0,0 +1,22 @@
+ModuleAndEnumWithSameNameAndCommonRoot.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ModuleAndEnumWithSameNameAndCommonRoot.ts (1 errors) ====
+ module enumdule {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+ export class Point {
+ constructor(public x: number, public y: number) { }
+ }
+ }
+
+ enum enumdule {
+ Red, Blue
+ }
+
+ var x: enumdule;
+ var x = enumdule.Red;
+
+ var y: { x: number; y: number };
+ var y = new enumdule.Point(0, 0);
\ No newline at end of file
diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt
index 5578e472334e7..2decb17efd346 100644
--- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt
+++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt
@@ -1,8 +1,13 @@
+ModuleWithExportedAndNonExportedImportAlias.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ModuleWithExportedAndNonExportedImportAlias.ts(12,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ModuleWithExportedAndNonExportedImportAlias.ts(18,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'Lines' does not exist on type 'typeof Geometry'.
-==== ModuleWithExportedAndNonExportedImportAlias.ts (1 errors) ====
+==== ModuleWithExportedAndNonExportedImportAlias.ts (4 errors) ====
module A {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface Point {
x: number;
y: number;
@@ -14,12 +19,16 @@ ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'L
}
module B {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export class Line {
constructor(public start: A.Point, public end: A.Point) { }
}
}
module Geometry {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export import Points = A;
import Lines = B;
diff --git a/tests/baselines/reference/accessorsInAmbientContext.errors.txt b/tests/baselines/reference/accessorsInAmbientContext.errors.txt
index 89cd98a0a0c66..1cf20ba2859ff 100644
--- a/tests/baselines/reference/accessorsInAmbientContext.errors.txt
+++ b/tests/baselines/reference/accessorsInAmbientContext.errors.txt
@@ -1,3 +1,4 @@
+accessorsInAmbientContext.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
accessorsInAmbientContext.ts(3,17): error TS1183: An implementation cannot be declared in ambient contexts.
accessorsInAmbientContext.ts(4,18): error TS1183: An implementation cannot be declared in ambient contexts.
accessorsInAmbientContext.ts(6,24): error TS1183: An implementation cannot be declared in ambient contexts.
@@ -8,8 +9,10 @@ accessorsInAmbientContext.ts(15,20): error TS1183: An implementation cannot be d
accessorsInAmbientContext.ts(16,21): error TS1183: An implementation cannot be declared in ambient contexts.
-==== accessorsInAmbientContext.ts (8 errors) ====
+==== accessorsInAmbientContext.ts (9 errors) ====
declare module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class C {
get X() { return 1; }
~
diff --git a/tests/baselines/reference/aliasesInSystemModule1.errors.txt b/tests/baselines/reference/aliasesInSystemModule1.errors.txt
index cbd259f770a6a..c0db7b033d77f 100644
--- a/tests/baselines/reference/aliasesInSystemModule1.errors.txt
+++ b/tests/baselines/reference/aliasesInSystemModule1.errors.txt
@@ -1,7 +1,8 @@
aliasesInSystemModule1.ts(1,24): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
+aliasesInSystemModule1.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== aliasesInSystemModule1.ts (1 errors) ====
+==== aliasesInSystemModule1.ts (2 errors) ====
import alias = require('foo');
~~~~~
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
@@ -13,6 +14,8 @@ aliasesInSystemModule1.ts(1,24): error TS2792: Cannot find module 'foo'. Did you
let z = new cls2();
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
diff --git a/tests/baselines/reference/aliasesInSystemModule2.errors.txt b/tests/baselines/reference/aliasesInSystemModule2.errors.txt
index e484e65dd8a43..396dede61aaa7 100644
--- a/tests/baselines/reference/aliasesInSystemModule2.errors.txt
+++ b/tests/baselines/reference/aliasesInSystemModule2.errors.txt
@@ -1,7 +1,8 @@
aliasesInSystemModule2.ts(1,21): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
+aliasesInSystemModule2.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== aliasesInSystemModule2.ts (1 errors) ====
+==== aliasesInSystemModule2.ts (2 errors) ====
import {alias} from "foo";
~~~~~
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
@@ -13,6 +14,8 @@ aliasesInSystemModule2.ts(1,21): error TS2792: Cannot find module 'foo'. Did you
let z = new cls2();
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
diff --git a/tests/baselines/reference/ambientDeclarations.errors.txt b/tests/baselines/reference/ambientDeclarations.errors.txt
new file mode 100644
index 0000000000000..1d5f527da7482
--- /dev/null
+++ b/tests/baselines/reference/ambientDeclarations.errors.txt
@@ -0,0 +1,85 @@
+ambientDeclarations.ts(55,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientDeclarations.ts(61,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ambientDeclarations.ts (2 errors) ====
+ // Ambient variable without type annotation
+ declare var n;
+
+ // Ambient variable with type annotation
+ declare var m: string;
+
+ // Ambient function with no type annotations
+ declare function fn1();
+
+ // Ambient function with type annotations
+ declare function fn2(n: string): number;
+
+ // Ambient function with valid overloads
+ declare function fn3(n: string): number;
+ declare function fn4(n: number, y: number): string;
+
+ // Ambient function with optional parameters
+ declare function fn5(x, y?);
+ declare function fn6(e?);
+ declare function fn7(x, y?, ...z);
+ declare function fn8(y?, ...z: number[]);
+ declare function fn9(...q: {}[]);
+ declare function fn10(...q: T[]);
+
+ // Ambient class
+ declare class cls {
+ constructor();
+ method(): cls;
+ static static(p): number;
+ static q;
+ private fn();
+ private static fns();
+ }
+
+ // Ambient enum
+ declare enum E1 {
+ x,
+ y,
+ z
+ }
+
+ // Ambient enum with integer literal initializer
+ declare enum E2 {
+ q,
+ a = 1,
+ b,
+ c = 2,
+ d
+ }
+
+ // Ambient enum members are always exported with or without export keyword
+ declare enum E3 {
+ A
+ }
+ declare module E3 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ var B;
+ }
+ var x = E3.B;
+
+ // Ambient module
+ declare module M1 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ var x;
+ function fn(): number;
+ }
+
+ // Ambient module members are always exported with or without export keyword
+ var p = M1.x;
+ var q = M1.fn();
+
+ // Ambient external module in the global module
+ // Ambient external module with a string literal name that is a top level external module name
+ declare module 'external1' {
+ var q;
+ }
+
+
\ No newline at end of file
diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types
index c403f220e083b..fa48dbc4bbfaa 100644
--- a/tests/baselines/reference/ambientDeclarations.types
+++ b/tests/baselines/reference/ambientDeclarations.types
@@ -4,6 +4,7 @@
// Ambient variable without type annotation
declare var n;
>n : any
+> : ^^^
// Ambient variable with type annotation
declare var m: string;
@@ -42,18 +43,23 @@ declare function fn5(x, y?);
>fn5 : (x: any, y?: any) => any
> : ^ ^^^^^^^ ^^^^^^^^^^^^^^
>x : any
+> : ^^^
>y : any
+> : ^^^
declare function fn6(e?);
>fn6 : (e?: any) => any
> : ^ ^^^^^^^^^^^^^^
>e : any
+> : ^^^
declare function fn7(x, y?, ...z);
>fn7 : (x: any, y?: any, ...z: any[]) => any
> : ^ ^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>y : any
+> : ^^^
>z : any[]
> : ^^^^^
@@ -61,6 +67,7 @@ declare function fn8(y?, ...z: number[]);
>fn8 : (y?: any, ...z: number[]) => any
> : ^ ^^^^^^^^^^^ ^^ ^^^^^^^^
>y : any
+> : ^^^
>z : number[]
> : ^^^^^^^^
@@ -90,9 +97,11 @@ declare class cls {
>static : (p: any) => number
> : ^ ^^^^^^^^^^
>p : any
+> : ^^^
static q;
>q : any
+> : ^^^
private fn();
>fn : () => any
@@ -166,10 +175,13 @@ declare module E3 {
var B;
>B : any
+> : ^^^
}
var x = E3.B;
>x : any
+> : ^^^
>E3.B : any
+> : ^^^
>E3 : typeof E3
> : ^^^^^^^^^
>B : any
@@ -182,6 +194,7 @@ declare module M1 {
var x;
>x : any
+> : ^^^
function fn(): number;
>fn : () => number
@@ -191,7 +204,9 @@ declare module M1 {
// Ambient module members are always exported with or without export keyword
var p = M1.x;
>p : any
+> : ^^^
>M1.x : any
+> : ^^^
>M1 : typeof M1
> : ^^^^^^^^^
>x : any
@@ -217,6 +232,7 @@ declare module 'external1' {
var q;
>q : any
+> : ^^^
}
diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt
index ce20862cdb857..5c8f3b4b2effd 100644
--- a/tests/baselines/reference/ambientErrors.errors.txt
+++ b/tests/baselines/reference/ambientErrors.errors.txt
@@ -2,6 +2,7 @@ ambientErrors.ts(2,17): error TS1039: Initializers are not allowed in ambient co
ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
ambientErrors.ts(20,24): error TS1183: An implementation cannot be declared in ambient contexts.
ambientErrors.ts(29,9): error TS1066: In ambient enum declarations member initializer must be constant expression.
+ambientErrors.ts(33,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
ambientErrors.ts(34,13): error TS1039: Initializers are not allowed in ambient contexts.
ambientErrors.ts(35,19): error TS1183: An implementation cannot be declared in ambient contexts.
ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts.
@@ -9,12 +10,13 @@ ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient c
ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts.
ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts.
ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts.
+ambientErrors.ts(46,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name.
ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
-==== ambientErrors.ts (14 errors) ====
+==== ambientErrors.ts (16 errors) ====
// Ambient variable with an initializer
declare var x = 4;
~
@@ -56,6 +58,8 @@ ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a m
// Ambient module with initializers for values, bodies for functions / classes
declare module M1 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var x = 3;
~
!!! error TS1039: Initializers are not allowed in ambient contexts.
@@ -83,6 +87,8 @@ ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a m
// Ambient external module not in the global module
module M2 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
declare module 'nope' { }
~~~~~~
!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces.
diff --git a/tests/baselines/reference/ambientInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientInsideNonAmbient.errors.txt
new file mode 100644
index 0000000000000..87f04fecf8067
--- /dev/null
+++ b/tests/baselines/reference/ambientInsideNonAmbient.errors.txt
@@ -0,0 +1,30 @@
+ambientInsideNonAmbient.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientInsideNonAmbient.ts(6,20): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientInsideNonAmbient.ts(9,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientInsideNonAmbient.ts(14,13): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ambientInsideNonAmbient.ts (4 errors) ====
+ module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export declare var x;
+ export declare function f();
+ export declare class C { }
+ export declare enum E { }
+ export declare module M { }
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ }
+
+ module M2 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ declare var x;
+ declare function f();
+ declare class C { }
+ declare enum E { }
+ declare module M { }
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/ambientInsideNonAmbient.types b/tests/baselines/reference/ambientInsideNonAmbient.types
index f9d706286989c..fbabcf0fd1102 100644
--- a/tests/baselines/reference/ambientInsideNonAmbient.types
+++ b/tests/baselines/reference/ambientInsideNonAmbient.types
@@ -7,6 +7,7 @@ module M {
export declare var x;
>x : any
+> : ^^^
export declare function f();
>f : () => any
@@ -29,6 +30,7 @@ module M2 {
declare var x;
>x : any
+> : ^^^
declare function f();
>f : () => any
diff --git a/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt b/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt
index 32d0fa85f966d..3a653a94ba206 100644
--- a/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt
+++ b/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt
@@ -1,19 +1,31 @@
+ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,23): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,21): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,1): error TS2304: Cannot find name 'declare'.
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,16): error TS2819: Namespace name cannot be 'debugger'.
ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,25): error TS1005: ';' expected.
-==== ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts (4 errors) ====
+==== ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts (8 errors) ====
// https://github.com/microsoft/TypeScript/issues/7840
declare module chrome.debugger {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ ~~~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
declare var tabId: number;
}
export const tabId = chrome.debugger.tabId;
declare module test.class {}
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ ~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
declare module debugger {} // still an error
~~~~~~~
diff --git a/tests/baselines/reference/ambientModuleExports.errors.txt b/tests/baselines/reference/ambientModuleExports.errors.txt
new file mode 100644
index 0000000000000..1c4f09c44cd96
--- /dev/null
+++ b/tests/baselines/reference/ambientModuleExports.errors.txt
@@ -0,0 +1,28 @@
+ambientModuleExports.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ambientModuleExports.ts(11,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ambientModuleExports.ts (2 errors) ====
+ declare module Foo {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ function a():void;
+ var b:number;
+ class C {}
+ }
+
+ Foo.a();
+ Foo.b;
+ var c = new Foo.C();
+
+ declare module Foo2 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export function a(): void;
+ export var b: number;
+ export class C { }
+ }
+
+ Foo2.a();
+ Foo2.b;
+ var c2 = new Foo2.C();
\ No newline at end of file
diff --git a/tests/baselines/reference/ambientModuleWithTemplateLiterals.errors.txt b/tests/baselines/reference/ambientModuleWithTemplateLiterals.errors.txt
new file mode 100644
index 0000000000000..92c2c9b5f2a7d
--- /dev/null
+++ b/tests/baselines/reference/ambientModuleWithTemplateLiterals.errors.txt
@@ -0,0 +1,26 @@
+ambientModuleWithTemplateLiterals.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== ambientModuleWithTemplateLiterals.ts (1 errors) ====
+ declare module Foo {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ enum Bar {
+ a = `1`,
+ b = '2',
+ c = '3'
+ }
+
+ export const a = 'string';
+ export const b = `template`;
+
+ export const c = Bar.a;
+ export const d = Bar['b'];
+ export const e = Bar[`c`];
+ }
+
+ Foo.a;
+ Foo.b;
+ Foo.c;
+ Foo.d;
+ Foo.e;
\ No newline at end of file
diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.errors.txt b/tests/baselines/reference/anyAssignabilityInInheritance.errors.txt
new file mode 100644
index 0000000000000..0b93ab491ad42
--- /dev/null
+++ b/tests/baselines/reference/anyAssignabilityInInheritance.errors.txt
@@ -0,0 +1,97 @@
+anyAssignabilityInInheritance.ts(67,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+anyAssignabilityInInheritance.ts(75,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== anyAssignabilityInInheritance.ts (2 errors) ====
+ // any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted
+
+ interface I {
+ [x: string]: any;
+ foo: any; // ok, any identical to itself
+ }
+
+ var a: any;
+
+ declare function foo2(x: number): number;
+ declare function foo2(x: any): any;
+ var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
+
+ declare function foo3(x: string): string;
+ declare function foo3(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo4(x: boolean): boolean;
+ declare function foo4(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo5(x: Date): Date;
+ declare function foo5(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo6(x: RegExp): RegExp;
+ declare function foo6(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo7(x: { bar: number }): { bar: number };
+ declare function foo7(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo8(x: number[]): number[];
+ declare function foo8(x: any): any;
+ var r3 = foo3(a); // any
+
+ interface I8 { foo: string }
+ declare function foo9(x: I8): I8;
+ declare function foo9(x: any): any;
+ var r3 = foo3(a); // any
+
+ class A { foo: number; }
+ declare function foo10(x: A): A;
+ declare function foo10(x: any): any;
+ var r3 = foo3(a); // any
+
+ class A2 { foo: T; }
+ declare function foo11(x: A2): A2;
+ declare function foo11(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo12(x: (x) => number): (x) => number;
+ declare function foo12(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo13(x: (x: T) => T): (x: T) => T;
+ declare function foo13(x: any): any;
+ var r3 = foo3(a); // any
+
+ enum E { A }
+ declare function foo14(x: E): E;
+ declare function foo14(x: any): any;
+ var r3 = foo3(a); // any
+
+ function f() { }
+ module f {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var bar = 1;
+ }
+ declare function foo15(x: typeof f): typeof f;
+ declare function foo15(x: any): any;
+ var r3 = foo3(a); // any
+
+ class CC { baz: string }
+ module CC {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var bar = 1;
+ }
+ declare function foo16(x: CC): CC;
+ declare function foo16(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo17(x: Object): Object;
+ declare function foo17(x: any): any;
+ var r3 = foo3(a); // any
+
+ declare function foo18(x: {}): {};
+ declare function foo18(x: any): any;
+ var r3 = foo3(a); // any
\ No newline at end of file
diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types
index 9d3dfd809172f..3ef4dc934f2dc 100644
--- a/tests/baselines/reference/anyAssignabilityInInheritance.types
+++ b/tests/baselines/reference/anyAssignabilityInInheritance.types
@@ -10,10 +10,12 @@ interface I {
foo: any; // ok, any identical to itself
>foo : any
+> : ^^^
}
var a: any;
>a : any
+> : ^^^
declare function foo2(x: number): number;
>foo2 : { (x: number): number; (x: any): any; }
@@ -25,13 +27,17 @@ declare function foo2(x: any): any;
>foo2 : { (x: number): number; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
>r3 : any
+> : ^^^
>foo2(a) : any
+> : ^^^
>foo2 : { (x: number): number; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo3(x: string): string;
>foo3 : { (x: string): string; (x: any): any; }
@@ -43,13 +49,17 @@ declare function foo3(x: any): any;
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo4(x: boolean): boolean;
>foo4 : { (x: boolean): boolean; (x: any): any; }
@@ -61,13 +71,17 @@ declare function foo4(x: any): any;
>foo4 : { (x: boolean): boolean; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo5(x: Date): Date;
>foo5 : { (x: Date): Date; (x: any): any; }
@@ -79,13 +93,17 @@ declare function foo5(x: any): any;
>foo5 : { (x: Date): Date; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo6(x: RegExp): RegExp;
>foo6 : { (x: RegExp): RegExp; (x: any): any; }
@@ -97,13 +115,17 @@ declare function foo6(x: any): any;
>foo6 : { (x: RegExp): RegExp; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo7(x: { bar: number }): { bar: number };
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
@@ -119,13 +141,17 @@ declare function foo7(x: any): any;
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo8(x: number[]): number[];
>foo8 : { (x: number[]): number[]; (x: any): any; }
@@ -137,13 +163,17 @@ declare function foo8(x: any): any;
>foo8 : { (x: number[]): number[]; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
interface I8 { foo: string }
>foo : string
@@ -159,13 +189,17 @@ declare function foo9(x: any): any;
>foo9 : { (x: I8): I8; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
class A { foo: number; }
>A : A
@@ -183,13 +217,17 @@ declare function foo10(x: any): any;
>foo10 : { (x: A): A; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
class A2 { foo: T; }
>A2 : A2
@@ -207,13 +245,17 @@ declare function foo11(x: any): any;
>foo11 : { (x: A2): A2; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo12(x: (x) => number): (x) => number;
>foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; }
@@ -221,19 +263,25 @@ declare function foo12(x: (x) => number): (x) => number;
>x : (x: any) => number
> : ^ ^^^^^^^^^^
>x : any
+> : ^^^
>x : any
+> : ^^^
declare function foo12(x: any): any;
>foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo13(x: (x: T) => T): (x: T) => T;
>foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; }
@@ -249,13 +297,17 @@ declare function foo13(x: any): any;
>foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
enum E { A }
>E : E
@@ -273,13 +325,17 @@ declare function foo14(x: any): any;
>foo14 : { (x: E): E; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
function f() { }
>f : typeof f
@@ -309,13 +365,17 @@ declare function foo15(x: any): any;
>foo15 : { (x: typeof f): typeof f; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
class CC { baz: string }
>CC : CC
@@ -343,13 +403,17 @@ declare function foo16(x: any): any;
>foo16 : { (x: CC): CC; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo17(x: Object): Object;
>foo17 : { (x: Object): Object; (x: any): any; }
@@ -361,13 +425,17 @@ declare function foo17(x: any): any;
>foo17 : { (x: Object): Object; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
declare function foo18(x: {}): {};
>foo18 : { (x: {}): {}; (x: any): any; }
@@ -379,11 +447,15 @@ declare function foo18(x: any): any;
>foo18 : { (x: {}): {}; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>x : any
+> : ^^^
var r3 = foo3(a); // any
>r3 : any
+> : ^^^
>foo3(a) : any
+> : ^^^
>foo3 : { (x: string): string; (x: any): any; }
> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^
>a : any
+> : ^^^
diff --git a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt
new file mode 100644
index 0000000000000..d266c5c5ee604
--- /dev/null
+++ b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt
@@ -0,0 +1,139 @@
+anyAssignableToEveryType2.ts(89,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+anyAssignableToEveryType2.ts(99,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== anyAssignableToEveryType2.ts (2 errors) ====
+ // any is not a subtype of any other types, but is assignable, all the below should work
+
+ interface I {
+ [x: string]: any;
+ foo: any; // ok, any identical to itself
+ }
+
+
+ interface I2 {
+ [x: string]: number;
+ foo: any;
+ }
+
+
+ interface I3 {
+ [x: string]: string;
+ foo: any;
+ }
+
+
+ interface I4 {
+ [x: string]: boolean;
+ foo: any;
+ }
+
+
+ interface I5 {
+ [x: string]: Date;
+ foo: any;
+ }
+
+
+ interface I6 {
+ [x: string]: RegExp;
+ foo: any;
+ }
+
+
+ interface I7 {
+ [x: string]: { bar: number };
+ foo: any;
+ }
+
+
+ interface I8 {
+ [x: string]: number[];
+ foo: any;
+ }
+
+
+ interface I9 {
+ [x: string]: I8;
+ foo: any;
+ }
+
+ class A { foo: number; }
+ interface I10 {
+ [x: string]: A;
+ foo: any;
+ }
+
+ class A2 { foo: T; }
+ interface I11 {
+ [x: string]: A2;
+ foo: any;
+ }
+
+
+ interface I12 {
+ [x: string]: (x) => number;
+ foo: any;
+ }
+
+
+ interface I13 {
+ [x: string]: (x: T) => T;
+ foo: any;
+ }
+
+
+ enum E { A }
+ interface I14 {
+ [x: string]: E;
+ foo: any;
+ }
+
+
+ function f() { }
+ module f {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var bar = 1;
+ }
+ interface I15 {
+ [x: string]: typeof f;
+ foo: any;
+ }
+
+
+ class c { baz: string }
+ module c {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var bar = 1;
+ }
+ interface I16 {
+ [x: string]: typeof c;
+ foo: any;
+ }
+
+
+ interface I17 {
+ [x: string]: T;
+ foo: any;
+ }
+
+
+ interface I18 {
+ [x: string]: U;
+ foo: any;
+ }
+
+
+ interface I19 {
+ [x: string]: Object;
+ foo: any;
+ }
+
+
+ interface I20 {
+ [x: string]: {};
+ foo: any;
+ }
+
\ No newline at end of file
diff --git a/tests/baselines/reference/anyAssignableToEveryType2.types b/tests/baselines/reference/anyAssignableToEveryType2.types
index 00d846e345155..b38a8522e0b01 100644
--- a/tests/baselines/reference/anyAssignableToEveryType2.types
+++ b/tests/baselines/reference/anyAssignableToEveryType2.types
@@ -10,6 +10,7 @@ interface I {
foo: any; // ok, any identical to itself
>foo : any
+> : ^^^
}
@@ -20,6 +21,7 @@ interface I2 {
foo: any;
>foo : any
+> : ^^^
}
@@ -30,6 +32,7 @@ interface I3 {
foo: any;
>foo : any
+> : ^^^
}
@@ -40,6 +43,7 @@ interface I4 {
foo: any;
>foo : any
+> : ^^^
}
@@ -50,6 +54,7 @@ interface I5 {
foo: any;
>foo : any
+> : ^^^
}
@@ -60,6 +65,7 @@ interface I6 {
foo: any;
>foo : any
+> : ^^^
}
@@ -72,6 +78,7 @@ interface I7 {
foo: any;
>foo : any
+> : ^^^
}
@@ -82,6 +89,7 @@ interface I8 {
foo: any;
>foo : any
+> : ^^^
}
@@ -92,6 +100,7 @@ interface I9 {
foo: any;
>foo : any
+> : ^^^
}
class A { foo: number; }
@@ -107,6 +116,7 @@ interface I10 {
foo: any;
>foo : any
+> : ^^^
}
class A2 { foo: T; }
@@ -122,6 +132,7 @@ interface I11 {
foo: any;
>foo : any
+> : ^^^
}
@@ -130,9 +141,11 @@ interface I12 {
>x : string
> : ^^^^^^
>x : any
+> : ^^^
foo: any;
>foo : any
+> : ^^^
}
@@ -145,6 +158,7 @@ interface I13 {
foo: any;
>foo : any
+> : ^^^
}
@@ -161,6 +175,7 @@ interface I14 {
foo: any;
>foo : any
+> : ^^^
}
@@ -187,6 +202,7 @@ interface I15 {
foo: any;
>foo : any
+> : ^^^
}
@@ -215,6 +231,7 @@ interface I16 {
foo: any;
>foo : any
+> : ^^^
}
@@ -225,6 +242,7 @@ interface I17 {
foo: any;
>foo : any
+> : ^^^
}
@@ -235,6 +253,7 @@ interface I18 {
foo: any;
>foo : any
+> : ^^^
}
@@ -245,6 +264,7 @@ interface I19 {
foo: any;
>foo : any
+> : ^^^
}
@@ -255,5 +275,6 @@ interface I20 {
foo: any;
>foo : any
+> : ^^^
}
diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt
index a8263630deaa9..f1784b5ea3182 100644
--- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt
+++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt
@@ -1,9 +1,12 @@
+arrayAssignmentTest5.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'.
Property 'state' is missing in type 'IToken' but required in type 'IStateToken'.
-==== arrayAssignmentTest5.ts (1 errors) ====
+==== arrayAssignmentTest5.ts (2 errors) ====
module Test {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
interface IState {
}
interface IToken {
diff --git a/tests/baselines/reference/arrayBestCommonTypes.errors.txt b/tests/baselines/reference/arrayBestCommonTypes.errors.txt
new file mode 100644
index 0000000000000..16ce6d27d4994
--- /dev/null
+++ b/tests/baselines/reference/arrayBestCommonTypes.errors.txt
@@ -0,0 +1,116 @@
+arrayBestCommonTypes.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+arrayBestCommonTypes.ts(54,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== arrayBestCommonTypes.ts (2 errors) ====
+ module EmptyTypes {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ interface iface { }
+ class base implements iface { }
+ class base2 implements iface { }
+ class derived extends base { }
+
+
+ class f {
+ public voidIfAny(x: boolean, y?: boolean): number;
+ public voidIfAny(x: string, y?: boolean): number;
+ public voidIfAny(x: number, y?: boolean): number;
+ public voidIfAny(x: any, y = false): any { return null; }
+
+ public x() {
+ (this.voidIfAny([4, 2][0]));
+ (this.voidIfAny([4, 2, undefined][0]));
+ (this.voidIfAny([undefined, 2, 4][0]));
+ (this.voidIfAny([null, 2, 4][0]));
+ (this.voidIfAny([2, 4, null][0]));
+ (this.voidIfAny([undefined, 4, null][0]));
+
+ (this.voidIfAny(['', "q"][0]));
+ (this.voidIfAny(['', "q", undefined][0]));
+ (this.voidIfAny([undefined, "q", ''][0]));
+ (this.voidIfAny([null, "q", ''][0]));
+ (this.voidIfAny(["q", '', null][0]));
+ (this.voidIfAny([undefined, '', null][0]));
+
+ (this.voidIfAny([[3, 4], [null]][0][0]));
+
+
+ var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
+ var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
+ var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
+
+ var anyObj: any = null;
+ // Order matters here so test all the variants
+ var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
+ var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
+ var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
+
+ var ifaceObj: iface = null;
+ var baseObj = new base();
+ var base2Obj = new base2();
+
+ var b1 = [baseObj, base2Obj, ifaceObj];
+ var b2 = [base2Obj, baseObj, ifaceObj];
+ var b3 = [baseObj, ifaceObj, base2Obj];
+ var b4 = [ifaceObj, baseObj, base2Obj];
+ }
+ }
+ }
+
+ module NonEmptyTypes {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ interface iface { x: string; }
+ class base implements iface { x: string; y: string; }
+ class base2 implements iface { x: string; z: string; }
+ class derived extends base { a: string; }
+
+
+ class f {
+ public voidIfAny(x: boolean, y?: boolean): number;
+ public voidIfAny(x: string, y?: boolean): number;
+ public voidIfAny(x: number, y?: boolean): number;
+ public voidIfAny(x: any, y = false): any { return null; }
+
+ public x() {
+ (this.voidIfAny([4, 2][0]));
+ (this.voidIfAny([4, 2, undefined][0]));
+ (this.voidIfAny([undefined, 2, 4][0]));
+ (this.voidIfAny([null, 2, 4][0]));
+ (this.voidIfAny([2, 4, null][0]));
+ (this.voidIfAny([undefined, 4, null][0]));
+
+ (this.voidIfAny(['', "q"][0]));
+ (this.voidIfAny(['', "q", undefined][0]));
+ (this.voidIfAny([undefined, "q", ''][0]));
+ (this.voidIfAny([null, "q", ''][0]));
+ (this.voidIfAny(["q", '', null][0]));
+ (this.voidIfAny([undefined, '', null][0]));
+
+ (this.voidIfAny([[3, 4], [null]][0][0]));
+
+
+ var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
+ var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
+ var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
+
+ var anyObj: any = null;
+ // Order matters here so test all the variants
+ var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
+ var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
+ var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
+
+ var ifaceObj: iface = null;
+ var baseObj = new base();
+ var base2Obj = new base2();
+
+ var b1 = [baseObj, base2Obj, ifaceObj];
+ var b2 = [base2Obj, baseObj, ifaceObj];
+ var b3 = [baseObj, ifaceObj, base2Obj];
+ var b4 = [ifaceObj, baseObj, base2Obj];
+ }
+ }
+ }
+
+
\ No newline at end of file
diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types
index 2ed7f2c9d8fa3..2355370b3113b 100644
--- a/tests/baselines/reference/arrayBestCommonTypes.types
+++ b/tests/baselines/reference/arrayBestCommonTypes.types
@@ -53,6 +53,7 @@ module EmptyTypes {
>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
>x : any
+> : ^^^
>y : boolean
> : ^^^^^^^
>false : false
@@ -495,6 +496,7 @@ module EmptyTypes {
var anyObj: any = null;
>anyObj : any
+> : ^^^
// Order matters here so test all the variants
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
@@ -525,7 +527,9 @@ module EmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
@@ -539,7 +543,9 @@ module EmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
@@ -583,7 +589,9 @@ module EmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
@@ -735,6 +743,7 @@ module NonEmptyTypes {
>voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; }
> : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^
>x : any
+> : ^^^
>y : boolean
> : ^^^^^^^
>false : false
@@ -1177,6 +1186,7 @@ module NonEmptyTypes {
var anyObj: any = null;
>anyObj : any
+> : ^^^
// Order matters here so test all the variants
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
@@ -1207,7 +1217,9 @@ module NonEmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
@@ -1221,7 +1233,9 @@ module NonEmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
@@ -1265,7 +1279,9 @@ module NonEmptyTypes {
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
> : ^^^^^^^^^^^^^^^^^^^^^^
>x : any
+> : ^^^
>anyObj : any
+> : ^^^
>y : string
> : ^^^^^^
>'a' : "a"
diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt
index 1e27fe363487b..6dfffc9d65b61 100644
--- a/tests/baselines/reference/arrowFunctionContexts.errors.txt
+++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt
@@ -1,12 +1,15 @@
arrowFunctionContexts.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
arrowFunctionContexts.ts(30,9): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values.
arrowFunctionContexts.ts(31,16): error TS2332: 'this' cannot be referenced in current location.
+arrowFunctionContexts.ts(35,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+arrowFunctionContexts.ts(41,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrowFunctionContexts.ts(43,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
arrowFunctionContexts.ts(71,13): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values.
arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in current location.
+arrowFunctionContexts.ts(76,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== arrowFunctionContexts.ts (6 errors) ====
+==== arrowFunctionContexts.ts (9 errors) ====
// Arrow function used in with statement
with (window) {
~~~~~~~~~~~~~
@@ -48,12 +51,16 @@ arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in cu
// Arrow function as module variable initializer
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var a = (s) => '';
var b = (s) => s;
}
// Repeat above for module members that are functions? (necessary to redo all of them?)
module M2 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// Arrow function used in with statement
with (window) {
~~~~~~~~~~~~~
@@ -95,6 +102,8 @@ arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in cu
// Arrow function as module variable initializer
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var a = (s) => '';
var b = (s) => s;
}
diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt
index 925b762414f79..b5211462da33a 100644
--- a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt
+++ b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt
@@ -1,14 +1,18 @@
+arrowFunctionsMissingTokens.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrowFunctionsMissingTokens.ts(2,16): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(4,22): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(6,17): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(8,36): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(10,42): error TS1005: '=>' expected.
+arrowFunctionsMissingTokens.ts(13,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+arrowFunctionsMissingTokens.ts(14,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrowFunctionsMissingTokens.ts(15,23): error TS1005: '{' expected.
arrowFunctionsMissingTokens.ts(17,29): error TS1005: '{' expected.
arrowFunctionsMissingTokens.ts(19,24): error TS1005: '{' expected.
arrowFunctionsMissingTokens.ts(21,43): error TS1005: '{' expected.
arrowFunctionsMissingTokens.ts(23,49): error TS1005: '{' expected.
arrowFunctionsMissingTokens.ts(25,23): error TS1005: '{' expected.
+arrowFunctionsMissingTokens.ts(28,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrowFunctionsMissingTokens.ts(29,23): error TS1109: Expression expected.
arrowFunctionsMissingTokens.ts(31,29): error TS1109: Expression expected.
arrowFunctionsMissingTokens.ts(33,24): error TS1109: Expression expected.
@@ -17,15 +21,19 @@ arrowFunctionsMissingTokens.ts(37,49): error TS1109: Expression expected.
arrowFunctionsMissingTokens.ts(39,23): error TS1109: Expression expected.
arrowFunctionsMissingTokens.ts(40,5): error TS1128: Declaration or statement expected.
arrowFunctionsMissingTokens.ts(41,1): error TS1128: Declaration or statement expected.
+arrowFunctionsMissingTokens.ts(43,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
arrowFunctionsMissingTokens.ts(44,14): error TS1109: Expression expected.
arrowFunctionsMissingTokens.ts(46,21): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(48,14): error TS2304: Cannot find name 'x'.
arrowFunctionsMissingTokens.ts(50,35): error TS1005: '=>' expected.
arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
+arrowFunctionsMissingTokens.ts(55,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== arrowFunctionsMissingTokens.ts (24 errors) ====
+==== arrowFunctionsMissingTokens.ts (30 errors) ====
module missingArrowsWithCurly {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var a = () { };
~
!!! error TS1005: '=>' expected.
@@ -48,7 +56,11 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
}
module missingCurliesWithArrow {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
module withStatement {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var a = () => var k = 10;};
~~~
!!! error TS1005: '{' expected.
@@ -75,6 +87,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
}
module withoutStatement {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var a = () => };
~
!!! error TS1109: Expression expected.
@@ -106,6 +120,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
!!! error TS1128: Declaration or statement expected.
module ce_nEst_pas_une_arrow_function {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var a = ();
~
!!! error TS1109: Expression expected.
@@ -128,6 +144,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected.
}
module okay {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
var a = () => { };
var b = (): void => { }
diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt
new file mode 100644
index 0000000000000..a8ef0e30c40f6
--- /dev/null
+++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt
@@ -0,0 +1,15 @@
+asiPreventsParsingAsAmbientExternalModule02.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== asiPreventsParsingAsAmbientExternalModule02.ts (1 errors) ====
+ var declare: number;
+ var module: string;
+
+ module container {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ declare // this is the identifier 'declare'
+ module // this is the identifier 'module'
+ "my external module" // this is just a string
+ { } // this is a block body
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt
index aa2cfd5c1e952..68d6dba6e37c3 100644
--- a/tests/baselines/reference/assignToExistingClass.errors.txt
+++ b/tests/baselines/reference/assignToExistingClass.errors.txt
@@ -1,8 +1,11 @@
+assignToExistingClass.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignToExistingClass.ts(8,13): error TS2629: Cannot assign to 'Mocked' because it is a class.
-==== assignToExistingClass.ts (1 errors) ====
+==== assignToExistingClass.ts (2 errors) ====
module Test {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Mocked {
myProp: string;
}
diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt
index c91ddb00897e1..8a7ae753e9672 100644
--- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt
@@ -1,3 +1,5 @@
+assignmentCompatWithCallSignatures4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatWithCallSignatures4.ts(9,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithCallSignatures4.ts(45,9): error TS2322: Type '(x: number) => string[]' is not assignable to type '(x: T) => U[]'.
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
@@ -47,6 +49,7 @@ assignmentCompatWithCallSignatures4.ts(74,9): error TS2322: Type '(x: { a: strin
Types of property 'a' are incompatible.
Type 'T' is not assignable to type 'string'.
Type 'Base' is not assignable to type 'string'.
+assignmentCompatWithCallSignatures4.ts(85,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithCallSignatures4.ts(89,9): error TS2322: Type '(x: T) => string[]' is not assignable to type '(x: T) => T[]'.
Type 'string[]' is not assignable to type 'T[]'.
Type 'string' is not assignable to type 'T'.
@@ -63,16 +66,20 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
-==== assignmentCompatWithCallSignatures4.ts (15 errors) ====
+==== assignmentCompatWithCallSignatures4.ts (18 errors) ====
// These are mostly permitted with the current loose rules. All ok unless otherwise noted.
module Errors {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class OtherDerived extends Base { bing: string; }
module WithNonGenericSignaturesInBaseType {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// target type with non-generic call signatures
var a2: (x: number) => string[];
var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2;
@@ -211,6 +218,8 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s
}
module WithGenericSignaturesInBaseType {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// target type has generic call signature
var a2: (x: T) => T[];
var b2: (x: T) => string[];
diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt
index 9c654f2e09c20..fa621d063db25 100644
--- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt
@@ -1,3 +1,5 @@
+assignmentCompatWithConstructSignatures4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatWithConstructSignatures4.ts(9,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithConstructSignatures4.ts(45,9): error TS2322: Type 'new (x: number) => string[]' is not assignable to type 'new (x: T) => U[]'.
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'number'.
@@ -63,6 +65,7 @@ assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x:
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'.
Type '(a: any) => any' provides no match for the signature 'new (a: T): T'.
+assignmentCompatWithConstructSignatures4.ts(85,5): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithConstructSignatures4.ts(89,9): error TS2322: Type 'new (x: T) => string[]' is not assignable to type 'new (x: T) => T[]'.
Type 'string[]' is not assignable to type 'T[]'.
Type 'string' is not assignable to type 'T'.
@@ -79,16 +82,20 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x
'T' could be instantiated with an arbitrary type which could be unrelated to 'string'.
-==== assignmentCompatWithConstructSignatures4.ts (19 errors) ====
+==== assignmentCompatWithConstructSignatures4.ts (22 errors) ====
// checking assignment compatibility relations for function types.
module Errors {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class OtherDerived extends Base { bing: string; }
module WithNonGenericSignaturesInBaseType {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// target type with non-generic call signatures
var a2: new (x: number) => string[];
var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived2;
@@ -247,6 +254,8 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x
}
module WithGenericSignaturesInBaseType {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// target type has generic call signature
var a2: new (x: T) => T[];
var b2: new (x: T) => string[];
diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt
index d92429833fb5a..59108f3d0e47c 100644
--- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt
@@ -1,7 +1,9 @@
+assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
Target signature provides too few arguments. Expected 1 or more, but got 0.
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
Target signature provides too few arguments. Expected 2 or more, but got 1.
+assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(39,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '() => T'.
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
@@ -91,16 +93,19 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(91,9): error
Types of parameters 'x' and 'x' are incompatible.
Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
+assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(95,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
Target signature provides too few arguments. Expected 1 or more, but got 0.
assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
Target signature provides too few arguments. Expected 2 or more, but got 1.
-==== assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ====
+==== assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (32 errors) ====
// call signatures in derived types must have the same or fewer optional parameters as the target for assignment
module ClassTypeParam {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base {
a: () => T;
a2: (x?: T) => T;
@@ -143,6 +148,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro
}
module GenericSignaturesInvalid {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base2 {
a: () => T;
@@ -336,6 +343,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro
}
module GenericSignaturesValid {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base2 {
a: () => T;
diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
index f990fc308dcb9..3459fb10be40b 100644
--- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt
@@ -4,6 +4,7 @@ assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assig
assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
'number' index signatures are incompatible.
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
+assignmentCompatWithNumericIndexer.ts(20,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'.
'number' index signatures are incompatible.
Type 'Derived' is not assignable to type 'T'.
@@ -22,7 +23,7 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not as
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
-==== assignmentCompatWithNumericIndexer.ts (6 errors) ====
+==== assignmentCompatWithNumericIndexer.ts (7 errors) ====
// Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
@@ -52,6 +53,8 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
module Generics {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class A {
[x: number]: T;
}
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers.errors.txt
new file mode 100644
index 0000000000000..78826b6dd81a3
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.errors.txt
@@ -0,0 +1,94 @@
+assignmentCompatWithObjectMembers.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatWithObjectMembers.ts(45,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatWithObjectMembers.ts (2 errors) ====
+ // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
+ // no errors expected
+
+ module SimpleTypes {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ class S { foo: string; }
+ class T { foo: string; }
+ var s: S;
+ var t: T;
+
+ interface S2 { foo: string; }
+ interface T2 { foo: string; }
+ var s2: S2;
+ var t2: T2;
+
+ var a: { foo: string; }
+ var b: { foo: string; }
+
+ var a2 = { foo: '' };
+ var b2 = { foo: '' };
+
+ s = t;
+ t = s;
+ s = s2;
+ s = a2;
+
+ s2 = t2;
+ t2 = s2;
+ s2 = t;
+ s2 = b;
+ s2 = a2;
+
+ a = b;
+ b = a;
+ a = s;
+ a = s2;
+ a = a2;
+
+ a2 = b2;
+ b2 = a2;
+ a2 = b;
+ a2 = t2;
+ a2 = t;
+ }
+
+ module ObjectTypes {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ class S { foo: S; }
+ class T { foo: T; }
+ var s: S;
+ var t: T;
+
+ interface S2 { foo: S2; }
+ interface T2 { foo: T2; }
+ var s2: S2;
+ var t2: T2;
+
+ var a: { foo: typeof a; }
+ var b: { foo: typeof b; }
+
+ var a2 = { foo: a2 };
+ var b2 = { foo: b2 };
+
+ s = t;
+ t = s;
+ s = s2;
+ s = a2;
+
+ s2 = t2;
+ t2 = s2;
+ s2 = t;
+ s2 = b;
+ s2 = a2;
+
+ a = b;
+ b = a;
+ a = s;
+ a = s2;
+ a = a2;
+
+ a2 = b2;
+ b2 = a2;
+ a2 = b;
+ a2 = t2;
+ a2 = t;
+
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types
index 415c4c29ef94f..606738c45045c 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types
@@ -287,17 +287,23 @@ module ObjectTypes {
var a2 = { foo: a2 };
>a2 : any
+> : ^^^
>{ foo: a2 } : { foo: any; }
> : ^^^^^^^^^^^^^
>foo : any
+> : ^^^
>a2 : any
+> : ^^^
var b2 = { foo: b2 };
>b2 : any
+> : ^^^
>{ foo: b2 } : { foo: any; }
> : ^^^^^^^^^^^^^
>foo : any
+> : ^^^
>b2 : any
+> : ^^^
s = t;
>s = t : T
@@ -325,9 +331,11 @@ module ObjectTypes {
s = a2;
>s = a2 : any
+> : ^^^
>s : S
> : ^
>a2 : any
+> : ^^^
s2 = t2;
>s2 = t2 : T2
@@ -363,9 +371,11 @@ module ObjectTypes {
s2 = a2;
>s2 = a2 : any
+> : ^^^
>s2 : S2
> : ^^
>a2 : any
+> : ^^^
a = b;
>a = b : { foo: typeof b; }
@@ -401,24 +411,33 @@ module ObjectTypes {
a = a2;
>a = a2 : any
+> : ^^^
>a : { foo: typeof a; }
> : ^^^^^^^ ^^^
>a2 : any
+> : ^^^
a2 = b2;
>a2 = b2 : any
+> : ^^^
>a2 : any
+> : ^^^
>b2 : any
+> : ^^^
b2 = a2;
>b2 = a2 : any
+> : ^^^
>b2 : any
+> : ^^^
>a2 : any
+> : ^^^
a2 = b;
>a2 = b : { foo: typeof b; }
> : ^^^^^^^ ^^^
>a2 : any
+> : ^^^
>b : { foo: typeof b; }
> : ^^^^^^^ ^^^
@@ -426,6 +445,7 @@ module ObjectTypes {
>a2 = t2 : T2
> : ^^
>a2 : any
+> : ^^^
>t2 : T2
> : ^^
@@ -433,6 +453,7 @@ module ObjectTypes {
>a2 = t : T
> : ^
>a2 : any
+> : ^^^
>t : T
> : ^
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
index 72885e82376a8..5b967ab895833 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt
@@ -1,3 +1,4 @@
+assignmentCompatWithObjectMembers4.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'.
Types of property 'foo' are incompatible.
Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
@@ -37,6 +38,7 @@ assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assi
assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'.
Types of property 'foo' are incompatible.
Property 'bar' is missing in type 'Derived2' but required in type 'Derived'.
+assignmentCompatWithObjectMembers4.ts(48,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'.
Types of property 'foo' are incompatible.
Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
@@ -51,10 +53,12 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
Property 'baz' is missing in type 'Base' but required in type 'Derived2'.
-==== assignmentCompatWithObjectMembers4.ts (17 errors) ====
+==== assignmentCompatWithObjectMembers4.ts (19 errors) ====
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M
module OnlyDerived {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Base { baz: string; }
@@ -165,6 +169,8 @@ assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }'
}
module WithBase {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Base { baz: string; }
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
index 1a1a101200420..3936f36cee668 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt
@@ -1,3 +1,4 @@
+assignmentCompatWithObjectMembersAccessibility.ts(3,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'E' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'.
@@ -14,6 +15,7 @@ assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I'
Property 'foo' is private in type 'E' but not in type 'I'.
assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'.
Property 'foo' is private in type 'E' but not in type 'D'.
+assignmentCompatWithObjectMembersAccessibility.ts(56,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'.
Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'.
assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'.
@@ -48,10 +50,12 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
Property 'foo' is private in type 'E' but not in type 'D'.
-==== assignmentCompatWithObjectMembersAccessibility.ts (24 errors) ====
+==== assignmentCompatWithObjectMembersAccessibility.ts (26 errors) ====
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
module TargetIsPublic {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
class Base {
public foo: string;
@@ -129,6 +133,8 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D'
}
module TargetIsPublic {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
class Base {
private foo: string;
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt
index 6182370720517..d0b5ee6f8cfc2 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt
@@ -1,3 +1,5 @@
+assignmentCompatWithObjectMembersOptionality.ts(7,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatWithObjectMembersOptionality.ts(49,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C'.
Property 'opt' is optional in type 'D' but required in type 'C'.
assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C'.
@@ -12,7 +14,7 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'.
-==== assignmentCompatWithObjectMembersOptionality.ts (6 errors) ====
+==== assignmentCompatWithObjectMembersOptionality.ts (8 errors) ====
// Derived member is not optional but base member is, should be ok
class Base { foo: string; }
@@ -20,6 +22,8 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
class Derived2 extends Derived { baz: string; }
module TargetHasOptional {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
interface C {
opt?: Base
@@ -62,6 +66,8 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is
}
module SourceHasOptional {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
interface C {
opt: Base
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt
index f1ba1224c455d..447a01a4dae36 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt
@@ -1,3 +1,4 @@
+assignmentCompatWithObjectMembersOptionality2.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersOptionality2.ts(33,5): error TS2559: Type 'D' has no properties in common with type 'C'.
assignmentCompatWithObjectMembersOptionality2.ts(34,5): error TS2559: Type 'E' has no properties in common with type 'C'.
assignmentCompatWithObjectMembersOptionality2.ts(35,5): error TS2559: Type 'F' has no properties in common with type 'C'.
@@ -7,6 +8,7 @@ assignmentCompatWithObjectMembersOptionality2.ts(38,5): error TS2559: Type 'F' h
assignmentCompatWithObjectMembersOptionality2.ts(39,5): error TS2559: Type 'D' has no properties in common with type '{ opt?: Base; }'.
assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'.
assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'.
+assignmentCompatWithObjectMembersOptionality2.ts(50,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2741: Property 'opt' is missing in type 'D' but required in type 'C'.
assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2741: Property 'opt' is missing in type 'E' but required in type 'C'.
assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2741: Property 'opt' is missing in type 'F' but required in type 'C'.
@@ -18,7 +20,7 @@ assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2741: Property '
assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property 'opt' is missing in type 'F' but required in type '{ opt: Base; }'.
-==== assignmentCompatWithObjectMembersOptionality2.ts (18 errors) ====
+==== assignmentCompatWithObjectMembersOptionality2.ts (20 errors) ====
// M is optional and S contains no property with the same name as M
// N is optional and T contains no property with the same name as N
@@ -27,6 +29,8 @@ assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property '
class Derived2 extends Derived { baz: string; }
module TargetHasOptional {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
interface C {
opt?: Base
@@ -87,6 +91,8 @@ assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property '
}
module SourceHasOptional {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
// targets
interface C {
opt: Base
diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt
index 6c85c052e0336..6e552101a108b 100644
--- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt
@@ -1,3 +1,4 @@
+assignmentCompatWithObjectMembersStringNumericNames.ts(4,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2741: Property ''1'' is missing in type 'T' but required in type 'S'.
assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2741: Property ''1.'' is missing in type 'S' but required in type 'T'.
assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S'.
@@ -14,6 +15,7 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2741: Prop
assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2741: Property ''1.0'' is missing in type '{ '1': string; }' but required in type '{ '1.0': string; }'.
assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type '{ '1': string; }'.
assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2741: Property ''1.0'' is missing in type 'T' but required in type '{ '1.0': string; }'.
+assignmentCompatWithObjectMembersStringNumericNames.ts(45,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S'.
assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2741: Property ''1'' is missing in type '{ '1.0': string; }' but required in type 'S2'.
assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2741: Property ''1.'' is missing in type '{ 1: string; baz?: string; }' but required in type '{ '1.': string; bar?: string; }'.
@@ -29,11 +31,13 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2741: Prop
assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2741: Property ''1.0'' is missing in type 'T' but required in type '{ '1.0': string; }'.
-==== assignmentCompatWithObjectMembersStringNumericNames.ts (29 errors) ====
+==== assignmentCompatWithObjectMembersStringNumericNames.ts (31 errors) ====
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M
// string named numeric properties work correctly, errors below unless otherwise noted
module JustStrings {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class S { '1': string; }
class T { '1.': string; }
var s: S;
@@ -123,6 +127,8 @@ assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2741: Prop
}
module NumbersAndStrings {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class S { '1': string; }
class T { 1: string; }
var s: S;
diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
index ea6734d5a8622..44ce794ef751b 100644
--- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt
@@ -4,6 +4,7 @@ assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assign
assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
+assignmentCompatWithStringIndexer.ts(21,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
@@ -28,7 +29,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
-==== assignmentCompatWithStringIndexer.ts (8 errors) ====
+==== assignmentCompatWithStringIndexer.ts (9 errors) ====
// index signatures must be compatible in assignments
interface Base { foo: string; }
@@ -59,6 +60,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
module Generics {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
class A {
[x: string]: T;
}
diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
index c330a9fa38b33..d7a6285114118 100644
--- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
+++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt
@@ -4,6 +4,7 @@ assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assig
assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
'string' index signatures are incompatible.
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
+assignmentCompatWithStringIndexer2.ts(21,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'.
'string' index signatures are incompatible.
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
@@ -28,7 +29,7 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
-==== assignmentCompatWithStringIndexer2.ts (8 errors) ====
+==== assignmentCompatWithStringIndexer2.ts (9 errors) ====
// index signatures must be compatible in assignments
interface Base { foo: string; }
@@ -59,6 +60,8 @@ assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not as
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
module Generics {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
interface A {
[x: string]: T;
}
diff --git a/tests/baselines/reference/assignmentCompatability1.errors.txt b/tests/baselines/reference/assignmentCompatability1.errors.txt
new file mode 100644
index 0000000000000..b9a357e747163
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatability1.errors.txt
@@ -0,0 +1,18 @@
+assignmentCompatability1.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability1.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatability1.ts (2 errors) ====
+ module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
+ export var __val__obj4 = obj4;
+ }
+ module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var aa = {};;
+ export var __val__aa = aa;
+ }
+ __test2__.__val__aa = __test1__.__val__obj4
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt
index 73418f7911fac..a1cc9070a56b2 100644
--- a/tests/baselines/reference/assignmentCompatability11.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability11.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability11.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability11.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number'.
-==== assignmentCompatability11.ts (1 errors) ====
+==== assignmentCompatability11.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: 1};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt
index 4156d20c5a293..51bdab4bff086 100644
--- a/tests/baselines/reference/assignmentCompatability12.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability12.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability12.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability12.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string'.
-==== assignmentCompatability12.ts (1 errors) ====
+==== assignmentCompatability12.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: "1"};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt
index 99b3a3e41f35d..920ea45abfcdc 100644
--- a/tests/baselines/reference/assignmentCompatability13.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability13.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability13.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability13.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'.
-==== assignmentCompatability13.ts (1 errors) ====
+==== assignmentCompatability13.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: "1"};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt
index f32b599604baa..0bb119dd877ac 100644
--- a/tests/baselines/reference/assignmentCompatability14.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability14.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability14.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability14.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean'.
-==== assignmentCompatability14.ts (1 errors) ====
+==== assignmentCompatability14.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: true};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt
index a3726fb2e9fa8..3b3667ea1c63c 100644
--- a/tests/baselines/reference/assignmentCompatability15.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability15.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability15.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability15.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'boolean'.
-==== assignmentCompatability15.ts (1 errors) ====
+==== assignmentCompatability15.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: true};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt
index 060dd9436aae3..2db9ea103e5cf 100644
--- a/tests/baselines/reference/assignmentCompatability16.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability16.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability16.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability16.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'any[]'.
-==== assignmentCompatability16.ts (1 errors) ====
+==== assignmentCompatability16.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: [1]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt
index 5b644b0f0142f..995a40b797d9d 100644
--- a/tests/baselines/reference/assignmentCompatability17.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability17.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability17.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability17.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'any[]'.
-==== assignmentCompatability17.ts (1 errors) ====
+==== assignmentCompatability17.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: [1]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt
index dd7d852885890..285f7297fed34 100644
--- a/tests/baselines/reference/assignmentCompatability18.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability18.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability18.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability18.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'number[]'.
-==== assignmentCompatability18.ts (1 errors) ====
+==== assignmentCompatability18.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: [1]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt
index 111f623baf545..c3e0454f95c01 100644
--- a/tests/baselines/reference/assignmentCompatability19.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability19.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability19.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability19.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number[]'.
-==== assignmentCompatability19.ts (1 errors) ====
+==== assignmentCompatability19.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: [1]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability2.errors.txt b/tests/baselines/reference/assignmentCompatability2.errors.txt
new file mode 100644
index 0000000000000..39620ad064df6
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatability2.errors.txt
@@ -0,0 +1,18 @@
+assignmentCompatability2.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability2.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatability2.ts (2 errors) ====
+ module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
+ export var __val__obj4 = obj4;
+ }
+ module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var aa:{};;
+ export var __val__aa = aa;
+ }
+ __test2__.__val__aa = __test1__.__val__obj4
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt
index 249ded8a2dcc4..c408fe1fd8550 100644
--- a/tests/baselines/reference/assignmentCompatability20.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability20.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability20.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability20.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string[]'.
-==== assignmentCompatability20.ts (1 errors) ====
+==== assignmentCompatability20.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: ["1"]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt
index cdee4dd3d2e06..f37708746ec33 100644
--- a/tests/baselines/reference/assignmentCompatability21.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability21.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability21.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability21.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'string[]'.
-==== assignmentCompatability21.ts (1 errors) ====
+==== assignmentCompatability21.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: ["1"]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt
index da9cd1e4c5759..e3e26c9bd077d 100644
--- a/tests/baselines/reference/assignmentCompatability22.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability22.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability22.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability22.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean[]'.
-==== assignmentCompatability22.ts (1 errors) ====
+==== assignmentCompatability22.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {one: [true]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt
index 0b3b422b60c5d..ee6e5643d77ad 100644
--- a/tests/baselines/reference/assignmentCompatability23.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability23.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability23.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability23.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'boolean[]'.
-==== assignmentCompatability23.ts (1 errors) ====
+==== assignmentCompatability23.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = {two: [true]};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt
index 7298208241e28..3b981b3c45828 100644
--- a/tests/baselines/reference/assignmentCompatability24.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability24.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability24.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability24.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'.
Type 'interfaceWithPublicAndOptional' provides no match for the signature '(a: Tstring): Tstring'.
-==== assignmentCompatability24.ts (1 errors) ====
+==== assignmentCompatability24.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj = function f(a: Tstring) { return a; };;
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt
index 8c1a2431ba6a3..28d6201b59bb6 100644
--- a/tests/baselines/reference/assignmentCompatability25.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability25.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability25.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability25.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'.
Types of property 'two' are incompatible.
Type 'string' is not assignable to type 'number'.
-==== assignmentCompatability25.ts (1 errors) ====
+==== assignmentCompatability25.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{two:number;};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt
index 014f618d473d8..3bbe0a9a5c8c1 100644
--- a/tests/baselines/reference/assignmentCompatability26.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability26.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability26.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability26.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string'.
-==== assignmentCompatability26.ts (1 errors) ====
+==== assignmentCompatability26.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:string;};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt
index 1dae5a7495c23..969a310a35f3b 100644
--- a/tests/baselines/reference/assignmentCompatability27.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability27.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability27.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability27.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'.
Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'.
-==== assignmentCompatability27.ts (1 errors) ====
+==== assignmentCompatability27.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{two:string;};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt
index fda541dc3f37f..8ab437417b1d4 100644
--- a/tests/baselines/reference/assignmentCompatability28.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability28.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability28.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability28.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean'.
-==== assignmentCompatability28.ts (1 errors) ====
+==== assignmentCompatability28.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:boolean;};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt
index 3e9056460ad10..c0cdc11e309fc 100644
--- a/tests/baselines/reference/assignmentCompatability29.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability29.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability29.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability29.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'any[]'.
-==== assignmentCompatability29.ts (1 errors) ====
+==== assignmentCompatability29.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:any[];};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability3.errors.txt b/tests/baselines/reference/assignmentCompatability3.errors.txt
new file mode 100644
index 0000000000000..29d5f059649da
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatability3.errors.txt
@@ -0,0 +1,18 @@
+assignmentCompatability3.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability3.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatability3.ts (2 errors) ====
+ module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
+ export var __val__obj4 = obj4;
+ }
+ module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var obj = {one: 1};
+ export var __val__obj = obj;
+ }
+ __test2__.__val__obj = __test1__.__val__obj4
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt
index 4dfa8802383c3..479def51f9e9d 100644
--- a/tests/baselines/reference/assignmentCompatability30.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability30.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability30.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability30.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'number[]'.
-==== assignmentCompatability30.ts (1 errors) ====
+==== assignmentCompatability30.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:number[];};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt
index 680c03f7e7d3d..8fe27163cf03f 100644
--- a/tests/baselines/reference/assignmentCompatability31.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability31.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability31.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability31.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'string[]'.
-==== assignmentCompatability31.ts (1 errors) ====
+==== assignmentCompatability31.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:string[];};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt
index dd1d9838a4737..fc0520d89c59f 100644
--- a/tests/baselines/reference/assignmentCompatability32.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability32.errors.txt
@@ -1,14 +1,20 @@
+assignmentCompatability32.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability32.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'.
Types of property 'one' are incompatible.
Type 'number' is not assignable to type 'boolean[]'.
-==== assignmentCompatability32.ts (1 errors) ====
+==== assignmentCompatability32.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{one:boolean[];};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt
index ca248ffd6f4fc..a47c39fedab46 100644
--- a/tests/baselines/reference/assignmentCompatability33.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability33.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability33.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability33.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'.
Type 'interfaceWithPublicAndOptional' provides no match for the signature '(a: Tstring): Tstring'.
-==== assignmentCompatability33.ts (1 errors) ====
+==== assignmentCompatability33.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj: { (a: Tstring): Tstring; };
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt
index 5519c0c36d890..a6c20a2928a0b 100644
--- a/tests/baselines/reference/assignmentCompatability34.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability34.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability34.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability34.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'.
Type 'interfaceWithPublicAndOptional' provides no match for the signature '(a: Tnumber): Tnumber'.
-==== assignmentCompatability34.ts (1 errors) ====
+==== assignmentCompatability34.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var obj: { (a:Tnumber):Tnumber;};
export var __val__obj = obj;
}
diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt
index 2a1082e2ffa2c..c03b1163da47f 100644
--- a/tests/baselines/reference/assignmentCompatability35.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability35.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability35.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability35.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [index: number]: number; }'.
Index signature for type 'number' is missing in type 'interfaceWithPublicAndOptional'.
-==== assignmentCompatability35.ts (1 errors) ====
+==== assignmentCompatability35.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{[index:number]:number;};;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt
new file mode 100644
index 0000000000000..449a610965ac1
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatability36.errors.txt
@@ -0,0 +1,18 @@
+assignmentCompatability36.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability36.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatability36.ts (2 errors) ====
+ module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
+ export var __val__obj4 = obj4;
+ }
+ module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var aa:{[index:string]:any;};;
+ export var __val__aa = aa;
+ }
+ __test2__.__val__aa = __test1__.__val__obj4
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt
index eeeaf566b53cc..e4c3aa1ffa545 100644
--- a/tests/baselines/reference/assignmentCompatability37.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability37.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability37.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability37.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'.
Type 'interfaceWithPublicAndOptional' provides no match for the signature 'new (param: Tnumber): any'.
-==== assignmentCompatability37.ts (1 errors) ====
+==== assignmentCompatability37.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{ new (param: Tnumber); };;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt
index d8c6d710d732f..d15795cbd51c3 100644
--- a/tests/baselines/reference/assignmentCompatability38.errors.txt
+++ b/tests/baselines/reference/assignmentCompatability38.errors.txt
@@ -1,13 +1,19 @@
+assignmentCompatability38.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability38.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'.
Type 'interfaceWithPublicAndOptional' provides no match for the signature 'new (param: Tstring): any'.
-==== assignmentCompatability38.ts (1 errors) ====
+==== assignmentCompatability38.ts (3 errors) ====
module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var aa:{ new (param: Tstring); };;
export var __val__aa = aa;
}
diff --git a/tests/baselines/reference/assignmentCompatability4.errors.txt b/tests/baselines/reference/assignmentCompatability4.errors.txt
new file mode 100644
index 0000000000000..11794503078ad
--- /dev/null
+++ b/tests/baselines/reference/assignmentCompatability4.errors.txt
@@ -0,0 +1,18 @@
+assignmentCompatability4.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentCompatability4.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== assignmentCompatability4.ts (2 errors) ====
+ module __test1__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };;
+ export var __val__obj4 = obj4;
+ }
+ module __test2__ {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export var aa:{one:number;};;
+ export var __val__aa = aa;
+ }
+ __test2__.__val__aa = __test1__.__val__obj4
\ No newline at end of file
diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt
index cd5a9761cef79..b7cb73a22e7e1 100644
--- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt
+++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt
@@ -3,6 +3,7 @@ assignmentLHSIsValue.ts(7,13): error TS2364: The left-hand side of an assignment
assignmentLHSIsValue.ts(8,21): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
assignmentLHSIsValue.ts(11,18): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
assignmentLHSIsValue.ts(13,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
+assignmentLHSIsValue.ts(16,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentLHSIsValue.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
assignmentLHSIsValue.ts(19,1): error TS2629: Cannot assign to 'C' because it is a class.
assignmentLHSIsValue.ts(22,1): error TS2628: Cannot assign to 'E' because it is an enum.
@@ -39,7 +40,7 @@ assignmentLHSIsValue.ts(69,1): error TS2364: The left-hand side of an assignment
assignmentLHSIsValue.ts(70,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
-==== assignmentLHSIsValue.ts (39 errors) ====
+==== assignmentLHSIsValue.ts (40 errors) ====
// expected error for all the LHS of assignments
var value: any;
@@ -66,6 +67,8 @@ assignmentLHSIsValue.ts(70,1): error TS2364: The left-hand side of an assignment
// identifiers: module, class, enum, function
module M { export var a; }
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
M = value;
~
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt
index 168cb6b653be7..a03153ff96edc 100644
--- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt
+++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt
@@ -1,10 +1,13 @@
assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'.
+assignmentToParenthesizedIdentifiers.ts(7,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'.
assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'.
assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'.
assignmentToParenthesizedIdentifiers.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
assignmentToParenthesizedIdentifiers.ts(18,2): error TS2631: Cannot assign to 'M' because it is a namespace.
+assignmentToParenthesizedIdentifiers.ts(20,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+assignmentToParenthesizedIdentifiers.ts(21,12): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
assignmentToParenthesizedIdentifiers.ts(25,5): error TS2631: Cannot assign to 'M3' because it is a namespace.
assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'.
assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'.
@@ -24,7 +27,7 @@ assignmentToParenthesizedIdentifiers.ts(69,1): error TS2629: Cannot assign to 'C
assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C' because it is a class.
-==== assignmentToParenthesizedIdentifiers.ts (24 errors) ====
+==== assignmentToParenthesizedIdentifiers.ts (27 errors) ====
var x: number;
x = 3; // OK
(x) = 3; // OK
@@ -36,6 +39,8 @@ assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C
!!! error TS2322: Type 'string' is not assignable to type 'number'.
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var y: number;
}
M.y = 3; // OK
@@ -59,7 +64,11 @@ assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
module M2 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export module M3 {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export var x: number;
}
diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt b/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt
index d31f2dc0c77fc..b8a6124468e32 100644
--- a/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt
+++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt
@@ -1,7 +1,8 @@
asyncAwaitIsolatedModules_es2017.ts(1,27): error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
+asyncAwaitIsolatedModules_es2017.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== asyncAwaitIsolatedModules_es2017.ts (1 errors) ====
+==== asyncAwaitIsolatedModules_es2017.ts (2 errors) ====
import { MyPromise } from "missing";
~~~~~~~~~
!!! error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es2017.ts(1,27): error TS2792: Cannot find module 'mis
}
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export async function f1() { }
}
\ No newline at end of file
diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.errors.txt b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.errors.txt
index db8a11aa8690b..296fc8854f4ef 100644
--- a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.errors.txt
+++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.errors.txt
@@ -1,7 +1,8 @@
asyncAwaitIsolatedModules_es5.ts(1,27): error TS2307: Cannot find module 'missing' or its corresponding type declarations.
+asyncAwaitIsolatedModules_es5.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== asyncAwaitIsolatedModules_es5.ts (1 errors) ====
+==== asyncAwaitIsolatedModules_es5.ts (2 errors) ====
import { MyPromise } from "missing";
~~~~~~~~~
!!! error TS2307: Cannot find module 'missing' or its corresponding type declarations.
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es5.ts(1,27): error TS2307: Cannot find module 'missin
}
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export async function f1() { }
}
\ No newline at end of file
diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.errors.txt b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.errors.txt
index 9ee15a6cc8b1b..b2f78c6c3203d 100644
--- a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.errors.txt
+++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.errors.txt
@@ -1,7 +1,8 @@
asyncAwaitIsolatedModules_es6.ts(1,27): error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
+asyncAwaitIsolatedModules_es6.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
-==== asyncAwaitIsolatedModules_es6.ts (1 errors) ====
+==== asyncAwaitIsolatedModules_es6.ts (2 errors) ====
import { MyPromise } from "missing";
~~~~~~~~~
!!! error TS2792: Cannot find module 'missing'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
@@ -41,5 +42,7 @@ asyncAwaitIsolatedModules_es6.ts(1,27): error TS2792: Cannot find module 'missin
}
module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
export async function f1() { }
}
\ No newline at end of file
diff --git a/tests/baselines/reference/asyncAwait_es2017.errors.txt b/tests/baselines/reference/asyncAwait_es2017.errors.txt
new file mode 100644
index 0000000000000..c7731eb3b615a
--- /dev/null
+++ b/tests/baselines/reference/asyncAwait_es2017.errors.txt
@@ -0,0 +1,52 @@
+asyncAwait_es2017.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== asyncAwait_es2017.ts (1 errors) ====
+ type MyPromise = Promise;
+ declare var MyPromise: typeof Promise;
+ declare var p: Promise;
+ declare var mp: MyPromise;
+
+ async function f0() { }
+ async function f1(): Promise { }
+ async function f3(): MyPromise { }
+
+ let f4 = async function() { }
+ let f5 = async function(): Promise { }
+ let f6 = async function(): MyPromise { }
+
+ let f7 = async () => { };
+ let f8 = async (): Promise => { };
+ let f9 = async (): MyPromise => { };
+ let f10 = async () => p;
+ let f11 = async () => mp;
+ let f12 = async (): Promise => mp;
+ let f13 = async (): MyPromise => p;
+
+ let o = {
+ async m1() { },
+ async m2(): Promise { },
+ async m3(): MyPromise { }
+ };
+
+ class C {
+ async m1() { }
+ async m2(): Promise { }
+ async m3(): MyPromise { }
+ static async m4() { }
+ static async m5(): Promise { }
+ static async m6(): MyPromise { }
+ }
+
+ module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export async function f1() { }
+ }
+
+ async function f14() {
+ block: {
+ await 1;
+ break block;
+ }
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/asyncAwait_es5.errors.txt b/tests/baselines/reference/asyncAwait_es5.errors.txt
new file mode 100644
index 0000000000000..dc5a04160866e
--- /dev/null
+++ b/tests/baselines/reference/asyncAwait_es5.errors.txt
@@ -0,0 +1,52 @@
+asyncAwait_es5.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== asyncAwait_es5.ts (1 errors) ====
+ type MyPromise = Promise;
+ declare var MyPromise: typeof Promise;
+ declare var p: Promise;
+ declare var mp: MyPromise;
+
+ async function f0() { }
+ async function f1(): Promise { }
+ async function f3(): MyPromise { }
+
+ let f4 = async function() { }
+ let f5 = async function(): Promise { }
+ let f6 = async function(): MyPromise { }
+
+ let f7 = async () => { };
+ let f8 = async (): Promise => { };
+ let f9 = async (): MyPromise => { };
+ let f10 = async () => p;
+ let f11 = async () => mp;
+ let f12 = async (): Promise => mp;
+ let f13 = async (): MyPromise => p;
+
+ let o = {
+ async m1() { },
+ async m2(): Promise { },
+ async m3(): MyPromise { }
+ };
+
+ class C {
+ async m1() { }
+ async m2(): Promise { }
+ async m3(): MyPromise { }
+ static async m4() { }
+ static async m5(): Promise { }
+ static async m6(): MyPromise { }
+ }
+
+ module M {
+ ~~~~~~
+!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+ export async function f1() { }
+ }
+
+ async function f14() {
+ block: {
+ await 1;
+ break block;
+ }
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/asyncAwait_es6.errors.txt b/tests/baselines/reference/asyncAwait_es6.errors.txt
new file mode 100644
index 0000000000000..1a82a8f0ede69
--- /dev/null
+++ b/tests/baselines/reference/asyncAwait_es6.errors.txt
@@ -0,0 +1,52 @@
+asyncAwait_es6.ts(37,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
+
+
+==== asyncAwait_es6.ts (1 errors) ====
+ type MyPromise = Promise;
+ declare var MyPromise: typeof Promise;
+ declare var p: Promise;
+ declare var mp: MyPromise;
+
+ async function f0() { }
+ async function f1(): Promise { }
+ async function f3(): MyPromise { }
+
+ let f4 = async function() { }
+ let f5 = async function(): Promise { }
+ let f6 = async function(): MyPromise { }
+
+ let f7 = async () => { };
+ let f8 = async (): Promise => { };
+ let f9 = async (): MyPromise => { };
+ let f10 = async () => p;
+ let f11 = async () => mp;
+ let f12 = async (): Promise => mp;
+ let f13 = async (): MyPromise => p;
+
+ let o = {
+ async m1() { },
+ async m2(): Promise { },
+ async m3(): MyPromise { }
+ };
+
+ class C {
+ async m1() { }
+ async m2(): Promise