diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 843b5b2f94d66..15b9106f34f5f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -47309,6 +47309,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { error(node.name, Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); } + if ((node.flags & NodeFlags.Namespace) === NodeFlags.None && node.name.kind !== SyntaxKind.StringLiteral && !isGlobalScopeAugmentation(node)) { + error(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); + } + const isAmbientExternalModule: boolean = isAmbientModule(node); const contextErrorMessage = isAmbientExternalModule ? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file @@ -47345,9 +47349,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions)) ) { - if (compilerOptions.erasableSyntaxOnly) { - error(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled); - } if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { // This could be loosened a little if needed. The only problem we are trying to avoid is unqualified diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..4f4536b4631c2 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt @@ -0,0 +1,17 @@ +module.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== module.d.ts (1 errors) ==== + declare module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/AmbientModuleAndAmbientWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..0d2a80d631d0b --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.errors.txt @@ -0,0 +1,35 @@ +class.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.d.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== module.d.ts (2 errors) ==== + declare module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Origin: { + x: number; + y: number; + } + } + } + +==== class.d.ts (1 errors) ==== + declare module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(x: number, y: number); + x: number; + y: number; + } + } + +==== test.ts (0 errors) ==== + var p: { x: number; y: number; } + var p = A.Point.Origin; + var p = new A.Point(0, 0); // unexpected error here, bug 840000 + \ No newline at end of file diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..b30dfe53a2af4 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.errors.txt @@ -0,0 +1,32 @@ +classPoint.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.d.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== module.d.ts (2 errors) ==== + declare module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Origin: { + x: number; + y: number; + } + } + } + +==== classPoint.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + } + } + +==== test.ts (0 errors) ==== + var p: { x: number; y: number; } + var p = A.Point.Origin; + var p = new A.Point(0, 0); // unexpected error here, bug 840000 \ 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..a1e830b2aea03 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.errors.txt @@ -0,0 +1,19 @@ +module.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== module.d.ts (1 errors) ==== + declare module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt index ce6f836d168c6..ec528be92a9e9 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt @@ -1,11 +1,15 @@ +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(10,19): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(20,12): error TS2304: Cannot find name 'T'. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(22,23): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(34,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(35,26): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): error TS2304: Cannot find name 'T'. -==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (5 errors) ==== +==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (9 errors) ==== // all expected to be errors class clodule1{ @@ -15,6 +19,8 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err } module clodule1 { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function f(x: T) { } ~ !!! error TS2304: Cannot find name 'T'. @@ -27,6 +33,8 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err } module clodule2 { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x: T; ~ !!! error TS2304: Cannot find name 'T'. @@ -46,6 +54,8 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err } module clodule3 { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = { id: T }; ~ !!! error TS2304: Cannot find name 'T'. @@ -58,6 +68,8 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err } module clodule4 { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class D { name: T; ~ diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt index 4fdf96cc4fee2..c4662f58a17e6 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,8 +1,9 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. -==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== +==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (3 errors) ==== class clodule { id: string; value: T; @@ -13,6 +14,8 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFu } module clodule { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // error: duplicate identifier expected export function fn(x: T, y: T): T { ~~ diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt index e85d3f1c32c2a..f2e9776899e57 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,8 +1,9 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. -==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== +==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (3 errors) ==== class clodule { id: string; value: T; @@ -13,6 +14,8 @@ ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStati } module clodule { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // error: duplicate identifier expected export function fn(x: T, y: T): T { ~~ diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt index 10513ef9e6d1e..4af26dbefa2f3 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt @@ -1,7 +1,8 @@ +ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // error: duplicate identifier expected export function fn(x: T, y: T): number { return clodule.sfn('a'); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt index 5c973d3184374..c60487bf91f3c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.errors.txt @@ -1,10 +1,13 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(8,21): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20,25): error TS2300: Duplicate identifier 'Origin'. -==== ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (4 errors) ==== +==== ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (7 errors) ==== class Point { constructor(public x: number, public y: number) { } @@ -14,6 +17,8 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20 } module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Origin() { return null; } //expected duplicate identifier error ~~~~~~ !!! error TS2300: Duplicate identifier 'Origin'. @@ -21,6 +26,8 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20 module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { constructor(public x: number, public y: number) { } @@ -30,6 +37,8 @@ ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20 } export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Origin() { return ""; }//expected duplicate identifier error ~~~~~~ !!! error TS2300: Duplicate identifier 'Origin'. diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.errors.txt new file mode 100644 index 0000000000000..8872541cb657c --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.errors.txt @@ -0,0 +1,34 @@ +ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts (3 errors) ==== + class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } + } + + module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function Origin() { return ""; }// not an error, since not exported + } + + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + + static Origin(): Point { return { x: 0, y: 0 }; } + } + + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function Origin() { return ""; }// not an error since not exported + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt index e42c4b7e66a8b..dc39def8d12af 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.errors.txt @@ -1,10 +1,13 @@ ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(8,16): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'. +ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): error TS2300: Duplicate identifier 'Origin'. -==== ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (4 errors) ==== +==== ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (7 errors) ==== class Point { constructor(public x: number, public y: number) { } @@ -14,6 +17,8 @@ ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): } module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Origin = ""; //expected duplicate identifier error ~~~~~~ !!! error TS2300: Duplicate identifier 'Origin'. @@ -21,6 +26,8 @@ ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { constructor(public x: number, public y: number) { } @@ -30,6 +37,8 @@ ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): } export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Origin = ""; //expected duplicate identifier error ~~~~~~ !!! error TS2300: Duplicate identifier 'Origin'. diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.errors.txt new file mode 100644 index 0000000000000..404f9e97b7403 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.errors.txt @@ -0,0 +1,34 @@ +ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts (3 errors) ==== + class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Origin = ""; // not an error, since not exported + } + + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + + static Origin: Point = { x: 0, y: 0 }; + } + + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Origin = ""; // not an error since not exported + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt index 4c67c17831b78..57a24cbaed5a0 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,8 +1,18 @@ +class.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +class.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== class.ts (0 errors) ==== +==== class.ts (2 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { constructor(x: number, y: number) { this.x = x; @@ -13,10 +23,16 @@ module.ts(2,19): error TS2433: A namespace declaration cannot be in a different } } -==== module.ts (1 errors) ==== +==== module.ts (4 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var Origin = new Point(0, 0); } @@ -28,12 +44,14 @@ module.ts(2,19): error TS2433: A namespace declaration cannot be in a different var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? -==== simple.ts (0 errors) ==== +==== simple.ts (1 errors) ==== class A { id: string; } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Instance = new A(); } diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt index 4c67c17831b78..57a24cbaed5a0 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt @@ -1,8 +1,18 @@ +class.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +class.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== class.ts (0 errors) ==== +==== class.ts (2 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { constructor(x: number, y: number) { this.x = x; @@ -13,10 +23,16 @@ module.ts(2,19): error TS2433: A namespace declaration cannot be in a different } } -==== module.ts (1 errors) ==== +==== module.ts (4 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var Origin = new Point(0, 0); } @@ -28,12 +44,14 @@ module.ts(2,19): error TS2433: A namespace declaration cannot be in a different var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? -==== simple.ts (0 errors) ==== +==== simple.ts (1 errors) ==== class A { id: string; } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Instance = new A(); } diff --git a/tests/baselines/reference/ES5SymbolProperty2.errors.txt b/tests/baselines/reference/ES5SymbolProperty2.errors.txt index 21ade634ca8b0..d7ce2912a6a5d 100644 --- a/tests/baselines/reference/ES5SymbolProperty2.errors.txt +++ b/tests/baselines/reference/ES5SymbolProperty2.errors.txt @@ -1,8 +1,11 @@ +ES5SymbolProperty2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ES5SymbolProperty2.ts(10,11): error TS2585: 'Symbol' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later. -==== ES5SymbolProperty2.ts (1 errors) ==== +==== ES5SymbolProperty2.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var Symbol: any; export class C { diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..78562a34a6842 --- /dev/null +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.errors.txt @@ -0,0 +1,22 @@ +EnumAndModuleWithSameNameAndCommonRoot.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== EnumAndModuleWithSameNameAndCommonRoot.ts (1 errors) ==== + enum enumdule { + Red, Blue + } + + module enumdule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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..c96f5b67ad044 --- /dev/null +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.errors.txt @@ -0,0 +1,25 @@ +ExportClassWhichExtendsInterfaceWithInaccessibleType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportClassWhichExtendsInterfaceWithInaccessibleType.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..7c1eb10c6fc8b --- /dev/null +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt @@ -0,0 +1,26 @@ +ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..205499df30998 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt @@ -0,0 +1,21 @@ +ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Point { + x: number; + y: number; + } + + export class points { + + [idx: number]: Point; + [idx: string]: Point; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt new file mode 100644 index 0000000000000..ee1c0d29369a6 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt @@ -0,0 +1,30 @@ +ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + + static fromorigin2d(p: Point): Line{ + return null; + } + } + } + \ 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..f6d35824776d7 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt @@ -0,0 +1,21 @@ +ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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..d8e0e88e32d31 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt @@ -0,0 +1,21 @@ +ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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..7decaa035f2fc --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt @@ -0,0 +1,21 @@ +ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..1e2684b8fbb22 --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt @@ -0,0 +1,28 @@ +ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export interface Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export interface Line{ + new (start: TPoint, end: TPoint); + start: TPoint; + end: TPoint; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..df2d0eb8af00c --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt @@ -0,0 +1,21 @@ +ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface Point { + x: number; + y: number; + } + + export interface points { + + [idx: number]: Point; + [idx: string]: Point; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.errors.txt b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.errors.txt new file mode 100644 index 0000000000000..42584d50f5020 --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.errors.txt @@ -0,0 +1,29 @@ +ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface Point { + x: number; + y: number; + } + + export var Origin: Point = { x: 0, y: 0 }; + + export interface Point3d extends Point { + z: number; + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export interface Line{ + new (start: TPoint, end: TPoint); + + start: TPoint; + end: TPoint; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.errors.txt b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.errors.txt new file mode 100644 index 0000000000000..c2270e5768388 --- /dev/null +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.errors.txt @@ -0,0 +1,29 @@ +ExportModuleWithAccessibleTypesOnItsExportedMembers.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ExportModuleWithAccessibleTypesOnItsExportedMembers.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportModuleWithAccessibleTypesOnItsExportedMembers.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Point { + constructor(public x: number, public y: number) { } + } + + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Origin: Point = new Point(0, 0); + + export class Line { + constructor(start: Point, end: Point) { + + } + + static fromOrigin(p: Point) { + return new Line({ x: 0, y: 0 }, p); + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..5092f01214c67 --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.errors.txt @@ -0,0 +1,17 @@ +ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Point { + constructor(public x: number, public y: number) { } + } + + export var Origin: Point = { x: 0, y: 0 }; + + export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; + } + \ 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..afab78cf0ec47 --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt @@ -0,0 +1,17 @@ +ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt new file mode 100644 index 0000000000000..5e3240e95c019 --- /dev/null +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt @@ -0,0 +1,14 @@ +ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class B { + id: number; + } + + export var beez: Array; + export var beez2 = new Array(); + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.errors.txt b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..ee6212fbd674e --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.errors.txt @@ -0,0 +1,17 @@ +ExportVariableWithAccessibleTypeInTypeAnnotation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportVariableWithAccessibleTypeInTypeAnnotation.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface Point { + x: number; + y: number; + } + + // valid since Point is exported + export var Origin: Point = { x: 0, y: 0 }; + } + \ 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..5e6f48b258990 --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.errors.txt @@ -0,0 +1,24 @@ +ExportVariableWithInaccessibleTypeInTypeAnnotation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ExportVariableWithInaccessibleTypeInTypeAnnotation.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt index d71944866d1d7..906a2221e253a 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,19 +1,30 @@ +function.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +simple.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'. -==== function.ts (0 errors) ==== +==== function.ts (1 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Point() { return { x: 0, y: 0 }; } } -==== module.ts (1 errors) ==== +==== module.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var Origin = { x: 0, y: 0 }; } @@ -31,14 +42,18 @@ test.ts(2,5): error TS2403: Subsequent variable declarations must have the same var cl = A.Point.Origin; // not expected to be an error. -==== simple.ts (1 errors) ==== +==== simple.ts (3 errors) ==== module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Point() { return { x: 0, y: 0 }; } export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Origin = { x: 0, y: 0 }; } } diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt new file mode 100644 index 0000000000000..62978c1f19caf --- /dev/null +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.errors.txt @@ -0,0 +1,32 @@ +function.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== function.ts (1 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function Point() { + return { x: 0, y: 0 }; + } + } + +==== module.ts (2 errors) ==== + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/FunctionDeclaration7.errors.txt b/tests/baselines/reference/FunctionDeclaration7.errors.txt index 9f4446f3613f3..9bce27d1dd622 100644 --- a/tests/baselines/reference/FunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7.errors.txt @@ -1,8 +1,11 @@ +FunctionDeclaration7.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. FunctionDeclaration7.ts(2,13): error TS2391: Function implementation is missing or not immediately following the declaration. -==== FunctionDeclaration7.ts (1 errors) ==== +==== FunctionDeclaration7.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo(); ~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt index c8f357bada3d6..3a09a5e4b65d0 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.errors.txt @@ -1,9 +1,12 @@ +InvalidNonInstantiatedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. InvalidNonInstantiatedModule.ts(5,9): error TS2708: Cannot use namespace 'M' as a value. InvalidNonInstantiatedModule.ts(7,15): error TS2708: Cannot use namespace 'M' as a value. -==== InvalidNonInstantiatedModule.ts (2 errors) ==== +==== InvalidNonInstantiatedModule.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point { x: number; y: number } } diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt index 1da20e5604fa3..c6ef3ae762eea 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt @@ -1,19 +1,35 @@ +classPoint.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classPoint.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. simple.ts(1,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. simple.ts(2,31): error TS2449: Class 'A' used before its declaration. -==== module.ts (1 errors) ==== +==== module.ts (4 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var Origin = new Point(0, 0); } } -==== classPoint.ts (0 errors) ==== +==== classPoint.ts (2 errors) ==== module X.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // duplicate identifier export class Point { constructor(x: number, y: number) { @@ -25,9 +41,11 @@ simple.ts(2,31): error TS2449: Class 'A' used before its declaration. } } -==== simple.ts (2 errors) ==== +==== simple.ts (3 errors) ==== module A { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. export var Instance = new A(); ~ diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt new file mode 100644 index 0000000000000..1db5393d47d47 --- /dev/null +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.errors.txt @@ -0,0 +1,22 @@ +ModuleAndEnumWithSameNameAndCommonRoot.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ModuleAndEnumWithSameNameAndCommonRoot.ts (1 errors) ==== + module enumdule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + 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/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt index d88cb56a78592..dae9592bc42bf 100644 --- a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.errors.txt @@ -1,29 +1,44 @@ +function.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +module.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +simple.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. simple.ts(3,19): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. -==== module.ts (1 errors) ==== +==== module.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var Origin = { x: 0, y: 0 }; } } -==== function.ts (0 errors) ==== +==== function.ts (1 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // duplicate identifier error export function Point() { return { x: 0, y: 0 }; } } -==== simple.ts (1 errors) ==== +==== simple.ts (3 errors) ==== module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Point { ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. export var Origin = { x: 0, y: 0 }; } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt index 0e64c5ff2118a..c784f4a863c6c 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt @@ -1,9 +1,12 @@ +ModuleWithExportedAndNonExportedClasses.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ModuleWithExportedAndNonExportedClasses.ts(30,16): error TS2339: Property 'A2' does not exist on type 'typeof A'. ModuleWithExportedAndNonExportedClasses.ts(31,17): error TS2339: Property 'A2' does not exist on type 'typeof A'. -==== ModuleWithExportedAndNonExportedClasses.ts (2 errors) ==== +==== ModuleWithExportedAndNonExportedClasses.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { id: number; name: string; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt index 5d2d48c0ac130..3fb10086203c5 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.errors.txt @@ -1,8 +1,11 @@ +ModuleWithExportedAndNonExportedEnums.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ModuleWithExportedAndNonExportedEnums.ts(10,11): error TS2339: Property 'Day' does not exist on type 'typeof A'. -==== ModuleWithExportedAndNonExportedEnums.ts (1 errors) ==== +==== ModuleWithExportedAndNonExportedEnums.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Color { Red, Blue } enum Day { Monday, Tuesday } } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt index eda91f4cb1a8a..74e995229b6cd 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt @@ -1,9 +1,12 @@ +ModuleWithExportedAndNonExportedFunctions.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ModuleWithExportedAndNonExportedFunctions.ts(28,13): error TS2339: Property 'fn2' does not exist on type 'typeof A'. ModuleWithExportedAndNonExportedFunctions.ts(29,14): error TS2551: Property 'fng2' does not exist on type 'typeof A'. Did you mean 'fng'? -==== ModuleWithExportedAndNonExportedFunctions.ts (2 errors) ==== +==== ModuleWithExportedAndNonExportedFunctions.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function fn(s: string) { return true; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt index 5578e472334e7..8bc2bdb649a1c 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.errors.txt @@ -1,8 +1,13 @@ +ModuleWithExportedAndNonExportedImportAlias.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ModuleWithExportedAndNonExportedImportAlias.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ModuleWithExportedAndNonExportedImportAlias.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point { x: number; y: number; @@ -14,12 +19,16 @@ ModuleWithExportedAndNonExportedImportAlias.ts(37,21): error TS2339: Property 'L } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Line { constructor(public start: A.Point, public end: A.Point) { } } } module Geometry { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import Points = A; import Lines = B; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt index b53616c66dbc3..f4e8da09f9aa0 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.errors.txt @@ -1,8 +1,11 @@ +ModuleWithExportedAndNonExportedVariables.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ModuleWithExportedAndNonExportedVariables.ts(11,11): error TS2339: Property 'y' does not exist on type 'typeof A'. -==== ModuleWithExportedAndNonExportedVariables.ts (1 errors) ==== +==== ModuleWithExportedAndNonExportedVariables.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 'hello world' var y = 12; } diff --git a/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt b/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt index 38c0480c6bf35..776f98dd71b4e 100644 --- a/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt +++ b/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt @@ -1,10 +1,14 @@ +NonInitializedExportInInternalModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. NonInitializedExportInInternalModule.ts(2,8): error TS1123: Variable declaration list cannot be empty. NonInitializedExportInInternalModule.ts(3,5): error TS2304: Cannot find name 'let'. NonInitializedExportInInternalModule.ts(4,10): error TS1123: Variable declaration list cannot be empty. +NonInitializedExportInInternalModule.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== NonInitializedExportInInternalModule.ts (3 errors) ==== +==== NonInitializedExportInInternalModule.ts (5 errors) ==== module Inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var; !!! error TS1123: Variable declaration list cannot be empty. @@ -29,6 +33,8 @@ NonInitializedExportInInternalModule.ts(4,10): error TS1123: Variable declaratio } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/Protected2.errors.txt b/tests/baselines/reference/Protected2.errors.txt index 6affb6084ade0..38347822d5bed 100644 --- a/tests/baselines/reference/Protected2.errors.txt +++ b/tests/baselines/reference/Protected2.errors.txt @@ -1,8 +1,11 @@ Protected2.ts(1,1): error TS1044: 'protected' modifier cannot appear on a module or namespace element. +Protected2.ts(1,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== Protected2.ts (1 errors) ==== +==== Protected2.ts (2 errors) ==== protected module M { ~~~~~~~~~ !!! error TS1044: 'protected' modifier cannot appear on a module or namespace element. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..f83144aaf59c2 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt @@ -0,0 +1,67 @@ +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(20,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(20,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(27,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(28,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts (8 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + x: number; + y: number; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Point { + fromCarthesian(p: A.Point) { + return { x: p.x, y: p.y }; + } + } + } + + // ensure merges as expected + var p: { x: number; y: number; }; + var p: A.Point; + + module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Line { + length: number; + } + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Line { + name: string; + } + } + } + } + + // ensure merges as expected + var l: { length: number; } + var l: X.Y.Z.Line; + + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..121c82a50a8ec --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.errors.txt @@ -0,0 +1,64 @@ +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(19,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(26,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts(26,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts (8 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + toCarth(): Point; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Point { + fromCarth(): Point; + } + } + + // ensure merges as expected + var p: { x: number; y: number; toCarth(): A.Point; }; + var p: A.Point; + + module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Line { + new (start: A.Point, end: A.Point); + } + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Line { + start: A.Point; + end: A.Point; + } + } + } + + // ensure merges as expected + var l: { new (s: A.Point, e: A.Point); } + var l: X.Y.Z.Line; + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.errors.txt new file mode 100644 index 0000000000000..1718df0896831 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.errors.txt @@ -0,0 +1,54 @@ +part1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part1.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== part1.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + } + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + export var Origin: Point = { x: 0, y: 0 }; + } + +==== part2.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // not a collision, since we don't export + var Origin: string = "0,0"; + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Plane { + constructor(public tl: Point, public br: Point) { } + } + } + } + +==== part3.ts (0 errors) ==== + // test the merging actually worked + + var o: { x: number; y: number }; + var o: A.Point; + var o = A.Origin; + var o = A.Utils.mirror(o); + + var p: { tl: A.Point; br: A.Point }; + var p: A.Utils.Plane; + var p = new A.Utils.Plane(o, { x: 1, y: 1 }); + + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt index 63afa98aa5cbc..8d8ac2515f5e7 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt @@ -1,11 +1,21 @@ +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(2,18): error TS2300: Duplicate identifier 'Point'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(10,18): error TS2300: Duplicate identifier 'Point'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(16,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(16,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(17,18): error TS2300: Duplicate identifier 'Line'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(23,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(24,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error TS2300: Duplicate identifier 'Line'. -==== TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (4 errors) ==== +==== TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (12 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. @@ -15,6 +25,8 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error } module A{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // expected error export class Point { ~~~~~ @@ -25,6 +37,12 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error } module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Line { ~~~~ !!! error TS2300: Duplicate identifier 'Line'. @@ -33,8 +51,14 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error } module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // expected error export class Line { ~~~~ diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..48ef961a2bf11 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.errors.txt @@ -0,0 +1,64 @@ +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(19,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(26,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts(26,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts (8 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + toCarth(): Point; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + fromCarth(): Point; + } + } + + // ensure merges as expected + var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; + var p: A.Point; + + module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Line { + new (start: A.Point, end: A.Point); + } + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Line { + start: A.Point; + end: A.Point; + } + } + } + + // ensure merges as expected + var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); } + var l: X.Y.Z.Line; + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt index e7d9bcf40169a..09744b3a9ec70 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.errors.txt @@ -1,16 +1,24 @@ +part1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part1.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. part2.ts(3,24): error TS2304: Cannot find name 'Point'. +part2.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. part2.ts(7,36): error TS2304: Cannot find name 'Point'. part2.ts(7,54): error TS2304: Cannot find name 'Point'. -==== part1.ts (0 errors) ==== +==== part1.ts (2 errors) ==== export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point { x: number; y: number; } export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function mirror(p: T) { return { x: p.y, y: p.x }; } @@ -19,14 +27,18 @@ part2.ts(7,54): error TS2304: Cannot find name 'Point'. export var Origin: Point = { x: 0, y: 0 }; } -==== part2.ts (3 errors) ==== +==== part2.ts (5 errors) ==== export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // collision with 'Origin' var in other part of merged module export var Origin: Point = { x: 0, y: 0 }; ~~~~~ !!! error TS2304: Cannot find name 'Point'. export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Plane { constructor(public tl: Point, public br: Point) { } ~~~~~ diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..49143f7f71ccf --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt @@ -0,0 +1,67 @@ +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(15,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(15,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(22,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(23,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts (10 errors) ==== + module A.B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + + module A{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: string; + } + } + + // ensure the right var decl is exported + var x: number; + var x = A.B.x; + + module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Line { + length: number; + } + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Line { + name: string; + } + } + } + } + + // make sure merging works as expected + var l: { length: number }; + var l: X.Y.Z.Line; + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.errors.txt b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.errors.txt new file mode 100644 index 0000000000000..005d49bad0257 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.errors.txt @@ -0,0 +1,49 @@ +part1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part1.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part1.ts(8,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(6,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== part1.ts (3 errors) ==== + module Root { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + } + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + } + } + +==== part2.ts (3 errors) ==== + module otherRoot { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // have to be fully qualified since in different root + export var Origin: Root.A.Point = { x: 0, y: 0 }; + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Plane { + constructor(public tl: Root.A.Point, public br: Root.A.Point) { } + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.errors.txt b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.errors.txt new file mode 100644 index 0000000000000..f4013881daa5f --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.errors.txt @@ -0,0 +1,52 @@ +part1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part1.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +part2.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== part1.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + } + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function mirror(p: T) { + return { x: p.y, y: p.x }; + } + } + } + +==== part2.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Origin: Point = { x: 0, y: 0 }; + + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Plane { + constructor(public tl: Point, public br: Point) { } + } + } + } + +==== part3.ts (0 errors) ==== + // test the merging actually worked + + var o: { x: number; y: number }; + var o: A.Point; + var o = A.Origin; + var o = A.Utils.mirror(o); + + var p: { tl: A.Point; br: A.Point }; + var p: A.Utils.Plane; + var p = new A.Utils.Plane(o, { x: 1, y: 1 }); + + \ No newline at end of file diff --git a/tests/baselines/reference/acceptableAlias1.errors.txt b/tests/baselines/reference/acceptableAlias1.errors.txt new file mode 100644 index 0000000000000..282073e490eb8 --- /dev/null +++ b/tests/baselines/reference/acceptableAlias1.errors.txt @@ -0,0 +1,16 @@ +acceptableAlias1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +acceptableAlias1.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== acceptableAlias1.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + export import X = N; + } + + import r = M.X; \ No newline at end of file diff --git a/tests/baselines/reference/acceptableAlias1.types b/tests/baselines/reference/acceptableAlias1.types index 224ddc550dd7c..7b32d4449eb87 100644 --- a/tests/baselines/reference/acceptableAlias1.types +++ b/tests/baselines/reference/acceptableAlias1.types @@ -10,7 +10,8 @@ module M { export import X = N; >X : any > : ^^^ ->N : error +>N : any +> : ^^^ } import r = M.X; diff --git a/tests/baselines/reference/accessorsInAmbientContext.errors.txt b/tests/baselines/reference/accessorsInAmbientContext.errors.txt index 89cd98a0a0c66..a253a176dff11 100644 --- a/tests/baselines/reference/accessorsInAmbientContext.errors.txt +++ b/tests/baselines/reference/accessorsInAmbientContext.errors.txt @@ -1,3 +1,4 @@ +accessorsInAmbientContext.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { get X() { return 1; } ~ diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.errors.txt b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.errors.txt new file mode 100644 index 0000000000000..e890074f0a456 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.errors.txt @@ -0,0 +1,45 @@ +additionOperatorWithAnyAndEveryType.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== additionOperatorWithAnyAndEveryType.ts (1 errors) ==== + function foo() { } + class C { + public a: string; + static foo() { } + } + enum E { a, b, c } + module M { export var a } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: Object; + + // any as left operand, result is type Any except plusing string + var r1 = a + a; + var r2 = a + b; + var r3 = a + c; + var r4 = a + d; + var r5 = a + e; + + // any as right operand, result is type Any except plusing string + var r6 = b + a; + var r7 = c + a; + var r8 = d + a; + var r9 = e + a; + + // other cases + var r10 = a + foo; + var r11 = a + foo(); + var r12 = a + C; + var r13 = a + new C(); + var r14 = a + E; + var r15 = a + E.a; + var r16 = a + M; + var r17 = a + ''; + var r18 = a + 123; + var r19 = a + { a: '' }; + var r20 = a + ((a: string) => { return a }); \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index 5f3e5634c9166..2c9d08e49e3ce 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -31,9 +31,11 @@ module M { export var a } >M : typeof M > : ^^^^^^^^ >a : any +> : ^^^ var a: any; >a : any +> : ^^^ var b: boolean; >b : boolean @@ -54,21 +56,31 @@ var e: Object; // any as left operand, result is type Any except plusing string var r1 = a + a; >r1 : any +> : ^^^ >a + a : any +> : ^^^ >a : any +> : ^^^ >a : any +> : ^^^ var r2 = a + b; >r2 : any +> : ^^^ >a + b : any +> : ^^^ >a : any +> : ^^^ >b : boolean > : ^^^^^^^ var r3 = a + c; >r3 : any +> : ^^^ >a + c : any +> : ^^^ >a : any +> : ^^^ >c : number > : ^^^^^^ @@ -78,30 +90,40 @@ var r4 = a + d; >a + d : string > : ^^^^^^ >a : any +> : ^^^ >d : string > : ^^^^^^ var r5 = a + e; >r5 : any +> : ^^^ >a + e : any +> : ^^^ >a : any +> : ^^^ >e : Object > : ^^^^^^ // any as right operand, result is type Any except plusing string var r6 = b + a; >r6 : any +> : ^^^ >b + a : any +> : ^^^ >b : boolean > : ^^^^^^^ >a : any +> : ^^^ var r7 = c + a; >r7 : any +> : ^^^ >c + a : any +> : ^^^ >c : number > : ^^^^^^ >a : any +> : ^^^ var r8 = d + a; >r8 : string @@ -111,26 +133,36 @@ var r8 = d + a; >d : string > : ^^^^^^ >a : any +> : ^^^ var r9 = e + a; >r9 : any +> : ^^^ >e + a : any +> : ^^^ >e : Object > : ^^^^^^ >a : any +> : ^^^ // other cases var r10 = a + foo; >r10 : any +> : ^^^ >a + foo : any +> : ^^^ >a : any +> : ^^^ >foo : () => void > : ^^^^^^^^^^ var r11 = a + foo(); >r11 : any +> : ^^^ >a + foo() : any +> : ^^^ >a : any +> : ^^^ >foo() : void > : ^^^^ >foo : () => void @@ -138,15 +170,21 @@ var r11 = a + foo(); var r12 = a + C; >r12 : any +> : ^^^ >a + C : any +> : ^^^ >a : any +> : ^^^ >C : typeof C > : ^^^^^^^^ var r13 = a + new C(); >r13 : any +> : ^^^ >a + new C() : any +> : ^^^ >a : any +> : ^^^ >new C() : C > : ^ >C : typeof C @@ -154,15 +192,21 @@ var r13 = a + new C(); var r14 = a + E; >r14 : any +> : ^^^ >a + E : any +> : ^^^ >a : any +> : ^^^ >E : typeof E > : ^^^^^^^^ var r15 = a + E.a; >r15 : any +> : ^^^ >a + E.a : any +> : ^^^ >a : any +> : ^^^ >E.a : E.a > : ^^^ >E : typeof E @@ -172,8 +216,11 @@ var r15 = a + E.a; var r16 = a + M; >r16 : any +> : ^^^ >a + M : any +> : ^^^ >a : any +> : ^^^ >M : typeof M > : ^^^^^^^^ @@ -183,20 +230,27 @@ var r17 = a + ''; >a + '' : string > : ^^^^^^ >a : any +> : ^^^ >'' : "" > : ^^ var r18 = a + 123; >r18 : any +> : ^^^ >a + 123 : any +> : ^^^ >a : any +> : ^^^ >123 : 123 > : ^^^ var r19 = a + { a: '' }; >r19 : any +> : ^^^ >a + { a: '' } : any +> : ^^^ >a : any +> : ^^^ >{ a: '' } : { a: string; } > : ^^^^^^^^^^^^^^ >a : string @@ -206,8 +260,11 @@ var r19 = a + { a: '' }; var r20 = a + ((a: string) => { return a }); >r20 : any +> : ^^^ >a + ((a: string) => { return a }) : any +> : ^^^ >a : any +> : ^^^ >((a: string) => { return a }) : (a: string) => string > : ^ ^^ ^^^^^^^^^^^ >(a: string) => { return a } : (a: string) => string diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt index cb628c01a37d0..b950e63f581ef 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt @@ -1,3 +1,4 @@ +additionOperatorWithInvalidOperands.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. additionOperatorWithInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. additionOperatorWithInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. additionOperatorWithInvalidOperands.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'Object'. @@ -19,7 +20,7 @@ additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'. -==== additionOperatorWithInvalidOperands.ts (19 errors) ==== +==== additionOperatorWithInvalidOperands.ts (20 errors) ==== function foo() { } class C { public a: string; @@ -27,6 +28,8 @@ additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot } enum E { a, b, c } module M { export var a } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a: boolean; var b: number; diff --git a/tests/baselines/reference/aliasBug.errors.txt b/tests/baselines/reference/aliasBug.errors.txt index d8842b18de0fc..74864f8daefc4 100644 --- a/tests/baselines/reference/aliasBug.errors.txt +++ b/tests/baselines/reference/aliasBug.errors.txt @@ -1,12 +1,21 @@ +aliasBug.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasBug.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasBug.ts(5,39): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. aliasBug.ts(16,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. -==== aliasBug.ts (1 errors) ==== +==== aliasBug.ts (4 errors) ==== module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Provide { } export module bar { export module baz {export class boo {}}} + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } import provide = foo; diff --git a/tests/baselines/reference/aliasErrors.errors.txt b/tests/baselines/reference/aliasErrors.errors.txt index 5e94cd3c9a710..b705f11963884 100644 --- a/tests/baselines/reference/aliasErrors.errors.txt +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -1,3 +1,6 @@ +aliasErrors.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasErrors.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasErrors.ts(4,39): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. aliasErrors.ts(11,12): error TS2503: Cannot find namespace 'no'. aliasErrors.ts(12,13): error TS2503: Cannot find namespace 'no'. aliasErrors.ts(13,12): error TS1003: Identifier expected. @@ -7,11 +10,17 @@ aliasErrors.ts(16,12): error TS2503: Cannot find namespace 'undefined'. aliasErrors.ts(26,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. -==== aliasErrors.ts (7 errors) ==== +==== aliasErrors.ts (10 errors) ==== module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Provide { } export module bar { export module baz {export class boo {}}} + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } import provide = foo; diff --git a/tests/baselines/reference/aliasInaccessibleModule.errors.txt b/tests/baselines/reference/aliasInaccessibleModule.errors.txt new file mode 100644 index 0000000000000..204a1e8fe9699 --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule.errors.txt @@ -0,0 +1,14 @@ +aliasInaccessibleModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasInaccessibleModule.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== aliasInaccessibleModule.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + export import X = N; + } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule.types b/tests/baselines/reference/aliasInaccessibleModule.types index db6580de04e75..92b8113901b02 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.types +++ b/tests/baselines/reference/aliasInaccessibleModule.types @@ -10,5 +10,6 @@ module M { export import X = N; >X : any > : ^^^ ->N : error +>N : any +> : ^^^ } diff --git a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt new file mode 100644 index 0000000000000..74346879cde4b --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt @@ -0,0 +1,18 @@ +aliasInaccessibleModule2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +aliasInaccessibleModule2.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== aliasInaccessibleModule2.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + } + + } + import R = N; + export import X = R; + } \ No newline at end of file diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt index 69493aecadc87..e372d12fceaf8 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.errors.txt @@ -1,3 +1,4 @@ +aliasOnMergedModuleInterface_0.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. aliasOnMergedModuleInterface_1.ts(5,16): error TS2708: Cannot use namespace 'foo' as a value. @@ -10,10 +11,12 @@ aliasOnMergedModuleInterface_1.ts(5,16): error TS2708: Cannot use namespace 'foo ~~~ !!! error TS2708: Cannot use namespace 'foo' as a value. -==== aliasOnMergedModuleInterface_0.ts (0 errors) ==== +==== aliasOnMergedModuleInterface_0.ts (1 errors) ==== declare module "foo" { module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { } } diff --git a/tests/baselines/reference/aliasesInSystemModule1.errors.txt b/tests/baselines/reference/aliasesInSystemModule1.errors.txt index cbd259f770a6a..62ed41998d85a 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..df79aaf1fd52b 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import cls = alias.Class; let x = new alias.Class(); let y = new cls(); diff --git a/tests/baselines/reference/alwaysStrictModule.errors.txt b/tests/baselines/reference/alwaysStrictModule.errors.txt index d3fa738698d47..fef79e49a378d 100644 --- a/tests/baselines/reference/alwaysStrictModule.errors.txt +++ b/tests/baselines/reference/alwaysStrictModule.errors.txt @@ -1,8 +1,11 @@ +alwaysStrictModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. alwaysStrictModule.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. -==== alwaysStrictModule.ts (1 errors) ==== +==== alwaysStrictModule.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f() { var arguments = []; ~~~~~~~~~ diff --git a/tests/baselines/reference/alwaysStrictModule2.errors.txt b/tests/baselines/reference/alwaysStrictModule2.errors.txt index 54481a89df317..4a753e175fb64 100644 --- a/tests/baselines/reference/alwaysStrictModule2.errors.txt +++ b/tests/baselines/reference/alwaysStrictModule2.errors.txt @@ -1,9 +1,13 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. a.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. b.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. -==== a.ts (1 errors) ==== +==== a.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f() { var arguments = []; ~~~~~~~~~ @@ -11,8 +15,10 @@ b.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. } } -==== b.ts (1 errors) ==== +==== b.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f2() { var arguments = []; ~~~~~~~~~ diff --git a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt index 1ad933c52218d..e025b1ba503a2 100644 --- a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt +++ b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt @@ -1,10 +1,13 @@ error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. +alwaysStrictNoImplicitUseStrict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. alwaysStrictNoImplicitUseStrict.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. !!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration. -==== alwaysStrictNoImplicitUseStrict.ts (1 errors) ==== +==== alwaysStrictNoImplicitUseStrict.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f() { var arguments = []; ~~~~~~~~~ diff --git a/tests/baselines/reference/ambientDeclarations.errors.txt b/tests/baselines/reference/ambientDeclarations.errors.txt new file mode 100644 index 0000000000000..86fe6e5277748 --- /dev/null +++ b/tests/baselines/reference/ambientDeclarations.errors.txt @@ -0,0 +1,85 @@ +ambientDeclarations.ts(55,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientDeclarations.ts(61,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var B; + } + var x = E3.B; + + // Ambient module + declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/ambientEnumElementInitializer6.errors.txt b/tests/baselines/reference/ambientEnumElementInitializer6.errors.txt new file mode 100644 index 0000000000000..9493eb9ed511b --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer6.errors.txt @@ -0,0 +1,11 @@ +ambientEnumElementInitializer6.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientEnumElementInitializer6.ts (1 errors) ==== + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum E { + e = 3 + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index ce20862cdb857..30443aadf8ace 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,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module 'nope' { } ~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index ae9302d5286e6..2f933bf9a0249 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,9 +1,12 @@ +ambientExternalModuleInsideNonAmbient.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ambientExternalModuleInsideNonAmbient.ts(2,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -==== ambientExternalModuleInsideNonAmbient.ts (2 errors) ==== +==== ambientExternalModuleInsideNonAmbient.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare module "M" { } ~~~~~~ !!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.errors.txt b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.errors.txt new file mode 100644 index 0000000000000..2e1ea474d1c1a --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.errors.txt @@ -0,0 +1,22 @@ +ambientExternalModuleWithInternalImportDeclaration_0.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientExternalModuleWithInternalImportDeclaration_1.ts (0 errors) ==== + /// + import A = require('M'); + var c = new A(); +==== ambientExternalModuleWithInternalImportDeclaration_0.ts (1 errors) ==== + declare module 'M' { + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var f: number; + } + class C { + foo(): void; + } + import X = C; + export = X; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.errors.txt b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.errors.txt new file mode 100644 index 0000000000000..f892c2fd6ff04 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.errors.txt @@ -0,0 +1,21 @@ +ambientExternalModuleWithoutInternalImportDeclaration_0.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientExternalModuleWithoutInternalImportDeclaration_1.ts (0 errors) ==== + /// + import A = require('M'); + var c = new A(); +==== ambientExternalModuleWithoutInternalImportDeclaration_0.ts (1 errors) ==== + declare module 'M' { + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var f: number; + } + class C { + foo(): void; + } + export = C; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/ambientFundule.errors.txt b/tests/baselines/reference/ambientFundule.errors.txt new file mode 100644 index 0000000000000..a8b435c11233b --- /dev/null +++ b/tests/baselines/reference/ambientFundule.errors.txt @@ -0,0 +1,9 @@ +ambientFundule.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientFundule.ts (1 errors) ==== + declare function f(); + declare module f { var x } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare function f(x); \ No newline at end of file diff --git a/tests/baselines/reference/ambientFundule.types b/tests/baselines/reference/ambientFundule.types index 884f964f2b838..8e488153c859d 100644 --- a/tests/baselines/reference/ambientFundule.types +++ b/tests/baselines/reference/ambientFundule.types @@ -9,9 +9,11 @@ declare module f { var x } >f : typeof f > : ^^^^^^^^ >x : any +> : ^^^ declare function f(x); >f : typeof f > : ^^^^^^^^ >x : any +> : ^^^ diff --git a/tests/baselines/reference/ambientInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientInsideNonAmbient.errors.txt new file mode 100644 index 0000000000000..f27fb1271eba5 --- /dev/null +++ b/tests/baselines/reference/ambientInsideNonAmbient.errors.txt @@ -0,0 +1,30 @@ +ambientInsideNonAmbient.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientInsideNonAmbient.ts(6,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientInsideNonAmbient.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientInsideNonAmbient.ts(14,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientInsideNonAmbient.ts (4 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare var x; + export declare function f(); + export declare class C { } + export declare enum E { } + export declare module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare var x; + declare function f(); + declare class C { } + declare enum E { } + declare module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ 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/ambientInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.errors.txt new file mode 100644 index 0000000000000..7864404c29fcd --- /dev/null +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.errors.txt @@ -0,0 +1,11 @@ +ambientInsideNonAmbientExternalModule.ts(5,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientInsideNonAmbientExternalModule.ts (1 errors) ==== + export declare var x; + export declare function f(); + export declare class C { } + export declare enum E { } + export declare module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types index 337697296dbe6..ab399bb12801c 100644 --- a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types @@ -3,6 +3,7 @@ === ambientInsideNonAmbientExternalModule.ts === export declare var x; >x : any +> : ^^^ export declare function f(); >f : () => any diff --git a/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt b/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt index 32d0fa85f966d..b2bc0f9cc2961 100644 --- a/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt +++ b/tests/baselines/reference/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt @@ -1,19 +1,31 @@ +ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(3,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(9,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare var tabId: number; } export const tabId = chrome.debugger.tabId; declare module test.class {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..f4ad0d9a945fb --- /dev/null +++ b/tests/baselines/reference/ambientModuleExports.errors.txt @@ -0,0 +1,28 @@ +ambientModuleExports.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientModuleExports.ts(11,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientModuleExports.ts (2 errors) ==== + declare module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function a():void; + var b:number; + class C {} + } + + Foo.a(); + Foo.b; + var c = new Foo.C(); + + declare module Foo2 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/ambientModuleWithClassDeclarationWithExtends.errors.txt b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.errors.txt new file mode 100644 index 0000000000000..8fa4c3ffd9e5d --- /dev/null +++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.errors.txt @@ -0,0 +1,10 @@ +ambientModuleWithClassDeclarationWithExtends.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientModuleWithClassDeclarationWithExtends.ts (1 errors) ==== + declare module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { } + class B extends A { } + } \ 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..529879ac30144 --- /dev/null +++ b/tests/baselines/reference/ambientModuleWithTemplateLiterals.errors.txt @@ -0,0 +1,26 @@ +ambientModuleWithTemplateLiterals.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientModuleWithTemplateLiterals.ts (1 errors) ==== + declare module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/ambientModules.errors.txt b/tests/baselines/reference/ambientModules.errors.txt new file mode 100644 index 0000000000000..c33e08d69859d --- /dev/null +++ b/tests/baselines/reference/ambientModules.errors.txt @@ -0,0 +1,11 @@ +ambientModules.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ambientModules.ts(1,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ambientModules.ts (2 errors) ==== + declare module Foo.Bar { export var foo; }; + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + Foo.Bar.foo = 5; \ No newline at end of file diff --git a/tests/baselines/reference/ambientModules.types b/tests/baselines/reference/ambientModules.types index 6ef1a845483b4..ac53317188a1b 100644 --- a/tests/baselines/reference/ambientModules.types +++ b/tests/baselines/reference/ambientModules.types @@ -7,11 +7,13 @@ declare module Foo.Bar { export var foo; }; >Bar : typeof Bar > : ^^^^^^^^^^ >foo : any +> : ^^^ Foo.Bar.foo = 5; >Foo.Bar.foo = 5 : 5 > : ^ >Foo.Bar.foo : any +> : ^^^ >Foo.Bar : typeof Foo.Bar > : ^^^^^^^^^^^^^^ >Foo : typeof Foo diff --git a/tests/baselines/reference/ambientStatement1.errors.txt b/tests/baselines/reference/ambientStatement1.errors.txt index 8ab93c1b1f56c..250b9db6adaa9 100644 --- a/tests/baselines/reference/ambientStatement1.errors.txt +++ b/tests/baselines/reference/ambientStatement1.errors.txt @@ -1,9 +1,12 @@ +ambientStatement1.ts(1,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ambientStatement1.ts(2,6): error TS1036: Statements are not allowed in ambient contexts. ambientStatement1.ts(4,22): error TS1039: Initializers are not allowed in ambient contexts. -==== ambientStatement1.ts (2 errors) ==== +==== ambientStatement1.ts (3 errors) ==== declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while(true); ~~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index 5201538571011..8b37520e5f034 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -1,11 +1,14 @@ +ambientWithStatements.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts. ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body. ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -==== ambientWithStatements.ts (4 errors) ==== +==== ambientWithStatements.ts (5 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. break; ~~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.errors.txt b/tests/baselines/reference/amdImportNotAsPrimaryExpression.errors.txt new file mode 100644 index 0000000000000..83332d965991f --- /dev/null +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.errors.txt @@ -0,0 +1,35 @@ +foo_0.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + // None of the below should cause a runtime dependency on foo_0 + import f = foo.M1; + var i: f.I2; + var x: foo.C1 = <{m1: number}>{}; + var y: typeof foo.C1.s1 = false; + var z: foo.M1.I2; + var e: number = 0; +==== foo_0.ts (1 errors) ==== + export class C1 { + m1 = 42; + static s1 = true; + } + + export interface I1 { + name: string; + age: number; + } + + export module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I2 { + foo: string; + } + } + + export enum E1 { + A,B,C + } + \ No newline at end of file diff --git a/tests/baselines/reference/anonterface.errors.txt b/tests/baselines/reference/anonterface.errors.txt new file mode 100644 index 0000000000000..e8cdf07720e4e --- /dev/null +++ b/tests/baselines/reference/anonterface.errors.txt @@ -0,0 +1,20 @@ +anonterface.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== anonterface.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + m(fn:{ (n:number):string; },n2:number):string { + return fn(n2); + } + } + } + + var c=new M.C(); + c.m(function(n) { return "hello: "+n; },18); + + + + \ 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..ee0cf773801d4 --- /dev/null +++ b/tests/baselines/reference/anyAssignabilityInInheritance.errors.txt @@ -0,0 +1,97 @@ +anyAssignabilityInInheritance.ts(67,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +anyAssignabilityInInheritance.ts(75,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..2714a229f58f2 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt @@ -0,0 +1,139 @@ +anyAssignableToEveryType2.ts(89,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +anyAssignableToEveryType2.ts(99,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + interface I15 { + [x: string]: typeof f; + foo: any; + } + + + class c { baz: string } + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/anyDeclare.errors.txt b/tests/baselines/reference/anyDeclare.errors.txt index cfbb06ee70413..2a0cbd3f3df4a 100644 --- a/tests/baselines/reference/anyDeclare.errors.txt +++ b/tests/baselines/reference/anyDeclare.errors.txt @@ -1,10 +1,13 @@ +anyDeclare.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. anyDeclare.ts(3,9): error TS2300: Duplicate identifier 'myFn'. anyDeclare.ts(4,14): error TS2300: Duplicate identifier 'myFn'. -==== anyDeclare.ts (2 errors) ==== +==== anyDeclare.ts (3 errors) ==== declare var x: any; module myMod { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var myFn; ~~~~ !!! error TS2300: Duplicate identifier 'myFn'. diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index a8263630deaa9..d518ad7090004 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,9 +1,12 @@ +arrayAssignmentTest5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface IState { } interface IToken { diff --git a/tests/baselines/reference/arrayAssignmentTest6.errors.txt b/tests/baselines/reference/arrayAssignmentTest6.errors.txt new file mode 100644 index 0000000000000..262a343f62354 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest6.errors.txt @@ -0,0 +1,26 @@ +arrayAssignmentTest6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== arrayAssignmentTest6.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface IState { + } + interface IToken { + startIndex: number; + } + interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + interface IMode { + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; + } + export class Bug implements IMode { + public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { + return null; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/arrayBestCommonTypes.errors.txt b/tests/baselines/reference/arrayBestCommonTypes.errors.txt new file mode 100644 index 0000000000000..a302cbfd07521 --- /dev/null +++ b/tests/baselines/reference/arrayBestCommonTypes.errors.txt @@ -0,0 +1,116 @@ +arrayBestCommonTypes.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +arrayBestCommonTypes.ts(54,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== arrayBestCommonTypes.ts (2 errors) ==== + module EmptyTypes { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index e1b1746de5889..ff7c9ece66b51 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -1,11 +1,14 @@ +arraySigChecking.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. arraySigChecking.ts(11,17): error TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. arraySigChecking.ts(18,27): error TS2322: Type 'void' is not assignable to type 'string'. arraySigChecking.ts(22,13): error TS2322: Type 'number' is not assignable to type 'number[]'. arraySigChecking.ts(22,16): error TS2322: Type 'number' is not assignable to type 'number[]'. -==== arraySigChecking.ts (4 errors) ==== +==== arraySigChecking.ts (5 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface iBar { t: any; } interface iFoo extends iBar { s: any; diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.errors.txt b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.errors.txt new file mode 100644 index 0000000000000..ef59586e3af4e --- /dev/null +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.errors.txt @@ -0,0 +1,34 @@ +arrayTypeInSignatureOfInterfaceAndClass.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +arrayTypeInSignatureOfInterfaceAndClass.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== arrayTypeInSignatureOfInterfaceAndClass.ts (2 errors) ==== + declare module WinJS { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Promise { + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; + } + } + declare module Data { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IListItem { + itemIndex: number; + key: any; + data: T; + group: any; + isHeader: boolean; + cached: boolean; + isNonSourceData: boolean; + preventAugmentation: boolean; + } + export interface IVirtualList { + //removeIndices: WinJS.Promise[]>; + removeIndices(indices: number[], options?: any): WinJS.Promise[]>; + } + export class VirtualList implements IVirtualList { + //removeIndices: WinJS.Promise[]>; + public removeIndices(indices: number[], options?: any): WinJS.Promise[]>; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types index 5c62a97c0fc12..05b92d374bfbd 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types @@ -19,9 +19,11 @@ declare module WinJS { >error : (error: any) => Promise > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ } } declare module Data { @@ -35,6 +37,7 @@ declare module Data { key: any; >key : any +> : ^^^ data: T; >data : T @@ -42,6 +45,7 @@ declare module Data { group: any; >group : any +> : ^^^ isHeader: boolean; >isHeader : boolean @@ -67,6 +71,7 @@ declare module Data { >indices : number[] > : ^^^^^^^^ >options : any +> : ^^^ >WinJS : any > : ^^^ } @@ -81,6 +86,7 @@ declare module Data { >indices : number[] > : ^^^^^^^^ >options : any +> : ^^^ >WinJS : any > : ^^^ } diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 1e27fe363487b..ab32ca3d17ab4 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +arrowFunctionContexts.ts(41,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = (s) => ''; var b = (s) => s; } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.errors.txt b/tests/baselines/reference/arrowFunctionInExpressionStatement2.errors.txt new file mode 100644 index 0000000000000..0fe9aaa473220 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.errors.txt @@ -0,0 +1,9 @@ +arrowFunctionInExpressionStatement2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== arrowFunctionInExpressionStatement2.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + () => 0; + } \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt index 925b762414f79..f8e0ddd2be64f 100644 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt +++ b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt @@ -1,14 +1,18 @@ +arrowFunctionsMissingTokens.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +arrowFunctionsMissingTokens.ts(14,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== arrowFunctionsMissingTokens.ts (24 errors) ==== +==== arrowFunctionsMissingTokens.ts (30 errors) ==== module missingArrowsWithCurly { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = () { }; ~ !!! error TS1005: '=>' expected. @@ -48,7 +56,11 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected. } module missingCurliesWithArrow { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module withStatement { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = () => var k = 10;}; ~~~ !!! error TS1005: '{' expected. @@ -75,6 +87,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected. } module withoutStatement { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = (); ~ !!! error TS1109: Expression expected. @@ -128,6 +144,8 @@ arrowFunctionsMissingTokens.ts(52,41): error TS1005: '=>' expected. } module okay { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..9442e560cb172 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.errors.txt @@ -0,0 +1,15 @@ +asiPreventsParsingAsAmbientExternalModule02.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== asiPreventsParsingAsAmbientExternalModule02.ts (1 errors) ==== + var declare: number; + var module: string; + + module container { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/assign1.errors.txt b/tests/baselines/reference/assign1.errors.txt new file mode 100644 index 0000000000000..37055435d3757 --- /dev/null +++ b/tests/baselines/reference/assign1.errors.txt @@ -0,0 +1,15 @@ +assign1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assign1.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface I { + salt:number; + pepper:number; + } + + var x:I={salt:2,pepper:0}; + } + \ No newline at end of file diff --git a/tests/baselines/reference/assignAnyToEveryType.errors.txt b/tests/baselines/reference/assignAnyToEveryType.errors.txt index d0704bab7a465..57c7dcc907474 100644 --- a/tests/baselines/reference/assignAnyToEveryType.errors.txt +++ b/tests/baselines/reference/assignAnyToEveryType.errors.txt @@ -1,7 +1,8 @@ +assignAnyToEveryType.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignAnyToEveryType.ts(41,1): error TS2631: Cannot assign to 'M' because it is a namespace. -==== assignAnyToEveryType.ts (1 errors) ==== +==== assignAnyToEveryType.ts (2 errors) ==== // all of these are valid var x: any; @@ -39,6 +40,8 @@ assignAnyToEveryType.ts(41,1): error TS2631: Cannot assign to 'M' because it is var j2: { (x: T): string } = x; module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var foo = 1; } diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt index aa2cfd5c1e952..7ce27500cafad 100644 --- a/tests/baselines/reference/assignToExistingClass.errors.txt +++ b/tests/baselines/reference/assignToExistingClass.errors.txt @@ -1,8 +1,11 @@ +assignToExistingClass.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Mocked { myProp: string; } diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index cc1b83bf65913..137d7044fa0df 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,8 +1,11 @@ +assignToFn.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. -==== assignToFn.ts (1 errors) ==== +==== assignToFn.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I { f(n:number):boolean; } diff --git a/tests/baselines/reference/assignToModule.errors.txt b/tests/baselines/reference/assignToModule.errors.txt index 3b0a5bb65aa36..d128cced7ad5b 100644 --- a/tests/baselines/reference/assignToModule.errors.txt +++ b/tests/baselines/reference/assignToModule.errors.txt @@ -1,8 +1,11 @@ +assignToModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignToModule.ts(2,1): error TS2708: Cannot use namespace 'A' as a value. -==== assignToModule.ts (1 errors) ==== +==== assignToModule.ts (2 errors) ==== module A {} + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. A = undefined; // invalid LHS ~ !!! error TS2708: Cannot use namespace 'A' as a value. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index c91ddb00897e1..bcca04ad5b562 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,3 +1,5 @@ +assignmentCompatWithCallSignatures4.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatWithCallSignatures4.ts(9,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // 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..1ca5adffd21f7 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,3 +1,5 @@ +assignmentCompatWithConstructSignatures4.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatWithConstructSignatures4.ts(9,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // 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..4e06a5a8dea95 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,7 +1,9 @@ +assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Base { a: () => T; a2: (x?: T) => T; @@ -143,6 +148,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro } module GenericSignaturesInvalid { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Base2 { a: () => T; @@ -336,6 +343,8 @@ assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): erro } module GenericSignaturesValid { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Base2 { a: () => T; diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index f990fc308dcb9..ae4764d8e25d2 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: number]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index 0afe61148c6b4..9595d47750c9f 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -4,6 +4,7 @@ assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assi assignmentCompatWithNumericIndexer2.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 +assignmentCompatWithNumericIndexer2.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatWithNumericIndexer2.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 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not a Type 'Base' is missing the following properties from type 'Derived2': baz, bar -==== assignmentCompatWithNumericIndexer2.ts (6 errors) ==== +==== assignmentCompatWithNumericIndexer2.ts (7 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -52,6 +53,8 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not a !!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { [x: number]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index cc002dbfafb92..c855649a8a5f2 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -4,13 +4,14 @@ assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. 'number' index signatures are incompatible. Property 'baz' is missing in type 'Derived' but required in type 'Derived2'. +assignmentCompatWithNumericIndexer3.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatWithNumericIndexer3.ts(33,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'. 'Derived' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived'. -==== assignmentCompatWithNumericIndexer3.ts (3 errors) ==== +==== assignmentCompatWithNumericIndexer3.ts (4 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -46,6 +47,8 @@ assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: !!! related TS2728 assignmentCompatWithNumericIndexer3.ts:5:38: 'baz' is declared here. module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..e876556d5e51a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.errors.txt @@ -0,0 +1,94 @@ +assignmentCompatWithObjectMembers.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatWithObjectMembers.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..4ed46791ea393 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,3 +1,4 @@ +assignmentCompatWithObjectMembers4.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..c2e99f1fc39bd 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -1,3 +1,4 @@ +assignmentCompatWithObjectMembersAccessibility.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets class Base { public foo: string; @@ -129,6 +133,8 @@ assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' } module TargetIsPublic { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets class Base { private foo: string; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt index 6182370720517..2c4ea05e4a470 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -1,3 +1,5 @@ +assignmentCompatWithObjectMembersOptionality.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatWithObjectMembersOptionality.ts(49,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets interface C { opt?: Base @@ -62,6 +66,8 @@ assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is } module SourceHasOptional { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets interface C { opt: Base diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index f1ba1224c455d..a6809db100692 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,3 +1,4 @@ +assignmentCompatWithObjectMembersOptionality2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets interface C { opt?: Base @@ -87,6 +91,8 @@ assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2741: Property ' } module SourceHasOptional { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // targets interface C { opt: Base diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index 6c85c052e0336..bb8861ee0666e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,3 +1,4 @@ +assignmentCompatWithObjectMembersStringNumericNames.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..5457e41c72aca 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: string]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index c330a9fa38b33..0177bbd6cd78b 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { [x: string]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt index f7de5656d1044..371b11b36856a 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -1,4 +1,5 @@ assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'. +assignmentCompatWithStringIndexer3.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. 'string' index signatures are incompatible. Type 'string' is not assignable to type 'T'. @@ -9,7 +10,7 @@ assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not as Type 'Derived' is not assignable to type 'string'. -==== assignmentCompatWithStringIndexer3.ts (3 errors) ==== +==== assignmentCompatWithStringIndexer3.ts (4 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -24,6 +25,8 @@ assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not as b1 = a; // error module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class 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..7635b5c0d4cd0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability1.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability1.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability1.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt new file mode 100644 index 0000000000000..5d4abcae191b3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability10.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability10.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability10.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class classWithPublicAndOptional { constructor(public one: T, public two?: U) {} } var x4 = new classWithPublicAndOptional(1);; + export var __val__x4 = x4; + } + __test2__.__val__x4 = __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..bfaec042ff7f6 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability11.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability11.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..dabd4999097b0 100644 --- a/tests/baselines/reference/assignmentCompatability12.errors.txt +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability12.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability12.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..d34aab6bbddd8 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability13.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability13.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..42c9c81928e8f 100644 --- a/tests/baselines/reference/assignmentCompatability14.errors.txt +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability14.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability14.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..ebd5e6b8fb189 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability15.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability15.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..2fd31bd4eca50 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability16.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability16.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..8d7cb3dc3bdea 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability17.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability17.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..991a36cdcfe54 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability18.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability18.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..49648b014328a 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability19.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability19.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..b3d330b6d5fcd --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability2.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability2.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability2.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..9166afdd4b807 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability20.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability20.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..75d9f4bdadeb6 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability21.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability21.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..23e498fd35a39 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability22.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability22.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..e5072d41245ee 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability23.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability23.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..7d4ec1023d38b 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability24.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability24.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..e8a4e48c68f08 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability25.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability25.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..55354d1e9c971 100644 --- a/tests/baselines/reference/assignmentCompatability26.errors.txt +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability26.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability26.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..c3938d9e74941 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability27.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability27.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..3eaa9e9a37af1 100644 --- a/tests/baselines/reference/assignmentCompatability28.errors.txt +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability28.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability28.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..30b9e09d20187 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability29.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability29.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..a51ac66127337 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability3.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability3.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability3.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..da8945a06b55b 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability30.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability30.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..07a6da4f3d50d 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability31.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability31.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..2efad35037a66 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,14 +1,20 @@ +assignmentCompatability32.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability32.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..31cfe3dcc24b1 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability33.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability33.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..b027062cb032a 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability34.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability34.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..0d0d02909548a 100644 --- a/tests/baselines/reference/assignmentCompatability35.errors.txt +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability35.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability35.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..eef5ac9592a2a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability36.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability36.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability36.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..863430da8841e 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability37.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability37.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..335445123c53c 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability38.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability38.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var aa:{ new (param: Tstring); };; export var __val__aa = aa; } diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index a3dda96f781e1..20166ffeeef10 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability39.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability39.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. -==== assignmentCompatability39.ts (1 errors) ==== +==== assignmentCompatability39.ts (3 errors) ==== module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class classWithTwoPublic { constructor(public one: T, public two: U) {} } var x2 = new classWithTwoPublic(1, "a");; export var __val__x2 = x2; } diff --git a/tests/baselines/reference/assignmentCompatability4.errors.txt b/tests/baselines/reference/assignmentCompatability4.errors.txt new file mode 100644 index 0000000000000..d3089db6323b2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability4.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability4.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability4.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt index a990107339074..13aac8fcd49dc 100644 --- a/tests/baselines/reference/assignmentCompatability40.errors.txt +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability40.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability40.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. -==== assignmentCompatability40.ts (1 errors) ==== +==== assignmentCompatability40.ts (3 errors) ==== module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class classWithPrivate { constructor(private one: T) {} } var x5 = new classWithPrivate(1);; export var __val__x5 = x5; } diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt index 7f5a1e60cbeff..086a5a91e4b80 100644 --- a/tests/baselines/reference/assignmentCompatability41.errors.txt +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability41.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability41.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. -==== assignmentCompatability41.ts (1 errors) ==== +==== assignmentCompatability41.ts (3 errors) ==== module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class classWithTwoPrivate { constructor(private one: T, private two: U) {} } var x6 = new classWithTwoPrivate(1, "a");; export var __val__x6 = x6; } diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt index 7cd727cf1f7e5..65ce8250f0a98 100644 --- a/tests/baselines/reference/assignmentCompatability42.errors.txt +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability42.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability42.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. -==== assignmentCompatability42.ts (1 errors) ==== +==== assignmentCompatability42.ts (3 errors) ==== module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class classWithPublicPrivate { constructor(public one: T, private two: U) {} } var x7 = new classWithPublicPrivate(1, "a");; export var __val__x7 = x7; } diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index 97874671752be..8f3edb44338f1 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,13 +1,19 @@ +assignmentCompatability43.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability43.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. -==== assignmentCompatability43.ts (1 errors) ==== +==== assignmentCompatability43.ts (3 errors) ==== module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface interfaceTwo { one: T; two: U; }; var obj2: interfaceTwo = { one: 1, two: "a" };; export var __val__obj2 = obj2; } diff --git a/tests/baselines/reference/assignmentCompatability5.errors.txt b/tests/baselines/reference/assignmentCompatability5.errors.txt new file mode 100644 index 0000000000000..8bdf3743f3cd1 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability5.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability5.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability5.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceOne { one: T; }; var obj1: interfaceOne = { one: 1 };; + export var __val__obj1 = obj1; + } + __test2__.__val__obj1 = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability6.errors.txt b/tests/baselines/reference/assignmentCompatability6.errors.txt new file mode 100644 index 0000000000000..87bb205c79714 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability6.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability6.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability6.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; + export var __val__obj3 = obj3; + } + __test2__.__val__obj3 = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability7.errors.txt b/tests/baselines/reference/assignmentCompatability7.errors.txt new file mode 100644 index 0000000000000..22083425fc8dd --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability7.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability7.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability7.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability7.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + __test2__.__val__obj4 = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability8.errors.txt b/tests/baselines/reference/assignmentCompatability8.errors.txt new file mode 100644 index 0000000000000..f16cd428407f3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability8.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability8.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability8.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability8.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class classWithPublic { constructor(public one: T) {} } var x1 = new classWithPublic(1);; + export var __val__x1 = x1; + } + __test2__.__val__x1 = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability9.errors.txt b/tests/baselines/reference/assignmentCompatability9.errors.txt new file mode 100644 index 0000000000000..cb2e3177e7282 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability9.errors.txt @@ -0,0 +1,18 @@ +assignmentCompatability9.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentCompatability9.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== assignmentCompatability9.ts (2 errors) ==== + module __test1__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + module __test2__ { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; + export var __val__x3 = x3; + } + __test2__.__val__x3 = __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..98524e9207d09 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = value; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/assignmentToFunction.errors.txt b/tests/baselines/reference/assignmentToFunction.errors.txt index fe15bb4dcd190..e562cf9ab1275 100644 --- a/tests/baselines/reference/assignmentToFunction.errors.txt +++ b/tests/baselines/reference/assignmentToFunction.errors.txt @@ -1,14 +1,17 @@ assignmentToFunction.ts(2,1): error TS2630: Cannot assign to 'fn' because it is a function. +assignmentToFunction.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentToFunction.ts(8,9): error TS2630: Cannot assign to 'bar' because it is a function. -==== assignmentToFunction.ts (2 errors) ==== +==== assignmentToFunction.ts (3 errors) ==== function fn() { } fn = () => 3; ~~ !!! error TS2630: Cannot assign to 'fn' because it is a function. module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function xyz() { function bar() { } diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index 733139013e432..7f1e149e1f2da 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,11 +1,14 @@ assignmentToObjectAndFunction.ts(1,24): error TS2322: Type 'number' is not assignable to type '() => string'. assignmentToObjectAndFunction.ts(8,5): error TS2740: Type '{}' is missing the following properties from type 'Function': apply, call, bind, prototype, and 3 more. +assignmentToObjectAndFunction.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentToObjectAndFunction.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentToObjectAndFunction.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(this: Function, thisArg: any, argArray?: any) => any'. -==== assignmentToObjectAndFunction.ts (3 errors) ==== +==== assignmentToObjectAndFunction.ts (6 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type '() => string'. @@ -21,6 +24,8 @@ assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not a function foo() { } module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var boom = 0; } @@ -28,6 +33,8 @@ assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not a function bar() { } module bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function apply(thisArg: string, argArray?: string) { } } @@ -35,6 +42,8 @@ assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not a function bad() { } module bad { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var apply = 0; } diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 168cb6b653be7..2a38b01f35595 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +assignmentToParenthesizedIdentifiers.ts(21,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x: number; } diff --git a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt index a0e6c842d91fa..eafff9f9ded4d 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt +++ b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt @@ -1,13 +1,16 @@ +assignmentToReferenceTypes.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignmentToReferenceTypes.ts(5,1): error TS2708: Cannot use namespace 'M' as a value. assignmentToReferenceTypes.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class. assignmentToReferenceTypes.ts(13,1): error TS2628: Cannot assign to 'E' because it is an enum. assignmentToReferenceTypes.ts(16,1): error TS2630: Cannot assign to 'f' because it is a function. -==== assignmentToReferenceTypes.ts (4 errors) ==== +==== assignmentToReferenceTypes.ts (5 errors) ==== // Should all be allowed module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } M = null; ~ diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index d55a66a9b642e..b8a3c3a7750ab 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,3 +1,4 @@ +assignments.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. assignments.ts(11,1): error TS2708: Cannot use namespace 'M' as a value. assignments.ts(14,1): error TS2629: Cannot assign to 'C' because it is a class. assignments.ts(17,1): error TS2628: Cannot assign to 'E' because it is an enum. @@ -6,7 +7,7 @@ assignments.ts(21,1): error TS2630: Cannot assign to 'fn' because it is a functi assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here. -==== assignments.ts (6 errors) ==== +==== assignments.ts (7 errors) ==== // In this file: // Assign to a module // Assign to a class @@ -17,6 +18,8 @@ assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used // Assign to an interface module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = null; // Error ~ !!! error TS2708: Cannot use namespace 'M' as a value. diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt b/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.errors.txt index d31f2dc0c77fc..ea051dab40b5b 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..2b9254857d5ac 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..f53acacdcbbfe 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,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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..a3546292af254 --- /dev/null +++ b/tests/baselines/reference/asyncAwait_es2017.errors.txt @@ -0,0 +1,52 @@ +asyncAwait_es2017.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..27529fda3f5b7 --- /dev/null +++ b/tests/baselines/reference/asyncAwait_es5.errors.txt @@ -0,0 +1,52 @@ +asyncAwait_es5.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 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..d3e160451a1dd --- /dev/null +++ b/tests/baselines/reference/asyncAwait_es6.errors.txt @@ -0,0 +1,52 @@ +asyncAwait_es6.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== 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 { } + async m3(): MyPromise { } + static async m4() { } + static async m5(): Promise { } + static async m6(): MyPromise { } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export async function f1() { } + } + + async function f14() { + block: { + await 1; + break block; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncModule_es5.errors.txt b/tests/baselines/reference/asyncModule_es5.errors.txt index a9b7e9e3c542a..1e1a93d5e8077 100644 --- a/tests/baselines/reference/asyncModule_es5.errors.txt +++ b/tests/baselines/reference/asyncModule_es5.errors.txt @@ -1,8 +1,11 @@ asyncModule_es5.ts(1,1): error TS1042: 'async' modifier cannot be used here. +asyncModule_es5.ts(1,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== asyncModule_es5.ts (1 errors) ==== +==== asyncModule_es5.ts (2 errors) ==== async module M { ~~~~~ !!! error TS1042: 'async' modifier cannot be used here. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/asyncModule_es6.errors.txt b/tests/baselines/reference/asyncModule_es6.errors.txt index 3b50471f3004c..142e5061bee99 100644 --- a/tests/baselines/reference/asyncModule_es6.errors.txt +++ b/tests/baselines/reference/asyncModule_es6.errors.txt @@ -1,8 +1,11 @@ asyncModule_es6.ts(1,1): error TS1042: 'async' modifier cannot be used here. +asyncModule_es6.ts(1,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== asyncModule_es6.ts (1 errors) ==== +==== asyncModule_es6.ts (2 errors) ==== async module M { ~~~~~ !!! error TS1042: 'async' modifier cannot be used here. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/augmentExportEquals5.errors.txt b/tests/baselines/reference/augmentExportEquals5.errors.txt new file mode 100644 index 0000000000000..c40e7d84a2cca --- /dev/null +++ b/tests/baselines/reference/augmentExportEquals5.errors.txt @@ -0,0 +1,84 @@ +express.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== express.d.ts (1 errors) ==== + declare module Express { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Request { } + export interface Response { } + export interface Application { } + } + + declare module "express" { + function e(): e.Express; + namespace e { + interface IRoute { + all(...handler: RequestHandler[]): IRoute; + } + + interface IRouterMatcher { + (name: string|RegExp, ...handlers: RequestHandler[]): T; + } + + interface IRouter extends RequestHandler { + route(path: string): IRoute; + } + + export function Router(options?: any): Router; + + export interface Router extends IRouter {} + + interface Errback { (err: Error): void; } + + interface Request extends Express.Request { + + get (name: string): string; + } + + interface Response extends Express.Response { + charset: string; + } + + interface ErrorRequestHandler { + (err: any, req: Request, res: Response, next: Function): any; + } + + interface RequestHandler { + (req: Request, res: Response, next: Function): any; + } + + interface Handler extends RequestHandler {} + + interface RequestParamHandler { + (req: Request, res: Response, next: Function, param: any): any; + } + + interface Application extends IRouter, Express.Application { + routes: any; + } + + interface Express extends Application { + createApplication(): Application; + } + + var static: any; + } + + export = e; + } + +==== augmentation.ts (0 errors) ==== + /// + import * as e from "express"; + declare module "express" { + interface Request { + id: number; + } + } + +==== consumer.ts (0 errors) ==== + import { Request } from "express"; + import "./augmentation"; + let x: Request; + const y = x.id; \ No newline at end of file diff --git a/tests/baselines/reference/augmentExportEquals5.types b/tests/baselines/reference/augmentExportEquals5.types index 7c512800e3d27..4575e304240a3 100644 --- a/tests/baselines/reference/augmentExportEquals5.types +++ b/tests/baselines/reference/augmentExportEquals5.types @@ -49,6 +49,7 @@ declare module "express" { >Router : (options?: any) => Router > : ^ ^^^ ^^^^^ >options : any +> : ^^^ export interface Router extends IRouter {} @@ -79,6 +80,7 @@ declare module "express" { interface ErrorRequestHandler { (err: any, req: Request, res: Response, next: Function): any; >err : any +> : ^^^ >req : Request > : ^^^^^^^ >res : Response @@ -108,6 +110,7 @@ declare module "express" { >next : Function > : ^^^^^^^^ >param : any +> : ^^^ } interface Application extends IRouter, Express.Application { @@ -116,6 +119,7 @@ declare module "express" { routes: any; >routes : any +> : ^^^ } interface Express extends Application { @@ -126,6 +130,7 @@ declare module "express" { var static: any; >static : any +> : ^^^ } export = e; diff --git a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt index 5dc80d0a39df4..7fd519a706f6e 100644 --- a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt +++ b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.errors.txt @@ -1,8 +1,11 @@ +augmentedClassWithPrototypePropertyOnModule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedClassWithPrototypePropertyOnModule.ts(3,9): error TS2300: Duplicate identifier 'prototype'. -==== augmentedClassWithPrototypePropertyOnModule.ts (1 errors) ==== +==== augmentedClassWithPrototypePropertyOnModule.ts (2 errors) ==== declare module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var f; var prototype; // This should be error since prototype would be static property on class m ~~~~~~~~~ diff --git a/tests/baselines/reference/augmentedTypesClass3.errors.txt b/tests/baselines/reference/augmentedTypesClass3.errors.txt new file mode 100644 index 0000000000000..21bed5d14c337 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass3.errors.txt @@ -0,0 +1,25 @@ +augmentedTypesClass3.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesClass3.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesClass3.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== augmentedTypesClass3.ts (3 errors) ==== + // class then module + class c5 { public foo() { } } + module c5 { } // should be ok + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class c5a { public foo() { } } + module c5a { var y = 2; } // should be ok + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class c5b { public foo() { } } + module c5b { export var y = 2; } // should be ok + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + //// class then import + class c5c { public foo() { } } + //import c5c = require(''); \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesEnum.errors.txt b/tests/baselines/reference/augmentedTypesEnum.errors.txt index a8e9752429881..d07063dd87cf0 100644 --- a/tests/baselines/reference/augmentedTypesEnum.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum.errors.txt @@ -10,9 +10,12 @@ augmentedTypesEnum.ts(18,11): error TS2432: In an enum with multiple declaration augmentedTypesEnum.ts(20,12): error TS2300: Duplicate identifier 'One'. augmentedTypesEnum.ts(21,12): error TS2300: Duplicate identifier 'One'. augmentedTypesEnum.ts(21,12): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +augmentedTypesEnum.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesEnum.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesEnum.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== augmentedTypesEnum.ts (12 errors) ==== +==== augmentedTypesEnum.ts (15 errors) ==== // enum then var enum e1111 { One } // error ~~~~~ @@ -62,12 +65,18 @@ augmentedTypesEnum.ts(21,12): error TS2432: In an enum with multiple declaration // enum then internal module enum e6 { One } module e6 { } // ok + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum e6a { One } module e6a { var y = 2; } // should be error + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum e6b { One } module e6b { export var y = 2; } // should be error + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // enum then import, messes with error reporting //enum e7 { One } diff --git a/tests/baselines/reference/augmentedTypesEnum3.errors.txt b/tests/baselines/reference/augmentedTypesEnum3.errors.txt index a50b45318012d..58908d84731e2 100644 --- a/tests/baselines/reference/augmentedTypesEnum3.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum3.errors.txt @@ -1,16 +1,26 @@ +augmentedTypesEnum3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesEnum3.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesEnum3.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesEnum3.ts(16,5): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +augmentedTypesEnum3.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== augmentedTypesEnum3.ts (1 errors) ==== +==== augmentedTypesEnum3.ts (5 errors) ==== module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var t; } enum E { } enum F { } module F { var t; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var o; } enum A { @@ -22,5 +32,7 @@ augmentedTypesEnum3.ts(16,5): error TS2432: In an enum with multiple declaration !!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var p; } \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.errors.txt b/tests/baselines/reference/augmentedTypesExternalModule1.errors.txt new file mode 100644 index 0000000000000..e7da67d073926 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesExternalModule1.errors.txt @@ -0,0 +1,9 @@ +augmentedTypesExternalModule1.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== augmentedTypesExternalModule1.ts (1 errors) ==== + export var a = 1; + class c5 { public foo() { } } + module c5 { } // should be ok everywhere + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesFunction.errors.txt b/tests/baselines/reference/augmentedTypesFunction.errors.txt index 241e746460938..20343321e0b66 100644 --- a/tests/baselines/reference/augmentedTypesFunction.errors.txt +++ b/tests/baselines/reference/augmentedTypesFunction.errors.txt @@ -10,9 +10,13 @@ augmentedTypesFunction.ts(16,10): error TS2814: Function with bodies can only me augmentedTypesFunction.ts(17,7): error TS2813: Class declaration cannot implement overload list for 'y3a'. augmentedTypesFunction.ts(20,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations. augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +augmentedTypesFunction.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesFunction.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesFunction.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesFunction.ts(34,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== augmentedTypesFunction.ts (12 errors) ==== +==== augmentedTypesFunction.ts (16 errors) ==== // function then var function y1() { } // error ~~ @@ -66,15 +70,23 @@ augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge // function then internal module function y5() { } module y5 { } // ok since module is not instantiated + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function y5a() { } module y5a { var y = 2; } // should be an error + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function y5b() { } module y5b { export var y = 3; } // should be an error + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function y5c() { } module y5c { export interface I { foo(): void } } // should be an error + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // function then import, messes with other errors //function y6() { } diff --git a/tests/baselines/reference/augmentedTypesModules.errors.txt b/tests/baselines/reference/augmentedTypesModules.errors.txt index c5e17402e5b7e..85b10a4f6764b 100644 --- a/tests/baselines/reference/augmentedTypesModules.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules.errors.txt @@ -1,21 +1,54 @@ +augmentedTypesModules.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(5,8): error TS2300: Duplicate identifier 'm1a'. augmentedTypesModules.ts(6,5): error TS2300: Duplicate identifier 'm1a'. +augmentedTypesModules.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(8,8): error TS2300: Duplicate identifier 'm1b'. augmentedTypesModules.ts(9,5): error TS2300: Duplicate identifier 'm1b'. +augmentedTypesModules.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(16,8): error TS2300: Duplicate identifier 'm1d'. augmentedTypesModules.ts(19,5): error TS2300: Duplicate identifier 'm1d'. +augmentedTypesModules.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(25,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(28,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(39,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(48,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(51,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules.ts(55,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(58,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(61,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(63,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(67,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(70,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(74,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(77,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(80,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(83,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(86,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(91,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(92,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules.ts(95,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== augmentedTypesModules.ts (9 errors) ==== +==== augmentedTypesModules.ts (38 errors) ==== // module then var module m1 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var m1 = 1; // Should be allowed module m1a { var y = 2; } // error ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2300: Duplicate identifier 'm1a'. var m1a = 1; // error ~~~ @@ -23,18 +56,24 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be module m1b { export var y = 2; } // error ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2300: Duplicate identifier 'm1b'. var m1b = 1; // error ~~~ !!! error TS2300: Duplicate identifier 'm1b'. module m1c { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { foo(): void; } } var m1c = 1; // Should be allowed module m1d { // error ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2300: Duplicate identifier 'm1d'. export class I { foo() { } } } @@ -44,84 +83,132 @@ augmentedTypesModules.ts(51,8): error TS2434: A namespace declaration cannot be // module then function module m2 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2() { }; // ok since the module is not instantiated module m2a { var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. function m2b() { }; // error since the module is instantiated // should be errors to have function first function m2c() { }; module m2c { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m2d { } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare function m2d(): void; declare function m2e(): void; module m2e { } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2f() { }; module m2f { export interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2g() { }; module m2g { export class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // module then class module m3 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class m3 { } // ok since the module is not instantiated module m3a { var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. class m3a { foo() { } } // error, class isn't ambient or declared before the module class m3b { foo() { } } module m3b { var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class m3c { foo() { } } module m3c { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { foo(): void } module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m3e { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3e { foo(): void } declare class m3f { foo(): void } module m3f { export interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3g { foo(): void } module m3g { export class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // module then enum // should be errors module m4 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum m4 { } module m4a { var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum m4a { One } module m4b { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum m4b { One } module m4c { interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum m4c { One } module m4d { class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum m4d { One } //// module then module module m5 { export var y = 2; } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m5 { export interface I { foo(): void } } // should already be reasonably well covered + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // module then import module m6 { export var y = 2; } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. //import m6 = require(''); \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesModules2.errors.txt b/tests/baselines/reference/augmentedTypesModules2.errors.txt index 2407ac456e8ff..a9664840a49e4 100644 --- a/tests/baselines/reference/augmentedTypesModules2.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules2.errors.txt @@ -1,40 +1,67 @@ +augmentedTypesModules2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules2.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules2.ts(5,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules2.ts(8,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules2.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules2.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules2.ts(14,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +augmentedTypesModules2.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules2.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules2.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules2.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== augmentedTypesModules2.ts (3 errors) ==== +==== augmentedTypesModules2.ts (12 errors) ==== // module then function module m2 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2() { }; // ok since the module is not instantiated module m2a { var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. function m2a() { }; // error since the module is instantiated module m2b { export var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. function m2b() { }; // error since the module is instantiated function m2c() { }; module m2c { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m2cc { export var y = 2; } ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. function m2cc() { }; // error to have module first module m2d { } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare function m2d(): void; declare function m2e(): void; module m2e { } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2f() { }; module m2f { export interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function m2g() { }; module m2g { export class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesModules3.errors.txt b/tests/baselines/reference/augmentedTypesModules3.errors.txt index c93b9b5b3f2de..2ac5c3a88870c 100644 --- a/tests/baselines/reference/augmentedTypesModules3.errors.txt +++ b/tests/baselines/reference/augmentedTypesModules3.errors.txt @@ -1,12 +1,18 @@ +augmentedTypesModules3.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesModules3.ts(5,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. -==== augmentedTypesModules3.ts (1 errors) ==== +==== augmentedTypesModules3.ts (3 errors) ==== //// module then class module m3 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class m3 { } // ok since the module is not instantiated module m3a { var y = 2; } ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. class m3a { foo() { } } // error, class isn't ambient or declared before the module \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesModules3b.errors.txt b/tests/baselines/reference/augmentedTypesModules3b.errors.txt new file mode 100644 index 0000000000000..ee75bf9fab4be --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules3b.errors.txt @@ -0,0 +1,39 @@ +augmentedTypesModules3b.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3b.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3b.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3b.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3b.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules3b.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== augmentedTypesModules3b.ts (6 errors) ==== + class m3b { foo() { } } + module m3b { var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class m3c { foo() { } } + module m3c { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + declare class m3d { foo(): void } + module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + module m3e { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare class m3e { foo(): void } + + declare class m3f { foo(): void } + module m3f { export interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + declare class m3g { foo(): void } + module m3g { export class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesModules4.errors.txt b/tests/baselines/reference/augmentedTypesModules4.errors.txt new file mode 100644 index 0000000000000..f0fca75eaf652 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules4.errors.txt @@ -0,0 +1,46 @@ +augmentedTypesModules4.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +augmentedTypesModules4.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== augmentedTypesModules4.ts (7 errors) ==== + // module then enum + // should be errors + module m4 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum m4 { } + + module m4a { var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum m4a { One } + + module m4b { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum m4b { One } + + module m4c { interface I { foo(): void } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum m4c { One } + + module m4d { class C { foo() { } } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum m4d { One } + + //// module then module + + module m5 { export var y = 2; } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m5 { export interface I { foo(): void } } // should already be reasonably well covered + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt index 724b5660fd68f..cf1c40d73d153 100644 --- a/tests/baselines/reference/augmentedTypesVar.errors.txt +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -7,13 +7,16 @@ augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'. augmentedTypesVar.ts(17,7): error TS2300: Duplicate identifier 'x4a'. augmentedTypesVar.ts(20,5): error TS2567: Enum declarations can only merge with namespace or other enum declarations. augmentedTypesVar.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +augmentedTypesVar.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesVar.ts(27,5): error TS2300: Duplicate identifier 'x6a'. +augmentedTypesVar.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesVar.ts(28,8): error TS2300: Duplicate identifier 'x6a'. augmentedTypesVar.ts(30,5): error TS2300: Duplicate identifier 'x6b'. +augmentedTypesVar.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'. -==== augmentedTypesVar.ts (13 errors) ==== +==== augmentedTypesVar.ts (16 errors) ==== // var then var var x1 = 1; var x1 = 2; @@ -58,12 +61,16 @@ augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'. // var then module var x6 = 1; module x6 { } // ok since non-instantiated + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x6a = 1; // error ~~~ !!! error TS2300: Duplicate identifier 'x6a'. module x6a { var y = 2; } // error since instantiated ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2300: Duplicate identifier 'x6a'. var x6b = 1; // error @@ -71,6 +78,8 @@ augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'. !!! error TS2300: Duplicate identifier 'x6b'. module x6b { export var y = 2; } // error ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2300: Duplicate identifier 'x6b'. // var then import, messes with other error reporting diff --git a/tests/baselines/reference/bind1.errors.txt b/tests/baselines/reference/bind1.errors.txt index a324676ec837d..cf92ab8a584b3 100644 --- a/tests/baselines/reference/bind1.errors.txt +++ b/tests/baselines/reference/bind1.errors.txt @@ -1,8 +1,11 @@ +bind1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. bind1.ts(2,31): error TS2304: Cannot find name 'I'. -==== bind1.ts (1 errors) ==== +==== bind1.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C implements I {} // this should be an unresolved symbol I error ~ !!! error TS2304: Cannot find name 'I'. diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.errors.txt b/tests/baselines/reference/binopAssignmentShouldHaveType.errors.txt new file mode 100644 index 0000000000000..57e8afea37d71 --- /dev/null +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.errors.txt @@ -0,0 +1,25 @@ +binopAssignmentShouldHaveType.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== binopAssignmentShouldHaveType.ts (1 errors) ==== + declare var console; + "use strict"; + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Bug { + getName():string { + return "name"; + } + bug() { + var name:string= null; + if ((name= this.getName()).length > 0) { + console.log(name); + } + } + } + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.types b/tests/baselines/reference/binopAssignmentShouldHaveType.types index b070ae3a4c2e0..44caf85b146f1 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.types +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.types @@ -3,6 +3,7 @@ === binopAssignmentShouldHaveType.ts === declare var console; >console : any +> : ^^^ "use strict"; >"use strict" : "use strict" @@ -58,7 +59,9 @@ module Test { console.log(name); >console.log(name) : any +> : ^^^ >console.log : any +> : ^^^ >console : any > : ^^^ >log : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt index 3f827e0f4e93e..8b52cbb636e1b 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,4 @@ +bitwiseNotOperatorWithAnyOtherType.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. bitwiseNotOperatorWithAnyOtherType.ts(34,24): error TS18050: The value 'undefined' cannot be used here. bitwiseNotOperatorWithAnyOtherType.ts(35,24): error TS18050: The value 'null' cannot be used here. bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. @@ -5,7 +6,7 @@ bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -==== bitwiseNotOperatorWithAnyOtherType.ts (5 errors) ==== +==== bitwiseNotOperatorWithAnyOtherType.ts (6 errors) ==== // ~ operator on any type var ANY: any; @@ -26,6 +27,8 @@ bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt new file mode 100644 index 0000000000000..39c5eafe2a771 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt @@ -0,0 +1,44 @@ +bitwiseNotOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bitwiseNotOperatorWithBooleanType.ts (1 errors) ==== + // ~ operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = ~BOOLEAN; + + // boolean type literal + var ResultIsNumber2 = ~true; + var ResultIsNumber3 = ~{ x: true, y: false }; + + // boolean type expressions + var ResultIsNumber4 = ~objA.a; + var ResultIsNumber5 = ~M.n; + var ResultIsNumber6 = ~foo(); + var ResultIsNumber7 = ~A.foo(); + + // multiple ~ operators + var ResultIsNumber8 = ~~BOOLEAN; + + // miss assignment operators + ~true; + ~BOOLEAN; + ~foo(); + ~true, false; + ~objA.a; + ~M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..8446f65d527fd --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt @@ -0,0 +1,50 @@ +bitwiseNotOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bitwiseNotOperatorWithNumberType.ts (1 errors) ==== + // ~ operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = ~NUMBER; + var ResultIsNumber2 = ~NUMBER1; + + // number type literal + var ResultIsNumber3 = ~1; + var ResultIsNumber4 = ~{ x: 1, y: 2}; + var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsNumber6 = ~objA.a; + var ResultIsNumber7 = ~M.n; + var ResultIsNumber8 = ~NUMBER1[0]; + var ResultIsNumber9 = ~foo(); + var ResultIsNumber10 = ~A.foo(); + var ResultIsNumber11 = ~(NUMBER + NUMBER); + + // multiple ~ operators + var ResultIsNumber12 = ~~NUMBER; + var ResultIsNumber13 = ~~~(NUMBER + NUMBER); + + // miss assignment operators + ~NUMBER; + ~NUMBER1; + ~foo(); + ~objA.a; + ~M.n; + ~objA.a, M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt new file mode 100644 index 0000000000000..1076f3daa5be1 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt @@ -0,0 +1,49 @@ +bitwiseNotOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bitwiseNotOperatorWithStringType.ts (1 errors) ==== + // ~ operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = ~STRING; + var ResultIsNumber2 = ~STRING1; + + // string type literal + var ResultIsNumber3 = ~""; + var ResultIsNumber4 = ~{ x: "", y: "" }; + var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsNumber6 = ~objA.a; + var ResultIsNumber7 = ~M.n; + var ResultIsNumber8 = ~STRING1[0]; + var ResultIsNumber9 = ~foo(); + var ResultIsNumber10 = ~A.foo(); + var ResultIsNumber11 = ~(STRING + STRING); + var ResultIsNumber12 = ~STRING.charAt(0); + + // multiple ~ operators + var ResultIsNumber13 = ~~STRING; + var ResultIsNumber14 = ~~~(STRING + STRING); + + //miss assignment operators + ~STRING; + ~STRING1; + ~foo(); + ~objA.a,M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bluebirdStaticThis.errors.txt b/tests/baselines/reference/bluebirdStaticThis.errors.txt index 0c1f2baf595e5..e79f263d5290e 100644 --- a/tests/baselines/reference/bluebirdStaticThis.errors.txt +++ b/tests/baselines/reference/bluebirdStaticThis.errors.txt @@ -5,9 +5,10 @@ bluebirdStaticThis.ts(57,109): error TS2694: Namespace '"bluebirdStaticThis".Pro bluebirdStaticThis.ts(58,91): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'. bluebirdStaticThis.ts(59,91): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'. bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"bluebirdStaticThis".Promise' has no exported member 'Inspection'. +bluebirdStaticThis.ts(111,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== bluebirdStaticThis.ts (6 errors) ==== +==== bluebirdStaticThis.ts (7 errors) ==== // This version is reduced from the full d.ts by removing almost all the tests // and all the comments. // Then it adds explicit `this` arguments to the static members. @@ -133,6 +134,8 @@ bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"bluebirdStaticThis".Prom } export declare module Promise { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index 70c88dd904350..fef9ce9bf38b6 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,3 +1,5 @@ +callSignatureAssignabilityInInheritance.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +callSignatureAssignabilityInInheritance.ts(34,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. The types returned by 'a(...)' are incompatible between these types. Type 'string' is not assignable to type 'number'. @@ -7,8 +9,10 @@ callSignatureAssignabilityInInheritance.ts(63,15): error TS2430: Interface 'I3' 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== callSignatureAssignabilityInInheritance.ts (2 errors) ==== +==== callSignatureAssignabilityInInheritance.ts (4 errors) ==== module CallSignature { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's (x: number): void; @@ -42,6 +46,8 @@ callSignatureAssignabilityInInheritance.ts(63,15): error TS2430: Interface 'I3' } module MemberWithCallSignature { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's a: (x: number) => void; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 9f6a5043893e0..ebcf1846cbc6f 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,5 @@ +callSignatureAssignabilityInInheritance3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +callSignatureAssignabilityInInheritance3.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. @@ -26,6 +28,7 @@ callSignatureAssignabilityInInheritance3.ts(80,19): error TS2430: Interface 'I7' Type '{ a: string; b: number; }' is not assignable to type '{ a: Base; b: Base; }'. Types of property 'a' are incompatible. Type 'string' is not assignable to type 'Base'. +callSignatureAssignabilityInInheritance3.ts(94,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. callSignatureAssignabilityInInheritance3.ts(100,19): error TS2430: Interface 'I6' incorrectly extends interface 'B'. The types returned by 'a2(...)' are incompatible between these types. Type 'string[]' is not assignable to type 'T[]'. @@ -37,17 +40,21 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7 Type 'T' is not assignable to type 'string'. -==== callSignatureAssignabilityInInheritance3.ts (6 errors) ==== +==== callSignatureAssignabilityInInheritance3.ts (9 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases module Errors { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // base type with non-generic call signatures interface A { a2: (x: number) => string[]; @@ -164,6 +171,8 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7 } module WithGenericSignaturesInBaseType { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // base type has generic call signature interface B { a2: (x: T) => T[]; diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt new file mode 100644 index 0000000000000..bf81cf0447040 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.errors.txt @@ -0,0 +1,135 @@ +callSignatureWithoutReturnTypeAnnotationInference.ts(74,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +callSignatureWithoutReturnTypeAnnotationInference.ts(97,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +callSignatureWithoutReturnTypeAnnotationInference.ts(107,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +callSignatureWithoutReturnTypeAnnotationInference.ts(116,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== callSignatureWithoutReturnTypeAnnotationInference.ts (4 errors) ==== + // Call signatures without a return type should infer one from the function body (if present) + + // Simple types + function foo(x) { + return 1; + } + var r = foo(1); + + function foo2(x) { + return foo(x); + } + var r2 = foo2(1); + + function foo3() { + return foo3(); + } + var r3 = foo3(); + + function foo4(x: T) { + return x; + } + var r4 = foo4(1); + + function foo5(x) { + if (true) { + return 1; + } else { + return 2; + } + } + var r5 = foo5(1); + + function foo6(x) { + try { + } + catch (e) { + return []; + } + finally { + return []; + } + } + var r6 = foo6(1); + + function foo7(x) { + return typeof x; + } + var r7 = foo7(1); + + // object types + function foo8(x: number) { + return { x: x }; + } + var r8 = foo8(1); + + interface I { + foo: string; + } + function foo9(x: number) { + var i: I; + return i; + } + var r9 = foo9(1); + + class C { + foo: string; + } + function foo10(x: number) { + var c: C; + return c; + } + var r10 = foo10(1); + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + export class C { foo: string } + } + function foo11() { + return M; + } + var r11 = foo11(); + + // merged declarations + interface I2 { + x: number; + } + interface I2 { + y: number; + } + function foo12() { + var i2: I2; + return i2; + } + var r12 = foo12(); + + function m1() { return 1; } + module m1 { export var y = 2; } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo13() { + return m1; + } + var r13 = foo13(); + + class c1 { + foo: string; + constructor(x) { } + } + module c1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + } + function foo14() { + return c1; + } + var r14 = foo14(); + + enum e1 { A } + module e1 { export var y = 1; } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo15() { + return e1; + } + var r15 = foo15(); \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index 724f995738871..c269d0732a1a5 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -8,6 +8,7 @@ function foo(x) { >foo : (x: any) => number > : ^ ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ return 1; >1 : 1 @@ -27,6 +28,7 @@ function foo2(x) { >foo2 : (x: any) => number > : ^ ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ return foo(x); >foo(x) : number @@ -34,6 +36,7 @@ function foo2(x) { >foo : (x: any) => number > : ^ ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ } var r2 = foo2(1); >r2 : number @@ -87,6 +90,7 @@ function foo5(x) { >foo5 : (x: any) => 1 | 2 > : ^ ^^^^^^^^^^^^^^^ >x : any +> : ^^^ if (true) { >true : true @@ -116,11 +120,13 @@ function foo6(x) { >foo6 : (x: any) => any[] > : ^ ^^^^^^^^^^^^^^^ >x : any +> : ^^^ try { } catch (e) { >e : any +> : ^^^ return []; >[] : undefined[] @@ -146,11 +152,13 @@ function foo7(x) { >foo7 : (x: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ return typeof x; >typeof x : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ } var r7 = foo7(1); >r7 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" @@ -351,6 +359,7 @@ class c1 { constructor(x) { } >x : any +> : ^^^ } module c1 { >c1 : typeof c1 diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index 11b3093de6a53..e6b20a778e7ba 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -1,9 +1,12 @@ +cannotInvokeNewOnErrorExpression.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'. cannotInvokeNewOnErrorExpression.ts(5,22): error TS1011: An element access expression should take an argument. -==== cannotInvokeNewOnErrorExpression.ts (2 errors) ==== +==== cannotInvokeNewOnErrorExpression.ts (3 errors) ==== module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { class ClassA {} } diff --git a/tests/baselines/reference/chainedImportAlias.errors.txt b/tests/baselines/reference/chainedImportAlias.errors.txt new file mode 100644 index 0000000000000..0e8e533f8321c --- /dev/null +++ b/tests/baselines/reference/chainedImportAlias.errors.txt @@ -0,0 +1,15 @@ +chainedImportAlias_file0.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== chainedImportAlias_file1.ts (0 errors) ==== + import x = require('./chainedImportAlias_file0'); + import y = x; + y.m.foo(); + +==== chainedImportAlias_file0.ts (1 errors) ==== + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/checkForObjectTooStrict.errors.txt b/tests/baselines/reference/checkForObjectTooStrict.errors.txt index 0a6236689f01b..6549d15195773 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.errors.txt +++ b/tests/baselines/reference/checkForObjectTooStrict.errors.txt @@ -1,8 +1,11 @@ +checkForObjectTooStrict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. checkForObjectTooStrict.ts(3,18): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS. -==== checkForObjectTooStrict.ts (1 errors) ==== +==== checkForObjectTooStrict.ts (2 errors) ==== module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Object { ~~~~~~ diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt new file mode 100644 index 0000000000000..115911b026ea6 --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt @@ -0,0 +1,28 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface ElementAttributesProperty { props: {} } + interface IntrinsicElements { + div: any; + h2: any; + h1: any; + } + } + + class Button { + props: {} + render() { + return (
My Button
) + } + } + + // OK + let k1 =

Hello

world

; + let k2 =

Hello

{(user: any) =>

{user.name}

}
; + let k3 =
{1} {"That is a number"}
; + let k4 = ; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.types b/tests/baselines/reference/checkJsxChildrenProperty10.types index 71724417c4c92..7496782de13b3 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty10.types +++ b/tests/baselines/reference/checkJsxChildrenProperty10.types @@ -10,12 +10,15 @@ declare module JSX { interface IntrinsicElements { div: any; >div : any +> : ^^^ h2: any; >h2 : any +> : ^^^ h1: any; >h1 : any +> : ^^^ } } @@ -82,11 +85,13 @@ let k2 =

Hello

{(user: any) =>

{user.name}

}
; >(user: any) =>

{user.name}

: (user: any) => JSX.Element > : ^ ^^ ^^^^^^^^^^^^^^^^ >user : any +> : ^^^ >

{user.name}

: JSX.Element > : ^^^^^^^^^^^ >h2 : any > : ^^^ >user.name : any +> : ^^^ >user : any > : ^^^ >name : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt new file mode 100644 index 0000000000000..115911b026ea6 --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt @@ -0,0 +1,28 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface ElementAttributesProperty { props: {} } + interface IntrinsicElements { + div: any; + h2: any; + h1: any; + } + } + + class Button { + props: {} + render() { + return (
My Button
) + } + } + + // OK + let k1 =

Hello

world

; + let k2 =

Hello

{(user: any) =>

{user.name}

}
; + let k3 =
{1} {"That is a number"}
; + let k4 = ; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.types b/tests/baselines/reference/checkJsxChildrenProperty11.types index 3bb0b09acc47e..3bc4d6c4b39b2 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty11.types +++ b/tests/baselines/reference/checkJsxChildrenProperty11.types @@ -10,12 +10,15 @@ declare module JSX { interface IntrinsicElements { div: any; >div : any +> : ^^^ h2: any; >h2 : any +> : ^^^ h1: any; >h1 : any +> : ^^^ } } @@ -82,11 +85,13 @@ let k2 =

Hello

{(user: any) =>

{user.name}

}
; >(user: any) =>

{user.name}

: (user: any) => JSX.Element > : ^ ^^ ^^^^^^^^^^^^^^^^ >user : any +> : ^^^ >

{user.name}

: JSX.Element > : ^^^^^^^^^^^ >h2 : any > : ^^^ >user.name : any +> : ^^^ >user : any > : ^^^ >name : any diff --git a/tests/baselines/reference/circularImportAlias.errors.txt b/tests/baselines/reference/circularImportAlias.errors.txt index 3b3fa010f7e1c..4fbec63261fa4 100644 --- a/tests/baselines/reference/circularImportAlias.errors.txt +++ b/tests/baselines/reference/circularImportAlias.errors.txt @@ -1,10 +1,14 @@ +circularImportAlias.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. circularImportAlias.ts(5,30): error TS2449: Class 'C' used before its declaration. +circularImportAlias.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== circularImportAlias.ts (1 errors) ==== +==== circularImportAlias.ts (3 errors) ==== // expected no error module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import a = A; export class D extends a.C { ~ @@ -15,6 +19,8 @@ circularImportAlias.ts(5,30): error TS2449: Class 'C' used before its declaratio } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { name: string } export import b = B; } diff --git a/tests/baselines/reference/circularModuleImports.errors.txt b/tests/baselines/reference/circularModuleImports.errors.txt index d7fdcefcfdf47..8e4a9c4952790 100644 --- a/tests/baselines/reference/circularModuleImports.errors.txt +++ b/tests/baselines/reference/circularModuleImports.errors.txt @@ -1,8 +1,11 @@ +circularModuleImports.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. circularModuleImports.ts(5,5): error TS2303: Circular definition of import alias 'A'. -==== circularModuleImports.ts (1 errors) ==== +==== circularModuleImports.ts (2 errors) ==== module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { diff --git a/tests/baselines/reference/circularReference.errors.txt b/tests/baselines/reference/circularReference.errors.txt index 19fbe15d07025..6be664da0708b 100644 --- a/tests/baselines/reference/circularReference.errors.txt +++ b/tests/baselines/reference/circularReference.errors.txt @@ -1,11 +1,15 @@ +foo1.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'. +foo2.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'. foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. -==== foo2.ts (2 errors) ==== +==== foo2.ts (3 errors) ==== import foo1 = require('./foo1'); export module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C1 { m1: foo1.M1.C1; y: number @@ -25,9 +29,11 @@ foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. } } -==== foo1.ts (1 errors) ==== +==== foo1.ts (2 errors) ==== import foo2 = require('./foo2'); export module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C1 { m1: foo2.M1.C1; x: number; diff --git a/tests/baselines/reference/classAbstractImportInstantiation.errors.txt b/tests/baselines/reference/classAbstractImportInstantiation.errors.txt index accf2fcf80e60..e47c05de16293 100644 --- a/tests/baselines/reference/classAbstractImportInstantiation.errors.txt +++ b/tests/baselines/reference/classAbstractImportInstantiation.errors.txt @@ -1,9 +1,12 @@ +classAbstractImportInstantiation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classAbstractImportInstantiation.ts(4,5): error TS2511: Cannot create an instance of an abstract class. classAbstractImportInstantiation.ts(9,1): error TS2511: Cannot create an instance of an abstract class. -==== classAbstractImportInstantiation.ts (2 errors) ==== +==== classAbstractImportInstantiation.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export abstract class A {} new A; diff --git a/tests/baselines/reference/classAbstractInAModule.errors.txt b/tests/baselines/reference/classAbstractInAModule.errors.txt index e1967995f6634..0a4af731fe3a4 100644 --- a/tests/baselines/reference/classAbstractInAModule.errors.txt +++ b/tests/baselines/reference/classAbstractInAModule.errors.txt @@ -1,8 +1,11 @@ +classAbstractInAModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classAbstractInAModule.ts(6,1): error TS2511: Cannot create an instance of an abstract class. -==== classAbstractInAModule.ts (1 errors) ==== +==== classAbstractInAModule.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export abstract class A {} export class B extends A {} } diff --git a/tests/baselines/reference/classAbstractMergedDeclaration.errors.txt b/tests/baselines/reference/classAbstractMergedDeclaration.errors.txt index aed55c5cd23a2..3e9923a4434d0 100644 --- a/tests/baselines/reference/classAbstractMergedDeclaration.errors.txt +++ b/tests/baselines/reference/classAbstractMergedDeclaration.errors.txt @@ -1,3 +1,5 @@ +classAbstractMergedDeclaration.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classAbstractMergedDeclaration.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classAbstractMergedDeclaration.ts(13,16): error TS2300: Duplicate identifier 'CC1'. classAbstractMergedDeclaration.ts(14,7): error TS2300: Duplicate identifier 'CC1'. classAbstractMergedDeclaration.ts(16,7): error TS2300: Duplicate identifier 'CC2'. @@ -16,11 +18,15 @@ classAbstractMergedDeclaration.ts(38,1): error TS2511: Cannot create an instance classAbstractMergedDeclaration.ts(39,1): error TS2511: Cannot create an instance of an abstract class. -==== classAbstractMergedDeclaration.ts (16 errors) ==== +==== classAbstractMergedDeclaration.ts (18 errors) ==== abstract class CM {} module CM {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module MC {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. abstract class MC {} abstract class CI {} diff --git a/tests/baselines/reference/classAndInterfaceMerge.d.errors.txt b/tests/baselines/reference/classAndInterfaceMerge.d.errors.txt new file mode 100644 index 0000000000000..0947effcd9a22 --- /dev/null +++ b/tests/baselines/reference/classAndInterfaceMerge.d.errors.txt @@ -0,0 +1,33 @@ +classAndInterfaceMerge.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classAndInterfaceMerge.d.ts(22,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classAndInterfaceMerge.d.ts (2 errors) ==== + interface C { } + + declare class C { } + + interface C { } + + interface C { } + + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface C1 { } + + class C1 { } + + interface C1 { } + + interface C1 { } + + export class C2 { } + } + + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface C2 { } + } \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt new file mode 100644 index 0000000000000..ea7fe8907e82e --- /dev/null +++ b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt @@ -0,0 +1,18 @@ +classAndInterfaceWithSameName.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classAndInterfaceWithSameName.ts (1 errors) ==== + class C { foo: string; } + interface C { foo: string; } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class D { + bar: string; + } + + interface D { + bar: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classAndVariableWithSameName.errors.txt b/tests/baselines/reference/classAndVariableWithSameName.errors.txt index 4c35b2e29361a..eb85f343e6948 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.errors.txt +++ b/tests/baselines/reference/classAndVariableWithSameName.errors.txt @@ -1,10 +1,11 @@ classAndVariableWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'. classAndVariableWithSameName.ts(2,5): error TS2300: Duplicate identifier 'C'. +classAndVariableWithSameName.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classAndVariableWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'. classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'. -==== classAndVariableWithSameName.ts (4 errors) ==== +==== classAndVariableWithSameName.ts (5 errors) ==== class C { foo: string; } // error ~ !!! error TS2300: Duplicate identifier 'C'. @@ -13,6 +14,8 @@ classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'. !!! error TS2300: Duplicate identifier 'C'. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class D { // error ~ !!! error TS2300: Duplicate identifier 'D'. diff --git a/tests/baselines/reference/classConstructorAccessibility.errors.txt b/tests/baselines/reference/classConstructorAccessibility.errors.txt index 8ff647bda3dbe..87ae8a22ad696 100644 --- a/tests/baselines/reference/classConstructorAccessibility.errors.txt +++ b/tests/baselines/reference/classConstructorAccessibility.errors.txt @@ -1,10 +1,11 @@ classConstructorAccessibility.ts(14,9): error TS2673: Constructor of class 'D' is private and only accessible within the class declaration. classConstructorAccessibility.ts(15,9): error TS2674: Constructor of class 'E' is protected and only accessible within the class declaration. +classConstructorAccessibility.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classConstructorAccessibility.ts(31,13): error TS2673: Constructor of class 'D' is private and only accessible within the class declaration. classConstructorAccessibility.ts(32,13): error TS2674: Constructor of class 'E' is protected and only accessible within the class declaration. -==== classConstructorAccessibility.ts (4 errors) ==== +==== classConstructorAccessibility.ts (5 errors) ==== class C { public constructor(public x: number) { } } @@ -26,6 +27,8 @@ classConstructorAccessibility.ts(32,13): error TS2674: Constructor of class 'E { public constructor(public x: T) { } } diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.errors.txt b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.errors.txt new file mode 100644 index 0000000000000..4a155caf372ed --- /dev/null +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.errors.txt @@ -0,0 +1,23 @@ +classDeclarationMergedInModuleWithContinuation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classDeclarationMergedInModuleWithContinuation.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classDeclarationMergedInModuleWithContinuation.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classDeclarationMergedInModuleWithContinuation.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class N { } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var v = 0; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class O extends M.N { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt b/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt new file mode 100644 index 0000000000000..160cdc0efe091 --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt @@ -0,0 +1,12 @@ +classDoesNotDependOnPrivateMember.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classDoesNotDependOnPrivateMember.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface I { } + export class C { + private x: I; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpression.errors.txt b/tests/baselines/reference/classExpression.errors.txt new file mode 100644 index 0000000000000..6b741f6023ec2 --- /dev/null +++ b/tests/baselines/reference/classExpression.errors.txt @@ -0,0 +1,18 @@ +classExpression.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classExpression.ts (1 errors) ==== + var x = class C { + } + + var y = { + foo: class C2 { + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var z = class C4 { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingQualifiedName.errors.txt b/tests/baselines/reference/classExtendingQualifiedName.errors.txt index ab35af17620e3..3088eac533675 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.errors.txt +++ b/tests/baselines/reference/classExtendingQualifiedName.errors.txt @@ -1,8 +1,11 @@ +classExtendingQualifiedName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendingQualifiedName.ts(5,23): error TS2339: Property 'C' does not exist on type 'typeof M'. -==== classExtendingQualifiedName.ts (1 errors) ==== +==== classExtendingQualifiedName.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { } diff --git a/tests/baselines/reference/classExtendingQualifiedName2.errors.txt b/tests/baselines/reference/classExtendingQualifiedName2.errors.txt new file mode 100644 index 0000000000000..b26c43489aba6 --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName2.errors.txt @@ -0,0 +1,13 @@ +classExtendingQualifiedName2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classExtendingQualifiedName2.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + } + + class D extends M.C { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt index bf070e138561c..8b323a4539b2a 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt @@ -1,15 +1,21 @@ +classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2507: Type 'number' is not a constructor function type. -==== classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ==== +==== classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (3 errors) ==== class A { a: number; } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v: string; } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = 1; class B extends A { ~ diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt index 1803ad2ae4372..df5a5d01f6e34 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt @@ -1,9 +1,12 @@ +classExtendsClauseClassNotReferringConstructor.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2507: Type 'number' is not a constructor function type. -==== classExtendsClauseClassNotReferringConstructor.ts (1 errors) ==== +==== classExtendsClauseClassNotReferringConstructor.ts (2 errors) ==== class A { a: number; } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = 1; class B extends A { b: string; } ~ diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index 9c3cbd75f77c8..6142b57f57759 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -3,12 +3,13 @@ classExtendsEveryObjectType.ts(6,18): error TS2507: Type '{ foo: any; }' is not classExtendsEveryObjectType.ts(6,25): error TS2693: 'string' only refers to a type, but is being used as a value here. classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. classExtendsEveryObjectType.ts(8,18): error TS2507: Type '{ foo: string; }' is not a constructor function type. +classExtendsEveryObjectType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsEveryObjectType.ts(11,18): error TS2507: Type 'typeof M' is not a constructor function type. classExtendsEveryObjectType.ts(14,18): error TS2507: Type '() => void' is not a constructor function type. classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'undefined[]' is not a constructor function type. -==== classExtendsEveryObjectType.ts (8 errors) ==== +==== classExtendsEveryObjectType.ts (9 errors) ==== interface I { foo: string; } @@ -29,6 +30,8 @@ classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'undefined[]' is not a !!! error TS2507: Type '{ foo: string; }' is not a constructor function type. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C4 extends M { } // error ~ !!! error TS2507: Type 'typeof M' is not a constructor function type. diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.errors.txt b/tests/baselines/reference/classExtendsInterfaceInModule.errors.txt index d3c88f909442a..6a04e37e98c25 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceInModule.errors.txt @@ -1,10 +1,14 @@ +classExtendsInterfaceInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsInterfaceInModule.ts(5,18): error TS2689: Cannot extend an interface 'M.I1'. Did you mean 'implements'? classExtendsInterfaceInModule.ts(6,21): error TS2689: Cannot extend an interface 'M.I2'. Did you mean 'implements'? +classExtendsInterfaceInModule.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsInterfaceInModule.ts(14,17): error TS2689: Cannot extend an interface 'Mod.Nested.I'. Did you mean 'implements'? -==== classExtendsInterfaceInModule.ts (3 errors) ==== +==== classExtendsInterfaceInModule.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I1 {} export interface I2 {} } @@ -16,6 +20,8 @@ classExtendsInterfaceInModule.ts(14,17): error TS2689: Cannot extend an interfac !!! error TS2689: Cannot extend an interface 'M.I2'. Did you mean 'implements'? module Mod { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace Nested { export interface I {} } diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt index 40eb73ba51648..38e4db0dea132 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt @@ -1,14 +1,19 @@ classExtendsItselfIndirectly2.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly2.ts(1,19): error TS2449: Class 'E' used before its declaration. +classExtendsItselfIndirectly2.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsItselfIndirectly2.ts(4,18): error TS2506: 'D' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsItselfIndirectly2.ts(9,18): error TS2506: 'E' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsItselfIndirectly2.ts(13,11): error TS2506: 'C2' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly2.ts(13,27): error TS2449: Class 'E2' used before its declaration. +classExtendsItselfIndirectly2.ts(15,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsItselfIndirectly2.ts(16,22): error TS2506: 'D2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced directly or indirectly in its own base expression. -==== classExtendsItselfIndirectly2.ts (8 errors) ==== +==== classExtendsItselfIndirectly2.ts (13 errors) ==== class C extends N.E { foo: string; } // error ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. @@ -17,6 +22,8 @@ classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced direct !!! related TS2728 classExtendsItselfIndirectly2.ts:9:18: 'E' is declared here. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D extends C { bar: string; } ~ !!! error TS2506: 'D' is referenced directly or indirectly in its own base expression. @@ -24,12 +31,16 @@ classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced direct } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class E extends M.D { baz: number; } ~ !!! error TS2506: 'E' is referenced directly or indirectly in its own base expression. } module O { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C2 extends Q.E2 { foo: T; } // error ~~ !!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression. @@ -38,12 +49,16 @@ classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced direct !!! related TS2728 classExtendsItselfIndirectly2.ts:20:22: 'E2' is declared here. module P { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D2 extends C2 { bar: T; } ~~ !!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression. } module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class E2 extends P.D2 { baz: T; } ~~ !!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt index d08aa06400651..a2556db3d6775 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt @@ -1,10 +1,13 @@ +classExtendsShadowedConstructorFunction.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Type 'number' is not a constructor function type. -==== classExtendsShadowedConstructorFunction.ts (1 errors) ==== +==== classExtendsShadowedConstructorFunction.ts (2 errors) ==== class C { foo: string; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var C = 1; class D extends C { // error, C must evaluate to constructor function ~ diff --git a/tests/baselines/reference/classImplementsImportedInterface.errors.txt b/tests/baselines/reference/classImplementsImportedInterface.errors.txt new file mode 100644 index 0000000000000..5ada99ac9d32b --- /dev/null +++ b/tests/baselines/reference/classImplementsImportedInterface.errors.txt @@ -0,0 +1,21 @@ +classImplementsImportedInterface.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classImplementsImportedInterface.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classImplementsImportedInterface.ts (2 errors) ==== + module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import T = M1.I; + class C implements T { + foo() {} + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classTypeParametersInStatics.errors.txt b/tests/baselines/reference/classTypeParametersInStatics.errors.txt index 1f86d11c6cdee..a7c15389ba839 100644 --- a/tests/baselines/reference/classTypeParametersInStatics.errors.txt +++ b/tests/baselines/reference/classTypeParametersInStatics.errors.txt @@ -1,10 +1,13 @@ +classTypeParametersInStatics.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classTypeParametersInStatics.ts(12,40): error TS2302: Static members cannot reference class type parameters. classTypeParametersInStatics.ts(13,29): error TS2302: Static members cannot reference class type parameters. classTypeParametersInStatics.ts(13,43): error TS2302: Static members cannot reference class type parameters. -==== classTypeParametersInStatics.ts (3 errors) ==== +==== classTypeParametersInStatics.ts (4 errors) ==== module Editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class List { diff --git a/tests/baselines/reference/classWithConstructors.errors.txt b/tests/baselines/reference/classWithConstructors.errors.txt index 9feade7191b69..d0ffc7365acfa 100644 --- a/tests/baselines/reference/classWithConstructors.errors.txt +++ b/tests/baselines/reference/classWithConstructors.errors.txt @@ -1,13 +1,17 @@ +classWithConstructors.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classWithConstructors.ts(6,13): error TS2554: Expected 1 arguments, but got 0. classWithConstructors.ts(15,14): error TS2554: Expected 1 arguments, but got 0. classWithConstructors.ts(21,13): error TS2554: Expected 1 arguments, but got 0. +classWithConstructors.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. classWithConstructors.ts(31,13): error TS2554: Expected 1 arguments, but got 0. classWithConstructors.ts(40,14): error TS2554: Expected 1-2 arguments, but got 0. classWithConstructors.ts(46,13): error TS2554: Expected 1-2 arguments, but got 0. -==== classWithConstructors.ts (6 errors) ==== +==== classWithConstructors.ts (8 errors) ==== module NonGeneric { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { constructor(x: string) { } } @@ -42,6 +46,8 @@ classWithConstructors.ts(46,13): error TS2554: Expected 1-2 arguments, but got 0 } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { constructor(x: T) { } } diff --git a/tests/baselines/reference/classdecl.errors.txt b/tests/baselines/reference/classdecl.errors.txt new file mode 100644 index 0000000000000..81654aa740009 --- /dev/null +++ b/tests/baselines/reference/classdecl.errors.txt @@ -0,0 +1,105 @@ +classdecl.ts(39,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classdecl.ts(50,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +classdecl.ts(52,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== classdecl.ts (3 errors) ==== + class a { + //constructor (); + constructor (n: number); + constructor (s: string); + constructor (ns: any) { + + } + + public pgF() { } + + public pv; + public get d() { + return 30; + } + public set d(a: number) { + } + + public static get p2() { + return { x: 30, y: 40 }; + } + + private static d2() { + } + private static get p3() { + return "string"; + } + private pv3; + + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } + } + + class b extends a { + } + + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class b { + } + class d { + } + + + export interface ib { + } + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c extends b { + } + export class ib2 implements m1.ib { + } + } + } + + class c extends m1.b { + } + + class ib2 implements m1.ib { + } + + declare class aAmbient { + constructor (n: number); + constructor (s: string); + public pgF(): void; + public pv; + public d : number; + static p2 : { x: number; y: number; }; + static d2(); + static p3; + private pv3; + private foo(s); + } + + class d { + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } + } + + class e { + private foo(s: string): string; + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classdecl.types b/tests/baselines/reference/classdecl.types index 51fb325e33099..7c0c8ea10957f 100644 --- a/tests/baselines/reference/classdecl.types +++ b/tests/baselines/reference/classdecl.types @@ -16,6 +16,7 @@ class a { constructor (ns: any) { >ns : any +> : ^^^ } @@ -25,6 +26,7 @@ class a { public pv; >pv : any +> : ^^^ public get d() { >d : number @@ -72,6 +74,7 @@ class a { } private pv3; >pv3 : any +> : ^^^ private foo(n: number): string; >foo : { (n: number): string; (s: string): string; } @@ -89,10 +92,13 @@ class a { >foo : { (n: number): string; (s: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >ns : any +> : ^^^ return ns.toString(); >ns.toString() : any +> : ^^^ >ns.toString : any +> : ^^^ >ns : any > : ^^^ >toString : any @@ -184,6 +190,7 @@ declare class aAmbient { public pv; >pv : any +> : ^^^ public d : number; >d : number @@ -203,14 +210,17 @@ declare class aAmbient { static p3; >p3 : any +> : ^^^ private pv3; >pv3 : any +> : ^^^ private foo(s); >foo : (s: any) => any > : ^ ^^^^^^^^^^^^^ >s : any +> : ^^^ } class d { @@ -233,10 +243,13 @@ class d { >foo : { (n: number): string; (s: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >ns : any +> : ^^^ return ns.toString(); >ns.toString() : any +> : ^^^ >ns.toString : any +> : ^^^ >ns : any > : ^^^ >toString : any @@ -264,10 +277,13 @@ class e { >foo : { (s: string): string; (n: number): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >ns : any +> : ^^^ return ns.toString(); >ns.toString() : any +> : ^^^ >ns.toString : any +> : ^^^ >ns : any > : ^^^ >toString : any diff --git a/tests/baselines/reference/clinterfaces.errors.txt b/tests/baselines/reference/clinterfaces.errors.txt new file mode 100644 index 0000000000000..469eaeb9a742f --- /dev/null +++ b/tests/baselines/reference/clinterfaces.errors.txt @@ -0,0 +1,31 @@ +clinterfaces.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== clinterfaces.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { } + interface C { } + interface D { } + class D { } + } + + interface Foo { + a: string; + } + + class Foo{ + b: number; + } + + class Bar{ + b: number; + } + + interface Bar { + a: string; + } + + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.errors.txt b/tests/baselines/reference/cloduleAcrossModuleDefinitions.errors.txt new file mode 100644 index 0000000000000..331344da4e52a --- /dev/null +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.errors.txt @@ -0,0 +1,27 @@ +cloduleAcrossModuleDefinitions.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleAcrossModuleDefinitions.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleAcrossModuleDefinitions.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== cloduleAcrossModuleDefinitions.ts (3 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class B { + foo() { } + static bar() { } + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + } + } + + var b: A.B; // ok + \ No newline at end of file diff --git a/tests/baselines/reference/cloduleAndTypeParameters.errors.txt b/tests/baselines/reference/cloduleAndTypeParameters.errors.txt new file mode 100644 index 0000000000000..2f946832dadbf --- /dev/null +++ b/tests/baselines/reference/cloduleAndTypeParameters.errors.txt @@ -0,0 +1,19 @@ +cloduleAndTypeParameters.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== cloduleAndTypeParameters.ts (1 errors) ==== + class Foo { + constructor() { + } + } + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Bar { + bar(): void; + } + + export class Baz { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt index 0f8a911696aa3..64dc726ef4f7a 100644 --- a/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.errors.txt @@ -1,12 +1,15 @@ +cloduleSplitAcrossFiles_module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleSplitAcrossFiles_module.ts(1,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. ==== cloduleSplitAcrossFiles_class.ts (0 errors) ==== class D { } -==== cloduleSplitAcrossFiles_module.ts (1 errors) ==== +==== cloduleSplitAcrossFiles_module.ts (2 errors) ==== module D { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var y = "hi"; } diff --git a/tests/baselines/reference/cloduleStaticMembers.errors.txt b/tests/baselines/reference/cloduleStaticMembers.errors.txt index 1be933c421ac2..714c699a9c871 100644 --- a/tests/baselines/reference/cloduleStaticMembers.errors.txt +++ b/tests/baselines/reference/cloduleStaticMembers.errors.txt @@ -1,14 +1,17 @@ +cloduleStaticMembers.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleStaticMembers.ts(6,18): error TS2341: Property 'x' is private and only accessible within class 'Clod'. cloduleStaticMembers.ts(7,13): error TS2304: Cannot find name 'x'. cloduleStaticMembers.ts(10,13): error TS2304: Cannot find name 'y'. -==== cloduleStaticMembers.ts (3 errors) ==== +==== cloduleStaticMembers.ts (4 errors) ==== class Clod { private static x = 10; public static y = 10; } module Clod { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var p = Clod.x; ~ !!! error TS2341: Property 'x' is private and only accessible within class 'Clod'. diff --git a/tests/baselines/reference/cloduleTest1.errors.txt b/tests/baselines/reference/cloduleTest1.errors.txt new file mode 100644 index 0000000000000..65da6d4148d7f --- /dev/null +++ b/tests/baselines/reference/cloduleTest1.errors.txt @@ -0,0 +1,17 @@ +cloduleTest1.ts(5,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== cloduleTest1.ts (1 errors) ==== + declare function $(selector: string): $; + interface $ { + addClass(className: string): $; + } + module $ { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface AjaxSettings { + } + export function ajax(options: AjaxSettings) { } + } + var it: $ = $('.foo').addClass('bar'); + \ No newline at end of file diff --git a/tests/baselines/reference/cloduleTest2.errors.txt b/tests/baselines/reference/cloduleTest2.errors.txt index 674f2c0ea65ab..99d982cedae6d 100644 --- a/tests/baselines/reference/cloduleTest2.errors.txt +++ b/tests/baselines/reference/cloduleTest2.errors.txt @@ -1,16 +1,29 @@ +cloduleTest2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleTest2.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleTest2.ts(4,13): error TS2554: Expected 1 arguments, but got 0. +cloduleTest2.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleTest2.ts(9,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleTest2.ts(10,13): error TS2554: Expected 1 arguments, but got 0. +cloduleTest2.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleTest2.ts(14,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleTest2.ts(18,7): error TS2576: Property 'bar' does not exist on type 'm3d'. Did you mean to access the static member 'm3d.bar' instead? cloduleTest2.ts(19,7): error TS2339: Property 'y' does not exist on type 'm3d'. +cloduleTest2.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleTest2.ts(24,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleTest2.ts(27,7): error TS2576: Property 'bar' does not exist on type 'm3d'. Did you mean to access the static member 'm3d.bar' instead? cloduleTest2.ts(28,7): error TS2339: Property 'y' does not exist on type 'm3d'. +cloduleTest2.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleTest2.ts(33,9): error TS2554: Expected 1 arguments, but got 0. cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0. -==== cloduleTest2.ts (8 errors) ==== +==== cloduleTest2.ts (17 errors) ==== module T1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { constructor(foo); foo(): void ; static bar(); } var r = new m3d(); // error ~~~~~~~~~ @@ -19,8 +32,12 @@ cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0. } module T2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { constructor(foo); foo(): void; static bar(); } module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var r = new m3d(); // error ~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. @@ -28,7 +45,11 @@ cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0. } module T3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { foo(): void; static bar(); } var r = new m3d(); r.foo(); @@ -41,8 +62,12 @@ cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0. } module T4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { foo(): void; static bar(); } module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var r = new m3d(); r.foo(); r.bar(); // error @@ -54,6 +79,8 @@ cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0. } module m3d { export var y = 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class m3d { constructor(foo); foo(): void; static bar(); } var r = new m3d(); // error ~~~~~~~~~ diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt index acbf37b3e83e3..f20cd9f9d19f3 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.errors.txt @@ -1,11 +1,13 @@ cloduleWithDuplicateMember1.ts(3,16): error TS2300: Duplicate identifier 'x'. cloduleWithDuplicateMember1.ts(6,12): error TS2300: Duplicate identifier 'foo'. +cloduleWithDuplicateMember1.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleWithDuplicateMember1.ts(10,16): error TS2300: Duplicate identifier 'x'. +cloduleWithDuplicateMember1.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleWithDuplicateMember1.ts(13,21): error TS2300: Duplicate identifier 'foo'. cloduleWithDuplicateMember1.ts(14,21): error TS2300: Duplicate identifier 'x'. -==== cloduleWithDuplicateMember1.ts (5 errors) ==== +==== cloduleWithDuplicateMember1.ts (7 errors) ==== class C { get x() { return 1; } static get x() { @@ -19,11 +21,15 @@ cloduleWithDuplicateMember1.ts(14,21): error TS2300: Duplicate identifier 'x'. } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; ~ !!! error TS2300: Duplicate identifier 'x'. } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function foo() { } ~~~ !!! error TS2300: Duplicate identifier 'foo'. diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt index 1c14d0ce1f4aa..0753d588dced4 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.errors.txt @@ -1,19 +1,25 @@ +cloduleWithDuplicateMember2.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleWithDuplicateMember2.ts(7,16): error TS2300: Duplicate identifier 'x'. +cloduleWithDuplicateMember2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleWithDuplicateMember2.ts(10,21): error TS2300: Duplicate identifier 'x'. -==== cloduleWithDuplicateMember2.ts (2 errors) ==== +==== cloduleWithDuplicateMember2.ts (4 errors) ==== class C { set x(y) { } static set y(z) { } } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; ~ !!! error TS2300: Duplicate identifier 'x'. } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function x() { } ~ !!! error TS2300: Duplicate identifier 'x'. diff --git a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt index 22851740d13f9..cfba259fe7637 100644 --- a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt +++ b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.errors.txt @@ -1,10 +1,14 @@ +cloduleWithPriorInstantiatedModule.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. cloduleWithPriorInstantiatedModule.ts(2,8): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +cloduleWithPriorInstantiatedModule.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== cloduleWithPriorInstantiatedModule.ts (1 errors) ==== +==== cloduleWithPriorInstantiatedModule.ts (3 errors) ==== // Non-ambient & instantiated module. module Moclodule { ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. export interface Someinterface { foo(): void; @@ -17,6 +21,8 @@ cloduleWithPriorInstantiatedModule.ts(2,8): error TS2434: A namespace declaratio // Instantiated module. module Moclodule { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Manager { } } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.errors.txt b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.errors.txt new file mode 100644 index 0000000000000..1c0dfd6044c20 --- /dev/null +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.errors.txt @@ -0,0 +1,24 @@ +cloduleWithPriorUninstantiatedModule.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleWithPriorUninstantiatedModule.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== cloduleWithPriorUninstantiatedModule.ts (2 errors) ==== + // Non-ambient & uninstantiated module. + module Moclodule { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Someinterface { + foo(): void; + } + } + + class Moclodule { + } + + // Instantiated module. + module Moclodule { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Manager { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.errors.txt b/tests/baselines/reference/cloduleWithRecursiveReference.errors.txt new file mode 100644 index 0000000000000..80bb291cc9c53 --- /dev/null +++ b/tests/baselines/reference/cloduleWithRecursiveReference.errors.txt @@ -0,0 +1,16 @@ +cloduleWithRecursiveReference.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +cloduleWithRecursiveReference.ts(4,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== cloduleWithRecursiveReference.ts (2 errors) ==== + module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export class C { } + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var C = M.C + } + } \ No newline at end of file diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt index 416a7bba14857..437c8b0da6d43 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.errors.txt +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -1,14 +1,22 @@ +clodulesDerivedClasses.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +clodulesDerivedClasses.ts(5,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. Types of property 'Utils' are incompatible. Property 'convert' is missing in type 'typeof Path.Utils' but required in type 'typeof Shape.Utils'. +clodulesDerivedClasses.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +clodulesDerivedClasses.ts(14,13): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== clodulesDerivedClasses.ts (1 errors) ==== +==== clodulesDerivedClasses.ts (5 errors) ==== class Shape { id: number; } module Shape.Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function convert(): Shape { return null;} } @@ -23,6 +31,10 @@ clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' in } module Path.Utils { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function convert2(): Path { return null; } diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt new file mode 100644 index 0000000000000..6fd2fa541e310 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.errors.txt @@ -0,0 +1,63 @@ +collisionCodeGenModuleWithAccessorChildren.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithAccessorChildren.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithAccessorChildren.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithAccessorChildren.ts(30,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithAccessorChildren.ts(39,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithAccessorChildren.ts (5 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 3; + class c { + private y; + set Z(M) { + this.y = x; + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class d { + private y; + set Z(p) { + var M = 10; + this.y = x; + } + } + } + + module M { // Shouldnt be _M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class e { + private y; + set M(p) { + this.y = x; + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class f { + get Z() { + var M = 10; + return x; + } + } + } + + module M { // Shouldnt be _M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class e { + get M() { + return x; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.types index fb0a20a435458..cee0b21918877 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.types @@ -17,15 +17,19 @@ module M { private y; >y : any +> : ^^^ set Z(M) { >Z : any +> : ^^^ >M : any +> : ^^^ this.y = x; >this.y = x : number > : ^^^^^^ >this.y : any +> : ^^^ >this : this > : ^^^^ >y : any @@ -46,10 +50,13 @@ module M { private y; >y : any +> : ^^^ set Z(p) { >Z : any +> : ^^^ >p : any +> : ^^^ var M = 10; >M : number @@ -61,6 +68,7 @@ module M { >this.y = x : number > : ^^^^^^ >this.y : any +> : ^^^ >this : this > : ^^^^ >y : any @@ -81,15 +89,19 @@ module M { // Shouldnt be _M private y; >y : any +> : ^^^ set M(p) { >M : any +> : ^^^ >p : any +> : ^^^ this.y = x; >this.y = x : number > : ^^^^^^ >this.y : any +> : ^^^ >this : this > : ^^^^ >y : any diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.errors.txt new file mode 100644 index 0000000000000..94d9edba01551 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.errors.txt @@ -0,0 +1,35 @@ +collisionCodeGenModuleWithConstructorChildren.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithConstructorChildren.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithConstructorChildren.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithConstructorChildren.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 3; + class c { + constructor(M, p = x) { + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class d { + constructor(private M, p = x) { + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class d2 { + constructor() { + var M = 10; + var p = x; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types index 1f34f6bd21a24..df5d32e8db969 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types @@ -17,6 +17,7 @@ module M { constructor(M, p = x) { >M : any +> : ^^^ >p : number > : ^^^^^^ >x : number @@ -35,6 +36,7 @@ module M { constructor(private M, p = x) { >M : any +> : ^^^ >p : number > : ^^^^^^ >x : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.errors.txt new file mode 100644 index 0000000000000..921bb1f0702cf --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.errors.txt @@ -0,0 +1,12 @@ +collisionCodeGenModuleWithEnumMemberConflict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithEnumMemberConflict.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum e { + m1, + m2 = m1 + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.errors.txt new file mode 100644 index 0000000000000..32aaa553e8c2e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.errors.txt @@ -0,0 +1,31 @@ +collisionCodeGenModuleWithFunctionChildren.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithFunctionChildren.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithFunctionChildren.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithFunctionChildren.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 3; + function fn(M, p = x) { } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function fn2() { + var M; + var p = x; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function fn3() { + function M() { + var p = x; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 9e0e58bacddad..7fc42d5f52a88 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -15,6 +15,7 @@ module M { >fn : (M: any, p?: number) => void > : ^ ^^^^^^^ ^^^^^^^^^^^^^^^^^^ >M : any +> : ^^^ >p : number > : ^^^^^^ >x : number @@ -31,6 +32,7 @@ module M { var M; >M : any +> : ^^^ var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.errors.txt new file mode 100644 index 0000000000000..4e98fc76ab994 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.errors.txt @@ -0,0 +1,24 @@ +collisionCodeGenModuleWithMemberClassConflict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithMemberClassConflict.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithMemberClassConflict.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m1 { + } + } + var foo = new m1.m1(); + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m2 { + } + + export class _m2 { + } + } + var foo = new m2.m2(); + var foo = new m2._m2(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.errors.txt new file mode 100644 index 0000000000000..152404da70041 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.errors.txt @@ -0,0 +1,13 @@ +collisionCodeGenModuleWithMemberInterfaceConflict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithMemberInterfaceConflict.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m1 { + } + export class m2 implements m1 { + } + } + var foo = new m1.m2(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.errors.txt new file mode 100644 index 0000000000000..0b00be3728172 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.errors.txt @@ -0,0 +1,11 @@ +collisionCodeGenModuleWithMemberVariable.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithMemberVariable.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1 = 10; + var b = m1; + } + var foo = m1.m1; \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.errors.txt new file mode 100644 index 0000000000000..2a97573001011 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.errors.txt @@ -0,0 +1,47 @@ +collisionCodeGenModuleWithMethodChildren.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithMethodChildren.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithMethodChildren.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithMethodChildren.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithMethodChildren.ts (4 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 3; + class c { + fn(M, p = x) { } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class d { + fn2() { + var M; + var p = x; + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class e { + fn3() { + function M() { + var p = x; + } + } + } + } + + module M { // Shouldnt bn _M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class f { + M() { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types index 5f32484a85c11..7537d185bcdcd 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types @@ -19,6 +19,7 @@ module M { >fn : (M: any, p?: number) => void > : ^ ^^^^^^^ ^^^^^^^^^^^^^^^^^^ >M : any +> : ^^^ >p : number > : ^^^^^^ >x : number @@ -40,6 +41,7 @@ module M { var M; >M : any +> : ^^^ var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.errors.txt new file mode 100644 index 0000000000000..f6b2e62159fea --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.errors.txt @@ -0,0 +1,78 @@ +collisionCodeGenModuleWithModuleChildren.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(28,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(36,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(37,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleChildren.ts(38,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithModuleChildren.ts (11 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 3; + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var M = 10; + var p = x; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class M { + } + var p = x; + var p2 = new M(); + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function M() { + } + var p = x; + var p2 = M(); + } + } + + module M { // shouldnt be _M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface M { + } + var p = x; + var p2: M; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var p = x; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.errors.txt new file mode 100644 index 0000000000000..1c065e794480d --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.errors.txt @@ -0,0 +1,44 @@ +collisionCodeGenModuleWithModuleReopening.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleReopening.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleReopening.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionCodeGenModuleWithModuleReopening.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithModuleReopening.ts (4 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m1 { + } + } + var foo = new m1.m1(); + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + var b = new c1(); + var c = new m1(); + } + var foo2 = new m1.c1(); + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export var b10 = 10; + var x = new c1(); + } + var foo3 = new m2.c1(); + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m2 { + } + var b = new m2(); + var d = b10; + var c = new c1(); + } + var foo3 = new m2.c1(); + var foo2 = new m2.m2(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.errors.txt new file mode 100644 index 0000000000000..a9c3fa325a284 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.errors.txt @@ -0,0 +1,14 @@ +collisionCodeGenModuleWithPrivateMember.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithPrivateMember.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class m1 { + } + var x = new m1(); + export class c1 { + } + } + var foo = new m1.c1(); \ No newline at end of file diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt new file mode 100644 index 0000000000000..a5ca0de73ef9f --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.errors.txt @@ -0,0 +1,15 @@ +collisionCodeGenModuleWithUnicodeNames.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionCodeGenModuleWithUnicodeNames.ts (1 errors) ==== + module 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { + } + } + + var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123(); + + + \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.errors.txt new file mode 100644 index 0000000000000..fdc58394dbd39 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.errors.txt @@ -0,0 +1,50 @@ +collisionExportsRequireAndAmbientClass_externalmodule.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientClass_externalmodule.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientClass_globalFile.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientClass_globalFile.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientClass_externalmodule.ts (2 errors) ==== + export declare class require { + } + export declare class exports { + } + declare module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class require { + } + class exports { + } + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare class require { + } + export declare class exports { + } + } + +==== collisionExportsRequireAndAmbientClass_globalFile.ts (2 errors) ==== + declare class require { + } + declare class exports { + } + declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class require { + } + class exports { + } + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare class require { + } + export declare class exports { + } + var a = 10; + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.errors.txt new file mode 100644 index 0000000000000..6f5aa25972c04 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.errors.txt @@ -0,0 +1,73 @@ +collisionExportsRequireAndAmbientEnum_externalmodule.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientEnum_externalmodule.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientEnum_globalFile.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientEnum_globalFile.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientEnum_externalmodule.ts (2 errors) ==== + export declare enum require { + _thisVal1, + _thisVal2, + } + export declare enum exports { + _thisVal1, + _thisVal2, + } + declare module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum require { + _thisVal1, + _thisVal2, + } + enum exports { + _thisVal1, + _thisVal2, + } + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare enum require { + _thisVal1, + _thisVal2, + } + export declare enum exports { + _thisVal1, + _thisVal2, + } + } + +==== collisionExportsRequireAndAmbientEnum_globalFile.ts (2 errors) ==== + declare enum require { + _thisVal1, + _thisVal2, + } + declare enum exports { + _thisVal1, + _thisVal2, + } + declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum require { + _thisVal1, + _thisVal2, + } + enum exports { + _thisVal1, + _thisVal2, + } + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare enum require { + _thisVal1, + _thisVal2, + } + export declare enum exports { + _thisVal1, + _thisVal2, + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.errors.txt new file mode 100644 index 0000000000000..a4af1cb04c871 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.errors.txt @@ -0,0 +1,22 @@ +collisionExportsRequireAndAmbientFunction.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientFunction.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientFunction.ts (2 errors) ==== + export declare function exports(): number; + + export declare function require(): string[]; + + declare module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function exports(): string; + function require(): number; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare function exports(): string; + export declare function require(): string[]; + var a = 10; + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.errors.txt new file mode 100644 index 0000000000000..a0e25ff14e1fe --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.errors.txt @@ -0,0 +1,20 @@ +collisionExportsRequireAndAmbientFunctionInGlobalFile.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientFunctionInGlobalFile.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientFunctionInGlobalFile.ts (2 errors) ==== + declare function exports(): number; + declare function require(): string; + declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function exports(): string[]; + function require(): number[]; + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare function exports(): string; + export declare function require(): string; + var a = 10; + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt new file mode 100644 index 0000000000000..e63ec75d2d512 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt @@ -0,0 +1,143 @@ +collisionExportsRequireAndAmbientModule_externalmodule.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(10,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(19,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(20,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(26,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(34,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_externalmodule.ts(40,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(13,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(14,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(20,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(28,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientModule_globalFile.ts(34,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientModule_externalmodule.ts (8 errors) ==== + export declare module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + export function foo(): require.I { + return null; + } + export declare module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + export function foo2(): exports.I { + return null; + } + declare module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + export declare module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + var a = 10; + } + +==== collisionExportsRequireAndAmbientModule_globalFile.ts (8 errors) ==== + declare module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + declare module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + export declare module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + export class C { + } + } + + var a = 10; + } + \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.errors.txt new file mode 100644 index 0000000000000..b4ecafef260c5 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.errors.txt @@ -0,0 +1,39 @@ +collisionExportsRequireAndAmbientVar_externalmodule.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientVar_externalmodule.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientVar_globalFile.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndAmbientVar_globalFile.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndAmbientVar_externalmodule.ts (2 errors) ==== + export declare var exports: number; + export declare var require: string; + declare module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var exports: string; + var require: number; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare var exports: number; + export declare var require: string; + var a = 10; + } + +==== collisionExportsRequireAndAmbientVar_globalFile.ts (2 errors) ==== + declare var exports: number; + declare var require: string; + declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var exports: string; + var require: number; + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare var exports: string; + export declare var require: number; + var a = 10; + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt index dbe33f7bb0310..c10bf6776119c 100644 --- a/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndClass.errors.txt @@ -1,8 +1,12 @@ collisionExportsRequireAndClass_externalmodule.ts(1,14): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. collisionExportsRequireAndClass_externalmodule.ts(3,14): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +collisionExportsRequireAndClass_externalmodule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndClass_externalmodule.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndClass_globalFile.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndClass_globalFile.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndClass_externalmodule.ts (2 errors) ==== +==== collisionExportsRequireAndClass_externalmodule.ts (4 errors) ==== export class require { ~~~~~~~ !!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. @@ -12,30 +16,38 @@ collisionExportsRequireAndClass_externalmodule.ts(3,14): error TS2441: Duplicate !!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. } module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class require { } class exports { } } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class require { } export class exports { } } -==== collisionExportsRequireAndClass_globalFile.ts (0 errors) ==== +==== collisionExportsRequireAndClass_globalFile.ts (2 errors) ==== class require { } class exports { } module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class require { } class exports { } } module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class require { } export class exports { diff --git a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt index 37da5848b8d6c..55efd90a8e5be 100644 --- a/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndEnum.errors.txt @@ -1,8 +1,12 @@ collisionExportsRequireAndEnum_externalmodule.ts(1,13): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +collisionExportsRequireAndEnum_externalmodule.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndEnum_externalmodule.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndEnum_globalFile.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndEnum_globalFile.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndEnum_externalmodule.ts (2 errors) ==== +==== collisionExportsRequireAndEnum_externalmodule.ts (4 errors) ==== export enum require { // Error ~~~~~~~ !!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. @@ -16,6 +20,8 @@ collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate _thisVal2, } module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum require { _thisVal1, _thisVal2, @@ -26,6 +32,8 @@ collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate } } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum require { _thisVal1, _thisVal2, @@ -36,7 +44,7 @@ collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate } } -==== collisionExportsRequireAndEnum_globalFile.ts (0 errors) ==== +==== collisionExportsRequireAndEnum_globalFile.ts (2 errors) ==== enum require { _thisVal1, _thisVal2, @@ -46,6 +54,8 @@ collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate _thisVal2, } module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum require { _thisVal1, _thisVal2, @@ -56,6 +66,8 @@ collisionExportsRequireAndEnum_externalmodule.ts(5,13): error TS2441: Duplicate } } module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum require { _thisVal1, _thisVal2, diff --git a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt index a5cf85435ca77..fa23df1073640 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndFunction.errors.txt @@ -1,8 +1,10 @@ collisionExportsRequireAndFunction.ts(1,17): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +collisionExportsRequireAndFunction.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndFunction.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndFunction.ts (2 errors) ==== +==== collisionExportsRequireAndFunction.ts (4 errors) ==== export function exports() { ~~~~~~~ !!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. @@ -14,6 +16,8 @@ collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier return "require"; } module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function exports() { return 1; } @@ -22,6 +26,8 @@ collisionExportsRequireAndFunction.ts(4,17): error TS2441: Duplicate identifier } } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function exports() { return 1; } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.errors.txt b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.errors.txt new file mode 100644 index 0000000000000..aa08653c1f2a2 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.errors.txt @@ -0,0 +1,31 @@ +collisionExportsRequireAndFunctionInGlobalFile.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndFunctionInGlobalFile.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndFunctionInGlobalFile.ts (2 errors) ==== + function exports() { + return 1; + } + function require() { + return "require"; + } + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function exports() { + return 1; + } + function require() { + return "require"; + } + } + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function exports() { + return 1; + } + export function require() { + return "require"; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt index 25e9a3c14a18b..74603f11dd45f 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAlias.errors.txt @@ -1,9 +1,14 @@ +collisionExportsRequireAndInternalModuleAlias.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. collisionExportsRequireAndInternalModuleAlias.ts(5,8): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +collisionExportsRequireAndInternalModuleAlias.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndInternalModuleAlias.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndInternalModuleAlias.ts (2 errors) ==== +==== collisionExportsRequireAndInternalModuleAlias.ts (5 errors) ==== export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c { } } @@ -17,6 +22,8 @@ collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate i new require(); module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import exports = m.c; import require = m.c; new exports(); @@ -24,6 +31,8 @@ collisionExportsRequireAndInternalModuleAlias.ts(6,8): error TS2441: Duplicate i } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import exports = m.c; export import require = m.c; new exports(); diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.errors.txt b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.errors.txt new file mode 100644 index 0000000000000..0e964579f477c --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.errors.txt @@ -0,0 +1,34 @@ +collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts (3 errors) ==== + module mOfGloalFile { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + import exports = mOfGloalFile.c; + import require = mOfGloalFile.c; + new exports(); + new require(); + + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import exports = mOfGloalFile.c; + import require = mOfGloalFile.c; + new exports(); + new require(); + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import exports = mOfGloalFile.c; + export import require = mOfGloalFile.c; + new exports(); + new require(); + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt index be62e07875db8..0205a00a3ffab 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt @@ -1,10 +1,28 @@ +collisionExportsRequireAndModule_externalmodule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. collisionExportsRequireAndModule_externalmodule.ts(1,15): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +collisionExportsRequireAndModule_externalmodule.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_externalmodule.ts(20,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_externalmodule.ts(26,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_externalmodule.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_externalmodule.ts(34,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_externalmodule.ts(40,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(14,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(20,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(28,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndModule_globalFile.ts(34,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndModule_externalmodule.ts (2 errors) ==== +==== collisionExportsRequireAndModule_externalmodule.ts (10 errors) ==== export module require { ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ !!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. export interface I { } @@ -16,6 +34,8 @@ collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplica } export module exports { ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ !!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. export interface I { } @@ -26,13 +46,19 @@ collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplica return null; } module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { @@ -40,13 +66,19 @@ collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplica } } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } export module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { @@ -54,27 +86,37 @@ collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplica } } -==== collisionExportsRequireAndModule_globalFile.ts (0 errors) ==== +==== collisionExportsRequireAndModule_globalFile.ts (8 errors) ==== module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { @@ -82,13 +124,19 @@ collisionExportsRequireAndModule_externalmodule.ts(10,15): error TS2441: Duplica } } module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module require { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { } } export module exports { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } export class C { diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt new file mode 100644 index 0000000000000..db68579ecef97 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt @@ -0,0 +1,23 @@ +collisionExportsRequireAndUninstantiatedModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndUninstantiatedModule.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionExportsRequireAndUninstantiatedModule.ts (2 errors) ==== + export module require { // no error + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + export function foo(): require.I { + return null; + } + export module exports { // no error + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + export function foo2(): exports.I { + return null; + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt index 36c86cb380df8..0a822f9650170 100644 --- a/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndVar.errors.txt @@ -1,8 +1,12 @@ collisionExportsRequireAndVar_externalmodule.ts(3,5): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. collisionExportsRequireAndVar_externalmodule.ts(4,5): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +collisionExportsRequireAndVar_externalmodule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndVar_externalmodule.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndVar_globalFile.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +collisionExportsRequireAndVar_globalFile.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== collisionExportsRequireAndVar_externalmodule.ts (2 errors) ==== +==== collisionExportsRequireAndVar_externalmodule.ts (4 errors) ==== export function foo() { } var exports = 1; @@ -12,22 +16,30 @@ collisionExportsRequireAndVar_externalmodule.ts(4,5): error TS2441: Duplicate id ~~~~~~~ !!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var exports = 0; var require = "require"; } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var exports = 0; export var require = "require"; } -==== collisionExportsRequireAndVar_globalFile.ts (0 errors) ==== +==== collisionExportsRequireAndVar_globalFile.ts (2 errors) ==== var exports = 0; var require = "require"; module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var exports = 0; var require = "require"; } module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var exports = 0; export var require = "require"; } \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt new file mode 100644 index 0000000000000..3b0f4bac63bc4 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.errors.txt @@ -0,0 +1,11 @@ +collisionThisExpressionAndAliasInGlobal.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionThisExpressionAndAliasInGlobal.ts (1 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var b = 10; + } + var f = () => this; + import _this = a; // Error \ No newline at end of file diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt new file mode 100644 index 0000000000000..5c5d37ec126e8 --- /dev/null +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.errors.txt @@ -0,0 +1,11 @@ +collisionThisExpressionAndModuleInGlobal.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== collisionThisExpressionAndModuleInGlobal.ts (1 errors) ==== + module _this { //Error + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class c { + } + } + var f = () => this; \ No newline at end of file diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.errors.txt b/tests/baselines/reference/commentEmitAtEndOfFile1.errors.txt new file mode 100644 index 0000000000000..6ff0f090856bb --- /dev/null +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.errors.txt @@ -0,0 +1,19 @@ +commentEmitAtEndOfFile1.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentEmitAtEndOfFile1.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentEmitAtEndOfFile1.ts (2 errors) ==== + // test + var f = '' + // test #2 + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function bar() { } + } + // test #3 + module empty { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + // test #4 \ No newline at end of file diff --git a/tests/baselines/reference/commentOnAmbientModule.errors.txt b/tests/baselines/reference/commentOnAmbientModule.errors.txt new file mode 100644 index 0000000000000..48c1c81973a6e --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientModule.errors.txt @@ -0,0 +1,34 @@ +a.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +a.ts(12,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== b.ts (1 errors) ==== + /// + declare module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class foobar extends D.bar { + foo(); + } + } +==== a.ts (2 errors) ==== + /*!========= + Keep this pinned comment + ========= + */ + + /*! Don't keep this pinned comment */ + declare module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo(); + } + + // Don't keep this comment. + declare module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class bar { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/commentOnElidedModule1.errors.txt b/tests/baselines/reference/commentOnElidedModule1.errors.txt new file mode 100644 index 0000000000000..e06e38618c588 --- /dev/null +++ b/tests/baselines/reference/commentOnElidedModule1.errors.txt @@ -0,0 +1,29 @@ +a.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +a.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== b.ts (1 errors) ==== + /// + module ElidedModule3 { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } +==== a.ts (2 errors) ==== + /*!================= + Keep this pinned + ================= + */ + + /*! Don't keep this pinned comment */ + module ElidedModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + // Don't keep this comment. + module ElidedModule2 { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + \ No newline at end of file diff --git a/tests/baselines/reference/commentsDottedModuleName.errors.txt b/tests/baselines/reference/commentsDottedModuleName.errors.txt new file mode 100644 index 0000000000000..92d7c8ef9060d --- /dev/null +++ b/tests/baselines/reference/commentsDottedModuleName.errors.txt @@ -0,0 +1,15 @@ +commentsDottedModuleName.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsDottedModuleName.ts(2,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsDottedModuleName.ts (2 errors) ==== + /** this is multi declare module*/ + export module outerModule.InnerModule { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /// class b comment + export class b { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsExternalModules.errors.txt b/tests/baselines/reference/commentsExternalModules.errors.txt new file mode 100644 index 0000000000000..e22cf32f04f46 --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules.errors.txt @@ -0,0 +1,73 @@ +commentsExternalModules_0.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules_0.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules_0.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules_0.ts(36,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsExternalModules_1.ts (0 errors) ==== + /**This is on import declaration*/ + import extMod = require("commentsExternalModules_0"); // trailing comment1 + extMod.m1.fooExport(); + var newVar = new extMod.m1.m2.c(); + extMod.m4.fooExport(); + var newVar2 = new extMod.m4.m2.c(); + +==== commentsExternalModules_0.ts (4 errors) ==== + /** Module comment*/ + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + } + m1.fooExport(); + var myvar = new m1.m2.c(); + + /** Module comment */ + export module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment */ + export var b: number; + /** foo's comment + */ + function foo() { + return b; + } + /** m2 comments + */ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment; */ + export class c { + }; + /** i */ + export var i = new c(); + } + /** exported function */ + export function fooExport() { + return foo(); + } + } + m4.fooExport(); + var myvar2 = new m4.m2.c(); + \ No newline at end of file diff --git a/tests/baselines/reference/commentsExternalModules2.errors.txt b/tests/baselines/reference/commentsExternalModules2.errors.txt new file mode 100644 index 0000000000000..8650af940413f --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules2.errors.txt @@ -0,0 +1,73 @@ +commentsExternalModules2_0.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(36,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsExternalModules_1.ts (0 errors) ==== + /**This is on import declaration*/ + import extMod = require("commentsExternalModules2_0"); // trailing comment 1 + extMod.m1.fooExport(); + export var newVar = new extMod.m1.m2.c(); + extMod.m4.fooExport(); + export var newVar2 = new extMod.m4.m2.c(); + +==== commentsExternalModules2_0.ts (4 errors) ==== + /** Module comment*/ + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + } + m1.fooExport(); + var myvar = new m1.m2.c(); + + /** Module comment */ + export module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment */ + export var b: number; + /** foo's comment + */ + function foo() { + return b; + } + /** m2 comments + */ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment; */ + export class c { + }; + /** i */ + export var i = new c(); + } + /** exported function */ + export function fooExport() { + return foo(); + } + } + m4.fooExport(); + var myvar2 = new m4.m2.c(); + \ No newline at end of file diff --git a/tests/baselines/reference/commentsExternalModules3.errors.txt b/tests/baselines/reference/commentsExternalModules3.errors.txt new file mode 100644 index 0000000000000..c14765e373247 --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules3.errors.txt @@ -0,0 +1,73 @@ +commentsExternalModules2_0.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsExternalModules2_0.ts(36,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsExternalModules_1.ts (0 errors) ==== + /**This is on import declaration*/ + import extMod = require("./commentsExternalModules2_0"); // trailing comment 1 + extMod.m1.fooExport(); + export var newVar = new extMod.m1.m2.c(); + extMod.m4.fooExport(); + export var newVar2 = new extMod.m4.m2.c(); + +==== commentsExternalModules2_0.ts (4 errors) ==== + /** Module comment*/ + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + } + m1.fooExport(); + var myvar = new m1.m2.c(); + + /** Module comment */ + export module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment */ + export var b: number; + /** foo's comment + */ + function foo() { + return b; + } + /** m2 comments + */ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment; */ + export class c { + }; + /** i */ + export var i = new c(); + } + /** exported function */ + export function fooExport() { + return foo(); + } + } + m4.fooExport(); + var myvar2 = new m4.m2.c(); + \ No newline at end of file diff --git a/tests/baselines/reference/commentsFormatting.errors.txt b/tests/baselines/reference/commentsFormatting.errors.txt new file mode 100644 index 0000000000000..217d025fd3ba6 --- /dev/null +++ b/tests/baselines/reference/commentsFormatting.errors.txt @@ -0,0 +1,91 @@ +commentsFormatting.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsFormatting.ts (1 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** this is first line - aligned to class declaration + * this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c { + } + + /** this is first line - 4 spaces right aligned to class but in js file should be aligned to class declaration + * this is 8 spaces left aligned + * this is 7 spaces left aligned + * this is 6 spaces left aligned + * this is 5 spaces left aligned + * this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c2 { + } + + /** this is comment with new lines in between + + this is 4 spaces left aligned but above line is empty + + this is 3 spaces left aligned but above line is empty + + this is 2 spaces left aligned but above line is empty + + this is 1 spaces left aligned but above line is empty + + this is at same level as first line but above line is empty + + this is 1 spaces right aligned but above line is empty + + this is 2 spaces right aligned but above line is empty + + this is 3 spaces right aligned but above line is empty + + this is 4 spaces right aligned but above line is empty + + + Above 2 lines are empty + + + + above 3 lines are empty*/ + export class c3 { + } + + /** this is first line - aligned to class declaration + * this is 0 space + tab + * this is 1 space + tab + * this is 2 spaces + tab + * this is 3 spaces + tab + * this is 4 spaces + tab + * this is 5 spaces + tab + * this is 6 spaces + tab + * this is 7 spaces + tab + * this is 8 spaces + tab + * this is 9 spaces + tab + * this is 10 spaces + tab + * this is 11 spaces + tab + * this is 12 spaces + tab */ + export class c4 { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsModules.errors.txt b/tests/baselines/reference/commentsModules.errors.txt new file mode 100644 index 0000000000000..2e8a8731962a0 --- /dev/null +++ b/tests/baselines/reference/commentsModules.errors.txt @@ -0,0 +1,163 @@ +commentsModules.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(41,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(41,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(48,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(48,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(48,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(55,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(55,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(55,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(56,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(64,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(64,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(64,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(66,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(73,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(73,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(74,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(81,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(81,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsModules.ts(83,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsModules.ts (21 errors) ==== + /** Module comment*/ + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** b's comment*/ + export var b: number; + /** foo's comment*/ + function foo() { + return b; + } + /** m2 comments*/ + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class comment;*/ + export class c { + }; + /** i*/ + export var i = new c(); + } + /** exported function*/ + export function fooExport() { + return foo(); + } + + // shouldn't appear + export function foo2Export(/**hm*/ a: string) { + } + + /** foo3Export + * comment + */ + export function foo3Export() { + } + + /** foo4Export + * comment + */ + function foo4Export() { + } + } // trailing comment module + m1.fooExport(); + var myvar = new m1.m2.c(); + /** module comment of m2.m3*/ + module m2.m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + } /* trailing dotted module comment*/ + new m2.m3.c(); + /** module comment of m3.m4.m5*/ + module m3.m4.m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + } // trailing dotted module 2 + new m3.m4.m5.c(); + /** module comment of m4.m5.m6*/ + module m4.m5.m6 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m7 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + } /* trailing inner module */ /* multiple comments*/ + } + new m4.m5.m6.m7.c(); + /** module comment of m5.m6.m7*/ + module m5.m6.m7 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** module m8 comment*/ + export module m8 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + } + } + new m5.m6.m7.m8.c(); + module m6.m7 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m8 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + } + } + new m6.m7.m8.c(); + module m7.m8 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** module m9 comment*/ + export module m9 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** Exported class comment*/ + export class c { + } + + /** class d */ + class d { + } + + // class e + export class e { + } + } + } + new m7.m8.m9.c(); \ No newline at end of file diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt b/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt new file mode 100644 index 0000000000000..551d4dfe038dd --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt @@ -0,0 +1,45 @@ +commentsMultiModuleMultiFile_0.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsMultiModuleMultiFile_0.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsMultiModuleMultiFile_1.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsMultiModuleMultiFile_1.ts (1 errors) ==== + import m = require('commentsMultiModuleMultiFile_0'); + /** this is multi module 3 comment*/ + export module multiM { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class d comment*/ + export class d { + } + + /// class f comment + export class f { + } + } + new multiM.d(); +==== commentsMultiModuleMultiFile_0.ts (2 errors) ==== + /** this is multi declare module*/ + export module multiM { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /// class b comment + export class b { + } + } + /** thi is multi module 2*/ + export module multiM { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class c comment*/ + export class c { + } + + // class e comment + export class e { + } + } + + new multiM.b(); + new multiM.c(); + \ No newline at end of file diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.errors.txt b/tests/baselines/reference/commentsMultiModuleSingleFile.errors.txt new file mode 100644 index 0000000000000..24064d726c790 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.errors.txt @@ -0,0 +1,32 @@ +commentsMultiModuleSingleFile.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsMultiModuleSingleFile.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsMultiModuleSingleFile.ts (2 errors) ==== + /** this is multi declare module*/ + module multiM { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class b*/ + export class b { + } + + // class d + export class d { + } + } + + /// this is multi module 2 + module multiM { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class c comment*/ + export class c { + } + + /// class e + export class e { + } + } + new multiM.b(); + new multiM.c(); \ No newline at end of file diff --git a/tests/baselines/reference/commentsdoNotEmitComments.errors.txt b/tests/baselines/reference/commentsdoNotEmitComments.errors.txt new file mode 100644 index 0000000000000..be460a9367f5c --- /dev/null +++ b/tests/baselines/reference/commentsdoNotEmitComments.errors.txt @@ -0,0 +1,101 @@ +commentsdoNotEmitComments.ts(72,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsdoNotEmitComments.ts(81,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsdoNotEmitComments.ts (2 errors) ==== + /** Variable comments*/ + var myVariable = 10; + + /** function comments*/ + function foo(/** parameter comment*/p: number) { + } + + /** variable with function type comment*/ + var fooVar: () => void; + foo(50); + fooVar(); + + /**class comment*/ + class c { + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; + + /** function comment */ + public myFoo() { + return this.b; + } + + /** getter comment*/ + public get prop1() { + return this.b; + } + + /** setter comment*/ + public set prop1(val: number) { + this.b = val; + } + + /** overload signature1*/ + public foo1(a: number): string; + /** Overload signature 2*/ + public foo1(b: string): string; + /** overload implementation signature*/ + public foo1(aOrb) { + return aOrb.toString(); + } + } + + /**instance comment*/ + var i = new c(); + + /** interface comments*/ + interface i1 { + /** caller comments*/ + (a: number): number; + + /** new comments*/ + new (b: string); + + /**indexer property*/ + [a: number]: string; + + /** function property;*/ + myFoo(/*param prop*/a: number): string; + + /** prop*/ + prop: string; + } + + /**interface instance comments*/ + var i1_i: i1; + + /** this is module comment*/ + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class b */ + export class b { + constructor(public x: number) { + + } + } + + /// module m2 + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + } + + /// this is x + declare var x; + + + /** const enum member value comment (generated by TS) */ + const enum color { red, green, blue } + var shade: color = color.green; + \ No newline at end of file diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index 2a976739e0d62..c062b0c1b9178 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -118,10 +118,13 @@ class c { >foo1 : { (a: number): string; (b: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >aOrb : any +> : ^^^ return aOrb.toString(); >aOrb.toString() : any +> : ^^^ >aOrb.toString : any +> : ^^^ >aOrb : any > : ^^^ >toString : any @@ -198,6 +201,7 @@ module m1 { /// this is x declare var x; >x : any +> : ^^^ /** const enum member value comment (generated by TS) */ diff --git a/tests/baselines/reference/commentsemitComments.errors.txt b/tests/baselines/reference/commentsemitComments.errors.txt new file mode 100644 index 0000000000000..cbd19fcc72058 --- /dev/null +++ b/tests/baselines/reference/commentsemitComments.errors.txt @@ -0,0 +1,96 @@ +commentsemitComments.ts(72,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +commentsemitComments.ts(81,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== commentsemitComments.ts (2 errors) ==== + /** Variable comments*/ + var myVariable = 10; + + /** function comments*/ + function foo(/** parameter comment*/p: number) { + } + + /** variable with function type comment*/ + var fooVar: () => void; + foo(50); + fooVar(); + + /**class comment*/ + class c { + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; + + /** function comment */ + public myFoo() { + return this.b; + } + + /** getter comment*/ + public get prop1() { + return this.b; + } + + /** setter comment*/ + public set prop1(val: number) { + this.b = val; + } + + /** overload signature1*/ + public foo1(a: number): string; + /** Overload signature 2*/ + public foo1(b: string): string; + /** overload implementation signature*/ + public foo1(aOrb) { + return aOrb.toString(); + } + } + + /**instance comment*/ + var i = new c(); + + /** interface comments*/ + interface i1 { + /** caller comments*/ + (a: number): number; + + /** new comments*/ + new (b: string); + + /**indexer property*/ + [a: number]: string; + + /** function property;*/ + myFoo(/*param prop*/a: number): string; + + /** prop*/ + prop: string; + } + + /**interface instance comments*/ + var i1_i: i1; + + /** this is module comment*/ + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + /** class b */ + export class b { + constructor(public x: number) { + + } + } + + /// module m2 + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + } + + /// this is x + declare var x; + \ No newline at end of file diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index e9736dd5447bd..7137249b4bf85 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -118,10 +118,13 @@ class c { >foo1 : { (a: number): string; (b: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >aOrb : any +> : ^^^ return aOrb.toString(); >aOrb.toString() : any +> : ^^^ >aOrb.toString : any +> : ^^^ >aOrb : any > : ^^^ >toString : any @@ -198,4 +201,5 @@ module m1 { /// this is x declare var x; >x : any +> : ^^^ diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.errors.txt b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.errors.txt new file mode 100644 index 0000000000000..83332d965991f --- /dev/null +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.errors.txt @@ -0,0 +1,35 @@ +foo_0.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + // None of the below should cause a runtime dependency on foo_0 + import f = foo.M1; + var i: f.I2; + var x: foo.C1 = <{m1: number}>{}; + var y: typeof foo.C1.s1 = false; + var z: foo.M1.I2; + var e: number = 0; +==== foo_0.ts (1 errors) ==== + export class C1 { + m1 = 42; + static s1 = true; + } + + export interface I1 { + name: string; + age: number; + } + + export module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I2 { + foo: string; + } + } + + export enum E1 { + A,B,C + } + \ No newline at end of file diff --git a/tests/baselines/reference/complexRecursiveCollections.errors.txt b/tests/baselines/reference/complexRecursiveCollections.errors.txt index 3f51359243a8f..af1ab43018503 100644 --- a/tests/baselines/reference/complexRecursiveCollections.errors.txt +++ b/tests/baselines/reference/complexRecursiveCollections.errors.txt @@ -1,11 +1,27 @@ +immutable.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(19,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(64,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(110,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(129,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(161,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(182,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(213,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(262,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(265,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(283,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(299,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(333,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +immutable.ts(338,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. immutable.ts(341,22): error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Keyed' is not assignable to type 'this'. 'Keyed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Keyed'. +immutable.ts(357,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. immutable.ts(359,22): error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Indexed' is not assignable to type 'this'. 'Indexed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Indexed'. +immutable.ts(389,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Set' is not assignable to type 'this'. @@ -33,11 +49,13 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; toSeq(): N2; } -==== immutable.ts (3 errors) ==== +==== immutable.ts (19 errors) ==== // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. declare module Immutable { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any): any; export function is(first: any, second: any): boolean; export function hash(value: any): number; @@ -53,6 +71,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter hashCode(): number; } export module List { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isList(maybeList: any): maybeList is List; function of(...values: Array): List; } @@ -98,6 +118,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; } export module Map { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isMap(maybeMap: any): maybeMap is Map; function of(...keyValues: Array): Map; } @@ -144,6 +166,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; } export module OrderedMap { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap; } export function OrderedMap(collection: Iterable<[K, V]>): OrderedMap; @@ -163,6 +187,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; } export module Set { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isSet(maybeSet: any): maybeSet is Set; function of(...values: Array): Set; function fromKeys(iter: Collection): Set; @@ -195,6 +221,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; } export module OrderedSet { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isOrderedSet(maybeOrderedSet: any): boolean; function of(...values: Array): OrderedSet; function fromKeys(iter: Collection): OrderedSet; @@ -216,6 +244,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter zipWith(zipper: (...any: Array) => Z, ...collections: Array>): OrderedSet; } export module Stack { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isStack(maybeStack: any): maybeStack is Stack; function of(...values: Array): Stack; } @@ -247,6 +277,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter export function Range(start?: number, end?: number, step?: number): Seq.Indexed; export function Repeat(value: T, times?: number): Seq.Indexed; export module Record { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function isRecord(maybeRecord: any): maybeRecord is Record.Instance; export function getDescriptiveName(record: Instance): string; export interface Class { @@ -296,9 +328,13 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter } export function Record(defaultValues: T, name?: string): Record.Class; export module Seq { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; function of(...values: Array): Seq.Indexed; export module Keyed {} + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Keyed(collection: Iterable<[K, V]>): Seq.Keyed; export function Keyed(obj: {[key: string]: V}): Seq.Keyed; export function Keyed(): Seq.Keyed; @@ -317,6 +353,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; } module Indexed { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function of(...values: Array): Seq.Indexed; } export function Indexed(): Seq.Indexed; @@ -333,6 +371,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; } export module Set { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function of(...values: Array): Seq.Set; } export function Set(): Seq.Set; @@ -367,11 +407,15 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; } export module Collection { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; function isOrdered(maybeOrdered: any): boolean; export module Keyed {} + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Keyed(collection: Iterable<[K, V]>): Collection.Keyed; export function Keyed(obj: {[key: string]: V}): Collection.Keyed; export interface Keyed extends Collection { @@ -396,6 +440,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter [Symbol.iterator](): IterableIterator<[K, V]>; } export module Indexed {} + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Indexed(collection: Iterable): Collection.Indexed; export interface Indexed extends Collection { ~~~~~~~ @@ -433,6 +479,8 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter [Symbol.iterator](): IterableIterator; } export module Set {} + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function Set(collection: Iterable): Collection.Set; export interface Set extends Collection { ~~~ diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index 0131f5117a6f9..308277d428667 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,11 +1,24 @@ +complicatedPrivacy.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters. complicatedPrivacy.ts(35,6): error TS2693: 'number' only refers to a type, but is being used as a value here. +complicatedPrivacy.ts(44,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(70,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(71,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'. +complicatedPrivacy.ts(79,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(82,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(84,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +complicatedPrivacy.ts(95,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== complicatedPrivacy.ts (3 errors) ==== +==== complicatedPrivacy.ts (12 errors) ==== module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f1(c1: C1) { @@ -52,6 +65,8 @@ complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported me }) { } module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function f2(f1: C1) { } @@ -78,7 +93,11 @@ complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported me } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c_pr implements mglo5.i5, mglo5.i6 { ~~ @@ -89,11 +108,17 @@ complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported me } module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { } module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m6 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function f1() { return new C(); } @@ -105,6 +130,8 @@ complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported me } module mglo5 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface i5 { f1(): string; } diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index 336d069206d36..cd27de6261bf7 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -8,6 +8,7 @@ compoundAssignmentLHSIsValue.ts(21,5): error TS2364: The left-hand side of an as compoundAssignmentLHSIsValue.ts(22,5): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. compoundAssignmentLHSIsValue.ts(25,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. compoundAssignmentLHSIsValue.ts(26,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. +compoundAssignmentLHSIsValue.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. compoundAssignmentLHSIsValue.ts(30,1): error TS2631: Cannot assign to 'M' because it is a namespace. compoundAssignmentLHSIsValue.ts(31,1): error TS2631: Cannot assign to 'M' because it is a namespace. compoundAssignmentLHSIsValue.ts(33,1): error TS2629: Cannot assign to 'C' because it is a class. @@ -76,7 +77,7 @@ compoundAssignmentLHSIsValue.ts(121,1): error TS2362: The left-hand side of an a compoundAssignmentLHSIsValue.ts(122,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -==== compoundAssignmentLHSIsValue.ts (76 errors) ==== +==== compoundAssignmentLHSIsValue.ts (77 errors) ==== // expected error for all the LHS of compound assignments (arithmetic and addition) var value: any; @@ -126,6 +127,8 @@ compoundAssignmentLHSIsValue.ts(122,1): error TS2364: The left-hand side of an a // identifiers: module, class, enum, function module M { export var a; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M *= value; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt index cbb314d00cbef..f34c3e9669601 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt @@ -3,6 +3,7 @@ compoundExponentiationAssignmentLHSIsValue.ts(10,9): error TS2362: The left-hand compoundExponentiationAssignmentLHSIsValue.ts(13,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. compoundExponentiationAssignmentLHSIsValue.ts(18,5): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. compoundExponentiationAssignmentLHSIsValue.ts(21,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +compoundExponentiationAssignmentLHSIsValue.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. compoundExponentiationAssignmentLHSIsValue.ts(25,1): error TS2631: Cannot assign to 'M' because it is a namespace. compoundExponentiationAssignmentLHSIsValue.ts(27,1): error TS2629: Cannot assign to 'C' because it is a class. compoundExponentiationAssignmentLHSIsValue.ts(30,1): error TS2628: Cannot assign to 'E' because it is an enum. @@ -39,7 +40,7 @@ compoundExponentiationAssignmentLHSIsValue.ts(84,1): error TS2362: The left-hand compoundExponentiationAssignmentLHSIsValue.ts(85,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -==== compoundExponentiationAssignmentLHSIsValue.ts (39 errors) ==== +==== compoundExponentiationAssignmentLHSIsValue.ts (40 errors) ==== // expected error for all the LHS of compound assignments (arithmetic and addition) var value: any; @@ -74,6 +75,8 @@ compoundExponentiationAssignmentLHSIsValue.ts(85,1): error TS2362: The left-hand // identifiers: module, class, enum, function module M { export var a; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M **= value; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/compoundVarDecl1.errors.txt b/tests/baselines/reference/compoundVarDecl1.errors.txt new file mode 100644 index 0000000000000..4d40a4d9c375e --- /dev/null +++ b/tests/baselines/reference/compoundVarDecl1.errors.txt @@ -0,0 +1,9 @@ +compoundVarDecl1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== compoundVarDecl1.ts (1 errors) ==== + module Foo { var a = 1, b = 1; a = b + 2; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + var foo = 4, bar = 5; \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt index b6dae2c235231..624e67591c9fe 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES5.errors.txt @@ -1,8 +1,11 @@ +computedPropertyNames19_ES5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== computedPropertyNames19_ES5.ts (1 errors) ==== +==== computedPropertyNames19_ES5.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var obj = { [this.bar]: 0 ~~~~ diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt index aa8cf71340f99..c1e1d3d1c2d11 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt @@ -1,8 +1,11 @@ +computedPropertyNames19_ES6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. computedPropertyNames19_ES6.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== computedPropertyNames19_ES6.ts (1 errors) ==== +==== computedPropertyNames19_ES6.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var obj = { [this.bar]: 0 ~~~~ diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt index a6265f7d63670..8e98d126873e0 100644 --- a/tests/baselines/reference/constDeclarations-access3.errors.txt +++ b/tests/baselines/reference/constDeclarations-access3.errors.txt @@ -1,3 +1,4 @@ +constDeclarations-access3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constDeclarations-access3.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. constDeclarations-access3.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. constDeclarations-access3.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. @@ -18,8 +19,10 @@ constDeclarations-access3.ts(24,7): error TS2540: Cannot assign to 'x' because i constDeclarations-access3.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. -==== constDeclarations-access3.ts (18 errors) ==== +==== constDeclarations-access3.ts (19 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export const x = 0; } diff --git a/tests/baselines/reference/constDeclarations-access4.errors.txt b/tests/baselines/reference/constDeclarations-access4.errors.txt index c1cd937f6e679..4a745d0a66cec 100644 --- a/tests/baselines/reference/constDeclarations-access4.errors.txt +++ b/tests/baselines/reference/constDeclarations-access4.errors.txt @@ -1,3 +1,4 @@ +constDeclarations-access4.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constDeclarations-access4.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. constDeclarations-access4.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. constDeclarations-access4.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. @@ -18,8 +19,10 @@ constDeclarations-access4.ts(24,7): error TS2540: Cannot assign to 'x' because i constDeclarations-access4.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. -==== constDeclarations-access4.ts (18 errors) ==== +==== constDeclarations-access4.ts (19 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const x: number; } diff --git a/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt b/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt index c9aa397371737..71eef78155e9a 100644 --- a/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-ambient-errors.errors.txt @@ -3,10 +3,11 @@ constDeclarations-ambient-errors.ts(3,28): error TS1039: Initializers are not al constDeclarations-ambient-errors.ts(4,20): error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. constDeclarations-ambient-errors.ts(4,39): error TS1039: Initializers are not allowed in ambient contexts. constDeclarations-ambient-errors.ts(4,53): error TS1039: Initializers are not allowed in ambient contexts. +constDeclarations-ambient-errors.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constDeclarations-ambient-errors.ts(8,24): error TS1039: Initializers are not allowed in ambient contexts. -==== constDeclarations-ambient-errors.ts (6 errors) ==== +==== constDeclarations-ambient-errors.ts (7 errors) ==== // error: no intialization expected in ambient declarations declare const c1: boolean = true; ~~~~ @@ -23,6 +24,8 @@ constDeclarations-ambient-errors.ts(8,24): error TS1039: Initializers are not al !!! error TS1039: Initializers are not allowed in ambient contexts. declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const c6 = 0; const c7: number = 7; ~ diff --git a/tests/baselines/reference/constDeclarations-ambient.errors.txt b/tests/baselines/reference/constDeclarations-ambient.errors.txt new file mode 100644 index 0000000000000..eef26f59513bf --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient.errors.txt @@ -0,0 +1,15 @@ +constDeclarations-ambient.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constDeclarations-ambient.ts (1 errors) ==== + // No error + declare const c1: boolean; + declare const c2: number; + declare const c3, c4 :string, c5: any; + + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const c6; + const c7: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-ambient.types b/tests/baselines/reference/constDeclarations-ambient.types index 78482ac1661b8..8015a8bb112a8 100644 --- a/tests/baselines/reference/constDeclarations-ambient.types +++ b/tests/baselines/reference/constDeclarations-ambient.types @@ -12,9 +12,11 @@ declare const c2: number; declare const c3, c4 :string, c5: any; >c3 : any +> : ^^^ >c4 : string > : ^^^^^^ >c5 : any +> : ^^^ declare module M { >M : typeof M @@ -22,6 +24,7 @@ declare module M { const c6; >c6 : any +> : ^^^ const c7: number; >c7 : number diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt index 9e20946833e59..add3bc1ab6d6c 100644 --- a/tests/baselines/reference/constDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -1,7 +1,8 @@ constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +constDeclarations-scopes.ts(102,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== constDeclarations-scopes.ts (1 errors) ==== +==== constDeclarations-scopes.ts (2 errors) ==== // global const c = "string"; @@ -106,6 +107,8 @@ constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not sup // modules module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const c = 0; n = c; diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index 35f0f8b777163..db23a7b4efb46 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,7 +1,8 @@ constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +constDeclarations-validContexts.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== constDeclarations-validContexts.ts (1 errors) ==== +==== constDeclarations-validContexts.ts (2 errors) ==== // Control flow statements with blocks if (true) { const c1 = 0; @@ -89,6 +90,8 @@ constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is // modules module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const c22 = 0; { diff --git a/tests/baselines/reference/constDeclarations2.errors.txt b/tests/baselines/reference/constDeclarations2.errors.txt new file mode 100644 index 0000000000000..aaad06fe8102b --- /dev/null +++ b/tests/baselines/reference/constDeclarations2.errors.txt @@ -0,0 +1,13 @@ +constDeclarations2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constDeclarations2.ts (1 errors) ==== + // No error + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const c1 = false; + export const c2: number = 23; + export const c3 = 0, c4 :string = "", c5 = null; + } + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types index 8a0e3d877f6df..3f27fc4f94df3 100644 --- a/tests/baselines/reference/constDeclarations2.types +++ b/tests/baselines/reference/constDeclarations2.types @@ -28,5 +28,6 @@ module M { >"" : "" > : ^^ >c5 : any +> : ^^^ } diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt index 9c5eb5e7fa219..e0836ac006f1f 100644 --- a/tests/baselines/reference/constEnumErrors.errors.txt +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -1,4 +1,5 @@ constEnumErrors.ts(1,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +constEnumErrors.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constEnumErrors.ts(5,8): error TS2567: Enum declarations can only merge with namespace or other enum declarations. constEnumErrors.ts(12,9): error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums. constEnumErrors.ts(14,9): error TS2474: const enum member initializers must be constant expressions. @@ -16,7 +17,7 @@ constEnumErrors.ts(42,9): error TS2477: 'const' enum member initializer was eval constEnumErrors.ts(43,9): error TS2478: 'const' enum member initializer was evaluated to disallowed value 'NaN'. -==== constEnumErrors.ts (16 errors) ==== +==== constEnumErrors.ts (17 errors) ==== const enum E { ~ !!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. @@ -25,6 +26,8 @@ constEnumErrors.ts(43,9): error TS2478: 'const' enum member initializer was eval module E { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. var x = 1; } diff --git a/tests/baselines/reference/constEnumMergingWithValues1.errors.txt b/tests/baselines/reference/constEnumMergingWithValues1.errors.txt new file mode 100644 index 0000000000000..531a8da7b1810 --- /dev/null +++ b/tests/baselines/reference/constEnumMergingWithValues1.errors.txt @@ -0,0 +1,12 @@ +m1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m1.ts (1 errors) ==== + function foo() {} + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const enum E { X } + } + + export = foo \ No newline at end of file diff --git a/tests/baselines/reference/constEnumMergingWithValues2.errors.txt b/tests/baselines/reference/constEnumMergingWithValues2.errors.txt new file mode 100644 index 0000000000000..32bdb2aa4c09c --- /dev/null +++ b/tests/baselines/reference/constEnumMergingWithValues2.errors.txt @@ -0,0 +1,12 @@ +m1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m1.ts (1 errors) ==== + class foo {} + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const enum E { X } + } + + export = foo \ No newline at end of file diff --git a/tests/baselines/reference/constEnumMergingWithValues3.errors.txt b/tests/baselines/reference/constEnumMergingWithValues3.errors.txt new file mode 100644 index 0000000000000..da7ccc1f3df34 --- /dev/null +++ b/tests/baselines/reference/constEnumMergingWithValues3.errors.txt @@ -0,0 +1,12 @@ +m1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m1.ts (1 errors) ==== + enum foo { A } + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const enum E { X } + } + + export = foo \ No newline at end of file diff --git a/tests/baselines/reference/constEnumMergingWithValues4.errors.txt b/tests/baselines/reference/constEnumMergingWithValues4.errors.txt new file mode 100644 index 0000000000000..c375520da77db --- /dev/null +++ b/tests/baselines/reference/constEnumMergingWithValues4.errors.txt @@ -0,0 +1,19 @@ +m1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +m1.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m1.ts (2 errors) ==== + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const enum E { X } + } + + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 1; + } + + + export = foo \ No newline at end of file diff --git a/tests/baselines/reference/constEnumMergingWithValues5.errors.txt b/tests/baselines/reference/constEnumMergingWithValues5.errors.txt new file mode 100644 index 0000000000000..2e5ab568ac51c --- /dev/null +++ b/tests/baselines/reference/constEnumMergingWithValues5.errors.txt @@ -0,0 +1,11 @@ +m1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m1.ts (1 errors) ==== + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const enum E { X } + } + + export = foo \ No newline at end of file diff --git a/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport2.errors.txt b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport2.errors.txt new file mode 100644 index 0000000000000..0353b6fd37014 --- /dev/null +++ b/tests/baselines/reference/constEnumNamespaceReferenceCausesNoImport2.errors.txt @@ -0,0 +1,26 @@ +foo.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== index.ts (0 errors) ==== + import Foo = require("./reexport"); + function check(x: Foo.ConstFooEnum): void { + switch (x) { + case Foo.ConstFooEnum.Some: + break; + } + } +==== foo.ts (1 errors) ==== + export module ConstEnumOnlyModule { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum ConstFooEnum { + Some, + Values, + Here + } + } + +==== reexport.ts (0 errors) ==== + import * as Foo from "./foo"; + export = Foo.ConstEnumOnlyModule; + \ No newline at end of file diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.errors.txt b/tests/baselines/reference/constEnumOnlyModuleMerging.errors.txt new file mode 100644 index 0000000000000..035b96b29cb09 --- /dev/null +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.errors.txt @@ -0,0 +1,25 @@ +constEnumOnlyModuleMerging.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnumOnlyModuleMerging.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnumOnlyModuleMerging.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constEnumOnlyModuleMerging.ts (3 errors) ==== + module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + } + + module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum A { X } + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import O = Outer; + var x = O.A.X; + var y = O.x; + } \ No newline at end of file diff --git a/tests/baselines/reference/constEnums.errors.txt b/tests/baselines/reference/constEnums.errors.txt new file mode 100644 index 0000000000000..f95457d16fd3b --- /dev/null +++ b/tests/baselines/reference/constEnums.errors.txt @@ -0,0 +1,220 @@ +constEnums.ts(50,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(51,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(52,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(61,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(62,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(63,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(72,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(73,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(74,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(83,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(84,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(85,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constEnums.ts(92,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constEnums.ts (13 errors) ==== + const enum Enum1 { + A0 = 100, + } + + const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + PQ = E ** 2, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], + W5 = Enum1[`V`], + } + + const enum Comments { + "//", + "/*", + "*/", + "///", + "#", + "", + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum E { + V3 = A.B.C.E["V2"] & 200, + V4 = A.B.C.E[`V1`] << 1, + } + } + } + } + + module A1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum E { + V1 = 10, + V2 = 110, + } + } + } + } + + module A2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 1 + } + } + } + + import I = A.B.C.E; + import I1 = A1.B; + import I2 = A2.B; + + function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } + } + + function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } + } + + function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } + } + + + function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.PQ: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1[`U`]: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } + } + + function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } + } + + function baz(c: Comments) { + switch (c) { + case Comments["//"]: + case Comments["/*"]: + case Comments["*/"]: + case Comments["///"]: + case Comments["#"]: + case Comments[""]: + break; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt index 37b823ae23154..462aaba573ae2 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,3 +1,5 @@ +constructSignatureAssignabilityInInheritance.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constructSignatureAssignabilityInInheritance.ts(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. The types returned by 'new a(...)' are incompatible between these types. Type 'string' is not assignable to type 'number'. @@ -7,10 +9,12 @@ constructSignatureAssignabilityInInheritance.ts(67,15): error TS2430: Interface 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== constructSignatureAssignabilityInInheritance.ts (2 errors) ==== +==== constructSignatureAssignabilityInInheritance.ts (4 errors) ==== // Checking basic subtype relations with construct signatures module ConstructSignature { + ~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's new (x: number): void; // BUG 842221 @@ -43,6 +47,8 @@ constructSignatureAssignabilityInInheritance.ts(67,15): error TS2430: Interface } module MemberWithConstructSignature { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's a: new (x: number) => void; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 01f459ad6a7fc..7394ce133ba8e 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,5 @@ +constructSignatureAssignabilityInInheritance3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constructSignatureAssignabilityInInheritance3.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. @@ -26,6 +28,7 @@ constructSignatureAssignabilityInInheritance3.ts(70,19): error TS2430: Interface Type '{ a: string; b: number; }' is not assignable to type '{ a: Base; b: Base; }'. Types of property 'a' are incompatible. Type 'string' is not assignable to type 'Base'. +constructSignatureAssignabilityInInheritance3.ts(80,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructSignatureAssignabilityInInheritance3.ts(86,19): error TS2430: Interface 'I6' incorrectly extends interface 'B'. The types returned by 'new a2(...)' are incompatible between these types. Type 'string[]' is not assignable to type 'T[]'. @@ -37,17 +40,21 @@ constructSignatureAssignabilityInInheritance3.ts(95,19): error TS2430: Interface Type 'T' is not assignable to type 'string'. -==== constructSignatureAssignabilityInInheritance3.ts (6 errors) ==== +==== constructSignatureAssignabilityInInheritance3.ts (9 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases module Errors { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. 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 TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // base type with non-generic call signatures interface A { a2: new (x: number) => string[]; @@ -150,6 +157,8 @@ constructSignatureAssignabilityInInheritance3.ts(95,19): error TS2430: Interface } module WithGenericSignaturesInBaseType { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // base type has generic call signature interface B { a2: new (x: T) => T[]; diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt index cfc821f16b4a5..b18390a20724e 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.errors.txt @@ -1,8 +1,10 @@ +constructSignaturesWithOverloads2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constructSignaturesWithOverloads2.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructSignaturesWithOverloads2.ts(27,11): error TS2428: All declarations of 'I' must have identical type parameters. constructSignaturesWithOverloads2.ts(32,11): error TS2428: All declarations of 'I' must have identical type parameters. -==== constructSignaturesWithOverloads2.ts (2 errors) ==== +==== constructSignaturesWithOverloads2.ts (4 errors) ==== // No errors expected for basic overloads of construct signatures with merged declarations // clodules @@ -12,6 +14,8 @@ constructSignaturesWithOverloads2.ts(32,11): error TS2428: All declarations of ' constructor(x: number) { } } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } @@ -23,6 +27,8 @@ constructSignaturesWithOverloads2.ts(32,11): error TS2428: All declarations of ' constructor(x: T) { } } module C2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt b/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt new file mode 100644 index 0000000000000..5e4d8d45f9952 --- /dev/null +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt @@ -0,0 +1,20 @@ +constructorArgWithGenericCallSignature.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constructorArgWithGenericCallSignature.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface MyFunc { + (value1: T): T; + } + export class MyClass { + constructor(func: MyFunc) { } + } + + export function F(func: MyFunc) { } + } + var func: Test.MyFunc; + Test.F(func); // OK + var test = new Test.MyClass(func); // Should be OK + \ No newline at end of file diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt b/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt new file mode 100644 index 0000000000000..7c3be88688d96 --- /dev/null +++ b/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt @@ -0,0 +1,40 @@ +constructorHasPrototypeProperty.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +constructorHasPrototypeProperty.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constructorHasPrototypeProperty.ts (2 errors) ==== + module NonGeneric { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + foo: string; + } + + class D extends C { + bar: string; + } + + var r = C.prototype; + r.foo; + var r2 = D.prototype; + r2.bar; + } + + module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + foo: T; + bar: U; + } + + class D extends C { + baz: T; + bing: U; + } + + var r = C.prototype; // C + var ra = r.foo; // any + var r2 = D.prototype; // D + var rb = r2.baz; // any + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.types b/tests/baselines/reference/constructorHasPrototypeProperty.types index a0fa6c1c172e6..934958daf606e 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.types +++ b/tests/baselines/reference/constructorHasPrototypeProperty.types @@ -106,7 +106,9 @@ module Generic { var ra = r.foo; // any >ra : any +> : ^^^ >r.foo : any +> : ^^^ >r : C > : ^^^^^^^^^^^ >foo : any @@ -124,7 +126,9 @@ module Generic { var rb = r2.baz; // any >rb : any +> : ^^^ >r2.baz : any +> : ^^^ >r2 : D > : ^^^^^^^^^^^ >baz : any diff --git a/tests/baselines/reference/constructorOverloads4.errors.txt b/tests/baselines/reference/constructorOverloads4.errors.txt index 92562825b89a6..9fa3c044e737e 100644 --- a/tests/baselines/reference/constructorOverloads4.errors.txt +++ b/tests/baselines/reference/constructorOverloads4.errors.txt @@ -1,9 +1,12 @@ +constructorOverloads4.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructorOverloads4.ts(10,1): error TS2349: This expression is not callable. Type 'Function' has no call signatures. -==== constructorOverloads4.ts (1 errors) ==== +==== constructorOverloads4.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Function { constructor(...args: string[]); } diff --git a/tests/baselines/reference/constructorOverloads5.errors.txt b/tests/baselines/reference/constructorOverloads5.errors.txt new file mode 100644 index 0000000000000..3e01faa1db99f --- /dev/null +++ b/tests/baselines/reference/constructorOverloads5.errors.txt @@ -0,0 +1,24 @@ +constructorOverloads5.ts(3,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== constructorOverloads5.ts (1 errors) ==== + interface IArguments {} + + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function RegExp(pattern: string): RegExp; + export function RegExp(pattern: string, flags: string): RegExp; + export class RegExp { + constructor(pattern: string); + constructor(pattern: string, flags: string); + exec(string: string): string[]; + test(string: string): boolean; + source: string; + global: boolean; + ignoreCase: boolean; + multiline: boolean; + lastIndex: boolean; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index fcdb9edc337d7..43787fea0e42b 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,6 +1,7 @@ constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. +constructorWithIncompleteTypeAnnotation.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. @@ -90,7 +91,7 @@ constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== constructorWithIncompleteTypeAnnotation.ts (90 errors) ==== +==== constructorWithIncompleteTypeAnnotation.ts (91 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -111,6 +112,8 @@ constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or module TypeScriptAllInOne { + ~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Program { static Main(...args: string[]) { try { diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index adb7c9330d969..2cf889ba837c1 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -1,8 +1,10 @@ +contextualTyping.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +contextualTyping.ts(66,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient. contextualTyping.ts(223,5): error TS2741: Property 'x' is missing in type '{}' but required in type 'B'. -==== contextualTyping.ts (2 errors) ==== +==== contextualTyping.ts (4 errors) ==== // DEFAULT INTERFACES interface IFoo { n: number; @@ -24,6 +26,8 @@ contextualTyping.ts(223,5): error TS2741: Property 'x' is missing in type '{}' b // CONTEXT: Module property declaration module C2T5 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var foo: (i: number, s: string) => number = function(i) { return i; } @@ -69,6 +73,8 @@ contextualTyping.ts(223,5): error TS2741: Property 'x' is missing in type '{}' b // CONTEXT: Module property assignment module C5T5 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var foo: (i: number, s: string) => string; foo = function(i, s) { return s; diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt index c88882db813e8..eef563893e375 100644 --- a/tests/baselines/reference/convertKeywordsYes.errors.txt +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -1,4 +1,5 @@ convertKeywordsYes.ts(175,12): error TS18006: Classes may not have a field named 'constructor'. +convertKeywordsYes.ts(290,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. convertKeywordsYes.ts(292,11): error TS1213: Identifier expected. 'implements' is a reserved word in strict mode. Class definitions are automatically in strict mode. convertKeywordsYes.ts(293,11): error TS1213: Identifier expected. 'interface' is a reserved word in strict mode. Class definitions are automatically in strict mode. convertKeywordsYes.ts(294,11): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode. @@ -10,7 +11,7 @@ convertKeywordsYes.ts(301,11): error TS1213: Identifier expected. 'static' is a convertKeywordsYes.ts(303,11): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. -==== convertKeywordsYes.ts (10 errors) ==== +==== convertKeywordsYes.ts (11 errors) ==== // reserved ES5 future in strict mode var constructor = 0; @@ -303,6 +304,8 @@ convertKeywordsYes.ts(303,11): error TS1213: Identifier expected. 'yield' is a r } module bigModule { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class constructor { } class implements { } ~~~~~~~~~~ diff --git a/tests/baselines/reference/covariance1.errors.txt b/tests/baselines/reference/covariance1.errors.txt new file mode 100644 index 0000000000000..cc4f00e652c83 --- /dev/null +++ b/tests/baselines/reference/covariance1.errors.txt @@ -0,0 +1,23 @@ +covariance1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== covariance1.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface X { m1:number; } + export class XX implements X { constructor(public m1:number) { } } + + interface Y { x:X; } + + export function f(y:Y) { } + + var a:X; + f({x:a}); // ok + + var b:XX; + f({x:b}); // ok covariant subtype + } + + \ No newline at end of file diff --git a/tests/baselines/reference/crashRegressionTest.errors.txt b/tests/baselines/reference/crashRegressionTest.errors.txt index 57eef1da00bfa..a653202865aef 100644 --- a/tests/baselines/reference/crashRegressionTest.errors.txt +++ b/tests/baselines/reference/crashRegressionTest.errors.txt @@ -1,8 +1,17 @@ +crashRegressionTest.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +crashRegressionTest.ts(1,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +crashRegressionTest.ts(1,22): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. crashRegressionTest.ts(16,56): error TS2339: Property '_name' does not exist on type 'StringTemplate'. -==== crashRegressionTest.ts (1 errors) ==== +==== crashRegressionTest.ts (4 errors) ==== module MsPortal.Util.TemplateEngine { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. "use strict"; interface TemplateKeyValue { diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.errors.txt b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.errors.txt new file mode 100644 index 0000000000000..4038d5f24e84f --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.errors.txt @@ -0,0 +1,15 @@ +declFileAliasUseBeforeDeclaration2.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileAliasUseBeforeDeclaration2.ts (1 errors) ==== + declare module "test" { + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + } + } + class B extends E { + } + import E = A.C; + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.errors.txt b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.errors.txt new file mode 100644 index 0000000000000..49451020f9924 --- /dev/null +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.errors.txt @@ -0,0 +1,24 @@ +declFileAmbientExternalModuleWithSingleExportedModule_0.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileAmbientExternalModuleWithSingleExportedModule_0.ts(3,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileAmbientExternalModuleWithSingleExportedModule_1.ts (0 errors) ==== + /// + import SubModule = require('SubModule'); + export var x: SubModule.m.m3.c; + + +==== declFileAmbientExternalModuleWithSingleExportedModule_0.ts (2 errors) ==== + declare module "SubModule" { + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface c { + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.errors.txt b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.errors.txt new file mode 100644 index 0000000000000..50bf318917107 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.errors.txt @@ -0,0 +1,30 @@ +declFileExportAssignmentImportInternalModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileExportAssignmentImportInternalModule.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileExportAssignmentImportInternalModule.ts (2 errors) ==== + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + export var server: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + } + + import m = m3 + export = m; \ No newline at end of file diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types index 39642342a034c..c98b06a926bbd 100644 --- a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types @@ -9,8 +9,11 @@ module m3 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/declFileExportImportChain.errors.txt b/tests/baselines/reference/declFileExportImportChain.errors.txt new file mode 100644 index 0000000000000..03bdd4e177d01 --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain.errors.txt @@ -0,0 +1,30 @@ +declFileExportImportChain_a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileExportImportChain_a.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileExportImportChain_d.ts (0 errors) ==== + import c = require("declFileExportImportChain_c"); + export var x: c.b1.a.m2.c1; +==== declFileExportImportChain_a.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + } + } + export = m1; + +==== declFileExportImportChain_b.ts (0 errors) ==== + export import a = require("declFileExportImportChain_a"); + +==== declFileExportImportChain_b1.ts (0 errors) ==== + import b = require("declFileExportImportChain_b"); + export = b; + +==== declFileExportImportChain_c.ts (0 errors) ==== + export import b1 = require("declFileExportImportChain_b1"); + \ No newline at end of file diff --git a/tests/baselines/reference/declFileExportImportChain2.errors.txt b/tests/baselines/reference/declFileExportImportChain2.errors.txt new file mode 100644 index 0000000000000..1e8b0469563d6 --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain2.errors.txt @@ -0,0 +1,27 @@ +declFileExportImportChain2_a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileExportImportChain2_a.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileExportImportChain2_d.ts (0 errors) ==== + import c = require("declFileExportImportChain2_c"); + export var x: c.b.m2.c1; +==== declFileExportImportChain2_a.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + } + } + export = m1; + +==== declFileExportImportChain2_b.ts (0 errors) ==== + import a = require("declFileExportImportChain2_a"); + export = a; + +==== declFileExportImportChain2_c.ts (0 errors) ==== + export import b = require("declFileExportImportChain2_b"); + \ No newline at end of file diff --git a/tests/baselines/reference/declFileGenericType.errors.txt b/tests/baselines/reference/declFileGenericType.errors.txt new file mode 100644 index 0000000000000..0199f009e45c7 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType.errors.txt @@ -0,0 +1,45 @@ +declFileGenericType.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileGenericType.ts (1 errors) ==== + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A{ } + export class B { } + + export function F(x: T): A { return null; } + export function F2(x: T): C.A { return null; } + export function F3(x: T): C.A[] { return null; } + export function F4>(x: T): Array> { return null; } + + export function F5(): T { return null; } + + export function F6>(x: T): T { return null; } + + export class D{ + + constructor(public val: T) { } + + } + } + + export var a: C.A; + + export var b = C.F; + export var c = C.F2; + export var d = C.F3; + export var e = C.F4; + + export var x = (new C.D>(new C.A())).val; + + export function f>() { } + + export var g = C.F5>(); + + export class h extends C.A{ } + + export interface i extends C.A { } + + export var j = C.F6; + \ No newline at end of file diff --git a/tests/baselines/reference/declFileGenericType2.errors.txt b/tests/baselines/reference/declFileGenericType2.errors.txt new file mode 100644 index 0000000000000..77a20c5ff86d9 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType2.errors.txt @@ -0,0 +1,101 @@ +declFileGenericType2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(5,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(9,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(13,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(13,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(13,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(18,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(18,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(23,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(23,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(32,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(32,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileGenericType2.ts(32,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileGenericType2.ts (19 errors) ==== + declare module templa.mvc { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface IModel { + } + } + declare module templa.mvc { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface IController { + } + } + declare module templa.mvc { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class AbstractController implements mvc.IController { + } + } + declare module templa.mvc.composite { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface ICompositeControllerModel extends mvc.IModel { + getControllers(): mvc.IController[]; + } + } + module templa.dom.mvc { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IElementController extends templa.mvc.IController { + } + } + // Module + module templa.dom.mvc { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { + constructor() { + super(); + } + } + } + // Module + module templa.dom.mvc.composite { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { + public _controllers: templa.mvc.IController[]; + constructor() { + super(); + this._controllers = []; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.errors.txt b/tests/baselines/reference/declFileImportChainInExportAssignment.errors.txt new file mode 100644 index 0000000000000..a48be774c68b1 --- /dev/null +++ b/tests/baselines/reference/declFileImportChainInExportAssignment.errors.txt @@ -0,0 +1,18 @@ +declFileImportChainInExportAssignment.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileImportChainInExportAssignment.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileImportChainInExportAssignment.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + import a = m.c; + import b = a; + export = b; \ No newline at end of file diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.errors.txt b/tests/baselines/reference/declFileImportModuleWithExportAssignment.errors.txt new file mode 100644 index 0000000000000..d5fec830a011c --- /dev/null +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.errors.txt @@ -0,0 +1,29 @@ +declFileImportModuleWithExportAssignment_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileImportModuleWithExportAssignment_1.ts (0 errors) ==== + /**This is on import declaration*/ + import a1 = require("./declFileImportModuleWithExportAssignment_0"); + export var a = a1; + a.test1(null, null, null); + +==== declFileImportModuleWithExportAssignment_0.ts (1 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + var m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + export = m2; + \ No newline at end of file diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types index e87f98845ca8c..eaf67e98c34db 100644 --- a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types @@ -27,8 +27,11 @@ module m2 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/declFileInternalAliases.errors.txt b/tests/baselines/reference/declFileInternalAliases.errors.txt new file mode 100644 index 0000000000000..f659ce1e25960 --- /dev/null +++ b/tests/baselines/reference/declFileInternalAliases.errors.txt @@ -0,0 +1,24 @@ +declFileInternalAliases.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileInternalAliases.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileInternalAliases.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileInternalAliases.ts (3 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import x = m.c; + export var d = new x(); // emit the type as m.c + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import x = m.c; + export var d = new x(); // emit the type as x + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.errors.txt b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.errors.txt new file mode 100644 index 0000000000000..2690d77ead5bd --- /dev/null +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.errors.txt @@ -0,0 +1,14 @@ +declFileModuleAssignmentInObjectLiteralProperty.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileModuleAssignmentInObjectLiteralProperty.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + var d = { + m1: { m: m1 }, + m2: { c: m1.c }, + }; \ No newline at end of file diff --git a/tests/baselines/reference/declFileModuleContinuation.errors.txt b/tests/baselines/reference/declFileModuleContinuation.errors.txt new file mode 100644 index 0000000000000..3097bfc51f8eb --- /dev/null +++ b/tests/baselines/reference/declFileModuleContinuation.errors.txt @@ -0,0 +1,27 @@ +declFileModuleContinuation.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileModuleContinuation.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileModuleContinuation.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileModuleContinuation.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileModuleContinuation.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileModuleContinuation.ts (5 errors) ==== + module A.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { + } + } + + module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class W implements A.C.Z { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.errors.txt b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.errors.txt new file mode 100644 index 0000000000000..ab752e34d1b54 --- /dev/null +++ b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.errors.txt @@ -0,0 +1,12 @@ +declFileModuleWithPropertyOfTypeModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileModuleWithPropertyOfTypeModule.ts (1 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + + export var a = m; + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.errors.txt b/tests/baselines/reference/declFileTypeAnnotationArrayType.errors.txt new file mode 100644 index 0000000000000..d2452f82b794b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.errors.txt @@ -0,0 +1,56 @@ +declFileTypeAnnotationArrayType.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationArrayType.ts (1 errors) ==== + class c { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + export class g { + } + } + class g { + } + + // Just the name + function foo(): c[] { + return [new c()]; + } + function foo2() { + return [new c()]; + } + + // Qualified name + function foo3(): m.c[] { + return [new m.c()]; + } + function foo4() { + return m.c; + } + + // Just the name with type arguments + function foo5(): g[] { + return [new g()]; + } + function foo6() { + return [new g()]; + } + + // Qualified name with type arguments + function foo7(): m.g[] { + return [new m.g()]; + } + function foo8() { + return [new m.g()]; + } + + // Array of function types + function foo9(): (()=>c)[] { + return [() => new c()]; + } + function foo10() { + return [() => new c()]; + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.errors.txt b/tests/baselines/reference/declFileTypeAnnotationTupleType.errors.txt new file mode 100644 index 0000000000000..c88354c13bf41 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.errors.txt @@ -0,0 +1,23 @@ +declFileTypeAnnotationTupleType.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationTupleType.ts (1 errors) ==== + class c { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + export class g { + } + } + class g { + } + + // Just the name + var k: [c, m.c] = [new c(), new m.c()]; + var l = k; + + var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; + var y = x; \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.errors.txt new file mode 100644 index 0000000000000..90cd56a0ac06b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.errors.txt @@ -0,0 +1,45 @@ +declFileTypeAnnotationTypeAlias.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationTypeAlias.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationTypeAlias.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationTypeAlias.ts(26,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationTypeAlias.ts (4 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; + } + + interface Window { + someMethod(); + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type W = Window | string; + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Window { } + export var p: W; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.errors.txt new file mode 100644 index 0000000000000..53399ffff970b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.errors.txt @@ -0,0 +1,44 @@ +declFileTypeAnnotationTypeLiteral.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationTypeLiteral.ts (1 errors) ==== + class c { + } + class g { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + + // Object literal with everything + var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; + }; + + + // Function type + var y: (a: string) => string; + + // constructor type + var z: new (a: string) => m.c; \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.errors.txt b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.errors.txt new file mode 100644 index 0000000000000..b9a107d498d68 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.errors.txt @@ -0,0 +1,48 @@ +declFileTypeAnnotationTypeQuery.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationTypeQuery.ts (1 errors) ==== + class c { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + export class g { + } + } + class g { + } + + // Just the name + function foo(): typeof c { + return c; + } + function foo2() { + return c; + } + + // Qualified name + function foo3(): typeof m.c { + return m.c; + } + function foo4() { + return m.c; + } + + // Just the name with type arguments + function foo5(): typeof g { + return g; + } + function foo6() { + return g; + } + + // Qualified name with type arguments + function foo7(): typeof m.g { + return m.g + } + function foo8() { + return m.g + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.errors.txt b/tests/baselines/reference/declFileTypeAnnotationTypeReference.errors.txt new file mode 100644 index 0000000000000..cb33b8310adad --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.errors.txt @@ -0,0 +1,48 @@ +declFileTypeAnnotationTypeReference.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationTypeReference.ts (1 errors) ==== + class c { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + export class g { + } + } + class g { + } + + // Just the name + function foo(): c { + return new c(); + } + function foo2() { + return new c(); + } + + // Qualified name + function foo3(): m.c { + return new m.c(); + } + function foo4() { + return new m.c(); + } + + // Just the name with type arguments + function foo5(): g { + return new g(); + } + function foo6() { + return new g(); + } + + // Qualified name with type arguments + function foo7(): m.g { + return new m.g(); + } + function foo8() { + return new m.g(); + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.errors.txt b/tests/baselines/reference/declFileTypeAnnotationUnionType.errors.txt new file mode 100644 index 0000000000000..625f7a1fcc6c3 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.errors.txt @@ -0,0 +1,27 @@ +declFileTypeAnnotationUnionType.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationUnionType.ts (1 errors) ==== + class c { + private p: string; + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + private q: string; + } + export class g { + private r: string; + } + } + class g { + private s: string; + } + + // Just the name + var k: c | m.c = new c() || new m.c(); + var l = new c() || new m.c(); + + var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); + var y = new g() || new m.g() || (() => new c()); \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt new file mode 100644 index 0000000000000..2b2337d45339d --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -0,0 +1,108 @@ +declFileTypeAnnotationVisibilityErrorAccessors.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorAccessors.ts(8,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorAccessors.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + + export class public1 { + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt new file mode 100644 index 0000000000000..dc001ee8ea60d --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt @@ -0,0 +1,53 @@ +declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(29,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt new file mode 100644 index 0000000000000..b87880aca5dbf --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt @@ -0,0 +1,65 @@ +declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(37,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt new file mode 100644 index 0000000000000..8b940e0208da8 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt @@ -0,0 +1,61 @@ +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(15,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeAlias.ts(26,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorTypeAlias.ts (6 errors) ==== + interface Window { + someMethod(); + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + type W = Window | string; + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Window { } + export var p: W; // Should report error that W is private + } + } + + module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type W = Window | string; + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Window { } + export var p: W; // No error + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + class public1 { + } + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt new file mode 100644 index 0000000000000..78d0bf52f7520 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt @@ -0,0 +1,42 @@ +declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorTypeLiteral.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt new file mode 100644 index 0000000000000..eae39b6b068db --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt @@ -0,0 +1,41 @@ +declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(21,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.errors.txt b/tests/baselines/reference/declFileTypeofInAnonymousType.errors.txt new file mode 100644 index 0000000000000..08cb12e0fbe57 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.errors.txt @@ -0,0 +1,27 @@ +declFileTypeofInAnonymousType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeofInAnonymousType.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + export enum e { + weekday, + weekend, + holiday + } + } + var a: { c: m1.c; }; + var b = { + c: m1.c, + m1: m1 + }; + var c = { m1: m1 }; + var d = { + m: { mod: m1 }, + mc: { cl: m1.c }, + me: { en: m1.e }, + mh: m1.e.holiday + }; \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeofModule.errors.txt b/tests/baselines/reference/declFileTypeofModule.errors.txt new file mode 100644 index 0000000000000..b376cbe979474 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofModule.errors.txt @@ -0,0 +1,21 @@ +declFileTypeofModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileTypeofModule.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileTypeofModule.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c: string; + } + var m1_1 = m1; + var m1_2: typeof m1; + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var d: typeof m2; + } + + var m2_1 = m2; + var m2_2: typeof m2; \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.errors.txt b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.errors.txt new file mode 100644 index 0000000000000..fbb2b4caa655a --- /dev/null +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.errors.txt @@ -0,0 +1,52 @@ +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(1,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(1,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(13,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(13,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts(13,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts (10 errors) ==== + declare module A.B.Base { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class W { + id: number; + } + } + module X.Y.base { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class W extends A.B.Base.W { + name: string; + } + } + + module X.Y.base.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class W extends X.Y.base.W { + value: boolean; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt index 9d677e4bf7aba..e66175484c6ba 100644 --- a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFile.errors.txt @@ -1,6 +1,8 @@ +declFile.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declFile.d.ts(2,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. declFile.d.ts(5,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +declFile.d.ts(5,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -8,8 +10,10 @@ declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an alre /// var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file -==== declFile.d.ts (4 errors) ==== +==== declFile.d.ts (6 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare var x; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -20,6 +24,8 @@ declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an alre declare module N { } ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class C { } ~~~~~~~ diff --git a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt index 9d677e4bf7aba..e66175484c6ba 100644 --- a/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt +++ b/tests/baselines/reference/declFileWithErrorsInInputDeclarationFileWithOut.errors.txt @@ -1,6 +1,8 @@ +declFile.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declFile.d.ts(2,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. declFile.d.ts(5,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +declFile.d.ts(5,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -8,8 +10,10 @@ declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an alre /// var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file -==== declFile.d.ts (4 errors) ==== +==== declFile.d.ts (6 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare var x; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -20,6 +24,8 @@ declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an alre declare module N { } ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class C { } ~~~~~~~ diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.errors.txt b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.errors.txt new file mode 100644 index 0000000000000..f2c557519b756 --- /dev/null +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.errors.txt @@ -0,0 +1,44 @@ +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(1,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(1,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(13,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithExtendsClauseThatHasItsContainerNameConflict.ts(13,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileWithExtendsClauseThatHasItsContainerNameConflict.ts (8 errors) ==== + declare module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class B { + } + } + + module A.B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class EventManager { + id: number; + + } + } + + module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ContextMenu extends EventManager { + name: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.errors.txt b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.errors.txt new file mode 100644 index 0000000000000..f314bc2025ab2 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.errors.txt @@ -0,0 +1,37 @@ +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(5,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(5,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(5,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause1.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileWithInternalModuleNameConflictsInExtendsClause1.ts (8 errors) ==== + module X.A.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { + } + } + module X.A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.errors.txt b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.errors.txt new file mode 100644 index 0000000000000..f56ba01e19021 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.errors.txt @@ -0,0 +1,52 @@ +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(5,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(5,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(5,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(10,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(10,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause2.ts(11,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileWithInternalModuleNameConflictsInExtendsClause2.ts (12 errors) ==== + module X.A.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { + } + } + module X.A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class W implements A.C.Z { // This can refer to it as A.C.Z + } + } + + module X.A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.errors.txt b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.errors.txt new file mode 100644 index 0000000000000..553ac47cd3711 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.errors.txt @@ -0,0 +1,52 @@ +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(5,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(5,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(5,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(10,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(10,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declFileWithInternalModuleNameConflictsInExtendsClause3.ts(11,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declFileWithInternalModuleNameConflictsInExtendsClause3.ts (12 errors) ==== + module X.A.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { + } + } + module X.A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class W implements X.A.C.Z { // This needs to be referred as X.A.C.Z as A has conflict + } + } + + module X.A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declInput-2.errors.txt b/tests/baselines/reference/declInput-2.errors.txt new file mode 100644 index 0000000000000..bf696756e77d1 --- /dev/null +++ b/tests/baselines/reference/declInput-2.errors.txt @@ -0,0 +1,27 @@ +declInput-2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declInput-2.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { } + export class E {} + export interface I1 {} + interface I2 {} + export class D { + private c: C; // don't generate + public m1: number; + public m2: string; + public m22: C; // don't generate + public m23: E; + public m24: I1; + public m25: I2; // don't generate + public m232(): E { return null;} + public m242(): I1 { return null; } + public m252(): I2 { return null; } // don't generate + public m26(i:I1) {} + public m262(i:I2) {} + public m3():C { return new C(); } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declInput4.errors.txt b/tests/baselines/reference/declInput4.errors.txt new file mode 100644 index 0000000000000..46b3cc25c99e7 --- /dev/null +++ b/tests/baselines/reference/declInput4.errors.txt @@ -0,0 +1,21 @@ +declInput4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declInput4.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { } + export class E {} + export interface I1 {} + interface I2 {} + export class D { + public m1: number; + public m2: string; + public m23: E; + public m24: I1; + public m232(): E { return null;} + public m242(): I1 { return null; } + public m26(i:I1) {} + } + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.errors.txt b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.errors.txt new file mode 100644 index 0000000000000..11c5b28625aa9 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.errors.txt @@ -0,0 +1,9 @@ +declarationEmitDestructuringArrayPattern3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitDestructuringArrayPattern3.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var [a, b] = [1, 2]; + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.errors.txt b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.errors.txt index 0a47f24e6e3a8..3f5064fb270bf 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.errors.txt +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.errors.txt @@ -2,9 +2,10 @@ declarationEmitDestructuringObjectLiteralPattern.ts(2,23): error TS2353: Object declarationEmitDestructuringObjectLiteralPattern.ts(3,16): error TS2353: Object literal may only specify known properties, and 'x5' does not exist in type '{ y5: any; }'. declarationEmitDestructuringObjectLiteralPattern.ts(5,27): error TS2353: Object literal may only specify known properties, and 'y7' does not exist in type '{ x7: any; }'. declarationEmitDestructuringObjectLiteralPattern.ts(6,20): error TS2353: Object literal may only specify known properties, and 'x8' does not exist in type '{ y8: any; }'. +declarationEmitDestructuringObjectLiteralPattern.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== declarationEmitDestructuringObjectLiteralPattern.ts (4 errors) ==== +==== declarationEmitDestructuringObjectLiteralPattern.ts (5 errors) ==== var { } = { x: 5, y: "hello" }; var { x4 } = { x4: 5, y4: "hello" }; ~~ @@ -32,5 +33,7 @@ declarationEmitDestructuringObjectLiteralPattern.ts(6,20): error TS2353: Object var { a4, b4, c4 } = f15(); module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var { a4, b4, c4 } = f15(); } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.errors.txt b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.errors.txt new file mode 100644 index 0000000000000..361e8f77d5523 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.errors.txt @@ -0,0 +1,19 @@ +declarationEmitDestructuringObjectLiteralPattern2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitDestructuringObjectLiteralPattern2.ts (1 errors) ==== + var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; + + function f15() { + var a4 = "hello"; + var b4 = 1; + var c4 = true; + return { a4, b4, c4 }; + } + var { a4, b4, c4 } = f15(); + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var { a4, b4, c4 } = f15(); + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDestructuringPrivacyError.errors.txt b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.errors.txt new file mode 100644 index 0000000000000..d2956cde0372d --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringPrivacyError.errors.txt @@ -0,0 +1,11 @@ +declarationEmitDestructuringPrivacyError.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitDestructuringPrivacyError.ts (1 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class c { + } + export var [x, y, z] = [10, new c(), 30]; + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.errors.txt b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.errors.txt new file mode 100644 index 0000000000000..f28c5e10eb871 --- /dev/null +++ b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.errors.txt @@ -0,0 +1,18 @@ +declarationEmitImportInExportAssignmentModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitImportInExportAssignmentModule.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitImportInExportAssignmentModule.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + import x = c; + export var a: typeof x; + } + export = m; \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitNameConflicts.errors.txt b/tests/baselines/reference/declarationEmitNameConflicts.errors.txt new file mode 100644 index 0000000000000..195e2feb311c1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitNameConflicts.errors.txt @@ -0,0 +1,80 @@ +declarationEmit_nameConflicts_0.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(16,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(16,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(31,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(31,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(34,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_0.ts(40,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmit_nameConflicts_1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmit_nameConflicts_0.ts (9 errors) ==== + import im = require('./declarationEmit_nameConflicts_1'); + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + export class C { } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function g() { }; + export interface I { } + } + + export import a = M.f; + export import b = M.C; + export import c = N; + export import d = im; + } + + export module M.P { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + export class C { } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function g() { }; + export interface I { } + } + export import im = M.P.f; + export var a = M.a; // emitted incorrectly as typeof f + export var b = M.b; // ok + export var c = M.c; // ok + export var g = M.c.g; // ok + export var d = M.d; // emitted incorrectly as typeof im + } + + export module M.Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + export class C { } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function g() { }; + export interface I { } + } + export interface b extends M.b { } // ok + export interface I extends M.c.I { } // ok + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I extends M.c.I { } // ok + } + } +==== declarationEmit_nameConflicts_1.ts (1 errors) ==== + module f { export class c { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export = f; + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitNameConflicts2.errors.txt b/tests/baselines/reference/declarationEmitNameConflicts2.errors.txt new file mode 100644 index 0000000000000..40cf7a9d11060 --- /dev/null +++ b/tests/baselines/reference/declarationEmitNameConflicts2.errors.txt @@ -0,0 +1,42 @@ +declarationEmitNameConflicts2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(10,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts2.ts(10,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitNameConflicts2.ts (8 errors) ==== + module X.Y.base { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + export class C { } + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var v; + } + export enum E { } + } + + module X.Y.base.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var f = X.Y.base.f; // Should be base.f + export var C = X.Y.base.C; // Should be base.C + export var M = X.Y.base.M; // Should be base.M + export var E = X.Y.base.E; // Should be base.E + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitNameConflicts2.types b/tests/baselines/reference/declarationEmitNameConflicts2.types index b6df9551cfaf1..e23df33927f97 100644 --- a/tests/baselines/reference/declarationEmitNameConflicts2.types +++ b/tests/baselines/reference/declarationEmitNameConflicts2.types @@ -23,6 +23,7 @@ module X.Y.base { export var v; >v : any +> : ^^^ } export enum E { } >E : E diff --git a/tests/baselines/reference/declarationEmitNameConflicts3.errors.txt b/tests/baselines/reference/declarationEmitNameConflicts3.errors.txt new file mode 100644 index 0000000000000..c8f04fccff196 --- /dev/null +++ b/tests/baselines/reference/declarationEmitNameConflicts3.errors.txt @@ -0,0 +1,47 @@ +declarationEmitNameConflicts3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts3.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts3.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts3.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts3.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflicts3.ts(14,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitNameConflicts3.ts (6 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface D { } + export module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + } + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + } + export module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + } + } + + module M.P { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + static f() { } + } + export class E extends C { } + export enum D { + f + } + export var v: M.D; // ok + export var w = M.D.f; // error, should be typeof M.D.f + export var x = M.C.f; // error, should be typeof M.C.f + export var x = M.E.f; // error, should be typeof M.E.f + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitNameConflictsWithAlias.errors.txt b/tests/baselines/reference/declarationEmitNameConflictsWithAlias.errors.txt new file mode 100644 index 0000000000000..0e4060d47c6dc --- /dev/null +++ b/tests/baselines/reference/declarationEmitNameConflictsWithAlias.errors.txt @@ -0,0 +1,18 @@ +declarationEmitNameConflictsWithAlias.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflictsWithAlias.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declarationEmitNameConflictsWithAlias.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationEmitNameConflictsWithAlias.ts (3 errors) ==== + export module C { export interface I { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import v = C; + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module C { export interface I { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var w: v.I; // Gets emitted as C.I, which is the wrong interface + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitNameConflictsWithAlias.types b/tests/baselines/reference/declarationEmitNameConflictsWithAlias.types index 9b67cf259f9bc..4a770cd54c3b1 100644 --- a/tests/baselines/reference/declarationEmitNameConflictsWithAlias.types +++ b/tests/baselines/reference/declarationEmitNameConflictsWithAlias.types @@ -5,7 +5,8 @@ export module C { export interface I { } } export import v = C; >v : any > : ^^^ ->C : error +>C : any +> : ^^^ export module M { >M : typeof M diff --git a/tests/baselines/reference/declarationMaps.errors.txt b/tests/baselines/reference/declarationMaps.errors.txt new file mode 100644 index 0000000000000..b70127c90b1ee --- /dev/null +++ b/tests/baselines/reference/declarationMaps.errors.txt @@ -0,0 +1,24 @@ +declarationMaps.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declarationMaps.ts (1 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + var m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + + export = m2; \ No newline at end of file diff --git a/tests/baselines/reference/declarationMaps.types b/tests/baselines/reference/declarationMaps.types index dd9f1dd9a8218..42c233dfbe33e 100644 --- a/tests/baselines/reference/declarationMaps.types +++ b/tests/baselines/reference/declarationMaps.types @@ -5,8 +5,11 @@ module m2 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt b/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt index ba3e9d6c33792..ea1b2a0514174 100644 --- a/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt +++ b/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt @@ -1,9 +1,12 @@ error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'. +declarationMapsWithoutDeclaration.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. !!! error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'. -==== declarationMapsWithoutDeclaration.ts (0 errors) ==== +==== declarationMapsWithoutDeclaration.ts (1 errors) ==== module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface connectModule { (res, req, next): void; } diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 935c5f230bba6..6e39c45c6c54c 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -16,11 +16,12 @@ declarationsAndAssignments.ts(73,14): error TS2339: Property 'b' does not exist declarationsAndAssignments.ts(74,11): error TS2339: Property 'a' does not exist on type 'undefined[]'. declarationsAndAssignments.ts(74,14): error TS2339: Property 'b' does not exist on type 'undefined[]'. declarationsAndAssignments.ts(106,17): error TS2741: Property 'x' is missing in type '{ y: false; }' but required in type '{ x: any; y?: boolean; }'. +declarationsAndAssignments.ts(108,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declarationsAndAssignments.ts(138,6): error TS2322: Type 'string' is not assignable to type 'number'. declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assignable to type 'string'. -==== declarationsAndAssignments.ts (20 errors) ==== +==== declarationsAndAssignments.ts (21 errors) ==== function f0() { var [] = [1, "hello"]; var [x] = [1, "hello"]; @@ -166,6 +167,8 @@ declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assigna !!! error TS2741: Property 'x' is missing in type '{ y: false; }' but required in type '{ x: any; y?: boolean; }'. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var [a, b] = [1, 2]; } diff --git a/tests/baselines/reference/declareAlreadySeen.errors.txt b/tests/baselines/reference/declareAlreadySeen.errors.txt index 02a9b3802cafa..57c7222ede584 100644 --- a/tests/baselines/reference/declareAlreadySeen.errors.txt +++ b/tests/baselines/reference/declareAlreadySeen.errors.txt @@ -1,11 +1,15 @@ +declareAlreadySeen.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declareAlreadySeen.ts(2,13): error TS1030: 'declare' modifier already seen. declareAlreadySeen.ts(3,13): error TS1030: 'declare' modifier already seen. declareAlreadySeen.ts(5,13): error TS1030: 'declare' modifier already seen. +declareAlreadySeen.ts(5,28): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declareAlreadySeen.ts(7,13): error TS1030: 'declare' modifier already seen. -==== declareAlreadySeen.ts (4 errors) ==== +==== declareAlreadySeen.ts (6 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare declare var x; ~~~~~~~ !!! error TS1030: 'declare' modifier already seen. @@ -16,6 +20,8 @@ declareAlreadySeen.ts(7,13): error TS1030: 'declare' modifier already seen. declare declare module N { } ~~~~~~~ !!! error TS1030: 'declare' modifier already seen. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare declare class C { } ~~~~~~~ diff --git a/tests/baselines/reference/declareDottedExtend.errors.txt b/tests/baselines/reference/declareDottedExtend.errors.txt new file mode 100644 index 0000000000000..d4dcf406a99e1 --- /dev/null +++ b/tests/baselines/reference/declareDottedExtend.errors.txt @@ -0,0 +1,20 @@ +declareDottedExtend.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedExtend.ts(1,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declareDottedExtend.ts (2 errors) ==== + declare module A.B + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export class C{ } + } + + import ab = A.B; + + class D extends ab.C{ } + + class E extends A.B.C{ } + \ No newline at end of file diff --git a/tests/baselines/reference/declareDottedModuleName.errors.txt b/tests/baselines/reference/declareDottedModuleName.errors.txt new file mode 100644 index 0000000000000..5fc3d0e584b2e --- /dev/null +++ b/tests/baselines/reference/declareDottedModuleName.errors.txt @@ -0,0 +1,37 @@ +declareDottedModuleName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(2,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(6,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +declareDottedModuleName.ts(9,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declareDottedModuleName.ts (8 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module P.Q { } // This shouldnt be emitted + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module R.S { } //This should be emitted + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + module T.U { // This needs to be emitted + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.errors.txt b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.errors.txt new file mode 100644 index 0000000000000..e9d093b60e1a4 --- /dev/null +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.errors.txt @@ -0,0 +1,30 @@ +declareExternalModuleWithExportAssignedFundule.ts(7,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declareExternalModuleWithExportAssignedFundule.ts (1 errors) ==== + declare module "express" { + + export = express; + + function express(): express.ExpressServer; + + module express { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface ExpressServer { + + enable(name: string): ExpressServer; + + post(path: RegExp, handler: (req: Function) => void ): void; + + } + + export class ExpressServerRequest { + + } + + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/declareFileExportAssignment.errors.txt b/tests/baselines/reference/declareFileExportAssignment.errors.txt new file mode 100644 index 0000000000000..e02dc86dc23c9 --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignment.errors.txt @@ -0,0 +1,24 @@ +declareFileExportAssignment.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declareFileExportAssignment.ts (1 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + var m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + + export = m2; \ No newline at end of file diff --git a/tests/baselines/reference/declareFileExportAssignment.types b/tests/baselines/reference/declareFileExportAssignment.types index 7227046f2f8dd..4062243659000 100644 --- a/tests/baselines/reference/declareFileExportAssignment.types +++ b/tests/baselines/reference/declareFileExportAssignment.types @@ -5,8 +5,11 @@ module m2 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.errors.txt b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.errors.txt new file mode 100644 index 0000000000000..2e2ee4078aeb5 --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.errors.txt @@ -0,0 +1,24 @@ +declareFileExportAssignmentWithVarFromVariableStatement.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== declareFileExportAssignmentWithVarFromVariableStatement.ts (1 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + var x = 10, m2: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + + export = m2; \ No newline at end of file diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index a5dae84ceb261..56e67c0c560f5 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -5,8 +5,11 @@ module m2 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt index fc5349bd32097..38974fcafaa69 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod11.errors.txt @@ -1,8 +1,11 @@ +decoratorOnClassMethod11.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decoratorOnClassMethod11.ts(5,11): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== decoratorOnClassMethod11.ts (1 errors) ==== +==== decoratorOnClassMethod11.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { decorator(target: Object, key: string): void { } diff --git a/tests/baselines/reference/decoratorOnClassMethod12.errors.txt b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt index 419533fd0cbb9..32d4430420c45 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod12.errors.txt @@ -1,8 +1,11 @@ +decoratorOnClassMethod12.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decoratorOnClassMethod12.ts(6,11): error TS2660: 'super' can only be referenced in members of derived classes or object literal expressions. -==== decoratorOnClassMethod12.ts (1 errors) ==== +==== decoratorOnClassMethod12.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class S { decorator(target: Object, key: string): void { } } diff --git a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt index c0c7249c7e4a0..1100121e2a2a5 100644 --- a/tests/baselines/reference/decoratorOnImportEquals1.errors.txt +++ b/tests/baselines/reference/decoratorOnImportEquals1.errors.txt @@ -1,14 +1,20 @@ +decoratorOnImportEquals1.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +decoratorOnImportEquals1.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decoratorOnImportEquals1.ts(8,5): error TS1206: Decorators are not valid here. -==== decoratorOnImportEquals1.ts (1 errors) ==== +==== decoratorOnImportEquals1.ts (3 errors) ==== declare function dec(target: T): T; module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var X: number; } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. @dec ~ !!! error TS1206: Decorators are not valid here. diff --git a/tests/baselines/reference/decoratorOnInternalModule.errors.txt b/tests/baselines/reference/decoratorOnInternalModule.errors.txt index f28d1870dfc1c..72a0d20993d24 100644 --- a/tests/baselines/reference/decoratorOnInternalModule.errors.txt +++ b/tests/baselines/reference/decoratorOnInternalModule.errors.txt @@ -1,12 +1,15 @@ decoratorOnInternalModule.ts(3,1): error TS1206: Decorators are not valid here. +decoratorOnInternalModule.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== decoratorOnInternalModule.ts (1 errors) ==== +==== decoratorOnInternalModule.ts (2 errors) ==== declare function dec(target: T): T; @dec ~ !!! error TS1206: Decorators are not valid here. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..924aeabca50f9 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,54 @@ +decrementOperatorWithAnyOtherType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decrementOperatorWithAnyOtherType.ts (1 errors) ==== + // -- operator on any type + + var ANY: any; + var ANY1: any; + var ANY2: any[] = ["", ""]; + var obj = {x:1,y:null}; + class A { + public a: any; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = --ANY; + var ResultIsNumber2 = --ANY1; + + var ResultIsNumber3 = ANY1--; + var ResultIsNumber4 = ANY1--; + + // expressions + var ResultIsNumber5 = --ANY2[0]; + var ResultIsNumber6 = --obj.x; + var ResultIsNumber7 = --obj.y; + var ResultIsNumber8 = --objA.a; + var ResultIsNumber = --M.n; + + var ResultIsNumber9 = ANY2[0]--; + var ResultIsNumber10 = obj.x--; + var ResultIsNumber11 = obj.y--; + var ResultIsNumber12 = objA.a--; + var ResultIsNumber13 = M.n--; + + // miss assignment opertors + --ANY; + --ANY1; + --ANY2[0]; + --ANY, --ANY1; + --objA.a; + --M.n; + + ANY--; + ANY1--; + ANY2[0]--; + ANY--, ANY1--; + objA.a--; + M.n--; \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index edaef29571fd5..887439bc89cc6 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -5,9 +5,11 @@ var ANY: any; >ANY : any +> : ^^^ var ANY1: any; >ANY1 : any +> : ^^^ var ANY2: any[] = ["", ""]; >ANY2 : any[] @@ -37,6 +39,7 @@ class A { public a: any; >a : any +> : ^^^ } module M { >M : typeof M @@ -44,6 +47,7 @@ module M { export var n: any; >n : any +> : ^^^ } var objA = new A(); >objA : A @@ -60,6 +64,7 @@ var ResultIsNumber1 = --ANY; >--ANY : number > : ^^^^^^ >ANY : any +> : ^^^ var ResultIsNumber2 = --ANY1; >ResultIsNumber2 : number @@ -67,6 +72,7 @@ var ResultIsNumber2 = --ANY1; >--ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ var ResultIsNumber3 = ANY1--; >ResultIsNumber3 : number @@ -74,6 +80,7 @@ var ResultIsNumber3 = ANY1--; >ANY1-- : number > : ^^^^^^ >ANY1 : any +> : ^^^ var ResultIsNumber4 = ANY1--; >ResultIsNumber4 : number @@ -81,6 +88,7 @@ var ResultIsNumber4 = ANY1--; >ANY1-- : number > : ^^^^^^ >ANY1 : any +> : ^^^ // expressions var ResultIsNumber5 = --ANY2[0]; @@ -89,6 +97,7 @@ var ResultIsNumber5 = --ANY2[0]; >--ANY2[0] : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -112,6 +121,7 @@ var ResultIsNumber7 = --obj.y; >--obj.y : number > : ^^^^^^ >obj.y : any +> : ^^^ >obj : { x: number; y: any; } > : ^^^^^^^^^^^^^^^^^^^^^^ >y : any @@ -123,6 +133,7 @@ var ResultIsNumber8 = --objA.a; >--objA.a : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -134,6 +145,7 @@ var ResultIsNumber = --M.n; >--M.n : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -145,6 +157,7 @@ var ResultIsNumber9 = ANY2[0]--; >ANY2[0]-- : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -168,6 +181,7 @@ var ResultIsNumber11 = obj.y--; >obj.y-- : number > : ^^^^^^ >obj.y : any +> : ^^^ >obj : { x: number; y: any; } > : ^^^^^^^^^^^^^^^^^^^^^^ >y : any @@ -179,6 +193,7 @@ var ResultIsNumber12 = objA.a--; >objA.a-- : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -190,6 +205,7 @@ var ResultIsNumber13 = M.n--; >M.n-- : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -200,16 +216,19 @@ var ResultIsNumber13 = M.n--; >--ANY : number > : ^^^^^^ >ANY : any +> : ^^^ --ANY1; >--ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ --ANY2[0]; >--ANY2[0] : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -221,14 +240,17 @@ var ResultIsNumber13 = M.n--; >--ANY : number > : ^^^^^^ >ANY : any +> : ^^^ >--ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ --objA.a; >--objA.a : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -238,6 +260,7 @@ var ResultIsNumber13 = M.n--; >--M.n : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -247,16 +270,19 @@ ANY--; >ANY-- : number > : ^^^^^^ >ANY : any +> : ^^^ ANY1--; >ANY1-- : number > : ^^^^^^ >ANY1 : any +> : ^^^ ANY2[0]--; >ANY2[0]-- : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -268,14 +294,17 @@ ANY--, ANY1--; >ANY-- : number > : ^^^^^^ >ANY : any +> : ^^^ >ANY1-- : number > : ^^^^^^ >ANY1 : any +> : ^^^ objA.a--; >objA.a-- : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -285,6 +314,7 @@ M.n--; >M.n-- : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index a30ddc5d7ee10..5407c9eb5e99c 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,3 +1,4 @@ +decrementOperatorWithAnyOtherTypeInvalidOperations.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2629: Cannot assign to 'A' because it is a class. decrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2631: Cannot assign to 'M' because it is a namespace. @@ -52,7 +53,7 @@ decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,10): error TS1005: ';' decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,12): error TS1109: Expression expected. -==== decrementOperatorWithAnyOtherTypeInvalidOperations.ts (52 errors) ==== +==== decrementOperatorWithAnyOtherTypeInvalidOperations.ts (53 errors) ==== // -- operator on any type var ANY1: any; var ANY2: any[] = ["", ""]; @@ -71,6 +72,8 @@ decrementOperatorWithAnyOtherTypeInvalidOperations.ts(72,12): error TS1109: Expr } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.errors.txt b/tests/baselines/reference/decrementOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..8135d916af633 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberType.errors.txt @@ -0,0 +1,45 @@ +decrementOperatorWithNumberType.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decrementOperatorWithNumberType.ts (1 errors) ==== + // -- operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + class A { + public a: number; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = --NUMBER; + + var ResultIsNumber2 = NUMBER--; + + // expressions + var ResultIsNumber3 = --objA.a; + var ResultIsNumber4 = --M.n; + + var ResultIsNumber5 = objA.a--; + var ResultIsNumber6 = M.n--; + var ResultIsNumber7 = NUMBER1[0]--; + + // miss assignment operators + --NUMBER; + + --NUMBER1[0]; + --objA.a; + --M.n; + --objA.a, M.n; + + NUMBER--; + NUMBER1[0]--; + objA.a--; + M.n--; + objA.a--, M.n--; \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt index 1949b2cc66745..00bd9de3acc41 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -1,3 +1,4 @@ +decrementOperatorWithNumberTypeInvalidOperations.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decrementOperatorWithNumberTypeInvalidOperations.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithNumberTypeInvalidOperations.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithNumberTypeInvalidOperations.ts(22,25): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. @@ -20,7 +21,7 @@ decrementOperatorWithNumberTypeInvalidOperations.ts(45,1): error TS2356: An arit decrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -==== decrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== +==== decrementOperatorWithNumberTypeInvalidOperations.ts (21 errors) ==== // -- operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -32,6 +33,8 @@ decrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The ope static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt index 6f2e25175c05e..6954b712def49 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedBooleanType.errors.txt @@ -1,3 +1,4 @@ +decrementOperatorWithUnsupportedBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decrementOperatorWithUnsupportedBooleanType.ts(17,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithUnsupportedBooleanType.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithUnsupportedBooleanType.ts(22,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -29,7 +30,7 @@ decrementOperatorWithUnsupportedBooleanType.ts(54,1): error TS2356: An arithmeti decrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -==== decrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== +==== decrementOperatorWithUnsupportedBooleanType.ts (30 errors) ==== // -- operator on boolean type var BOOLEAN: boolean; @@ -40,6 +41,8 @@ decrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmet static foo() { return true; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt index acfb968b4085d..d7345f78b14c5 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.errors.txt @@ -1,3 +1,4 @@ +decrementOperatorWithUnsupportedStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. decrementOperatorWithUnsupportedStringType.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithUnsupportedStringType.ts(19,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. decrementOperatorWithUnsupportedStringType.ts(21,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -39,7 +40,7 @@ decrementOperatorWithUnsupportedStringType.ts(65,1): error TS2356: An arithmetic decrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -==== decrementOperatorWithUnsupportedStringType.ts (39 errors) ==== +==== decrementOperatorWithUnsupportedStringType.ts (40 errors) ==== // -- operator on string type var STRING: string; var STRING1: string[] = ["", ""]; @@ -51,6 +52,8 @@ decrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmeti static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index 3c2f0998ac2af..4f5ae88ab4c0e 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -6,10 +6,12 @@ defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Type 'string' is not as defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Conversion of type 'string' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Conversion of type 'string' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +defaultArgsInFunctionExpressions.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +defaultArgsInFunctionExpressions.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. defaultArgsInFunctionExpressions.ts(28,15): error TS2708: Cannot use namespace 'T' as a value. -==== defaultArgsInFunctionExpressions.ts (9 errors) ==== +==== defaultArgsInFunctionExpressions.ts (11 errors) ==== var f = function (a = 3) { return a; }; // Type should be (a?: number) => number var n: number = f(4); n = f(); @@ -49,7 +51,11 @@ defaultArgsInFunctionExpressions.ts(28,15): error TS2708: Cannot use namespace ' // Instantiated module module T { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module U { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x; } diff --git a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt index 1a4f2b723b211..bcb3508b5773e 100644 --- a/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,4 @@ +deleteOperatorWithAnyOtherType.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. deleteOperatorWithAnyOtherType.ts(25,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithAnyOtherType.ts(26,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithAnyOtherType.ts(27,31): error TS2703: The operand of a 'delete' operator must be a property reference. @@ -25,7 +26,7 @@ deleteOperatorWithAnyOtherType.ts(55,8): error TS2703: The operand of a 'delete' deleteOperatorWithAnyOtherType.ts(57,8): error TS2703: The operand of a 'delete' operator must be a property reference. -==== deleteOperatorWithAnyOtherType.ts (25 errors) ==== +==== deleteOperatorWithAnyOtherType.ts (26 errors) ==== // delete operator on any type var ANY: any; @@ -45,6 +46,8 @@ deleteOperatorWithAnyOtherType.ts(57,8): error TS2703: The operand of a 'delete' } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.errors.txt b/tests/baselines/reference/deleteOperatorWithBooleanType.errors.txt index 63a0d427ded7d..10ebcb415c7ee 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.errors.txt @@ -1,3 +1,4 @@ +deleteOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. deleteOperatorWithBooleanType.ts(17,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithBooleanType.ts(20,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithBooleanType.ts(21,31): error TS2703: The operand of a 'delete' operator must be a property reference. @@ -11,7 +12,7 @@ deleteOperatorWithBooleanType.ts(35,8): error TS2703: The operand of a 'delete' deleteOperatorWithBooleanType.ts(36,8): error TS2703: The operand of a 'delete' operator must be a property reference. -==== deleteOperatorWithBooleanType.ts (11 errors) ==== +==== deleteOperatorWithBooleanType.ts (12 errors) ==== // delete operator on boolean type var BOOLEAN: boolean; @@ -22,6 +23,8 @@ deleteOperatorWithBooleanType.ts(36,8): error TS2703: The operand of a 'delete' static foo() { return false; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.errors.txt b/tests/baselines/reference/deleteOperatorWithNumberType.errors.txt index 97094ff5839d4..1def187750d6f 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithNumberType.errors.txt @@ -1,3 +1,4 @@ +deleteOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. deleteOperatorWithNumberType.ts(18,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithNumberType.ts(19,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithNumberType.ts(22,31): error TS2703: The operand of a 'delete' operator must be a property reference. @@ -17,7 +18,7 @@ deleteOperatorWithNumberType.ts(41,8): error TS2703: The operand of a 'delete' o deleteOperatorWithNumberType.ts(42,8): error TS2703: The operand of a 'delete' operator must be a property reference. -==== deleteOperatorWithNumberType.ts (17 errors) ==== +==== deleteOperatorWithNumberType.ts (18 errors) ==== // delete operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -29,6 +30,8 @@ deleteOperatorWithNumberType.ts(42,8): error TS2703: The operand of a 'delete' o static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/deleteOperatorWithStringType.errors.txt b/tests/baselines/reference/deleteOperatorWithStringType.errors.txt index a872e8a070b99..ac9ac4284bd15 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/deleteOperatorWithStringType.errors.txt @@ -1,3 +1,4 @@ +deleteOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. deleteOperatorWithStringType.ts(18,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithStringType.ts(19,31): error TS2703: The operand of a 'delete' operator must be a property reference. deleteOperatorWithStringType.ts(22,31): error TS2703: The operand of a 'delete' operator must be a property reference. @@ -18,7 +19,7 @@ deleteOperatorWithStringType.ts(42,8): error TS2703: The operand of a 'delete' o deleteOperatorWithStringType.ts(43,8): error TS2703: The operand of a 'delete' operator must be a property reference. -==== deleteOperatorWithStringType.ts (18 errors) ==== +==== deleteOperatorWithStringType.ts (19 errors) ==== // delete operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -30,6 +31,8 @@ deleteOperatorWithStringType.ts(43,8): error TS2703: The operand of a 'delete' o static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/differentTypesWithSameName.errors.txt b/tests/baselines/reference/differentTypesWithSameName.errors.txt index 6d55e14bc103e..b2277874ef28b 100644 --- a/tests/baselines/reference/differentTypesWithSameName.errors.txt +++ b/tests/baselines/reference/differentTypesWithSameName.errors.txt @@ -1,9 +1,12 @@ +differentTypesWithSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. differentTypesWithSameName.ts(16,15): error TS2345: Argument of type 'variable' is not assignable to parameter of type 'm.variable'. Property 's' is missing in type 'variable' but required in type 'm.variable'. -==== differentTypesWithSameName.ts (1 errors) ==== +==== differentTypesWithSameName.ts (2 errors) ==== module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class variable{ s: string; } diff --git a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt index 05981baf43cb6..c328575731190 100644 --- a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt +++ b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt @@ -12,13 +12,14 @@ disallowLineTerminatorBeforeArrow.ts(23,8): error TS1200: Line terminator not pe disallowLineTerminatorBeforeArrow.ts(26,8): error TS1200: Line terminator not permitted before arrow. disallowLineTerminatorBeforeArrow.ts(52,5): error TS1200: Line terminator not permitted before arrow. disallowLineTerminatorBeforeArrow.ts(54,5): error TS1200: Line terminator not permitted before arrow. +disallowLineTerminatorBeforeArrow.ts(56,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. disallowLineTerminatorBeforeArrow.ts(59,13): error TS1200: Line terminator not permitted before arrow. disallowLineTerminatorBeforeArrow.ts(63,13): error TS1200: Line terminator not permitted before arrow. disallowLineTerminatorBeforeArrow.ts(68,13): error TS1200: Line terminator not permitted before arrow. disallowLineTerminatorBeforeArrow.ts(72,9): error TS1200: Line terminator not permitted before arrow. -==== disallowLineTerminatorBeforeArrow.ts (18 errors) ==== +==== disallowLineTerminatorBeforeArrow.ts (19 errors) ==== var f1 = () => { } ~~ @@ -103,6 +104,8 @@ disallowLineTerminatorBeforeArrow.ts(72,9): error TS1200: Line terminator not pe !!! error TS1200: Line terminator not permitted before arrow. module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class City { constructor(x: number, thing = () => 100) { diff --git a/tests/baselines/reference/dottedModuleName.errors.txt b/tests/baselines/reference/dottedModuleName.errors.txt index f60c698a5e20c..09bdea75f4be0 100644 --- a/tests/baselines/reference/dottedModuleName.errors.txt +++ b/tests/baselines/reference/dottedModuleName.errors.txt @@ -1,16 +1,36 @@ +dottedModuleName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. dottedModuleName.ts(3,29): error TS1144: '{' or ';' expected. dottedModuleName.ts(3,33): error TS2552: Cannot find name 'x'. Did you mean 'X'? +dottedModuleName.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(4,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(4,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(12,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(13,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(14,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName.ts(14,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== dottedModuleName.ts (2 errors) ==== +==== dottedModuleName.ts (12 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f(x:number)=>2*x; ~~ !!! error TS1144: '{' or ';' expected. ~ !!! error TS2552: Cannot find name 'x'. Did you mean 'X'? export module X.Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v2=f(v); } } @@ -19,8 +39,18 @@ dottedModuleName.ts(3,33): error TS2552: Cannot find name 'x'. Did you mean 'X'? module M.N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Y.Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v=f(10); } } diff --git a/tests/baselines/reference/dottedModuleName2.errors.txt b/tests/baselines/reference/dottedModuleName2.errors.txt new file mode 100644 index 0000000000000..8b16f7f77bd31 --- /dev/null +++ b/tests/baselines/reference/dottedModuleName2.errors.txt @@ -0,0 +1,70 @@ +dottedModuleName2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(9,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(22,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(22,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +dottedModuleName2.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== dottedModuleName2.ts (8 errors) ==== + module A.B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export var x = 1; + + } + + + + module AA { export module B { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export var x = 1; + + } } + + + + var tmpOK = AA.B.x; + + var tmpError = A.B.x; + + + module A.B.C + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + { + + export var x = 1; + + } + + + + module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + { + + import X1 = A; + + import X2 = A.B; + + import X3 = A.B.C; + + } + \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst13.errors.txt b/tests/baselines/reference/downlevelLetConst13.errors.txt new file mode 100644 index 0000000000000..b607deee0d8a4 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst13.errors.txt @@ -0,0 +1,24 @@ +downlevelLetConst13.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== downlevelLetConst13.ts (1 errors) ==== + 'use strict' + // exported let\const bindings should not be renamed + + export let foo = 10; + export const bar = "123" + export let [bar1] = [1]; + export const [bar2] = [2]; + export let {a: bar3} = { a: 1 }; + export const {a: bar4} = { a: 1 }; + + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export let baz = 100; + export const baz2 = true; + export let [bar5] = [1]; + export const [bar6] = [2]; + export let {a: bar7} = { a: 1 }; + export const {a: bar8} = { a: 1 }; + } \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst16.errors.txt b/tests/baselines/reference/downlevelLetConst16.errors.txt index fe8ff968d7946..6953d15cd0710 100644 --- a/tests/baselines/reference/downlevelLetConst16.errors.txt +++ b/tests/baselines/reference/downlevelLetConst16.errors.txt @@ -1,3 +1,7 @@ +downlevelLetConst16.ts(101,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +downlevelLetConst16.ts(110,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +downlevelLetConst16.ts(122,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +downlevelLetConst16.ts(132,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. downlevelLetConst16.ts(151,15): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. downlevelLetConst16.ts(164,17): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type. @@ -6,7 +10,7 @@ downlevelLetConst16.ts(216,16): error TS2461: Type 'undefined' is not an array t downlevelLetConst16.ts(223,17): error TS2339: Property 'a' does not exist on type 'undefined'. -==== downlevelLetConst16.ts (6 errors) ==== +==== downlevelLetConst16.ts (10 errors) ==== 'use strict' declare function use(a: any); @@ -108,6 +112,8 @@ downlevelLetConst16.ts(223,17): error TS2339: Property 'a' does not exist on typ } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let x = 1; use(x); let [y] = [1]; @@ -117,6 +123,8 @@ downlevelLetConst16.ts(223,17): error TS2339: Property 'a' does not exist on typ } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { let x = 1; use(x); @@ -129,6 +137,8 @@ downlevelLetConst16.ts(223,17): error TS2339: Property 'a' does not exist on typ } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const x = 1; use(x); const [y] = [1]; @@ -139,6 +149,8 @@ downlevelLetConst16.ts(223,17): error TS2339: Property 'a' does not exist on typ } module M4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { const x = 1; use(x); diff --git a/tests/baselines/reference/duplicateAnonymousInners1.errors.txt b/tests/baselines/reference/duplicateAnonymousInners1.errors.txt new file mode 100644 index 0000000000000..dfb5c81d08d6e --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousInners1.errors.txt @@ -0,0 +1,34 @@ +duplicateAnonymousInners1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousInners1.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== duplicateAnonymousInners1.ts (2 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Helper { + + } + + class Inner {} + // Inner should show up in intellisense + + export var Outer=0; + } + + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Should not be an error + class Helper { + + } + + // Inner should not show up in intellisense + // Outer should show up in intellisense + + } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.errors.txt b/tests/baselines/reference/duplicateAnonymousModuleClasses.errors.txt new file mode 100644 index 0000000000000..60df4a70d8654 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.errors.txt @@ -0,0 +1,80 @@ +duplicateAnonymousModuleClasses.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(38,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateAnonymousModuleClasses.ts(47,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== duplicateAnonymousModuleClasses.ts (7 errors) ==== + module F { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Helper { + + } + + } + + + module F { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Should not be an error + class Helper { + + } + + } + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Helper { + + } + + } + + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Should not be an error + class Helper { + + } + + } + + module Gar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Helper { + + } + + } + + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Should not be an error + class Helper { + + } + + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/duplicateExportAssignments.errors.txt b/tests/baselines/reference/duplicateExportAssignments.errors.txt index 8f056cc1de1a0..ca01377ee2366 100644 --- a/tests/baselines/reference/duplicateExportAssignments.errors.txt +++ b/tests/baselines/reference/duplicateExportAssignments.errors.txt @@ -2,6 +2,7 @@ foo1.ts(3,10): error TS2300: Duplicate identifier 'export='. foo1.ts(4,10): error TS2300: Duplicate identifier 'export='. foo2.ts(3,10): error TS2300: Duplicate identifier 'export='. foo2.ts(4,10): error TS2300: Duplicate identifier 'export='. +foo3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. foo3.ts(7,10): error TS2300: Duplicate identifier 'export='. foo3.ts(8,10): error TS2300: Duplicate identifier 'export='. foo4.ts(1,10): error TS2300: Duplicate identifier 'export='. @@ -31,8 +32,10 @@ foo5.ts(6,10): error TS2300: Duplicate identifier 'export='. ~ !!! error TS2300: Duplicate identifier 'export='. -==== foo3.ts (2 errors) ==== +==== foo3.ts (3 errors) ==== module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 10; } class y { diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt index f3b0a7b9c194d..d29ee7552045c 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.errors.txt @@ -1,24 +1,46 @@ +duplicateIdentifiersAcrossContainerBoundaries.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateIdentifiersAcrossContainerBoundaries.ts(9,21): error TS2814: Function with bodies can only merge with classes that are ambient. +duplicateIdentifiersAcrossContainerBoundaries.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateIdentifiersAcrossContainerBoundaries.ts(12,18): error TS2813: Class declaration cannot implement overload list for 'f'. +duplicateIdentifiersAcrossContainerBoundaries.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateIdentifiersAcrossContainerBoundaries.ts(37,12): error TS2300: Duplicate identifier 'x'. +duplicateIdentifiersAcrossContainerBoundaries.ts(40,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): error TS2300: Duplicate identifier 'x'. +duplicateIdentifiersAcrossContainerBoundaries.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(45,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateIdentifiersAcrossContainerBoundaries.ts(49,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== duplicateIdentifiersAcrossContainerBoundaries.ts (4 errors) ==== +==== duplicateIdentifiersAcrossContainerBoundaries.ts (18 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class I { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f() { } ~ !!! error TS2814: Function with bodies can only merge with classes that are ambient. !!! related TS6506 duplicateIdentifiersAcrossContainerBoundaries.ts:12:18: Consider adding a 'declare' modifier to this class. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class f { } // error ~ !!! error TS2813: Class declaration cannot implement overload list for 'f'. @@ -26,23 +48,35 @@ duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): error TS2300: Duplicate } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function g() { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class g { } // no error } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function C() { } // no error } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v = 3; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v = 3; // error for redeclaring var in a different parent } @@ -53,17 +87,25 @@ duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): error TS2300: Duplicate } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x: number; // error for redeclaring var in a different parent ~ !!! error TS2300: Duplicate identifier 'x'. } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module F { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var t; } } declare module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function F(); // no error because function is ambient } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.errors.txt index 808860e9fefe8..f02b54bd88c68 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateIdentifiersAcrossFileBoundaries.errors.txt @@ -1,13 +1,17 @@ file1.ts(3,7): error TS2813: Class declaration cannot implement overload list for 'C2'. file1.ts(4,10): error TS2814: Function with bodies can only merge with classes that are ambient. file1.ts(8,12): error TS2300: Duplicate identifier 'x'. +file1.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(12,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file2.ts(3,10): error TS2814: Function with bodies can only merge with classes that are ambient. file2.ts(4,7): error TS2813: Class declaration cannot implement overload list for 'f'. +file2.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file2.ts(7,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. file2.ts(8,16): error TS2300: Duplicate identifier 'x'. +file2.ts(11,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== file1.ts (3 errors) ==== +==== file1.ts (5 errors) ==== interface I { } class C1 { } class C2 { } @@ -28,12 +32,16 @@ file2.ts(8,16): error TS2300: Duplicate identifier 'x'. } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module F { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var t; } } -==== file2.ts (4 errors) ==== +==== file2.ts (6 errors) ==== class I { } // error -- cannot merge interface with non-ambient class interface C1 { } // error -- cannot merge interface with non-ambient class function C2() { } // error -- cannot merge function with non-ambient class @@ -48,6 +56,8 @@ file2.ts(8,16): error TS2300: Duplicate identifier 'x'. module Foo { ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var x: number; // error for redeclaring var in a different parent ~ @@ -56,6 +66,8 @@ file2.ts(8,16): error TS2300: Duplicate identifier 'x'. } declare module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function F(); // no error because function is ambient } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringIndexers.errors.txt b/tests/baselines/reference/duplicateStringIndexers.errors.txt index 5761f7411b53c..4d1ac86be24c2 100644 --- a/tests/baselines/reference/duplicateStringIndexers.errors.txt +++ b/tests/baselines/reference/duplicateStringIndexers.errors.txt @@ -1,3 +1,4 @@ +duplicateStringIndexers.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateStringIndexers.ts(5,9): error TS2374: Duplicate index signature for type 'string'. duplicateStringIndexers.ts(6,9): error TS2374: Duplicate index signature for type 'string'. duplicateStringIndexers.ts(10,9): error TS2374: Duplicate index signature for type 'string'. @@ -12,10 +13,12 @@ duplicateStringIndexers.ts(30,9): error TS2374: Duplicate index signature for ty duplicateStringIndexers.ts(31,9): error TS2374: Duplicate index signature for type 'string'. -==== duplicateStringIndexers.ts (12 errors) ==== +==== duplicateStringIndexers.ts (13 errors) ==== // it is an error to have duplicate index signatures of the same kind in a type module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Number { [x: string]: string; ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt index d08a3313c2047..91b4b5037d036 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.errors.txt @@ -1,40 +1,62 @@ +duplicateSymbolsExportMatching.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(24,15): error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local. duplicateSymbolsExportMatching.ts(25,22): error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local. duplicateSymbolsExportMatching.ts(26,22): error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local. duplicateSymbolsExportMatching.ts(27,15): error TS2395: Individual declarations in merged declaration 'E' must be all exported or all local. +duplicateSymbolsExportMatching.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(32,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(32,12): error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local. +duplicateSymbolsExportMatching.ts(35,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(35,19): error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local. +duplicateSymbolsExportMatching.ts(41,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(42,9): error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local. duplicateSymbolsExportMatching.ts(43,16): error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local. duplicateSymbolsExportMatching.ts(44,9): error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local. duplicateSymbolsExportMatching.ts(45,16): error TS2395: Individual declarations in merged declaration 'w' must be all exported or all local. +duplicateSymbolsExportMatching.ts(48,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateSymbolsExportMatching.ts(49,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(49,12): error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local. duplicateSymbolsExportMatching.ts(49,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. duplicateSymbolsExportMatching.ts(52,21): error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local. +duplicateSymbolsExportMatching.ts(55,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(56,11): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. +duplicateSymbolsExportMatching.ts(57,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(57,12): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. +duplicateSymbolsExportMatching.ts(58,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateSymbolsExportMatching.ts(58,19): error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. duplicateSymbolsExportMatching.ts(64,11): error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local. duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations in merged declaration 'D' must be all exported or all local. -==== duplicateSymbolsExportMatching.ts (18 errors) ==== +==== duplicateSymbolsExportMatching.ts (32 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface E { } interface I { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface E { } // ok interface I { } // ok } // Doesn't match export visibility, but it's in a different parent, so it's ok module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface E { } // ok export interface I { } // ok } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I { } interface I { } // ok export interface E { } @@ -42,6 +64,8 @@ duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations } module N2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I { } ~ !!! error TS2395: Individual declarations in merged declaration 'I' must be all exported or all local. @@ -58,13 +82,19 @@ duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations // Should report error only once for instantiated module module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module inst { ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ !!! error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local. var t; } export module inst { // one error ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ !!! error TS2395: Individual declarations in merged declaration 'inst' must be all exported or all local. var t; } @@ -72,6 +102,8 @@ duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations // Variables of the same / different type module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var v: string; ~ !!! error TS2395: Individual declarations in merged declaration 'v' must be all exported or all local. @@ -87,8 +119,12 @@ duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module F { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2395: Individual declarations in merged declaration 'F' must be all exported or all local. ~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. @@ -100,14 +136,20 @@ duplicateSymbolsExportMatching.ts(65,18): error TS2395: Individual declarations } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { } ~ !!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. module C { } ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol) ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2395: Individual declarations in merged declaration 'C' must be all exported or all local. var t; } diff --git a/tests/baselines/reference/duplicateVarAndImport.errors.txt b/tests/baselines/reference/duplicateVarAndImport.errors.txt new file mode 100644 index 0000000000000..ffd8aa1b8dec8 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport.errors.txt @@ -0,0 +1,11 @@ +duplicateVarAndImport.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== duplicateVarAndImport.ts (1 errors) ==== + // no error since module is not instantiated + + var a; + module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import a = M; \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVarAndImport.types b/tests/baselines/reference/duplicateVarAndImport.types index 02974fcbde6b4..76b94f9a7c526 100644 --- a/tests/baselines/reference/duplicateVarAndImport.types +++ b/tests/baselines/reference/duplicateVarAndImport.types @@ -5,10 +5,12 @@ var a; >a : any +> : ^^^ module M { } import a = M; >a : any > : ^^^ ->M : error +>M : any +> : ^^^ diff --git a/tests/baselines/reference/duplicateVarAndImport2.errors.txt b/tests/baselines/reference/duplicateVarAndImport2.errors.txt index 343834034a9ba..25fc22d003200 100644 --- a/tests/baselines/reference/duplicateVarAndImport2.errors.txt +++ b/tests/baselines/reference/duplicateVarAndImport2.errors.txt @@ -1,10 +1,13 @@ +duplicateVarAndImport2.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateVarAndImport2.ts(4,1): error TS2440: Import declaration conflicts with local declaration of 'a'. -==== duplicateVarAndImport2.ts (1 errors) ==== +==== duplicateVarAndImport2.ts (2 errors) ==== // error since module is instantiated var a; module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = M; ~~~~~~~~~~~~~ !!! error TS2440: Import declaration conflicts with local declaration of 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesByScope.errors.txt b/tests/baselines/reference/duplicateVariablesByScope.errors.txt new file mode 100644 index 0000000000000..1d38a5f3ad125 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.errors.txt @@ -0,0 +1,37 @@ +duplicateVariablesByScope.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== duplicateVariablesByScope.ts (1 errors) ==== + // duplicate local variables are only reported at global scope + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + for (var j = 0; j < 10; j++) { + } + + for (var j = 0; j < 10; j++) { + } + } + + function foo() { + var x = 2; + var x = 1; + if (true) { + var result = 1; + } + else { + var result = 2; + } + } + + class C { + foo() { + try { + var x = 1; + } + catch (e) { + var x = 2; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index 286b775cb1dae..29200f3e2ff97 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -94,6 +94,7 @@ class C { } catch (e) { >e : any +> : ^^^ var x = 2; >x : number diff --git a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt index 0752acccdfd8d..3da353ef96a9d 100644 --- a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt +++ b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt @@ -1,10 +1,11 @@ duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. +duplicateVariablesWithAny.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'. duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'. -==== duplicateVariablesWithAny.ts (4 errors) ==== +==== duplicateVariablesWithAny.ts (5 errors) ==== // They should have to be the same even when one of the types is 'any' var x: any; var x = 2; //error @@ -19,6 +20,8 @@ duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declaratio !!! related TS6203 duplicateVariablesWithAny.ts:5:5: 'y' was also declared here. module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x: any; var x = 2; //error ~ diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt index a5f612ce701b1..e99be262605c8 100644 --- a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt @@ -2,6 +2,8 @@ duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable d duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'. duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'. duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'. +duplicateVarsAcrossFileBoundaries_4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +duplicateVarsAcrossFileBoundaries_5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ==== duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ==== @@ -34,12 +36,16 @@ duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable d var y = ""; var z = 0; -==== duplicateVarsAcrossFileBoundaries_4.ts (0 errors) ==== +==== duplicateVarsAcrossFileBoundaries_4.ts (1 errors) ==== module P { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import p = P; var q; -==== duplicateVarsAcrossFileBoundaries_5.ts (0 errors) ==== +==== duplicateVarsAcrossFileBoundaries_5.ts (1 errors) ==== module Q { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import q = Q; var p; \ No newline at end of file diff --git a/tests/baselines/reference/emitMemberAccessExpression.errors.txt b/tests/baselines/reference/emitMemberAccessExpression.errors.txt new file mode 100644 index 0000000000000..1ffebcf9f0e86 --- /dev/null +++ b/tests/baselines/reference/emitMemberAccessExpression.errors.txt @@ -0,0 +1,43 @@ +emitMemberAccessExpression_file2.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +emitMemberAccessExpression_file2.ts(3,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +emitMemberAccessExpression_file2.ts(3,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +emitMemberAccessExpression_file3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +emitMemberAccessExpression_file3.ts(4,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +emitMemberAccessExpression_file3.ts(4,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== emitMemberAccessExpression_file3.ts (3 errors) ==== + /// + /// + declare var OData: any; + module Microsoft.PeopleAtWork.Model { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class KnockoutExtentions { + } + } +==== emitMemberAccessExpression_file1.ts (0 errors) ==== + /// + "use strict"; + +==== emitMemberAccessExpression_file2.ts (3 errors) ==== + /// + "use strict"; + module Microsoft.PeopleAtWork.Model { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class _Person { + public populate(raw: any) { + var res = Model.KnockoutExtentions; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/emitMemberAccessExpression.types b/tests/baselines/reference/emitMemberAccessExpression.types index 312ed1fa0d771..8a7047f5bee0d 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.types +++ b/tests/baselines/reference/emitMemberAccessExpression.types @@ -5,6 +5,7 @@ /// declare var OData: any; >OData : any +> : ^^^ module Microsoft.PeopleAtWork.Model { >Microsoft : typeof Microsoft @@ -47,6 +48,7 @@ module Microsoft.PeopleAtWork.Model { >populate : (raw: any) => void > : ^ ^^ ^^^^^^^^^ >raw : any +> : ^^^ var res = Model.KnockoutExtentions; >res : typeof KnockoutExtentions diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 36a4c7eb63e65..c99029f8d7442 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -2,6 +2,7 @@ enumAssignability.ts(9,1): error TS2322: Type 'F' is not assignable to type 'E'. enumAssignability.ts(10,1): error TS2322: Type 'E' is not assignable to type 'F'. enumAssignability.ts(11,1): error TS2322: Type '1' is not assignable to type 'E'. enumAssignability.ts(12,1): error TS2322: Type '1' is not assignable to type 'F'. +enumAssignability.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. @@ -27,7 +28,7 @@ enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B 'E' is assignable to the constraint of type 'B', but 'B' could be instantiated with a different subtype of constraint 'E'. -==== enumAssignability.ts (22 errors) ==== +==== enumAssignability.ts (23 errors) ==== // enums assignable to number, any, Object, errors unless otherwise noted enum E { A } @@ -52,6 +53,8 @@ enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B x = f; // ok module Others { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a: any = e; // ok class C { diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt index 3bfdd2aae934e..6b64da0c3528a 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt @@ -1,8 +1,10 @@ +enumAssignabilityInInheritance.ts(84,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumAssignabilityInInheritance.ts(93,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. -==== enumAssignabilityInInheritance.ts (2 errors) ==== +==== enumAssignabilityInInheritance.ts (4 errors) ==== // enum is only a subtype of number, no types are subtypes of enum, all of these except the first are errors @@ -87,6 +89,8 @@ enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable decl function f() { } module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } declare function foo14(x: typeof f): typeof f; @@ -96,6 +100,8 @@ enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable decl class CC { baz: string } module CC { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } declare function foo15(x: CC): CC; diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 277f7a39c7e72..86d21e8e72906 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,3 +1,4 @@ +enumAssignmentCompat.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. @@ -7,8 +8,10 @@ enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to enumAssignmentCompat.ts(34,5): error TS2322: Type '3' is not assignable to type 'W'. -==== enumAssignmentCompat.ts (7 errors) ==== +==== enumAssignmentCompat.ts (8 errors) ==== module W { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D { } } diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 1921f57eb3052..f9a58f7acbe05 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,3 +1,4 @@ +enumAssignmentCompat2.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. @@ -7,7 +8,7 @@ enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to enumAssignmentCompat2.ts(33,5): error TS2322: Type '3' is not assignable to type 'W'. -==== enumAssignmentCompat2.ts (7 errors) ==== +==== enumAssignmentCompat2.ts (8 errors) ==== enum W { a, b, c, @@ -15,6 +16,8 @@ enumAssignmentCompat2.ts(33,5): error TS2322: Type '3' is not assignable to type } module W { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D { } } diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index 9c10fd6b13d95..ffaf25de9af4c 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,3 +1,4 @@ +enumAssignmentCompat3.ts(52,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. Property 'd' is missing in type 'First.E'. enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. @@ -20,7 +21,7 @@ enumAssignmentCompat3.ts(87,1): error TS2322: Type 'First.E' is not assignable t Each declaration of 'E.c' differs in its value, where '3' was expected but '2' was given. -==== enumAssignmentCompat3.ts (12 errors) ==== +==== enumAssignmentCompat3.ts (13 errors) ==== namespace First { export enum E { a, b, c, @@ -73,6 +74,8 @@ enumAssignmentCompat3.ts(87,1): error TS2322: Type 'First.E' is not assignable t a, b, c } export module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export let d = 5; } } diff --git a/tests/baselines/reference/enumBasics3.errors.txt b/tests/baselines/reference/enumBasics3.errors.txt index 534234050029b..b4ae3d08f8a7a 100644 --- a/tests/baselines/reference/enumBasics3.errors.txt +++ b/tests/baselines/reference/enumBasics3.errors.txt @@ -1,9 +1,13 @@ +enumBasics3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumBasics3.ts(5,13): error TS2339: Property 'a' does not exist on type 'E1.a'. +enumBasics3.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumBasics3.ts(14,20): error TS2339: Property 'a' does not exist on type 'E1.a'. -==== enumBasics3.ts (2 errors) ==== +==== enumBasics3.ts (4 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace N { export enum E1 { a = 1, @@ -15,6 +19,8 @@ enumBasics3.ts(14,20): error TS2339: Property 'a' does not exist on type 'E1.a'. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace N { export enum E2 { b = M.N.E1.a, diff --git a/tests/baselines/reference/enumDecl1.errors.txt b/tests/baselines/reference/enumDecl1.errors.txt new file mode 100644 index 0000000000000..d43e2b7781795 --- /dev/null +++ b/tests/baselines/reference/enumDecl1.errors.txt @@ -0,0 +1,14 @@ +enumDecl1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== enumDecl1.ts (1 errors) ==== + declare module mAmbient { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum e { + x, + y, + z + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt index de8ee8ae4477e..f6af44f0b47b2 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt @@ -10,13 +10,15 @@ enumIsNotASubtypeOfAnythingButNumber.ts(66,5): error TS2411: Property 'foo' of t enumIsNotASubtypeOfAnythingButNumber.ts(72,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type '(x: any) => number'. enumIsNotASubtypeOfAnythingButNumber.ts(78,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type '(x: T) => T'. enumIsNotASubtypeOfAnythingButNumber.ts(85,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type 'E2'. +enumIsNotASubtypeOfAnythingButNumber.ts(90,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumIsNotASubtypeOfAnythingButNumber.ts(95,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type 'typeof f'. +enumIsNotASubtypeOfAnythingButNumber.ts(100,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumIsNotASubtypeOfAnythingButNumber.ts(105,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type 'typeof c'. enumIsNotASubtypeOfAnythingButNumber.ts(111,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type 'T'. enumIsNotASubtypeOfAnythingButNumber.ts(117,5): error TS2411: Property 'foo' of type 'E' is not assignable to 'string' index type 'U'. -==== enumIsNotASubtypeOfAnythingButNumber.ts (16 errors) ==== +==== enumIsNotASubtypeOfAnythingButNumber.ts (18 errors) ==== // enums are only subtypes of number, any and no other types enum E { A } @@ -131,6 +133,8 @@ enumIsNotASubtypeOfAnythingButNumber.ts(117,5): error TS2411: Property 'foo' of function f() { } module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } interface I15 { @@ -143,6 +147,8 @@ enumIsNotASubtypeOfAnythingButNumber.ts(117,5): error TS2411: Property 'foo' of class c { baz: string } module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } interface I16 { diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt index f33a845975fdb..7004d001cd314 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt @@ -1,3 +1,7 @@ +enumLiteralAssignableToEnumInsideUnion.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumLiteralAssignableToEnumInsideUnion.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumLiteralAssignableToEnumInsideUnion.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumLiteralAssignableToEnumInsideUnion.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumLiteralAssignableToEnumInsideUnion.ts(24,7): error TS2322: Type 'Foo.A' is not assignable to type 'boolean | Foo'. enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo.A' is not assignable to type 'boolean | Foo'. enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo.A' is not assignable to type 'boolean | Foo.B'. @@ -5,24 +9,32 @@ enumLiteralAssignableToEnumInsideUnion.ts(27,7): error TS2322: Type 'Foo.A' is n enumLiteralAssignableToEnumInsideUnion.ts(28,7): error TS2322: Type 'Foo.A' is not assignable to type 'boolean | Foo'. -==== enumLiteralAssignableToEnumInsideUnion.ts (5 errors) ==== +==== enumLiteralAssignableToEnumInsideUnion.ts (9 errors) ==== module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Foo { A, B } } module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Foo { A, B } } module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Foo { A = 1 << 1, B = 1 << 2, } } module Ka { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Foo { A = 1 << 10, B = 1 << 11, diff --git a/tests/baselines/reference/enumMerging.errors.txt b/tests/baselines/reference/enumMerging.errors.txt new file mode 100644 index 0000000000000..2cfbdb66c2b71 --- /dev/null +++ b/tests/baselines/reference/enumMerging.errors.txt @@ -0,0 +1,96 @@ +enumMerging.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(49,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(52,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(56,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(56,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(59,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMerging.ts(60,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== enumMerging.ts (9 errors) ==== + // Enum with only constant members across 2 declarations with the same root module + // Enum with initializer in all declarations with constant members with the same root module + module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum EImpl1 { + A, B, C + } + + enum EImpl1 { + D = 1, E, F + } + + export enum EConst1 { + A = 3, B = 2, C = 1 + } + + export enum EConst1 { + D = 7, E = 9, F = 8 + } + + var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; + } + + // Enum with only computed members across 2 declarations with the same root module + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum EComp2 { + A = 'foo'.length, B = 'foo'.length, C = 'foo'.length + } + + export enum EComp2 { + D = 'foo'.length, E = 'foo'.length, F = 'foo'.length + } + + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; + } + + // Enum with initializer in only one of two declarations with constant members with the same root module + module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum EInit { + A, + B + } + + enum EInit { + C = 1, D, E + } + } + + // Enums with same name but different root module + module M4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Red, Green, Blue } + } + module M5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Red, Green, Blue } + } + + module M6.A { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Red, Green, Blue } + } + module M6 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Yellow = 1 } + } + var t = A.Color.Yellow; + t = A.Color.Red; + } + \ No newline at end of file diff --git a/tests/baselines/reference/enumMergingErrors.errors.txt b/tests/baselines/reference/enumMergingErrors.errors.txt index e0d3ba2e8233a..957d36c7ce9f7 100644 --- a/tests/baselines/reference/enumMergingErrors.errors.txt +++ b/tests/baselines/reference/enumMergingErrors.errors.txt @@ -1,20 +1,35 @@ +enumMergingErrors.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumMergingErrors.ts(26,22): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. +enumMergingErrors.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(34,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +enumMergingErrors.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enumMergingErrors.ts(38,22): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. -==== enumMergingErrors.ts (2 errors) ==== +==== enumMergingErrors.ts (11 errors) ==== // Enum with constant, computed, constant members split across 3 declarations with the same root module module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { A = 0 } export enum E2 { C } export enum E3 { A = 0 } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { B = 'foo'.length } export enum E2 { B = 'foo'.length } export enum E3 { C } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { C } export enum E2 { A = 0 } export enum E3 { B = 'foo'.length } @@ -22,12 +37,18 @@ enumMergingErrors.ts(38,22): error TS2432: In an enum with multiple declarations // Enum with no initializer in either declaration with constant members with the same root module module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { A = 0 } } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { B } } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { C } ~ !!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. @@ -36,12 +57,18 @@ enumMergingErrors.ts(38,22): error TS2432: In an enum with multiple declarations // Enum with initializer in only one of three declarations with constant members with the same root module module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { A } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { B = 0 } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum E1 { C } ~ !!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations3.errors.txt b/tests/baselines/reference/enumsWithMultipleDeclarations3.errors.txt new file mode 100644 index 0000000000000..8eac36a68cf31 --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations3.errors.txt @@ -0,0 +1,12 @@ +enumsWithMultipleDeclarations3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== enumsWithMultipleDeclarations3.ts (1 errors) ==== + module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + enum E { + A + } \ No newline at end of file diff --git a/tests/baselines/reference/erasableSyntaxOnly.errors.txt b/tests/baselines/reference/erasableSyntaxOnly.errors.txt index 523da93fd9d39..c243a172698f9 100644 --- a/tests/baselines/reference/erasableSyntaxOnly.errors.txt +++ b/tests/baselines/reference/erasableSyntaxOnly.errors.txt @@ -2,10 +2,6 @@ error TS2318: Cannot find global type 'IterableIterator'. commonjs.cts(1,1): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. commonjs.cts(2,1): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. index.ts(3,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -index.ts(6,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -index.ts(10,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -index.ts(16,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -index.ts(17,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. index.ts(22,6): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. index.ts(26,1): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. index.ts(28,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. @@ -24,7 +20,7 @@ index.ts(94,1): error TS1294: This syntax is not allowed when 'erasableSyntaxOnl !!! error TS2318: Cannot find global type 'IterableIterator'. -==== index.ts (20 errors) ==== +==== index.ts (16 errors) ==== class MyClassErr { // No parameter properties constructor(public foo: string) { } @@ -33,25 +29,17 @@ index.ts(94,1): error TS1294: This syntax is not allowed when 'erasableSyntaxOnl } namespace IllegalBecauseInstantiated { - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export const m = 1; } namespace AlsoIllegalBecauseInstantiated { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class PrivateClass { } } namespace IllegalBecauseNestedInstantiated { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. namespace Nested { - ~~~~~~ -!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export const m = 1; } } diff --git a/tests/baselines/reference/es5ExportEqualsDts.errors.txt b/tests/baselines/reference/es5ExportEqualsDts.errors.txt new file mode 100644 index 0000000000000..96f4be065a161 --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.errors.txt @@ -0,0 +1,18 @@ +es5ExportEqualsDts.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es5ExportEqualsDts.ts (1 errors) ==== + class A { + foo() { + var aVal: A.B; + return aVal; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface B { } + } + + export = A \ No newline at end of file diff --git a/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt b/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt index f5cd3e7810753..764ab679307e5 100644 --- a/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt +++ b/tests/baselines/reference/es5ModuleInternalNamedImports.errors.txt @@ -1,3 +1,6 @@ +es5ModuleInternalNamedImports.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es5ModuleInternalNamedImports.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es5ModuleInternalNamedImports.ts(11,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. es5ModuleInternalNamedImports.ts(22,5): error TS1194: Export declarations are not permitted in a namespace. es5ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in a namespace. es5ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in a namespace. @@ -12,8 +15,10 @@ es5ModuleInternalNamedImports.ts(32,32): error TS1147: Import declarations in a es5ModuleInternalNamedImports.ts(34,16): error TS2792: Cannot find module 'M3'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== es5ModuleInternalNamedImports.ts (12 errors) ==== +==== es5ModuleInternalNamedImports.ts (15 errors) ==== export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // variable export var M_V = 0; // interface @@ -22,8 +27,12 @@ es5ModuleInternalNamedImports.ts(34,16): error TS2792: Cannot find module 'M3'. export class M_C { } // instantiated module export module M_M { var x; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // uninstantiated module export module M_MU { } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // function export function M_F() { } // enum diff --git a/tests/baselines/reference/es6ClassTest.errors.txt b/tests/baselines/reference/es6ClassTest.errors.txt index 22547bed6d257..720b49878047c 100644 --- a/tests/baselines/reference/es6ClassTest.errors.txt +++ b/tests/baselines/reference/es6ClassTest.errors.txt @@ -1,7 +1,8 @@ es6ClassTest.ts(25,44): error TS1015: Parameter cannot have question mark and initializer. +es6ClassTest.ts(34,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== es6ClassTest.ts (1 errors) ==== +==== es6ClassTest.ts (2 errors) ==== class Bar { public goo: number; public prop1(x) { @@ -38,6 +39,8 @@ es6ClassTest.ts(25,44): error TS1015: Parameter cannot have question mark and in var f = new Foo(); declare module AmbientMod { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Provide { foo:number; zoo:string; diff --git a/tests/baselines/reference/es6ClassTest3.errors.txt b/tests/baselines/reference/es6ClassTest3.errors.txt new file mode 100644 index 0000000000000..90b9d09054103 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.errors.txt @@ -0,0 +1,20 @@ +es6ClassTest3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ClassTest3.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Visibility { + public foo() { }; + private bar() { }; + private x: number; + public y: number; + public z: number; + + constructor() { + this.x = 1; + this.y = 2; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest5.errors.txt b/tests/baselines/reference/es6ClassTest5.errors.txt new file mode 100644 index 0000000000000..d56fc80fc9b54 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest5.errors.txt @@ -0,0 +1,18 @@ +es6ClassTest5.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ClassTest5.ts (1 errors) ==== + class C1T5 { + foo: (i: number, s: string) => number = + (i) => { + return i; + } + } + module C2T5 {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class bigClass { + public break = 1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest7.errors.txt b/tests/baselines/reference/es6ClassTest7.errors.txt new file mode 100644 index 0000000000000..843c80d4ad446 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest7.errors.txt @@ -0,0 +1,14 @@ +es6ClassTest7.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ClassTest7.ts (1 errors) ==== + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Foo { + } + } + + class Bar extends M.Foo { + } + \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAll.errors.txt b/tests/baselines/reference/es6ExportAll.errors.txt new file mode 100644 index 0000000000000..c21850e485db3 --- /dev/null +++ b/tests/baselines/reference/es6ExportAll.errors.txt @@ -0,0 +1,22 @@ +server.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + export class c { + } + export interface i { + } + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + export var x = 10; + export module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + +==== client.ts (0 errors) ==== + export * from "server"; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAllInEs5.errors.txt b/tests/baselines/reference/es6ExportAllInEs5.errors.txt new file mode 100644 index 0000000000000..21caa6b4754af --- /dev/null +++ b/tests/baselines/reference/es6ExportAllInEs5.errors.txt @@ -0,0 +1,22 @@ +server.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + export class c { + } + export interface i { + } + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + export var x = 10; + export module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + +==== client.ts (0 errors) ==== + export * from "./server"; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportClause.errors.txt b/tests/baselines/reference/es6ExportClause.errors.txt new file mode 100644 index 0000000000000..843624b957c64 --- /dev/null +++ b/tests/baselines/reference/es6ExportClause.errors.txt @@ -0,0 +1,24 @@ +server.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + class c { + } + interface i { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + var x = 10; + module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + export { c }; + export { c as c2 }; + export { i, m as instantiatedModule }; + export { uninstantiated }; + export { x }; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportClauseInEs5.errors.txt b/tests/baselines/reference/es6ExportClauseInEs5.errors.txt new file mode 100644 index 0000000000000..843624b957c64 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseInEs5.errors.txt @@ -0,0 +1,24 @@ +server.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + class c { + } + interface i { + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + var x = 10; + module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + export { c }; + export { c as c2 }; + export { i, m as instantiatedModule }; + export { uninstantiated }; + export { x }; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.errors.txt b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.errors.txt new file mode 100644 index 0000000000000..402f453d15081 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.errors.txt @@ -0,0 +1,26 @@ +server.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + export class c { + } + export interface i { + } + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + export var x = 10; + export module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + +==== client.ts (0 errors) ==== + export { c } from "server"; + export { c as c2 } from "server"; + export { i, m as instantiatedModule } from "server"; + export { uninstantiated } from "server"; + export { x } from "server"; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.errors.txt b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.errors.txt new file mode 100644 index 0000000000000..6819282deed49 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.errors.txt @@ -0,0 +1,26 @@ +server.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +server.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.ts (2 errors) ==== + export class c { + } + export interface i { + } + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + export var x = 10; + export module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + +==== client.ts (0 errors) ==== + export { c } from "./server"; + export { c as c2 } from "./server"; + export { i, m as instantiatedModule } from "./server"; + export { uninstantiated } from "./server"; + export { x } from "./server"; \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index b748ed82a706b..dcc49324213a5 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -39,6 +39,11 @@ main.ts(103,15): error TS2498: Module '"function"' uses 'export =' and cannot be main.ts(104,15): error TS2498: Module '"function-module"' uses 'export =' and cannot be used with 'export *'. main.ts(105,15): error TS2498: Module '"class"' uses 'export =' and cannot be used with 'export *'. main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and cannot be used with 'export *'. +modules.d.ts(30,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +modules.d.ts(42,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +modules.d.ts(50,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +modules.d.ts(70,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +modules.d.ts(90,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ==== main.ts (41 errors) ==== @@ -241,7 +246,7 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno ~~~~~~~~~~~~~~ !!! error TS2498: Module '"class-module"' uses 'export =' and cannot be used with 'export *'. -==== modules.d.ts (0 errors) ==== +==== modules.d.ts (5 errors) ==== declare module "interface" { interface Foo { x: number; @@ -272,6 +277,8 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno declare module "module" { module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a: number; export var b: number; } @@ -284,6 +291,8 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno y: number; } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a: number; export var b: number; } @@ -292,6 +301,8 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno declare module "variable-module" { module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Bar { x: number; y: number; @@ -312,6 +323,8 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno declare module "function-module" { function foo(); module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a: number; export var b: number; } @@ -332,6 +345,8 @@ main.ts(106,15): error TS2498: Module '"class-module"' uses 'export =' and canno y: number; } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a: number; export var b: number; } diff --git a/tests/baselines/reference/es6ImportEqualsDeclaration2.errors.txt b/tests/baselines/reference/es6ImportEqualsDeclaration2.errors.txt new file mode 100644 index 0000000000000..8fb52d99c872b --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsDeclaration2.errors.txt @@ -0,0 +1,23 @@ +server.d.ts(8,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== server.d.ts (1 errors) ==== + declare module "other" { + export class C { } + } + + declare module "server" { + import events = require("other"); // Ambient declaration, no error expected. + + module S { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a: number; + } + + export = S; // Ambient declaration, no error expected. + } + +==== client.ts (0 errors) ==== + import {a} from "server"; + \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.errors.txt b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.errors.txt new file mode 100644 index 0000000000000..b7173cbd352c1 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.errors.txt @@ -0,0 +1,15 @@ +es6ImportNamedImportInIndirectExportAssignment_0.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ImportNamedImportInIndirectExportAssignment_0.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + +==== es6ImportNamedImportInIndirectExportAssignment_1.ts (0 errors) ==== + import { a } from "./es6ImportNamedImportInIndirectExportAssignment_0"; + import x = a; + export = x; \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.errors.txt b/tests/baselines/reference/es6ModuleClassDeclaration.errors.txt new file mode 100644 index 0000000000000..9c677811b5089 --- /dev/null +++ b/tests/baselines/reference/es6ModuleClassDeclaration.errors.txt @@ -0,0 +1,121 @@ +es6ModuleClassDeclaration.ts(36,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleClassDeclaration.ts(74,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleClassDeclaration.ts (2 errors) ==== + export class c { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + class c2 { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + new c(); + new c2(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c3 { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + class c4 { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + new c(); + new c2(); + new c3(); + new c4(); + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c3 { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + class c4 { + constructor() { + } + private x = 10; + public y = 30; + static k = 20; + private static l = 30; + private method1() { + } + public method2() { + } + static method3() { + } + private static method4() { + } + } + new c(); + new c2(); + new c3(); + new c4(); + new m1.c3(); + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleConst.errors.txt b/tests/baselines/reference/es6ModuleConst.errors.txt new file mode 100644 index 0000000000000..d509ece8fdc91 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConst.errors.txt @@ -0,0 +1,25 @@ +es6ModuleConst.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleConst.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleConst.ts (2 errors) ==== + export const a = "hello"; + export const x: string = a, y = x; + const b = y; + const c: string = b, d = c; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const k = a; + export const l: string = b, m = k; + const n = m1.k; + const o: string = n, p = k; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const k = a; + export const l: string = b, m = k; + const n = m1.k; + const o: string = n, p = k; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration.errors.txt b/tests/baselines/reference/es6ModuleConstEnumDeclaration.errors.txt new file mode 100644 index 0000000000000..0c1b6a525eb7b --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration.errors.txt @@ -0,0 +1,54 @@ +es6ModuleConstEnumDeclaration.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleConstEnumDeclaration.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleConstEnumDeclaration.ts (2 errors) ==== + export const enum e1 { + a, + b, + c + } + const enum e2 { + x, + y, + z + } + var x = e1.a; + var y = e2.x; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum e3 { + a, + b, + c + } + const enum e4 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e3.a; + var y2 = e4.x; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum e5 { + a, + b, + c + } + const enum e6 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e5.a; + var y2 = e6.x; + var x3 = m1.e3.a; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.errors.txt b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.errors.txt new file mode 100644 index 0000000000000..e9868276ecb89 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.errors.txt @@ -0,0 +1,54 @@ +es6ModuleConstEnumDeclaration2.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleConstEnumDeclaration2.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleConstEnumDeclaration2.ts (2 errors) ==== + export const enum e1 { + a, + b, + c + } + const enum e2 { + x, + y, + z + } + var x = e1.a; + var y = e2.x; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum e3 { + a, + b, + c + } + const enum e4 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e3.a; + var y2 = e4.x; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum e5 { + a, + b, + c + } + const enum e6 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e5.a; + var y2 = e6.x; + var x3 = m1.e3.a; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleEnumDeclaration.errors.txt b/tests/baselines/reference/es6ModuleEnumDeclaration.errors.txt new file mode 100644 index 0000000000000..e06d9200695a5 --- /dev/null +++ b/tests/baselines/reference/es6ModuleEnumDeclaration.errors.txt @@ -0,0 +1,54 @@ +es6ModuleEnumDeclaration.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleEnumDeclaration.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleEnumDeclaration.ts (2 errors) ==== + export enum e1 { + a, + b, + c + } + enum e2 { + x, + y, + z + } + var x = e1.a; + var y = e2.x; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum e3 { + a, + b, + c + } + enum e4 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e3.a; + var y2 = e4.x; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum e5 { + a, + b, + c + } + enum e6 { + x, + y, + z + } + var x1 = e1.a; + var y1 = e2.x; + var x2 = e5.a; + var y2 = e6.x; + var x3 = m1.e3.a; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleFunctionDeclaration.errors.txt b/tests/baselines/reference/es6ModuleFunctionDeclaration.errors.txt new file mode 100644 index 0000000000000..15dc4981deeac --- /dev/null +++ b/tests/baselines/reference/es6ModuleFunctionDeclaration.errors.txt @@ -0,0 +1,37 @@ +es6ModuleFunctionDeclaration.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleFunctionDeclaration.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleFunctionDeclaration.ts (2 errors) ==== + export function foo() { + } + function foo2() { + } + foo(); + foo2(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo3() { + } + function foo4() { + } + foo(); + foo2(); + foo3(); + foo4(); + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo3() { + } + function foo4() { + } + foo(); + foo2(); + foo3(); + foo4(); + m1.foo3(); + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleInternalImport.errors.txt b/tests/baselines/reference/es6ModuleInternalImport.errors.txt new file mode 100644 index 0000000000000..e50c00d4bbfaf --- /dev/null +++ b/tests/baselines/reference/es6ModuleInternalImport.errors.txt @@ -0,0 +1,31 @@ +es6ModuleInternalImport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalImport.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalImport.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleInternalImport.ts (3 errors) ==== + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a = 10; + } + export import a1 = m.a; + import a2 = m.a; + var x = a1 + a2; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import a3 = m.a; + import a4 = m.a; + var x = a1 + a2; + var x2 = a3 + a4; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import a3 = m.a; + import a4 = m.a; + var x = a1 + a2; + var x2 = a3 + a4; + var x4 = m1.a3 + m2.a3; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt b/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt index 0d0a4fe07ac8d..3c2a57f253bee 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt +++ b/tests/baselines/reference/es6ModuleInternalNamedImports.errors.txt @@ -1,3 +1,6 @@ +es6ModuleInternalNamedImports.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalNamedImports.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalNamedImports.ts(11,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. es6ModuleInternalNamedImports.ts(22,5): error TS1194: Export declarations are not permitted in a namespace. es6ModuleInternalNamedImports.ts(23,5): error TS1194: Export declarations are not permitted in a namespace. es6ModuleInternalNamedImports.ts(24,5): error TS1194: Export declarations are not permitted in a namespace. @@ -8,8 +11,10 @@ es6ModuleInternalNamedImports.ts(28,5): error TS1194: Export declarations are no es6ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are not permitted in a namespace. -==== es6ModuleInternalNamedImports.ts (8 errors) ==== +==== es6ModuleInternalNamedImports.ts (11 errors) ==== export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // variable export var M_V = 0; // interface @@ -18,8 +23,12 @@ es6ModuleInternalNamedImports.ts(29,5): error TS1194: Export declarations are no export class M_C { } // instantiated module export module M_M { var x; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // uninstantiated module export module M_MU { } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // function export function M_F() { } // enum diff --git a/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt b/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt index 5f8dde403e91d..be93ba949d60e 100644 --- a/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt +++ b/tests/baselines/reference/es6ModuleInternalNamedImports2.errors.txt @@ -1,3 +1,7 @@ +es6ModuleInternalNamedImports2.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalNamedImports2.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalNamedImports2.ts(11,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleInternalNamedImports2.ts(22,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. es6ModuleInternalNamedImports2.ts(24,5): error TS1194: Export declarations are not permitted in a namespace. es6ModuleInternalNamedImports2.ts(25,5): error TS1194: Export declarations are not permitted in a namespace. es6ModuleInternalNamedImports2.ts(26,5): error TS1194: Export declarations are not permitted in a namespace. @@ -8,8 +12,10 @@ es6ModuleInternalNamedImports2.ts(30,5): error TS1194: Export declarations are n es6ModuleInternalNamedImports2.ts(31,5): error TS1194: Export declarations are not permitted in a namespace. -==== es6ModuleInternalNamedImports2.ts (8 errors) ==== +==== es6ModuleInternalNamedImports2.ts (12 errors) ==== export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // variable export var M_V = 0; // interface @@ -18,8 +24,12 @@ es6ModuleInternalNamedImports2.ts(31,5): error TS1194: Export declarations are n export class M_C { } // instantiated module export module M_M { var x; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // uninstantiated module export module M_MU { } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // function export function M_F() { } // enum @@ -31,6 +41,8 @@ es6ModuleInternalNamedImports2.ts(31,5): error TS1194: Export declarations are n } export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Reexports export {M_V as v}; ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/es6ModuleLet.errors.txt b/tests/baselines/reference/es6ModuleLet.errors.txt new file mode 100644 index 0000000000000..5e27e1689ed0d --- /dev/null +++ b/tests/baselines/reference/es6ModuleLet.errors.txt @@ -0,0 +1,25 @@ +es6ModuleLet.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleLet.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleLet.ts (2 errors) ==== + export let a = "hello"; + export let x: string = a, y = x; + let b = y; + let c: string = b, d = c; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export let k = a; + export let l: string = b, m = k; + let n = m1.k; + let o: string = n, p = k; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export let k = a; + export let l: string = b, m = k; + let n = m1.k; + let o: string = n, p = k; + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.errors.txt b/tests/baselines/reference/es6ModuleModuleDeclaration.errors.txt new file mode 100644 index 0000000000000..2e94eadcd5a7f --- /dev/null +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.errors.txt @@ -0,0 +1,45 @@ +es6ModuleModuleDeclaration.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleModuleDeclaration.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleModuleDeclaration.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleModuleDeclaration.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleModuleDeclaration.ts(16,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleModuleDeclaration.ts(20,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleModuleDeclaration.ts (6 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a = 10; + var b = 10; + export module innerExportedModule { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var k = 10; + var l = 10; + } + export module innerNonExportedModule { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + var y = 10; + } + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a = 10; + var b = 10; + export module innerExportedModule { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var k = 10; + var l = 10; + } + export module innerNonExportedModule { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + var y = 10; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/es6ModuleVariableStatement.errors.txt b/tests/baselines/reference/es6ModuleVariableStatement.errors.txt new file mode 100644 index 0000000000000..926c5f0bfcc15 --- /dev/null +++ b/tests/baselines/reference/es6ModuleVariableStatement.errors.txt @@ -0,0 +1,25 @@ +es6ModuleVariableStatement.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +es6ModuleVariableStatement.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== es6ModuleVariableStatement.ts (2 errors) ==== + export var a = "hello"; + export var x: string = a, y = x; + var b = y; + var c: string = b, d = c; + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var k = a; + export var l: string = b, m = k; + var n = m1.k; + var o: string = n, p = k; + } + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var k = a; + export var l: string = b, m = k; + var n = m1.k; + var o: string = n, p = k; + } \ No newline at end of file diff --git a/tests/baselines/reference/escapedIdentifiers.errors.txt b/tests/baselines/reference/escapedIdentifiers.errors.txt new file mode 100644 index 0000000000000..90282513046bb --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.errors.txt @@ -0,0 +1,128 @@ +escapedIdentifiers.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +escapedIdentifiers.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== escapedIdentifiers.ts (2 errors) ==== + /* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za + */ + + // var decl + var \u0061 = 1; + a ++; + \u0061 ++; + + var b = 1; + b ++; + \u0062 ++; + + // modules + module moduleType1 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var baz1: number; + } + module moduleType\u0032 { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var baz2: number; + } + + moduleType1.baz1 = 3; + moduleType\u0031.baz1 = 3; + moduleType2.baz2 = 3; + moduleType\u0032.baz2 = 3; + + // classes + + class classType1 { + public foo1: number; + } + class classType\u0032 { + public foo2: number; + } + + var classType1Object1 = new classType1(); + classType1Object1.foo1 = 2; + var classType1Object2 = new classType\u0031(); + classType1Object2.foo1 = 2; + var classType2Object1 = new classType2(); + classType2Object1.foo2 = 2; + var classType2Object2 = new classType\u0032(); + classType2Object2.foo2 = 2; + + // interfaces + interface interfaceType1 { + bar1: number; + } + interface interfaceType\u0032 { + bar2: number; + } + + var interfaceType1Object1 = { bar1: 0 }; + interfaceType1Object1.bar1 = 2; + var interfaceType1Object2 = { bar1: 0 }; + interfaceType1Object2.bar1 = 2; + var interfaceType2Object1 = { bar2: 0 }; + interfaceType2Object1.bar2 = 2; + var interfaceType2Object2 = { bar2: 0 }; + interfaceType2Object2.bar2 = 2; + + + // arguments + class testClass { + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { + arg\u0031 = 1; + arg2 = 'string'; + arg\u0033 = true; + arg4 = 2; + } + } + + // constructors + class constructorTestClass { + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { + } + } + var constructorTestObject = new constructorTestClass(1, 'string', true, 2); + constructorTestObject.arg\u0031 = 1; + constructorTestObject.arg2 = 'string'; + constructorTestObject.arg\u0033 = true; + constructorTestObject.arg4 = 2; + + // Lables + + l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + + label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + + label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + + l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } \ No newline at end of file diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.errors.txt new file mode 100644 index 0000000000000..1ef9e79792e27 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.errors.txt @@ -0,0 +1,54 @@ +everyTypeWithAnnotationAndInitializer.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== everyTypeWithAnnotationAndInitializer.ts (1 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + var aNumber: number = 9.9; + var aString: string = 'this is a string'; + var aDate: Date = new Date(12); + var anObject: Object = new Object(); + + var anAny: any = null; + var aSecondAny: any = undefined; + var aVoid: void = undefined; + + var anInterface: I = new C(); + var aClass: C = new C(); + var aGenericClass: D = new D(); + var anObjectLiteral: I = { id: 12 }; + var anOtherObjectLiteral: { id: number } = new C(); + + var aFunction: typeof F = F; + var anOtherFunction: (x: string) => number = F; + var aLambda: typeof F = (x) => 2; + + var aModule: typeof M = M; + var aClassInModule: M.A = new M.A(); + var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; + + \ No newline at end of file diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index 85fd6c3f36b3c..a1c720d030a22 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -101,9 +101,11 @@ var anObject: Object = new Object(); var anAny: any = null; >anAny : any +> : ^^^ var aSecondAny: any = undefined; >aSecondAny : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index c5e9a1bf5f484..dd18098f2a8bf 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,3 +1,5 @@ +everyTypeWithAnnotationAndInvalidInitializer.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +everyTypeWithAnnotationAndInvalidInitializer.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. @@ -24,7 +26,7 @@ everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: n Type 'boolean' is not assignable to type 'string'. -==== everyTypeWithAnnotationAndInvalidInitializer.ts (15 errors) ==== +==== everyTypeWithAnnotationAndInvalidInitializer.ts (17 errors) ==== interface I { id: number; } @@ -43,6 +45,8 @@ everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: n function F2(x: number): boolean { return x < 42; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { name: string; } @@ -51,6 +55,8 @@ everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: n } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { id: number; } diff --git a/tests/baselines/reference/everyTypeWithInitializer.errors.txt b/tests/baselines/reference/everyTypeWithInitializer.errors.txt new file mode 100644 index 0000000000000..4fc888059a575 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithInitializer.errors.txt @@ -0,0 +1,55 @@ +everyTypeWithInitializer.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== everyTypeWithInitializer.ts (1 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + var aNumber = 9.9; + var aString = 'this is a string'; + var aDate = new Date(12); + var anObject = new Object(); + + var anAny = null; + var anOtherAny = new C(); + var anUndefined = undefined; + + + var aClass = new C(); + var aGenericClass = new D(); + var anObjectLiteral = { id: 12 }; + + var aFunction = F; + var aLambda = (x) => 2; + + var aModule = M; + var aClassInModule = new M.A(); + var aFunctionInModule = M.F2; + + // no initializer or annotation, so this is an 'any' + var x; + + \ No newline at end of file diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index acf32aa08f5c3..24e46e96cfb1b 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -101,10 +101,13 @@ var anObject = new Object(); var anAny = null; >anAny : any +> : ^^^ var anOtherAny = new C(); >anOtherAny : any +> : ^^^ > new C() : any +> : ^^^ >new C() : C > : ^ >C : typeof C @@ -112,6 +115,7 @@ var anOtherAny = new C(); var anUndefined = undefined; >anUndefined : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ @@ -154,6 +158,7 @@ var aLambda = (x) => 2; >(x) => 2 : (x: any) => number > : ^ ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >2 : 2 > : ^ @@ -188,5 +193,6 @@ var aFunctionInModule = M.F2; // no initializer or annotation, so this is an 'any' var x; >x : any +> : ^^^ diff --git a/tests/baselines/reference/exportAlreadySeen.errors.txt b/tests/baselines/reference/exportAlreadySeen.errors.txt index a34f14a8f7f27..36baa7afcb508 100644 --- a/tests/baselines/reference/exportAlreadySeen.errors.txt +++ b/tests/baselines/reference/exportAlreadySeen.errors.txt @@ -1,17 +1,23 @@ +exportAlreadySeen.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportAlreadySeen.ts(2,12): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(3,12): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(5,12): error TS1030: 'export' modifier already seen. +exportAlreadySeen.ts(5,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportAlreadySeen.ts(6,16): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(7,16): error TS1030: 'export' modifier already seen. +exportAlreadySeen.ts(11,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportAlreadySeen.ts(12,12): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(13,12): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(15,12): error TS1030: 'export' modifier already seen. +exportAlreadySeen.ts(15,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportAlreadySeen.ts(16,16): error TS1030: 'export' modifier already seen. exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. -==== exportAlreadySeen.ts (10 errors) ==== +==== exportAlreadySeen.ts (14 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export export var x = 1; ~~~~~~ !!! error TS1030: 'export' modifier already seen. @@ -22,6 +28,8 @@ exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. export export module N { ~~~~~~ !!! error TS1030: 'export' modifier already seen. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export export class C { } ~~~~~~ !!! error TS1030: 'export' modifier already seen. @@ -32,6 +40,8 @@ exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. } declare module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export export var x; ~~~~~~ !!! error TS1030: 'export' modifier already seen. @@ -42,6 +52,8 @@ exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. export export module N { ~~~~~~ !!! error TS1030: 'export' modifier already seen. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export export class C { } ~~~~~~ !!! error TS1030: 'export' modifier already seen. diff --git a/tests/baselines/reference/exportAssignClassAndModule.errors.txt b/tests/baselines/reference/exportAssignClassAndModule.errors.txt new file mode 100644 index 0000000000000..057f880f3c4e2 --- /dev/null +++ b/tests/baselines/reference/exportAssignClassAndModule.errors.txt @@ -0,0 +1,22 @@ +exportAssignClassAndModule_0.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportAssignClassAndModule_1.ts (0 errors) ==== + /// + import Foo = require('./exportAssignClassAndModule_0'); + + var z: Foo.Bar; + var zz: Foo; + zz.x; +==== exportAssignClassAndModule_0.ts (1 errors) ==== + class Foo { + x: Foo.Bar; + } + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Bar { + } + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignValueAndType.errors.txt b/tests/baselines/reference/exportAssignValueAndType.errors.txt new file mode 100644 index 0000000000000..8032f4e6efbf9 --- /dev/null +++ b/tests/baselines/reference/exportAssignValueAndType.errors.txt @@ -0,0 +1,20 @@ +exportAssignValueAndType.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportAssignValueAndType.ts (1 errors) ==== + declare module http { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Server { openPort: number; } + } + + interface server { + (): http.Server; + startTime: Date; + } + + var x = 5; + var server = new Date(); + export = server; + + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentCircularModules.errors.txt b/tests/baselines/reference/exportAssignmentCircularModules.errors.txt new file mode 100644 index 0000000000000..dd8e60e645d33 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentCircularModules.errors.txt @@ -0,0 +1,32 @@ +foo_0.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +foo_1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +foo_2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_2.ts (1 errors) ==== + import foo0 = require("./foo_0"); + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = foo0.x; + } + export = Foo; + +==== foo_0.ts (1 errors) ==== + import foo1 = require('./foo_1'); + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = foo1.x; + } + export = Foo; + +==== foo_1.ts (1 errors) ==== + import foo2 = require("./foo_2"); + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = foo2.x; + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentCircularModules.types b/tests/baselines/reference/exportAssignmentCircularModules.types index 7756674cf27ec..2c147fd2d8f97 100644 --- a/tests/baselines/reference/exportAssignmentCircularModules.types +++ b/tests/baselines/reference/exportAssignmentCircularModules.types @@ -11,7 +11,9 @@ module Foo { export var x = foo0.x; >x : any +> : ^^^ >foo0.x : any +> : ^^^ >foo0 : typeof foo0 > : ^^^^^^^^^^^ >x : any @@ -32,7 +34,9 @@ module Foo { export var x = foo1.x; >x : any +> : ^^^ >foo1.x : any +> : ^^^ >foo1 : typeof foo1 > : ^^^^^^^^^^^ >x : any @@ -53,7 +57,9 @@ module Foo { export var x = foo2.x; >x : any +> : ^^^ >foo2.x : any +> : ^^^ >foo2 : typeof foo2 > : ^^^^^^^^^^^ >x : any diff --git a/tests/baselines/reference/exportAssignmentError.errors.txt b/tests/baselines/reference/exportAssignmentError.errors.txt new file mode 100644 index 0000000000000..5aab8898ed3a3 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentError.errors.txt @@ -0,0 +1,14 @@ +exportEqualsModule_A.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportEqualsModule_A.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + + import M2 = M; + + export = M2; // should not error + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentError.types b/tests/baselines/reference/exportAssignmentError.types index dc19391c09d90..a9333cffc3293 100644 --- a/tests/baselines/reference/exportAssignmentError.types +++ b/tests/baselines/reference/exportAssignmentError.types @@ -7,6 +7,7 @@ module M { export var x; >x : any +> : ^^^ } import M2 = M; diff --git a/tests/baselines/reference/exportAssignmentInternalModule.errors.txt b/tests/baselines/reference/exportAssignmentInternalModule.errors.txt new file mode 100644 index 0000000000000..afb212ae4f521 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInternalModule.errors.txt @@ -0,0 +1,16 @@ +exportAssignmentInternalModule_A.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportAssignmentInternalModule_B.ts (0 errors) ==== + import modM = require("exportAssignmentInternalModule_A"); + + var n: number = modM.x; +==== exportAssignmentInternalModule_A.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + + export = M; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentInternalModule.types b/tests/baselines/reference/exportAssignmentInternalModule.types index 8485df8d8a41b..1a1854d7b03f6 100644 --- a/tests/baselines/reference/exportAssignmentInternalModule.types +++ b/tests/baselines/reference/exportAssignmentInternalModule.types @@ -9,6 +9,7 @@ var n: number = modM.x; >n : number > : ^^^^^^ >modM.x : any +> : ^^^ >modM : typeof modM > : ^^^^^^^^^^^ >x : any @@ -21,6 +22,7 @@ module M { export var x; >x : any +> : ^^^ } export = M; diff --git a/tests/baselines/reference/exportAssignmentMergedModule.errors.txt b/tests/baselines/reference/exportAssignmentMergedModule.errors.txt new file mode 100644 index 0000000000000..acfccd6341b72 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedModule.errors.txt @@ -0,0 +1,34 @@ +foo_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +foo_0.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +foo_0.ts(11,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + var a: number = foo.a(); + if(!!foo.b){ + foo.Test.answer = foo.c(42); + } +==== foo_0.ts (3 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function a(){ + return 5; + } + export var b = true; + } + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function c(a: number){ + return a; + } + export module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var answer = 42; + } + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.errors.txt b/tests/baselines/reference/exportAssignmentTopLevelClodule.errors.txt new file mode 100644 index 0000000000000..eca7d20a96a8e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.errors.txt @@ -0,0 +1,20 @@ +foo_0.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + if(foo.answer === 42){ + var x = new foo(); + } + +==== foo_0.ts (1 errors) ==== + class Foo { + test = "test"; + } + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var answer = 42; + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.errors.txt b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.errors.txt new file mode 100644 index 0000000000000..a612c32518227 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.errors.txt @@ -0,0 +1,21 @@ +foo_0.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + var color: foo; + if(color === foo.green){ + color = foo.answer; + } + +==== foo_0.ts (1 errors) ==== + enum foo { + red, green, blue + } + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var answer = 42; + } + export = foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.errors.txt b/tests/baselines/reference/exportAssignmentTopLevelFundule.errors.txt new file mode 100644 index 0000000000000..3b746665765f6 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.errors.txt @@ -0,0 +1,20 @@ +foo_0.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + if(foo.answer === 42){ + var x = foo(); + } + +==== foo_0.ts (1 errors) ==== + function foo() { + return "test"; + } + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var answer = 42; + } + export = foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.errors.txt b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.errors.txt new file mode 100644 index 0000000000000..0fc9c10e41849 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.errors.txt @@ -0,0 +1,17 @@ +foo_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo_1.ts (0 errors) ==== + import foo = require("./foo_0"); + if(foo.answer === 42){ + + } + +==== foo_0.ts (1 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var answer = 42; + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.errors.txt b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.errors.txt new file mode 100644 index 0000000000000..2418ebe371f42 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.errors.txt @@ -0,0 +1,30 @@ +exportAssignmentWithImportStatementPrivacyError.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportAssignmentWithImportStatementPrivacyError.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportAssignmentWithImportStatementPrivacyError.ts (2 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface connectModule { + (res, req, next): void; + } + export interface connectExport { + use: (mod: connectModule) => connectExport; + listen: (port: number) => void; + } + + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var server: { + (): m2.connectExport; + test1: m2.connectModule; + test2(): m2.connectModule; + }; + } + import M22 = M; + + export = M; \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types index 508a4f38e5dbf..de52ca6a72f8b 100644 --- a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types @@ -5,8 +5,11 @@ module m2 { export interface connectModule { (res, req, next): void; >res : any +> : ^^^ >req : any +> : ^^^ >next : any +> : ^^^ } export interface connectExport { use: (mod: connectModule) => connectExport; diff --git a/tests/baselines/reference/exportCodeGen.errors.txt b/tests/baselines/reference/exportCodeGen.errors.txt new file mode 100644 index 0000000000000..cd6ac359f5291 --- /dev/null +++ b/tests/baselines/reference/exportCodeGen.errors.txt @@ -0,0 +1,80 @@ +exportCodeGen.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(38,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportCodeGen.ts(50,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportCodeGen.ts (8 errors) ==== + // should replace all refs to 'x' in the body, + // with fully qualified + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 12; + function lt12() { + return x < 12; + } + } + + // should not fully qualify 'x' + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 12; + function lt12() { + return x < 12; + } + } + + // not copied, since not exported + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function no() { + return false; + } + } + + // copies, since exported + module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function yes() { + return true; + } + } + + // validate all exportable statements + module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Red } + export function fn() { } + export interface I { id: number } + export class C { name: string } + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 42; + } + } + + // validate all exportable statements, + // which are not exported + module F { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + enum Color { Red } + function fn() { } + interface I { id: number } + class C { name: string } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 42; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt index 5c998d1c9e044..71fc7e0b4793a 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt +++ b/tests/baselines/reference/exportDeclarationInInternalModule.errors.txt @@ -1,17 +1,23 @@ +exportDeclarationInInternalModule.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportDeclarationInInternalModule.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportDeclarationInInternalModule.ts(13,19): error TS1141: String literal expected. -==== exportDeclarationInInternalModule.ts (1 errors) ==== +==== exportDeclarationInInternalModule.ts (3 errors) ==== class Bbb { } class Aaa extends Bbb { } module Aaa { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class SomeType { } } module Bbb { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class SomeType { } export * from Aaa; // this line causes the nullref diff --git a/tests/baselines/reference/exportDeclaredModule.errors.txt b/tests/baselines/reference/exportDeclaredModule.errors.txt new file mode 100644 index 0000000000000..2e035dccddd52 --- /dev/null +++ b/tests/baselines/reference/exportDeclaredModule.errors.txt @@ -0,0 +1,15 @@ +foo1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== foo2.ts (0 errors) ==== + import foo1 = require('./foo1'); + var x: number = foo1.b(); +==== foo1.ts (1 errors) ==== + declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a: string; + export function b(): number; + } + export = M1; + \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.errors.txt b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.errors.txt new file mode 100644 index 0000000000000..6739a6f455f0c --- /dev/null +++ b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.errors.txt @@ -0,0 +1,12 @@ +exportDefaultForNonInstantiatedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportDefaultForNonInstantiatedModule.ts (1 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface foo { + } + } + // Should not be emitted + export default m; \ No newline at end of file diff --git a/tests/baselines/reference/exportEqualErrorType.errors.txt b/tests/baselines/reference/exportEqualErrorType.errors.txt index 5215d665060f1..9f15bf768f839 100644 --- a/tests/baselines/reference/exportEqualErrorType.errors.txt +++ b/tests/baselines/reference/exportEqualErrorType.errors.txt @@ -1,3 +1,4 @@ +exportEqualErrorType_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportEqualErrorType_1.ts(3,23): error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. @@ -8,8 +9,10 @@ exportEqualErrorType_1.ts(3,23): error TS2339: Property 'static' does not exist ~~~~~~ !!! error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. -==== exportEqualErrorType_0.ts (0 errors) ==== +==== exportEqualErrorType_0.ts (1 errors) ==== module server { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface connectModule { (res, req, next): void; } diff --git a/tests/baselines/reference/exportEqualMemberMissing.errors.txt b/tests/baselines/reference/exportEqualMemberMissing.errors.txt index df228c745a393..72c62e6dd0b18 100644 --- a/tests/baselines/reference/exportEqualMemberMissing.errors.txt +++ b/tests/baselines/reference/exportEqualMemberMissing.errors.txt @@ -1,3 +1,4 @@ +exportEqualMemberMissing_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportEqualMemberMissing_1.ts(3,23): error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. @@ -8,8 +9,10 @@ exportEqualMemberMissing_1.ts(3,23): error TS2339: Property 'static' does not ex ~~~~~~ !!! error TS2339: Property 'static' does not exist on type '{ (): connectExport; foo: Date; }'. -==== exportEqualMemberMissing_0.ts (0 errors) ==== +==== exportEqualMemberMissing_0.ts (1 errors) ==== module server { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface connectModule { (res, req, next): void; } diff --git a/tests/baselines/reference/exportEqualNamespaces.errors.txt b/tests/baselines/reference/exportEqualNamespaces.errors.txt new file mode 100644 index 0000000000000..b801c359fa802 --- /dev/null +++ b/tests/baselines/reference/exportEqualNamespaces.errors.txt @@ -0,0 +1,19 @@ +exportEqualNamespaces.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportEqualNamespaces.ts (1 errors) ==== + declare module server { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Server extends Object { } + } + + interface server { + (): server.Server; + startTime: Date; + } + + var x = 5; + var server = new Date(); + export = server; + \ No newline at end of file diff --git a/tests/baselines/reference/exportImportAlias.errors.txt b/tests/baselines/reference/exportImportAlias.errors.txt new file mode 100644 index 0000000000000..13b26cbe132bf --- /dev/null +++ b/tests/baselines/reference/exportImportAlias.errors.txt @@ -0,0 +1,98 @@ +exportImportAlias.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(30,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(46,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(51,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAlias.ts(60,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportImportAlias.ts (9 errors) ==== + // expect no errors here + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export var x = 'hello world' + export class Point { + constructor(public x: number, public y: number) { } + } + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Id { + name: string; + } + } + } + + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import a = A; + } + + var a: string = C.a.x; + var b: { x: number; y: number; } = new C.a.Point(0, 0); + var c: { name: string }; + var c: C.a.B.Id; + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function Y() { + return 42; + } + + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + } + } + } + + module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // 'y' should be a fundule here + export import y = X.Y; + } + + var m: number = Z.y(); + var n: { x: number; y: number; } = new Z.y.Point(0, 0); + + module K { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class L { + constructor(public name: string) { } + } + + export module L { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var y = 12; + export interface Point { + x: number; + y: number; + } + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import D = K.L; + } + + var o: { name: string }; + var o = new M.D('Hello'); + + var p: { x: number; y: number; } + var p: M.D.Point; \ No newline at end of file diff --git a/tests/baselines/reference/exportImportAndClodule.errors.txt b/tests/baselines/reference/exportImportAndClodule.errors.txt new file mode 100644 index 0000000000000..42340e8206f8d --- /dev/null +++ b/tests/baselines/reference/exportImportAndClodule.errors.txt @@ -0,0 +1,31 @@ +exportImportAndClodule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAndClodule.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportAndClodule.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportImportAndClodule.ts (3 errors) ==== + module K { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class L { + constructor(public name: string) { } + } + export module L { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var y = 12; + export interface Point { + x: number; + y: number; + } + } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import D = K.L; + } + var o: { name: string }; + var o = new M.D('Hello'); + var p: { x: number; y: number; } + var p: M.D.Point; \ No newline at end of file diff --git a/tests/baselines/reference/exportImportCanSubstituteConstEnumForValue.errors.txt b/tests/baselines/reference/exportImportCanSubstituteConstEnumForValue.errors.txt new file mode 100644 index 0000000000000..e28bfe36e8c48 --- /dev/null +++ b/tests/baselines/reference/exportImportCanSubstituteConstEnumForValue.errors.txt @@ -0,0 +1,76 @@ +exportImportCanSubstituteConstEnumForValue.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportCanSubstituteConstEnumForValue.ts(1,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportCanSubstituteConstEnumForValue.ts(1,30): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportCanSubstituteConstEnumForValue.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportCanSubstituteConstEnumForValue.ts(31,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportImportCanSubstituteConstEnumForValue.ts (5 errors) ==== + module MsPortalFx.ViewModels.Dialogs { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export const enum DialogResult { + Abort, + Cancel, + Ignore, + No, + Ok, + Retry, + Yes, + } + + export interface DialogResultCallback { + (result: MsPortalFx.ViewModels.Dialogs.DialogResult): void; + } + + export function someExportedFunction() { + } + + export const enum MessageBoxButtons { + AbortRetryIgnore, + OK, + OKCancel, + RetryCancel, + YesNo, + YesNoCancel, + } + } + + + module MsPortalFx.ViewModels { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + /** + * For some reason javascript code is emitted for this re-exported const enum. + */ + export import ReExportedEnum = Dialogs.DialogResult; + + /** + * Not exported to show difference. No javascript is emmitted (as expected) + */ + import DialogButtons = Dialogs.MessageBoxButtons; + + /** + * Re-exporting a function type to show difference. No javascript is emmitted (as expected) + */ + export import Callback = Dialogs.DialogResultCallback; + + export class SomeUsagesOfTheseConsts { + constructor() { + // these do get replaced by the const value + const value1 = ReExportedEnum.Cancel; + console.log(value1); + const value2 = DialogButtons.OKCancel; + console.log(value2); + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.errors.txt b/tests/baselines/reference/exportImportNonInstantiatedModule.errors.txt new file mode 100644 index 0000000000000..9066d8712fce0 --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.errors.txt @@ -0,0 +1,19 @@ +exportImportNonInstantiatedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportImportNonInstantiatedModule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportImportNonInstantiatedModule.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { x: number } + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import A1 = A + + } + + var x: B.A1.I = { x: 1 }; \ No newline at end of file diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index e85469e47b979..afb1fd5cb0d12 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -14,7 +14,8 @@ module B { export import A1 = A >A1 : any > : ^^^ ->A : error +>A : any +> : ^^^ } diff --git a/tests/baselines/reference/exportNonInitializedVariablesAMD.errors.txt b/tests/baselines/reference/exportNonInitializedVariablesAMD.errors.txt index 6b757c89a9ea9..b8d308002e3c8 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesAMD.errors.txt +++ b/tests/baselines/reference/exportNonInitializedVariablesAMD.errors.txt @@ -2,9 +2,10 @@ exportNonInitializedVariablesAMD.ts(1,4): error TS1123: Variable declaration lis exportNonInitializedVariablesAMD.ts(2,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. exportNonInitializedVariablesAMD.ts(2,1): error TS2304: Cannot find name 'let'. exportNonInitializedVariablesAMD.ts(3,6): error TS1123: Variable declaration list cannot be empty. +exportNonInitializedVariablesAMD.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportNonInitializedVariablesAMD.ts (4 errors) ==== +==== exportNonInitializedVariablesAMD.ts (5 errors) ==== var; !!! error TS1123: Variable declaration list cannot be empty. @@ -31,6 +32,8 @@ exportNonInitializedVariablesAMD.ts(3,6): error TS1123: Variable declaration lis } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.errors.txt b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.errors.txt index bdaf0bed5877e..9bcd27186ecc7 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesCommonJS.errors.txt +++ b/tests/baselines/reference/exportNonInitializedVariablesCommonJS.errors.txt @@ -2,9 +2,10 @@ exportNonInitializedVariablesCommonJS.ts(1,4): error TS1123: Variable declaratio exportNonInitializedVariablesCommonJS.ts(2,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. exportNonInitializedVariablesCommonJS.ts(2,1): error TS2304: Cannot find name 'let'. exportNonInitializedVariablesCommonJS.ts(3,6): error TS1123: Variable declaration list cannot be empty. +exportNonInitializedVariablesCommonJS.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportNonInitializedVariablesCommonJS.ts (4 errors) ==== +==== exportNonInitializedVariablesCommonJS.ts (5 errors) ==== var; !!! error TS1123: Variable declaration list cannot be empty. @@ -31,6 +32,8 @@ exportNonInitializedVariablesCommonJS.ts(3,6): error TS1123: Variable declaratio } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/exportNonInitializedVariablesES6.errors.txt b/tests/baselines/reference/exportNonInitializedVariablesES6.errors.txt index 69dbc8538bb77..c57b393d12f09 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesES6.errors.txt +++ b/tests/baselines/reference/exportNonInitializedVariablesES6.errors.txt @@ -2,9 +2,10 @@ exportNonInitializedVariablesES6.ts(1,4): error TS1123: Variable declaration lis exportNonInitializedVariablesES6.ts(2,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. exportNonInitializedVariablesES6.ts(2,1): error TS2304: Cannot find name 'let'. exportNonInitializedVariablesES6.ts(3,6): error TS1123: Variable declaration list cannot be empty. +exportNonInitializedVariablesES6.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportNonInitializedVariablesES6.ts (4 errors) ==== +==== exportNonInitializedVariablesES6.ts (5 errors) ==== var; !!! error TS1123: Variable declaration list cannot be empty. @@ -31,6 +32,8 @@ exportNonInitializedVariablesES6.ts(3,6): error TS1123: Variable declaration lis } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/exportNonInitializedVariablesSystem.errors.txt b/tests/baselines/reference/exportNonInitializedVariablesSystem.errors.txt index 87936e80db087..275a5442c71c0 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesSystem.errors.txt +++ b/tests/baselines/reference/exportNonInitializedVariablesSystem.errors.txt @@ -2,9 +2,10 @@ exportNonInitializedVariablesSystem.ts(1,4): error TS1123: Variable declaration exportNonInitializedVariablesSystem.ts(2,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. exportNonInitializedVariablesSystem.ts(2,1): error TS2304: Cannot find name 'let'. exportNonInitializedVariablesSystem.ts(3,6): error TS1123: Variable declaration list cannot be empty. +exportNonInitializedVariablesSystem.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportNonInitializedVariablesSystem.ts (4 errors) ==== +==== exportNonInitializedVariablesSystem.ts (5 errors) ==== var; !!! error TS1123: Variable declaration list cannot be empty. @@ -31,6 +32,8 @@ exportNonInitializedVariablesSystem.ts(3,6): error TS1123: Variable declaration } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/exportNonInitializedVariablesUMD.errors.txt b/tests/baselines/reference/exportNonInitializedVariablesUMD.errors.txt index d3139867a14d7..e28e8f57f03f3 100644 --- a/tests/baselines/reference/exportNonInitializedVariablesUMD.errors.txt +++ b/tests/baselines/reference/exportNonInitializedVariablesUMD.errors.txt @@ -2,9 +2,10 @@ exportNonInitializedVariablesUMD.ts(1,4): error TS1123: Variable declaration lis exportNonInitializedVariablesUMD.ts(2,1): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode. exportNonInitializedVariablesUMD.ts(2,1): error TS2304: Cannot find name 'let'. exportNonInitializedVariablesUMD.ts(3,6): error TS1123: Variable declaration list cannot be empty. +exportNonInitializedVariablesUMD.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportNonInitializedVariablesUMD.ts (4 errors) ==== +==== exportNonInitializedVariablesUMD.ts (5 errors) ==== var; !!! error TS1123: Variable declaration list cannot be empty. @@ -31,6 +32,8 @@ exportNonInitializedVariablesUMD.ts(3,6): error TS1123: Variable declaration lis } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1, b, c = 2; export var x, y, z; } diff --git a/tests/baselines/reference/exportPrivateType.errors.txt b/tests/baselines/reference/exportPrivateType.errors.txt new file mode 100644 index 0000000000000..eb29066cdab64 --- /dev/null +++ b/tests/baselines/reference/exportPrivateType.errors.txt @@ -0,0 +1,36 @@ +exportPrivateType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportPrivateType.ts (1 errors) ==== + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C1 { + x: string; + y: C1; + } + + class C2 { + test() { return true; } + } + + interface I1 { + (a: string, b: string): string; + (x: number, y: number): I1; + } + + interface I2 { + x: string; + y: number; + } + + // None of the types are exported, so per section 10.3, should all be errors + export var e: C1; + export var f: I1; + export var g: C2; + export var h: I2; + } + + var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'. + + \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.errors.txt b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.errors.txt new file mode 100644 index 0000000000000..2d67f2ee8023e --- /dev/null +++ b/tests/baselines/reference/exportSpecifierAndExportedMemberDeclaration.errors.txt @@ -0,0 +1,18 @@ +exportSpecifierAndExportedMemberDeclaration.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== exportSpecifierAndExportedMemberDeclaration.ts (1 errors) ==== + declare module "m2" { + export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface I { } + } + function Y(); + export { Y as X }; + function Z(): X.I; + } + + declare module "m2" { + function Z2(): X.I; + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt index 7c8cdd2db914b..bb0e707f14e16 100644 --- a/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt +++ b/tests/baselines/reference/exportSpecifierAndLocalMemberDeclaration.errors.txt @@ -1,9 +1,12 @@ +exportSpecifierAndLocalMemberDeclaration.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportSpecifierAndLocalMemberDeclaration.ts(11,20): error TS2503: Cannot find namespace 'X'. -==== exportSpecifierAndLocalMemberDeclaration.ts (1 errors) ==== +==== exportSpecifierAndLocalMemberDeclaration.ts (2 errors) ==== declare module "m2" { module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I { } } function Y(); diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt index d243086c7540e..d9584fadc1264 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt @@ -1,8 +1,11 @@ +exportSpecifierReferencingOuterDeclaration1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportSpecifierReferencingOuterDeclaration1.ts(3,14): error TS2661: Cannot export 'X'. Only local declarations can be exported from a module. -==== exportSpecifierReferencingOuterDeclaration1.ts (1 errors) ==== +==== exportSpecifierReferencingOuterDeclaration1.ts (2 errors) ==== declare module X { export interface bar { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module "m" { export { X }; ~ diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt index 3838a6a4dc54a..2c5173a94bc49 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt @@ -1,8 +1,11 @@ +exportSpecifierReferencingOuterDeclaration2_A.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportSpecifierReferencingOuterDeclaration2_B.ts(1,10): error TS2661: Cannot export 'X'. Only local declarations can be exported from a module. -==== exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== +==== exportSpecifierReferencingOuterDeclaration2_A.ts (1 errors) ==== declare module X { export interface bar { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ==== exportSpecifierReferencingOuterDeclaration2_B.ts (1 errors) ==== export { X }; diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt index deefe8cb768ef..b3156ea69b019 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt @@ -1,10 +1,16 @@ +exportSpecifierReferencingOuterDeclaration3.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportSpecifierReferencingOuterDeclaration3.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2694: Namespace 'X' has no exported member 'bar'. -==== exportSpecifierReferencingOuterDeclaration3.ts (1 errors) ==== +==== exportSpecifierReferencingOuterDeclaration3.ts (3 errors) ==== declare module X { export interface bar { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module "m" { module X { export interface foo { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export { X }; export function foo(): X.foo; export function bar(): X.bar; // error diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt index 15a7fa2ae9327..23f7c26a5b635 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt @@ -1,11 +1,17 @@ +exportSpecifierReferencingOuterDeclaration2_A.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +exportSpecifierReferencingOuterDeclaration2_B.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2694: Namespace 'X' has no exported member 'bar'. -==== exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== +==== exportSpecifierReferencingOuterDeclaration2_A.ts (1 errors) ==== declare module X { export interface bar { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== exportSpecifierReferencingOuterDeclaration2_B.ts (1 errors) ==== +==== exportSpecifierReferencingOuterDeclaration2_B.ts (2 errors) ==== declare module X { export interface foo { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export { X }; export declare function foo(): X.foo; export declare function bar(): X.bar; // error diff --git a/tests/baselines/reference/exportsAndImports1-amd.errors.txt b/tests/baselines/reference/exportsAndImports1-amd.errors.txt new file mode 100644 index 0000000000000..9dded8a70913f --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1-amd.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + var v = 1; + function f() { } + class C { + } + interface I { + } + enum E { + A, B, C + } + const enum D { + A, B, C + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + type T = number; + import a = M.x; + + export { v, f, C, I, E, D, M, N, T, a }; + +==== t2.ts (0 errors) ==== + export { v, f, C, I, E, D, M, N, T, a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v, f, C, I, E, D, M, N, T, a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports1-amd.types b/tests/baselines/reference/exportsAndImports1-amd.types index 3edfb621fe651..1eb82483d7e5f 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.types +++ b/tests/baselines/reference/exportsAndImports1-amd.types @@ -47,6 +47,7 @@ module M { export var x; >x : any +> : ^^^ } module N { export interface I { diff --git a/tests/baselines/reference/exportsAndImports1-es6.errors.txt b/tests/baselines/reference/exportsAndImports1-es6.errors.txt new file mode 100644 index 0000000000000..9dded8a70913f --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1-es6.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + var v = 1; + function f() { } + class C { + } + interface I { + } + enum E { + A, B, C + } + const enum D { + A, B, C + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + type T = number; + import a = M.x; + + export { v, f, C, I, E, D, M, N, T, a }; + +==== t2.ts (0 errors) ==== + export { v, f, C, I, E, D, M, N, T, a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v, f, C, I, E, D, M, N, T, a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports1-es6.types b/tests/baselines/reference/exportsAndImports1-es6.types index 2c73306443a96..1487ad1e2da2f 100644 --- a/tests/baselines/reference/exportsAndImports1-es6.types +++ b/tests/baselines/reference/exportsAndImports1-es6.types @@ -47,6 +47,7 @@ module M { export var x; >x : any +> : ^^^ } module N { export interface I { diff --git a/tests/baselines/reference/exportsAndImports1.errors.txt b/tests/baselines/reference/exportsAndImports1.errors.txt new file mode 100644 index 0000000000000..9dded8a70913f --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + var v = 1; + function f() { } + class C { + } + interface I { + } + enum E { + A, B, C + } + const enum D { + A, B, C + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + type T = number; + import a = M.x; + + export { v, f, C, I, E, D, M, N, T, a }; + +==== t2.ts (0 errors) ==== + export { v, f, C, I, E, D, M, N, T, a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v, f, C, I, E, D, M, N, T, a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports1.types b/tests/baselines/reference/exportsAndImports1.types index 12d4e6297502c..fbf868fbb37d0 100644 --- a/tests/baselines/reference/exportsAndImports1.types +++ b/tests/baselines/reference/exportsAndImports1.types @@ -47,6 +47,7 @@ module M { export var x; >x : any +> : ^^^ } module N { export interface I { diff --git a/tests/baselines/reference/exportsAndImports3-amd.errors.txt b/tests/baselines/reference/exportsAndImports3-amd.errors.txt new file mode 100644 index 0000000000000..51e29e01201c9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3-amd.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + export var v = 1; + export function f() { } + export class C { + } + export interface I { + } + export enum E { + A, B, C + } + export const enum D { + A, B, C + } + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + export type T = number; + export import a = M.x; + + export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; + +==== t2.ts (0 errors) ==== + export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports3-amd.types b/tests/baselines/reference/exportsAndImports3-amd.types index 2db1dd72527e5..a840af407a91c 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.types +++ b/tests/baselines/reference/exportsAndImports3-amd.types @@ -47,6 +47,7 @@ export module M { export var x; >x : any +> : ^^^ } export module N { export interface I { diff --git a/tests/baselines/reference/exportsAndImports3-es6.errors.txt b/tests/baselines/reference/exportsAndImports3-es6.errors.txt new file mode 100644 index 0000000000000..51e29e01201c9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3-es6.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + export var v = 1; + export function f() { } + export class C { + } + export interface I { + } + export enum E { + A, B, C + } + export const enum D { + A, B, C + } + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + export type T = number; + export import a = M.x; + + export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; + +==== t2.ts (0 errors) ==== + export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports3-es6.types b/tests/baselines/reference/exportsAndImports3-es6.types index 255d7190be20b..a13b92a132285 100644 --- a/tests/baselines/reference/exportsAndImports3-es6.types +++ b/tests/baselines/reference/exportsAndImports3-es6.types @@ -47,6 +47,7 @@ export module M { export var x; >x : any +> : ^^^ } export module N { export interface I { diff --git a/tests/baselines/reference/exportsAndImports3.errors.txt b/tests/baselines/reference/exportsAndImports3.errors.txt new file mode 100644 index 0000000000000..51e29e01201c9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3.errors.txt @@ -0,0 +1,40 @@ +t1.ts(13,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +t1.ts(16,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== t1.ts (2 errors) ==== + export var v = 1; + export function f() { } + export class C { + } + export interface I { + } + export enum E { + A, B, C + } + export const enum D { + A, B, C + } + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + export type T = number; + export import a = M.x; + + export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; + +==== t2.ts (0 errors) ==== + export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + +==== t3.ts (0 errors) ==== + import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; + export { v, f, C, I, E, D, M, N, T, a }; + \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports3.types b/tests/baselines/reference/exportsAndImports3.types index c228060b0bab8..585bbc1f8cae2 100644 --- a/tests/baselines/reference/exportsAndImports3.types +++ b/tests/baselines/reference/exportsAndImports3.types @@ -47,6 +47,7 @@ export module M { export var x; >x : any +> : ^^^ } export module N { export interface I { diff --git a/tests/baselines/reference/extBaseClass1.errors.txt b/tests/baselines/reference/extBaseClass1.errors.txt new file mode 100644 index 0000000000000..c7a6bf3d48c0f --- /dev/null +++ b/tests/baselines/reference/extBaseClass1.errors.txt @@ -0,0 +1,31 @@ +extBaseClass1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +extBaseClass1.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +extBaseClass1.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== extBaseClass1.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class B { + public x=10; + } + + export class C extends B { + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C2 extends B { + } + } + + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C3 extends M.B { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/extBaseClass2.errors.txt b/tests/baselines/reference/extBaseClass2.errors.txt index 041ec321416c6..79eb9884ea42a 100644 --- a/tests/baselines/reference/extBaseClass2.errors.txt +++ b/tests/baselines/reference/extBaseClass2.errors.txt @@ -1,9 +1,13 @@ +extBaseClass2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. extBaseClass2.ts(2,31): error TS2339: Property 'B' does not exist on type 'typeof M'. +extBaseClass2.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'. -==== extBaseClass2.ts (2 errors) ==== +==== extBaseClass2.ts (4 errors) ==== module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C4 extends M.B { ~ !!! error TS2339: Property 'B' does not exist on type 'typeof M'. @@ -11,6 +15,8 @@ extBaseClass2.ts(7,29): error TS2304: Cannot find name 'B'. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C5 extends B { ~ !!! error TS2304: Cannot find name 'B'. diff --git a/tests/baselines/reference/extendArray.errors.txt b/tests/baselines/reference/extendArray.errors.txt index a989fcae00b96..01b95b9251c43 100644 --- a/tests/baselines/reference/extendArray.errors.txt +++ b/tests/baselines/reference/extendArray.errors.txt @@ -1,13 +1,16 @@ +extendArray.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. extendArray.ts(7,19): error TS2552: Cannot find name '_element'. Did you mean 'Element'? extendArray.ts(7,32): error TS2552: Cannot find name '_element'. Did you mean 'Element'? -==== extendArray.ts (2 errors) ==== +==== extendArray.ts (3 errors) ==== var a = [1,2]; a.forEach(function (v,i,a) {}); declare module _Core { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Array { collect(fn:(e:_element) => _element[]) : any[]; ~~~~~~~~ diff --git a/tests/baselines/reference/extension.errors.txt b/tests/baselines/reference/extension.errors.txt index 9b1d5d7f597e6..f64f4168db6ae 100644 --- a/tests/baselines/reference/extension.errors.txt +++ b/tests/baselines/reference/extension.errors.txt @@ -1,4 +1,6 @@ +extension.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. extension.ts(10,18): error TS2300: Duplicate identifier 'C'. +extension.ts(15,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. extension.ts(16,5): error TS1128: Declaration or statement expected. extension.ts(16,12): error TS1434: Unexpected keyword or identifier. extension.ts(16,12): error TS2304: Cannot find name 'extension'. @@ -6,7 +8,7 @@ extension.ts(16,28): error TS2300: Duplicate identifier 'C'. extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'. -==== extension.ts (6 errors) ==== +==== extension.ts (8 errors) ==== interface I { x; } @@ -16,6 +18,8 @@ extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'. } declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { ~ !!! error TS2300: Duplicate identifier 'C'. @@ -24,6 +28,8 @@ extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'. } declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export extension class C { ~~~~~~ !!! error TS1128: Declaration or statement expected. diff --git a/tests/baselines/reference/externModuleClobber.errors.txt b/tests/baselines/reference/externModuleClobber.errors.txt new file mode 100644 index 0000000000000..8e925e26c49b7 --- /dev/null +++ b/tests/baselines/reference/externModuleClobber.errors.txt @@ -0,0 +1,19 @@ +externModuleClobber.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== externModuleClobber.ts (1 errors) ==== + declare module EM { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Position { } + + export class EC { + public getPosition() : EM.Position; + } + } + + var x:EM.Position; + var ec:EM.EC = new EM.EC(); + + x = ec.getPosition(); + \ No newline at end of file diff --git a/tests/baselines/reference/externSyntax.errors.txt b/tests/baselines/reference/externSyntax.errors.txt index 561dcf62ecad8..4b8a26ca50fc7 100644 --- a/tests/baselines/reference/externSyntax.errors.txt +++ b/tests/baselines/reference/externSyntax.errors.txt @@ -1,9 +1,12 @@ +externSyntax.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. externSyntax.ts(8,20): error TS1183: An implementation cannot be declared in ambient contexts. -==== externSyntax.ts (1 errors) ==== +==== externSyntax.ts (2 errors) ==== declare var v; declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D { public p; } diff --git a/tests/baselines/reference/externalModuleResolution.errors.txt b/tests/baselines/reference/externalModuleResolution.errors.txt new file mode 100644 index 0000000000000..dcc088f1dc0e9 --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution.errors.txt @@ -0,0 +1,20 @@ +foo.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consumer.ts (0 errors) ==== + import x = require('./foo'); + x.Y // .ts should be picked +==== foo.d.ts (0 errors) ==== + declare module M1 { + export var X:number; + } + export = M1 + +==== foo.ts (1 errors) ==== + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Y = 1; + } + export = M2 + \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleResolution2.errors.txt b/tests/baselines/reference/externalModuleResolution2.errors.txt new file mode 100644 index 0000000000000..265dbe53f0e5f --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution2.errors.txt @@ -0,0 +1,21 @@ +foo.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consumer.ts (0 errors) ==== + import x = require('./foo'); + x.X // .ts should be picked +==== foo.ts (1 errors) ==== + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var X = 1; + } + export = M2 + +==== foo.d.ts (0 errors) ==== + declare module M1 { + export var Y:number; + } + export = M1 + + \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt new file mode 100644 index 0000000000000..dd31c64a975ff --- /dev/null +++ b/tests/baselines/reference/externalModuleWithoutCompilerFlag1.errors.txt @@ -0,0 +1,9 @@ +externalModuleWithoutCompilerFlag1.ts(2,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== externalModuleWithoutCompilerFlag1.ts (1 errors) ==== + // Not on line 0 because we want to verify the error is placed in the appropriate location. + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/fatArrowSelf.errors.txt b/tests/baselines/reference/fatArrowSelf.errors.txt new file mode 100644 index 0000000000000..3eb2d8e05a9c4 --- /dev/null +++ b/tests/baselines/reference/fatArrowSelf.errors.txt @@ -0,0 +1,33 @@ +fatArrowSelf.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +fatArrowSelf.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== fatArrowSelf.ts (2 errors) ==== + module Events { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface ListenerCallback { + (value:any):void; + } + export class EventEmitter { + public addListener(type:string, listener:ListenerCallback) { + } + } + } + + module Consumer { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class EventEmitterConsummer { + constructor (private emitter: Events.EventEmitter) { } + + private register() { + this.emitter.addListener('change', (e) => { + this.changed(); + }); + } + + private changed() { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 3df444eebca09..07baa6946b4c5 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -8,6 +8,7 @@ module Events { export interface ListenerCallback { (value:any):void; >value : any +> : ^^^ } export class EventEmitter { >EventEmitter : EventEmitter @@ -60,6 +61,7 @@ module Consumer { >(e) => { this.changed(); } : (e: any) => void > : ^ ^^^^^^^^^^^^^^ >e : any +> : ^^^ this.changed(); >this.changed() : void diff --git a/tests/baselines/reference/for-inStatements.errors.txt b/tests/baselines/reference/for-inStatements.errors.txt index 530e47fd2f89c..07addf8127193 100644 --- a/tests/baselines/reference/for-inStatements.errors.txt +++ b/tests/baselines/reference/for-inStatements.errors.txt @@ -3,10 +3,11 @@ for-inStatements.ts(22,15): error TS2873: This kind of expression is always fals for-inStatements.ts(23,15): error TS2872: This kind of expression is always truthy. for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'Extract'. for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'Extract'. +for-inStatements.ts(67,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'Color.Blue'. -==== for-inStatements.ts (6 errors) ==== +==== for-inStatements.ts (7 errors) ==== var aString: string; for (aString in {}) { } @@ -86,6 +87,8 @@ for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' st module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class X { name:string } diff --git a/tests/baselines/reference/forInModule.errors.txt b/tests/baselines/reference/forInModule.errors.txt new file mode 100644 index 0000000000000..558316944aefc --- /dev/null +++ b/tests/baselines/reference/forInModule.errors.txt @@ -0,0 +1,11 @@ +forInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== forInModule.ts (1 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + for (var i = 0; i < 1; i++) { + i+i; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/forStatements.errors.txt b/tests/baselines/reference/forStatements.errors.txt new file mode 100644 index 0000000000000..a1690ce67bfc3 --- /dev/null +++ b/tests/baselines/reference/forStatements.errors.txt @@ -0,0 +1,52 @@ +forStatements.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== forStatements.ts (1 errors) ==== + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + for(var aNumber: number = 9.9;;){} + for(var aString: string = 'this is a string';;){} + for(var aDate: Date = new Date(12);;){} + for(var anObject: Object = new Object();;){} + + for(var anAny: any = null;;){} + for(var aSecondAny: any = undefined;;){} + for(var aVoid: void = undefined;;){} + + for(var anInterface: I = new C();;){} + for(var aClass: C = new C();;){} + for(var aGenericClass: D = new D();;){} + for(var anObjectLiteral: I = { id: 12 };;){} + for(var anOtherObjectLiteral: { id: number } = new C();;){} + + for(var aFunction: typeof F = F;;){} + for(var anOtherFunction: (x: string) => number = F;;){} + for(var aLambda: typeof F = (x) => 2;;){} + + for(var aModule: typeof M = M;;){} + for(var aClassInModule: M.A = new M.A();;){} + for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} \ No newline at end of file diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index 2d9fdfc3b34bc..f011966c2736a 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -101,9 +101,11 @@ for(var anObject: Object = new Object();;){} for(var anAny: any = null;;){} >anAny : any +> : ^^^ for(var aSecondAny: any = undefined;;){} >aSecondAny : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index 8eb8b69489c33..89280cf1736c0 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -1,3 +1,4 @@ +forStatementsMultipleInvalidDecl.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. @@ -12,7 +13,7 @@ forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable de forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. -==== forStatementsMultipleInvalidDecl.ts (12 errors) ==== +==== forStatementsMultipleInvalidDecl.ts (13 errors) ==== interface I { id: number; } @@ -35,6 +36,8 @@ forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable de function F(x: string): number { return 42; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { name: string; } diff --git a/tests/baselines/reference/forgottenNew.errors.txt b/tests/baselines/reference/forgottenNew.errors.txt index aaa789b259c71..6dc8d3b43a63d 100644 --- a/tests/baselines/reference/forgottenNew.errors.txt +++ b/tests/baselines/reference/forgottenNew.errors.txt @@ -1,8 +1,11 @@ +forgottenNew.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. forgottenNew.ts(5,14): error TS2348: Value of type 'typeof NullLogger' is not callable. Did you mean to include 'new'? -==== forgottenNew.ts (1 errors) ==== +==== forgottenNew.ts (2 errors) ==== module Tools { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class NullLogger { } } diff --git a/tests/baselines/reference/funClodule.errors.txt b/tests/baselines/reference/funClodule.errors.txt index 7bdb4d0311a0b..00260f079b711 100644 --- a/tests/baselines/reference/funClodule.errors.txt +++ b/tests/baselines/reference/funClodule.errors.txt @@ -1,10 +1,15 @@ +funClodule.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +funClodule.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. funClodule.ts(15,10): error TS2814: Function with bodies can only merge with classes that are ambient. +funClodule.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. funClodule.ts(19,7): error TS2813: Class declaration cannot implement overload list for 'foo3'. -==== funClodule.ts (2 errors) ==== +==== funClodule.ts (5 errors) ==== declare function foo(); declare module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function x(): any; } declare class foo { } // Should error @@ -12,6 +17,8 @@ funClodule.ts(19,7): error TS2813: Class declaration cannot implement overload l declare class foo2 { } declare module foo2 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function x(): any; } declare function foo2(); // Should error @@ -22,6 +29,8 @@ funClodule.ts(19,7): error TS2813: Class declaration cannot implement overload l !!! error TS2814: Function with bodies can only merge with classes that are ambient. !!! related TS6506 funClodule.ts:19:7: Consider adding a 'declare' modifier to this class. module foo3 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function x(): any { } } class foo3 { } // Should error diff --git a/tests/baselines/reference/funcdecl.errors.txt b/tests/baselines/reference/funcdecl.errors.txt new file mode 100644 index 0000000000000..4618edffa9f73 --- /dev/null +++ b/tests/baselines/reference/funcdecl.errors.txt @@ -0,0 +1,77 @@ +funcdecl.ts(51,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== funcdecl.ts (1 errors) ==== + function simpleFunc() { + return "this is my simple func"; + } + var simpleFuncVar = simpleFunc; + + function anotherFuncNoReturn() { + } + var anotherFuncNoReturnVar = anotherFuncNoReturn; + + function withReturn() : string{ + return "Hello"; + } + var withReturnVar = withReturn; + + function withParams(a : string) : string{ + return a; + } + var withparamsVar = withParams; + + function withMultiParams(a : number, b, c: Object) { + return a; + } + var withMultiParamsVar = withMultiParams; + + function withOptionalParams(a?: string) { + } + var withOptionalParamsVar = withOptionalParams; + + function withInitializedParams(a: string, b0, b = 30, c = "string value") { + } + var withInitializedParamsVar = withInitializedParams; + + function withOptionalInitializedParams(a: string, c: string = "hello string") { + } + var withOptionalInitializedParamsVar = withOptionalInitializedParams; + + function withRestParams(a: string, ... myRestParameter : number[]) { + return myRestParameter; + } + var withRestParamsVar = withRestParams; + + function overload1(n: number) : string; + function overload1(s: string) : string; + function overload1(ns: any) { + return ns.toString(); + } + var withOverloadSignature = overload1; + + function f(n: () => void) { } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(n: () => void ) { + } + + } + + m2.foo(() => { + + var b = 30; + return b; + }); + + + declare function fooAmbient(n: number): string; + + declare function overloadAmbient(n: number): string; + declare function overloadAmbient(s: string): string; + + var f2 = () => { + return "string"; + } \ No newline at end of file diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index 8e72055ce906e..6a019504ffcff 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -61,6 +61,7 @@ function withMultiParams(a : number, b, c: Object) { >a : number > : ^^^^^^ >b : any +> : ^^^ >c : Object > : ^^^^^^ @@ -92,6 +93,7 @@ function withInitializedParams(a: string, b0, b = 30, c = "string value") { >a : string > : ^^^^^^ >b0 : any +> : ^^^ >b : number > : ^^^^^^ >30 : 30 @@ -157,10 +159,13 @@ function overload1(ns: any) { >overload1 : { (n: number): string; (s: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >ns : any +> : ^^^ return ns.toString(); >ns.toString() : any +> : ^^^ >ns.toString : any +> : ^^^ >ns : any > : ^^^ >toString : any diff --git a/tests/baselines/reference/functionCall5.errors.txt b/tests/baselines/reference/functionCall5.errors.txt new file mode 100644 index 0000000000000..3e30882eb9201 --- /dev/null +++ b/tests/baselines/reference/functionCall5.errors.txt @@ -0,0 +1,9 @@ +functionCall5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== functionCall5.ts (1 errors) ==== + module m1 { export class c1 { public a; }} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo():m1.c1{return new m1.c1();}; + var x = foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall5.types b/tests/baselines/reference/functionCall5.types index 0c9357f8a0786..cf17e2ca77c42 100644 --- a/tests/baselines/reference/functionCall5.types +++ b/tests/baselines/reference/functionCall5.types @@ -7,6 +7,7 @@ module m1 { export class c1 { public a; }} >c1 : c1 > : ^^ >a : any +> : ^^^ function foo():m1.c1{return new m1.c1();}; >foo : () => m1.c1 diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index b1bfd014fd335..b37c0ad3f2947 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,10 +1,13 @@ +functionCall7.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. functionCall7.ts(5,10): error TS2554: Expected 1 arguments, but got 2. functionCall7.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. functionCall7.ts(7,1): error TS2554: Expected 1 arguments, but got 0. -==== functionCall7.ts (3 errors) ==== +==== functionCall7.ts (4 errors) ==== module m1 { export class c1 { public a; }} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo(a:m1.c1){ a.a = 1; }; var myC = new m1.c1(); foo(myC); diff --git a/tests/baselines/reference/functionInIfStatementInModule.errors.txt b/tests/baselines/reference/functionInIfStatementInModule.errors.txt new file mode 100644 index 0000000000000..dcfe1c08f1869 --- /dev/null +++ b/tests/baselines/reference/functionInIfStatementInModule.errors.txt @@ -0,0 +1,16 @@ +functionInIfStatementInModule.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== functionInIfStatementInModule.ts (1 errors) ==== + + module Midori + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + if (false) { + function Foo(src) + { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 0c2ff67fcbeb0..fbc5420cba46d 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -14,6 +14,7 @@ module Midori >Foo : (src: any) => void > : ^ ^^^^^^^^^^^^^^ >src : any +> : ^^^ { } } diff --git a/tests/baselines/reference/functionMergedWithModule.errors.txt b/tests/baselines/reference/functionMergedWithModule.errors.txt new file mode 100644 index 0000000000000..663ed4fa80699 --- /dev/null +++ b/tests/baselines/reference/functionMergedWithModule.errors.txt @@ -0,0 +1,29 @@ +functionMergedWithModule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +functionMergedWithModule.ts(5,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +functionMergedWithModule.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +functionMergedWithModule.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== functionMergedWithModule.ts (4 errors) ==== + function foo(title: string) { + var x = 10; + } + + module foo.Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { + } + } + + module foo.Baz { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function g() { + Bar.f(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/functionNameConflicts.errors.txt b/tests/baselines/reference/functionNameConflicts.errors.txt index 47b5b1011ef0c..7fa6a1007c9a2 100644 --- a/tests/baselines/reference/functionNameConflicts.errors.txt +++ b/tests/baselines/reference/functionNameConflicts.errors.txt @@ -1,3 +1,4 @@ +functionNameConflicts.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. functionNameConflicts.ts(5,14): error TS2300: Duplicate identifier 'fn1'. functionNameConflicts.ts(6,9): error TS2300: Duplicate identifier 'fn1'. functionNameConflicts.ts(8,9): error TS2300: Duplicate identifier 'fn2'. @@ -11,11 +12,13 @@ functionNameConflicts.ts(20,9): error TS2300: Duplicate identifier 'fn5'. functionNameConflicts.ts(24,10): error TS2389: Function implementation name must be 'over'. -==== functionNameConflicts.ts (11 errors) ==== +==== functionNameConflicts.ts (12 errors) ==== //Function and variable of the same name in same declaration space //Function overload with different name from implementation signature module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function fn1() { } ~~~ !!! error TS2300: Duplicate identifier 'fn1'. diff --git a/tests/baselines/reference/functionOverloadErrors.errors.txt b/tests/baselines/reference/functionOverloadErrors.errors.txt index 74e8f5bdc790d..9333b911c1a1b 100644 --- a/tests/baselines/reference/functionOverloadErrors.errors.txt +++ b/tests/baselines/reference/functionOverloadErrors.errors.txt @@ -1,6 +1,7 @@ functionOverloadErrors.ts(2,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public, private or protected. functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public, private or protected. +functionOverloadErrors.ts(74,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or non-exported. functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or non-exported. functionOverloadErrors.ts(85,18): error TS2384: Overload signatures must all be ambient or non-ambient. @@ -11,7 +12,7 @@ functionOverloadErrors.ts(103,10): error TS2394: This overload signature is not functionOverloadErrors.ts(116,19): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -==== functionOverloadErrors.ts (11 errors) ==== +==== functionOverloadErrors.ts (12 errors) ==== //Function overload signature with initializer function fn1(x = 3); ~~~~~ @@ -92,6 +93,8 @@ functionOverloadErrors.ts(116,19): error TS2371: A parameter initializer is only //Function overloads with differing export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function fn1(); ~~~ !!! error TS2383: Overload signatures must all be exported or non-exported. diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt b/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt new file mode 100644 index 0000000000000..c0df381ec4ba3 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.errors.txt @@ -0,0 +1,17 @@ +functionTypeArgumentArrayAssignment.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== functionTypeArgumentArrayAssignment.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Array { + foo: T; + length: number; + } + + function map() { + var ys: U[] = []; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.errors.txt b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.errors.txt new file mode 100644 index 0000000000000..6c1f72d77c2a4 --- /dev/null +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.errors.txt @@ -0,0 +1,15 @@ +funduleExportedClassIsUsedBeforeDeclaration.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== funduleExportedClassIsUsedBeforeDeclaration.ts (1 errors) ==== + interface A { // interface before module declaration + (): B.C; // uses defined below class in module + } + declare function B(): B.C; // function merged with module + declare module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { // class defined in module + } + } + new B.C(); \ No newline at end of file diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.errors.txt b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..3358a815a1561 --- /dev/null +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.errors.txt @@ -0,0 +1,13 @@ +funduleOfFunctionWithoutReturnTypeAnnotation.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== funduleOfFunctionWithoutReturnTypeAnnotation.ts (1 errors) ==== + function fn() { + return fn.n; + } + module fn { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n = 1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt index f4c5c1be2c31e..598865a6854c3 100644 --- a/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt +++ b/tests/baselines/reference/funduleSplitAcrossFiles.errors.txt @@ -1,12 +1,15 @@ +funduleSplitAcrossFiles_module.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. funduleSplitAcrossFiles_module.ts(1,8): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. ==== funduleSplitAcrossFiles_function.ts (0 errors) ==== function D() { } -==== funduleSplitAcrossFiles_module.ts (1 errors) ==== +==== funduleSplitAcrossFiles_module.ts (2 errors) ==== module D { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. export var y = "hi"; } diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.errors.txt b/tests/baselines/reference/funduleUsedAcrossFileBoundary.errors.txt new file mode 100644 index 0000000000000..0777d2b7db57b --- /dev/null +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.errors.txt @@ -0,0 +1,18 @@ +funduleUsedAcrossFileBoundary_file1.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== funduleUsedAcrossFileBoundary_file1.ts (1 errors) ==== + declare function Q(value: T): string; + declare module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Promise { + foo: string; + } + export function defer(): string; + } + +==== funduleUsedAcrossFileBoundary_file2.ts (0 errors) ==== + function promiseWithCancellation(promise: Q.Promise) { + var deferred = Q.defer(); // used to be an error + } \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 36e42284cd660..5f7d7c7667a8c 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,3 +1,4 @@ +fuzzy.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C' but required in type 'I'. fuzzy.ts(21,34): error TS2322: Type 'this' is not assignable to type 'I'. @@ -6,8 +7,10 @@ fuzzy.ts(25,20): error TS2352: Conversion of type '{ oneI: this; }' to type 'R' Property 'anything' is missing in type '{ oneI: this; }' but required in type 'R'. -==== fuzzy.ts (3 errors) ==== +==== fuzzy.ts (4 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { works:()=>R; alsoWorks:()=>R; diff --git a/tests/baselines/reference/generatedContextualTyping.errors.txt b/tests/baselines/reference/generatedContextualTyping.errors.txt index a33af3a894608..9c0711c19e0b4 100644 --- a/tests/baselines/reference/generatedContextualTyping.errors.txt +++ b/tests/baselines/reference/generatedContextualTyping.errors.txt @@ -1,3 +1,27 @@ +generatedContextualTyping.ts(186,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(187,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(188,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(189,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(190,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(191,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(192,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(193,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(194,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(195,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(196,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(197,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(198,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(199,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(200,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(201,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(202,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(203,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(204,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(205,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(206,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(207,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(208,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +generatedContextualTyping.ts(209,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. generatedContextualTyping.ts(219,12): error TS2873: This kind of expression is always falsy. generatedContextualTyping.ts(220,12): error TS2873: This kind of expression is always falsy. generatedContextualTyping.ts(221,12): error TS2873: This kind of expression is always falsy. @@ -32,7 +56,7 @@ generatedContextualTyping.ts(281,36): error TS2872: This kind of expression is a generatedContextualTyping.ts(282,28): error TS2872: This kind of expression is always truthy. -==== generatedContextualTyping.ts (32 errors) ==== +==== generatedContextualTyping.ts (56 errors) ==== class Base { private p; } class Derived1 extends Base { private m; } class Derived2 extends Base { private n; } @@ -219,29 +243,77 @@ generatedContextualTyping.ts(282,28): error TS2872: This kind of expression is a var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; module x181 { var t: () => Base[] = () => [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x182 { var t: () => Base[] = function() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x184 { var t: { (): Base[]; } = () => [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x187 { var t: Base[] = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x188 { var t: Array = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x189 { var t: { [n: number]: Base; } = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x193 { export var t: () => Base[] = () => [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x199 { export var t: Base[] = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x200 { export var t: Array = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x206 = <() => Base[]>function() { return [d1, d2] }; var x207 = <() => Base[]>function named() { return [d1, d2] }; var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.errors.txt b/tests/baselines/reference/generativeRecursionWithTypeOf.errors.txt new file mode 100644 index 0000000000000..1253902a1c7c3 --- /dev/null +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.errors.txt @@ -0,0 +1,16 @@ +generativeRecursionWithTypeOf.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== generativeRecursionWithTypeOf.ts (1 errors) ==== + class C { + static foo(x: number) { } + type: T; + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f(x: typeof C) { + return new x(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorInAmbientContext2.errors.txt b/tests/baselines/reference/generatorInAmbientContext2.errors.txt index 19591506c91c5..8fd21d19daf40 100644 --- a/tests/baselines/reference/generatorInAmbientContext2.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext2.errors.txt @@ -1,8 +1,11 @@ +generatorInAmbientContext2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. generatorInAmbientContext2.ts(2,14): error TS1221: Generators are not allowed in an ambient context. -==== generatorInAmbientContext2.ts (1 errors) ==== +==== generatorInAmbientContext2.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function *generator(): any; ~ !!! error TS1221: Generators are not allowed in an ambient context. diff --git a/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt b/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt index 8f8aa092f0636..96bef75b12f95 100644 --- a/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt @@ -1,8 +1,11 @@ +generatorInAmbientContext4.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. generatorInAmbientContext4.d.ts(2,14): error TS1221: Generators are not allowed in an ambient context. -==== generatorInAmbientContext4.d.ts (1 errors) ==== +==== generatorInAmbientContext4.d.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function *generator(): any; ~ !!! error TS1221: Generators are not allowed in an ambient context. diff --git a/tests/baselines/reference/generatorInAmbientContext6.errors.txt b/tests/baselines/reference/generatorInAmbientContext6.errors.txt new file mode 100644 index 0000000000000..685750daecb65 --- /dev/null +++ b/tests/baselines/reference/generatorInAmbientContext6.errors.txt @@ -0,0 +1,9 @@ +generatorInAmbientContext6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== generatorInAmbientContext6.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function *generator(): any { } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorOverloads1.errors.txt b/tests/baselines/reference/generatorOverloads1.errors.txt index 5fd52f4cfb8d0..b0a746a416029 100644 --- a/tests/baselines/reference/generatorOverloads1.errors.txt +++ b/tests/baselines/reference/generatorOverloads1.errors.txt @@ -1,9 +1,12 @@ +generatorOverloads1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. generatorOverloads1.ts(2,13): error TS1222: An overload signature cannot be declared as a generator. generatorOverloads1.ts(3,13): error TS1222: An overload signature cannot be declared as a generator. -==== generatorOverloads1.ts (2 errors) ==== +==== generatorOverloads1.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function* f(s: string): Iterable; ~ !!! error TS1222: An overload signature cannot be declared as a generator. diff --git a/tests/baselines/reference/generatorOverloads2.errors.txt b/tests/baselines/reference/generatorOverloads2.errors.txt index eb006a1bb48c0..ba42a262fbe46 100644 --- a/tests/baselines/reference/generatorOverloads2.errors.txt +++ b/tests/baselines/reference/generatorOverloads2.errors.txt @@ -1,10 +1,13 @@ +generatorOverloads2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. generatorOverloads2.ts(2,13): error TS1221: Generators are not allowed in an ambient context. generatorOverloads2.ts(3,13): error TS1221: Generators are not allowed in an ambient context. generatorOverloads2.ts(4,13): error TS1221: Generators are not allowed in an ambient context. -==== generatorOverloads2.ts (3 errors) ==== +==== generatorOverloads2.ts (4 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function* f(s: string): Iterable; ~ !!! error TS1221: Generators are not allowed in an ambient context. diff --git a/tests/baselines/reference/generatorOverloads5.errors.txt b/tests/baselines/reference/generatorOverloads5.errors.txt new file mode 100644 index 0000000000000..b55f5c4d5a282 --- /dev/null +++ b/tests/baselines/reference/generatorOverloads5.errors.txt @@ -0,0 +1,11 @@ +generatorOverloads5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== generatorOverloads5.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function f(s: string): Iterable; + function f(s: number): Iterable; + function* f(s: any): Iterable { } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorOverloads5.types b/tests/baselines/reference/generatorOverloads5.types index c8216bc974e14..ea7f04debc4e7 100644 --- a/tests/baselines/reference/generatorOverloads5.types +++ b/tests/baselines/reference/generatorOverloads5.types @@ -21,4 +21,5 @@ module M { >f : { (s: string): Iterable; (s: number): Iterable; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >s : any +> : ^^^ } diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt index ff20d7d6c5b26..150da153d8825 100644 --- a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName.errors.txt @@ -1,12 +1,17 @@ genericAndNonGenericInterfaceWithTheSameName.ts(3,11): error TS2428: All declarations of 'A' must have identical type parameters. genericAndNonGenericInterfaceWithTheSameName.ts(7,11): error TS2428: All declarations of 'A' must have identical type parameters. +genericAndNonGenericInterfaceWithTheSameName.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericAndNonGenericInterfaceWithTheSameName.ts(12,15): error TS2428: All declarations of 'A' must have identical type parameters. genericAndNonGenericInterfaceWithTheSameName.ts(16,15): error TS2428: All declarations of 'A' must have identical type parameters. +genericAndNonGenericInterfaceWithTheSameName.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericAndNonGenericInterfaceWithTheSameName.ts(34,22): error TS2428: All declarations of 'A' must have identical type parameters. +genericAndNonGenericInterfaceWithTheSameName.ts(39,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericAndNonGenericInterfaceWithTheSameName.ts(40,22): error TS2428: All declarations of 'A' must have identical type parameters. -==== genericAndNonGenericInterfaceWithTheSameName.ts (6 errors) ==== +==== genericAndNonGenericInterfaceWithTheSameName.ts (11 errors) ==== // generic and non-generic interfaces with the same name do not merge interface A { @@ -22,6 +27,8 @@ genericAndNonGenericInterfaceWithTheSameName.ts(40,22): error TS2428: All declar } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -36,18 +43,24 @@ genericAndNonGenericInterfaceWithTheSameName.ts(40,22): error TS2428: All declar } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo: string; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { // ok, different declaration space than other M2 bar: T; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -56,6 +69,8 @@ genericAndNonGenericInterfaceWithTheSameName.ts(40,22): error TS2428: All declar } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { // error ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.errors.txt b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.errors.txt new file mode 100644 index 0000000000000..06a53be3041f8 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.errors.txt @@ -0,0 +1,45 @@ +genericAndNonGenericInterfaceWithTheSameName2.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName2.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName2.ts(16,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericAndNonGenericInterfaceWithTheSameName2.ts(22,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericAndNonGenericInterfaceWithTheSameName2.ts (5 errors) ==== + // generic and non-generic interfaces with the same name do not merge + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + bar: T; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { // ok + foo: string; + } + } + + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + bar: T; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { // ok + foo: string; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.errors.txt b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.errors.txt index ea5c26f44a5f2..ba5fc6efeed8c 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.errors.txt +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.errors.txt @@ -1,10 +1,13 @@ +genericArgumentCallSigAssignmentCompat.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericArgumentCallSigAssignmentCompat.ts(16,31): error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator'. Type 'string | number | boolean' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. -==== genericArgumentCallSigAssignmentCompat.ts (1 errors) ==== +==== genericArgumentCallSigAssignmentCompat.ts (2 errors) ==== module Underscore { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Iterator { (value: T, index: any, list: any): U; } diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 653b071b3b4cc..74df3a5853fa2 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -1,6 +1,10 @@ +genericCallToOverloadedMethodWithOverloadedArguments.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallToOverloadedMethodWithOverloadedArguments.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. +genericCallToOverloadedMethodWithOverloadedArguments.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallToOverloadedMethodWithOverloadedArguments.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. @@ -10,6 +14,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. +genericCallToOverloadedMethodWithOverloadedArguments.ts(57,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No overload matches this call. Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. @@ -23,6 +28,7 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. +genericCallToOverloadedMethodWithOverloadedArguments.ts(73,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No overload matches this call. Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. @@ -34,8 +40,10 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No Type 'number' is not assignable to type 'boolean'. -==== genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ==== +==== genericCallToOverloadedMethodWithOverloadedArguments.ts (10 errors) ==== module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; } @@ -49,6 +57,8 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No ////////////////////////////////////// module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; } @@ -67,6 +77,8 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No ////////////////////////////////////// module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; then(cb: (x: T) => Promise, error?: (error: any) => Promise): Promise; @@ -81,6 +93,8 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No ////////////////////////////////////// module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; then(cb: (x: T) => Promise, error?: (error: any) => Promise): Promise; @@ -106,6 +120,8 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No ////////////////////////////////////// module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; then(cb: (x: T) => Promise, error?: (error: any) => Promise): Promise; @@ -136,6 +152,8 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No ////////////////////////////////////// module m6 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Promise { then(cb: (x: T) => Promise): Promise; then(cb: (x: T) => Promise, error?: (error: any) => Promise): Promise; diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index 6a958e04b9cf0..6780dafb34545 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,3 +1,4 @@ +genericCallWithGenericSignatureArguments2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallWithGenericSignatureArguments2.ts(10,51): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -10,6 +11,7 @@ genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of t Type 'Date' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'Date'. genericCallWithGenericSignatureArguments2.ts(37,43): error TS2322: Type 'F' is not assignable to type 'E'. +genericCallWithGenericSignatureArguments2.ts(40,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. 'Date' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Date'. genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. @@ -22,11 +24,13 @@ genericCallWithGenericSignatureArguments2.ts(67,51): error TS2304: Cannot find n genericCallWithGenericSignatureArguments2.ts(67,57): error TS2304: Cannot find name 'U'. -==== genericCallWithGenericSignatureArguments2.ts (10 errors) ==== +==== genericCallWithGenericSignatureArguments2.ts (12 errors) ==== // When a function expression is inferentially typed (section 4.9.3) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. module onlyT { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo(a: (x: T) => T, b: (x: T) => T) { var r: (x: T) => T; return r; @@ -81,6 +85,8 @@ genericCallWithGenericSignatureArguments2.ts(67,57): error TS2304: Cannot find n } module TU { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo(a: (x: T) => T, b: (x: U) => U) { var r: (x: T) => T; return r; diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt new file mode 100644 index 0000000000000..b5f6de61a7828 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt @@ -0,0 +1,57 @@ +genericCallWithOverloadedConstructorTypedArguments.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallWithOverloadedConstructorTypedArguments.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericCallWithOverloadedConstructorTypedArguments.ts (2 errors) ==== + // Function typed arguments with multiple signatures must be passed an implementation that matches all of them + // Inferences are made quadratic-pairwise to and from these overload sets + + module NonGenericParameter { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a: { + new(x: boolean): boolean; + new(x: string): string; + } + + function foo4(cb: typeof a) { + return new cb(null); + } + + var r = foo4(a); + var b: { new (x: T): T }; + var r2 = foo4(b); + } + + module GenericParameter { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo5(cb: { new(x: T): string; new(x: number): T }) { + return cb; + } + + var a: { + new (x: boolean): string; + new (x: number): boolean; + } + var r5 = foo5(a); // new{} => string; new(x:number) => {} + var b: { new(x: T): string; new(x: number): T; } + var r7 = foo5(b); // new any => string; new(x:number) => any + + function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r8 = foo6(a); // error + var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string + + function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { + return cb; + } + + var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string + var c: { new (x: T): string; (x: number): T; } + var c2: { new (x: T): string; new(x: number): T; } + var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string + var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 37ba19c5696f7..3167858b8aae5 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,12 +1,16 @@ +genericCallWithOverloadedConstructorTypedArguments2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallWithOverloadedConstructorTypedArguments2.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: unknown): string; new (x: unknown, y?: unknown): string; }'. Target signature provides too few arguments. Expected 2 or more, but got 1. -==== genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== +==== genericCallWithOverloadedConstructorTypedArguments2.ts (3 errors) ==== // Function typed arguments with multiple signatures must be passed an implementation that matches all of them // Inferences are made quadratic-pairwise to and from these overload sets module NonGenericParameter { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a: { new(x: boolean): boolean; new(x: string): string; @@ -21,6 +25,8 @@ genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Arg } module GenericParameter { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo5(cb: { new(x: T): string; new(x: number): T }) { return cb; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.errors.txt new file mode 100644 index 0000000000000..28e6969a1fe0c --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.errors.txt @@ -0,0 +1,53 @@ +genericCallWithOverloadedFunctionTypedArguments.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallWithOverloadedFunctionTypedArguments.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericCallWithOverloadedFunctionTypedArguments.ts (2 errors) ==== + // Function typed arguments with multiple signatures must be passed an implementation that matches all of them + // Inferences are made quadratic-pairwise to and from these overload sets + + module NonGenericParameter { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a: { + (x: boolean): boolean; + (x: string): string; + } + + function foo4(cb: typeof a) { + return cb; + } + + var r = foo4(a); + var r2 = foo4((x: T) => x); + var r4 = foo4(x => x); + } + + module GenericParameter { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo5(cb: { (x: T): string; (x: number): T }) { + return cb; + } + + var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var a: { (x: T): string; (x: number): T; } + var r7 = foo5(a); // any => string (+1 overload) + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var r9 = foo6((x: T) => ''); // any => string (+1 overload) + var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { + return cb; + } + + var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var a: { (x: T): string; (x: number): T; } + var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index 896f081b5c833..cc98a618bdaa7 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -68,7 +68,9 @@ module NonGenericParameter { >x => x : (x: any) => any > : ^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >x : any +> : ^^^ } module GenericParameter { @@ -100,7 +102,9 @@ module GenericParameter { >x => x : (x: any) => any > : ^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >x : any +> : ^^^ var a: { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -147,7 +151,9 @@ module GenericParameter { >x => x : (x: any) => any > : ^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >x : any +> : ^^^ var r9 = foo6((x: T) => ''); // any => string (+1 overload) >r9 : { (x: unknown): string; (x: unknown, y?: unknown): string; } @@ -210,7 +216,9 @@ module GenericParameter { >(x) => x : (x: any) => any > : ^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >x : any +> : ^^^ var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] >r13 : { (x: unknown): string; (x: unknown, y?: unknown): string; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 505bc85e1fc52..2f558ab82dd0a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,12 +1,16 @@ +genericCallWithOverloadedFunctionTypedArguments2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCallWithOverloadedFunctionTypedArguments2.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: unknown): string; (x: unknown, y?: unknown): string; }'. Target signature provides too few arguments. Expected 2 or more, but got 1. -==== genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== +==== genericCallWithOverloadedFunctionTypedArguments2.ts (3 errors) ==== // Function typed arguments with multiple signatures must be passed an implementation that matches all of them // Inferences are made quadratic-pairwise to and from these overload sets module NonGenericParameter { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a: { (x: boolean): boolean; (x: string): string; @@ -20,6 +24,8 @@ genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argume } module GenericParameter { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo5(cb: { (x: T): string; (x: number): T }) { return cb; } diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.errors.txt b/tests/baselines/reference/genericCallbacksAndClassHierarchy.errors.txt new file mode 100644 index 0000000000000..a54079676d22c --- /dev/null +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.errors.txt @@ -0,0 +1,29 @@ +genericCallbacksAndClassHierarchy.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericCallbacksAndClassHierarchy.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + subscribe(callback: (newValue: T) => void ): any; + } + export class C1 { + public value: I; + } + export class A { + public dummy: any; + } + export class B extends C1> { } + export class D { + _subscribe(viewModel: B): void { + var f = (newValue: A) => { }; + + var v: I> = viewModel.value; + + // both of these should work + v.subscribe(f); + v.subscribe((newValue: A) => { }); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.types b/tests/baselines/reference/genericCallbacksAndClassHierarchy.types index cc050bcb3c488..f9f97fea67a7f 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.types +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.types @@ -28,6 +28,7 @@ module M { public dummy: any; >dummy : any +> : ^^^ } export class B extends C1> { } >B : B @@ -66,6 +67,7 @@ module M { // both of these should work v.subscribe(f); >v.subscribe(f) : any +> : ^^^ >v.subscribe : (callback: (newValue: A) => void) => any > : ^ ^^^ ^^^^^^^^^^^ ^^^^^ >v : I> @@ -77,6 +79,7 @@ module M { v.subscribe((newValue: A) => { }); >v.subscribe((newValue: A) => { }) : any +> : ^^^ >v.subscribe : (callback: (newValue: A) => void) => any > : ^ ^^^ ^^^^^^^^^^^ ^^^^^ >v : I> diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.errors.txt b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.errors.txt new file mode 100644 index 0000000000000..7c550a127e8cb --- /dev/null +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.errors.txt @@ -0,0 +1,16 @@ +genericClassImplementingGenericInterfaceFromAnotherModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassImplementingGenericInterfaceFromAnotherModule.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericClassImplementingGenericInterfaceFromAnotherModule.ts (2 errors) ==== + module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IFoo { } + } + module bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Foo implements foo.IFoo { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.errors.txt b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.errors.txt new file mode 100644 index 0000000000000..e5bee9ef2d5c2 --- /dev/null +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.errors.txt @@ -0,0 +1,102 @@ +genericClassPropertyInheritanceSpecialization.ts(36,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(40,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(40,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(40,24): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(53,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(53,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(53,28): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassPropertyInheritanceSpecialization.ts(53,37): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericClassPropertyInheritanceSpecialization.ts (8 errors) ==== + interface KnockoutObservableBase { + peek(): T; + (): T; + (value: T): void; + } + + interface KnockoutObservable extends KnockoutObservableBase { + equalityComparer(a: T, b: T): boolean; + valueHasMutated(): void; + valueWillMutate(): void; + } + + interface KnockoutObservableArray extends KnockoutObservable { + indexOf(searchElement: T, fromIndex?: number): number; + slice(start: number, end?: number): T[]; + splice(start: number, deleteCount?: number, ...items: T[]): T[]; + pop(): T; + push(...items: T[]): void; + shift(): T; + unshift(...items: T[]): number; + reverse(): T[]; + sort(compareFunction?: (a: T, b: T) => number): void; + replace(oldItem: T, newItem: T): void; + remove(item: T): T[]; + removeAll(items?: T[]): T[]; + destroy(item: T): void; + destroyAll(items?: T[]): void; + } + + interface KnockoutObservableArrayStatic { + fn: KnockoutObservableArray; + + (value?: T[]): KnockoutObservableArray; + } + + declare module ko { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var observableArray: KnockoutObservableArrayStatic; + } + + module Portal.Controls.Validators { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Validator { + private _subscription; + public message: KnockoutObservable; + public validationState: KnockoutObservable; + public validate: KnockoutObservable; + constructor(message?: string) { } + public destroy(): void { } + public _validate(value: TValue): number {return 0 } + } + } + + module PortalFx.ViewModels.Controls.Validators { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Validator extends Portal.Controls.Validators.Validator { + + constructor(message?: string) { + super(message); + } + } + + } + + interface Contract { + + validators: KnockoutObservableArray>; + } + + + class ViewModel implements Contract { + + public validators: KnockoutObservableArray> = ko.observableArray>(); + } + + \ No newline at end of file diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 8df471267cb64..42a1d3f9580e5 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -157,6 +157,7 @@ module Portal.Controls.Validators { private _subscription; >_subscription : any +> : ^^^ public message: KnockoutObservable; >message : KnockoutObservable diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt index a9961dcb2d9ce..05ddbee0ed1f1 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -1,3 +1,5 @@ +genericClassWithFunctionTypedMemberArguments.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassWithFunctionTypedMemberArguments.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericClassWithFunctionTypedMemberArguments.ts(57,29): error TS2345: Argument of type '(x: T) => string' is not assignable to parameter of type '(a: 1) => string'. Types of parameters 'x' and 'a' are incompatible. Type 'number' is not assignable to type 'T'. @@ -14,11 +16,13 @@ genericClassWithFunctionTypedMemberArguments.ts(62,30): error TS2345: Argument o Type 'string' is not assignable to type '1'. -==== genericClassWithFunctionTypedMemberArguments.ts (4 errors) ==== +==== genericClassWithFunctionTypedMemberArguments.ts (6 errors) ==== // Generic functions used as arguments for function typed parameters are not used to make inferences from // Using function arguments, no errors expected module ImmediatelyFix { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { foo(x: (a: T) => T) { return x(null); @@ -42,6 +46,8 @@ genericClassWithFunctionTypedMemberArguments.ts(62,30): error TS2345: Argument o } module WithCandidates { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { foo2(x: T, cb: (a: T) => U) { return cb(x); diff --git a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.errors.txt b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.errors.txt new file mode 100644 index 0000000000000..2bb92963dfd8a --- /dev/null +++ b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.errors.txt @@ -0,0 +1,69 @@ +genericClassWithObjectTypeArgsAndConstraints.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericClassWithObjectTypeArgsAndConstraints.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericClassWithObjectTypeArgsAndConstraints.ts (2 errors) ==== + // Generic call with constraints infering type parameter from object member properties + // No errors expected + + class C { + x: string; + } + + class D { + x: string; + y: string; + } + + class X { + x: T; + } + + module Class { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class G { + foo(t: X, t2: X) { + var x: T; + return x; + } + } + + var c1 = new X(); + var d1 = new X(); + var g: G<{ x: string; y: string }>; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + + class G2 { + foo2(t: X, t2: X) { + var x: T; + return x; + } + } + var g2: G2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); + } + + module Interface { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface G { + foo(t: X, t2: X): T; + } + + var c1 = new X(); + var d1 = new X(); + var g: G<{ x: string; y: string }>; + var r = g.foo(c1, d1); + var r2 = g.foo(c1, c1); + + interface G2 { + foo2(t: X, t2: X): T; + } + + var g2: G2; + var r = g2.foo2(c1, d1); + var r2 = g2.foo2(c1, c1); + } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithStaticFactory.errors.txt b/tests/baselines/reference/genericClassWithStaticFactory.errors.txt new file mode 100644 index 0000000000000..639d367a52d6a --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticFactory.errors.txt @@ -0,0 +1,147 @@ +genericClassWithStaticFactory.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericClassWithStaticFactory.ts (1 errors) ==== + module Editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class List { + public next: List; + public prev: List; + private listFactory: ListFactory; + + constructor(public isHead: boolean, public data: T) { + this.listFactory = new ListFactory(); + + } + + public add(data: T): List { + var entry = this.listFactory.MakeEntry(data); + + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public count(): number { + var entry: List; + var i: number; + + entry = this.next; + for (i = 0; !(entry.isHead); i++) { + entry = entry.next; + } + + return (i); + } + + public isEmpty(): boolean { + return (this.next == this); + } + + public first(): T { + if (this.isEmpty()) + { + return this.next.data; + } + else { + return null; + } + } + + public pushEntry(entry: List): void { + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does + } + + public push(data: T): void { + var entry = this.listFactory.MakeEntry(data); + entry.data = data; + entry.isHead = false; + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does + } + + public popEntry(head: List): List { + if (this.next.isHead) { + return null; + } + else { + return this.listFactory.RemoveEntry(this.next); + } + } + + public insertEntry(entry: List): List { + entry.isHead = false; + this.prev.next = entry; + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public insertAfter(data: T): List { + var entry: List = this.listFactory.MakeEntry(data); + entry.next = this.next; + entry.prev = this; + this.next = entry; + entry.next.prev = entry;// entry.next.prev does not show intellisense, but entry.prev.prev does + return entry; + } + + public insertEntryBefore(entry: List): List { + this.prev.next = entry; + + entry.next = this; + entry.prev = this.prev; + this.prev = entry; + return entry; + } + + public insertBefore(data: T): List { + var entry = this.listFactory.MakeEntry(data); + return this.insertEntryBefore(entry); + } + } + + export class ListFactory { + + public MakeHead(): List { + var entry: List = new List(true, null); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public MakeEntry(data: T): List { + var entry: List = new List(false, data); + entry.prev = entry; + entry.next = entry; + return entry; + } + + public RemoveEntry(entry: List): List { + if (entry == null) { + return null; + } + else if (entry.isHead) { + // Can't remove the head of a list! + return null; + } + else { + entry.next.prev = entry.prev; + entry.prev.next = entry.next; + + return entry; + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassesInModule.errors.txt b/tests/baselines/reference/genericClassesInModule.errors.txt new file mode 100644 index 0000000000000..819904bfae83e --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule.errors.txt @@ -0,0 +1,14 @@ +genericClassesInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericClassesInModule.ts (1 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class B{ } + + export class A { } + } + + var a = new Foo.B(); \ No newline at end of file diff --git a/tests/baselines/reference/genericClassesRedeclaration.errors.txt b/tests/baselines/reference/genericClassesRedeclaration.errors.txt index 4e51674e9c595..f3a0fa1dd7de7 100644 --- a/tests/baselines/reference/genericClassesRedeclaration.errors.txt +++ b/tests/baselines/reference/genericClassesRedeclaration.errors.txt @@ -1,13 +1,17 @@ +genericClassesRedeclaration.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericClassesRedeclaration.ts(3,9): error TS2374: Duplicate index signature for type 'string'. genericClassesRedeclaration.ts(16,11): error TS2300: Duplicate identifier 'StringHashTable'. genericClassesRedeclaration.ts(29,11): error TS2300: Duplicate identifier 'IdentifierNameHashTable'. +genericClassesRedeclaration.ts(40,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericClassesRedeclaration.ts(42,9): error TS2374: Duplicate index signature for type 'string'. genericClassesRedeclaration.ts(55,11): error TS2300: Duplicate identifier 'StringHashTable'. genericClassesRedeclaration.ts(68,11): error TS2300: Duplicate identifier 'IdentifierNameHashTable'. -==== genericClassesRedeclaration.ts (6 errors) ==== +==== genericClassesRedeclaration.ts (8 errors) ==== declare module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface IIndexable { [s: string]: T; ~~~~~~~~~~~~~~~ @@ -53,6 +57,8 @@ genericClassesRedeclaration.ts(68,11): error TS2300: Duplicate identifier 'Ident } declare module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface IIndexable { [s: string]: T; ~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/genericCloduleInModule.errors.txt b/tests/baselines/reference/genericCloduleInModule.errors.txt new file mode 100644 index 0000000000000..9a6c28d826a44 --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule.errors.txt @@ -0,0 +1,21 @@ +genericCloduleInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCloduleInModule.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericCloduleInModule.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class B { + foo() { } + static bar() { } + } + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + } + } + + var b: A.B; + b.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/genericCloduleInModule2.errors.txt b/tests/baselines/reference/genericCloduleInModule2.errors.txt index 193c59fc01b88..022b3bccb22d4 100644 --- a/tests/baselines/reference/genericCloduleInModule2.errors.txt +++ b/tests/baselines/reference/genericCloduleInModule2.errors.txt @@ -1,8 +1,13 @@ +genericCloduleInModule2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCloduleInModule2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericCloduleInModule2.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericCloduleInModule2.ts(14,8): error TS2314: Generic type 'B' requires 1 type argument(s). -==== genericCloduleInModule2.ts (1 errors) ==== +==== genericCloduleInModule2.ts (4 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class B { foo() { } static bar() { } @@ -10,7 +15,11 @@ genericCloduleInModule2.ts(14,8): error TS2314: Generic type 'B' requires 1 t } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } } diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.errors.txt b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.errors.txt new file mode 100644 index 0000000000000..943c6a5211178 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.errors.txt @@ -0,0 +1,44 @@ +genericConstraintOnExtendedBuiltinTypes.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes.ts(20,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericConstraintOnExtendedBuiltinTypes.ts (5 errors) ==== + declare module EndGate { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface ICloneable { + Clone(): any; + } + } + + interface Number extends EndGate.ICloneable { } + + module EndGate.Tweening { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Tween{ + private _from: T; + + + constructor(from: T) { + this._from = from.Clone(); + } + } + } + + module EndGate.Tweening { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class NumberTween extends Tween{ + constructor(from: number) { + super(from); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types index f1f9a77a6dbf5..bdaebcd1fd9cf 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types @@ -34,6 +34,7 @@ module EndGate.Tweening { this._from = from.Clone(); >this._from = from.Clone() : any +> : ^^^ >this._from : T > : ^ >this : this @@ -41,6 +42,7 @@ module EndGate.Tweening { >_from : T > : ^ >from.Clone() : any +> : ^^^ >from.Clone : () => any > : ^^^^^^ >from : T diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.errors.txt b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.errors.txt new file mode 100644 index 0000000000000..3534f64d93315 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.errors.txt @@ -0,0 +1,43 @@ +genericConstraintOnExtendedBuiltinTypes2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes2.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes2.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericConstraintOnExtendedBuiltinTypes2.ts(19,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericConstraintOnExtendedBuiltinTypes2.ts (5 errors) ==== + module EndGate { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface ICloneable { + Clone(): any; + } + } + + interface Number extends EndGate.ICloneable { } + + module EndGate.Tweening { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Tween{ + private _from: T; + + constructor(from: T) { + this._from = from.Clone(); + } + } + } + + module EndGate.Tweening { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class NumberTween extends Tween{ + constructor(from: number) { + super(from); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types index 9c3d23ce7348c..88f8258923372 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types @@ -33,6 +33,7 @@ module EndGate.Tweening { this._from = from.Clone(); >this._from = from.Clone() : any +> : ^^^ >this._from : T > : ^ >this : this @@ -40,6 +41,7 @@ module EndGate.Tweening { >_from : T > : ^ >from.Clone() : any +> : ^^^ >from.Clone : () => any > : ^^^^^^ >from : T diff --git a/tests/baselines/reference/genericFunduleInModule.errors.txt b/tests/baselines/reference/genericFunduleInModule.errors.txt index 4faa622a4b5c7..f4494385664df 100644 --- a/tests/baselines/reference/genericFunduleInModule.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule.errors.txt @@ -1,10 +1,16 @@ +genericFunduleInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericFunduleInModule.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericFunduleInModule.ts(8,8): error TS2749: 'A.B' refers to a value, but is being used as a type here. Did you mean 'typeof A.B'? -==== genericFunduleInModule.ts (1 errors) ==== +==== genericFunduleInModule.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function B(x: T) { return x; } export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } } diff --git a/tests/baselines/reference/genericFunduleInModule2.errors.txt b/tests/baselines/reference/genericFunduleInModule2.errors.txt index a980c90918392..7cadf3a62dd11 100644 --- a/tests/baselines/reference/genericFunduleInModule2.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule2.errors.txt @@ -1,13 +1,22 @@ +genericFunduleInModule2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericFunduleInModule2.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericFunduleInModule2.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericFunduleInModule2.ts(11,8): error TS2749: 'A.B' refers to a value, but is being used as a type here. Did you mean 'typeof A.B'? -==== genericFunduleInModule2.ts (1 errors) ==== +==== genericFunduleInModule2.ts (4 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function B(x: T) { return x; } } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } } diff --git a/tests/baselines/reference/genericInference2.errors.txt b/tests/baselines/reference/genericInference2.errors.txt new file mode 100644 index 0000000000000..b900dcf7fe483 --- /dev/null +++ b/tests/baselines/reference/genericInference2.errors.txt @@ -0,0 +1,26 @@ +genericInference2.ts(1,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericInference2.ts (1 errors) ==== + declare module ko { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Observable { + (): T; + (value: T): any; + N: number; + g: boolean; + r: T; + } + export function observable(value: T): Observable; + } + var o = { + name: ko.observable("Bob"), + age: ko.observable(37) + }; + var x_v = o.name().length; // should be 'number' + var age_v = o.age(); // should be 'number' + var name_v = o.name("Robert"); // should be 'any' + var zz_v = o.name.N; // should be 'number' + var yy_v = o.name.g; // should be 'boolean' + var rr_v = o.name.r; // should be 'string' \ No newline at end of file diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index 58986441db6ff..6048e7d09279f 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -94,7 +94,9 @@ var name_v = o.name("Robert"); // should be 'any' >name_v : any +> : ^^^ >o.name("Robert") : any +> : ^^^ >o.name : ko.Observable > : ^^^^^^^^^^^^^^^^^^^^^ >o : { name: ko.Observable; age: ko.Observable; } diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt index f8106b2154c97..f12f9940d7ed0 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt @@ -1,10 +1,13 @@ +genericMergedDeclarationUsingTypeParameter.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericMergedDeclarationUsingTypeParameter.ts(3,19): error TS2304: Cannot find name 'T'. genericMergedDeclarationUsingTypeParameter.ts(4,14): error TS2304: Cannot find name 'T'. -==== genericMergedDeclarationUsingTypeParameter.ts (2 errors) ==== +==== genericMergedDeclarationUsingTypeParameter.ts (3 errors) ==== function foo(y: T, z: U) { return y; } module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x: T; ~ !!! error TS2304: Cannot find name 'T'. diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt index a1bd58f15c938..dba91a3bf586a 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter2.errors.txt @@ -1,10 +1,13 @@ +genericMergedDeclarationUsingTypeParameter2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericMergedDeclarationUsingTypeParameter2.ts(3,19): error TS2304: Cannot find name 'T'. genericMergedDeclarationUsingTypeParameter2.ts(4,14): error TS2304: Cannot find name 'T'. -==== genericMergedDeclarationUsingTypeParameter2.ts (2 errors) ==== +==== genericMergedDeclarationUsingTypeParameter2.ts (3 errors) ==== class foo { constructor(x: T) { } } module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x: T; ~ !!! error TS2304: Cannot find name 'T'. diff --git a/tests/baselines/reference/genericOfACloduleType1.errors.txt b/tests/baselines/reference/genericOfACloduleType1.errors.txt new file mode 100644 index 0000000000000..4864b72c808ca --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType1.errors.txt @@ -0,0 +1,21 @@ +genericOfACloduleType1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericOfACloduleType1.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericOfACloduleType1.ts (2 errors) ==== + class G{ bar(x: T) { return x; } } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { foo() { } } + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class X { + } + } + + var g1 = new G(); + g1.bar(null).foo(); + } + var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. \ No newline at end of file diff --git a/tests/baselines/reference/genericOfACloduleType2.errors.txt b/tests/baselines/reference/genericOfACloduleType2.errors.txt new file mode 100644 index 0000000000000..a00def7fd08ac --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType2.errors.txt @@ -0,0 +1,27 @@ +genericOfACloduleType2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericOfACloduleType2.ts(4,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +genericOfACloduleType2.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericOfACloduleType2.ts (3 errors) ==== + class G{ bar(x: T) { return x; } } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { foo() { } } + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class X { + } + } + + var g1 = new G(); + g1.bar(null).foo(); // no error + } + + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var g2 = new G() + } \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt index 2f06b05362e9c..97b0b79764fcd 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt @@ -1,8 +1,11 @@ +genericRecursiveImplicitConstructorErrors1.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). -==== genericRecursiveImplicitConstructorErrors1.ts (1 errors) ==== +==== genericRecursiveImplicitConstructorErrors1.ts (2 errors) ==== export declare module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class PullSymbol { } class PullSignatureSymbol extends PullSymbol { public addSpecialization(signature: PullSignatureSymbol, typeArguments: PullTypeSymbol[]): void; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.errors.txt new file mode 100644 index 0000000000000..d24e403dabceb --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.errors.txt @@ -0,0 +1,32 @@ +genericRecursiveImplicitConstructorErrors2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericRecursiveImplicitConstructorErrors2.ts (1 errors) ==== + module TypeScript2 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface DeclKind { }; + export interface PullTypesymbol { }; + export interface SymbolLinkKind { }; + export enum PullSymbolVisibility { + Private, + Public + } +   + export class PullSymbol { + constructor (name: string, declKind: DeclKind) { + + } + // link methods + public addOutgoingLink(linkTo: PullSymbol, kind: SymbolLinkKind) { + + } + + public getType(): PullTypeSymbol { + return undefined; + } + } + export class PullTypeSymbol extends PullSymbol { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt index 0a3d27451fda0..d66539934efa5 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt @@ -1,4 +1,6 @@ +genericRecursiveImplicitConstructorErrors3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2314: Generic type 'MemberName' requires 3 type argument(s). +genericRecursiveImplicitConstructorErrors3.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). @@ -7,8 +9,10 @@ genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2314: Generic type genericRecursiveImplicitConstructorErrors3.ts(19,22): error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. -==== genericRecursiveImplicitConstructorErrors3.ts (7 errors) ==== +==== genericRecursiveImplicitConstructorErrors3.ts (9 errors) ==== module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class MemberName { static create(arg1: any, arg2?: any, arg3?: any): MemberName { ~~~~~~~~~~ @@ -18,6 +22,8 @@ genericRecursiveImplicitConstructorErrors3.ts(19,22): error TS2339: Property 'is } module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class PullSymbol { public type: PullTypeSymbol = null; ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/genericSetterInClassType.errors.txt b/tests/baselines/reference/genericSetterInClassType.errors.txt new file mode 100644 index 0000000000000..42c2a51ce7b78 --- /dev/null +++ b/tests/baselines/reference/genericSetterInClassType.errors.txt @@ -0,0 +1,31 @@ +genericSetterInClassType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== genericSetterInClassType.ts (1 errors) ==== + module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + get y(): T { + return 1 as never; + } + set y(v) { } + } + + var c = new C(); + c.y = c.y; + + class Box { + #value!: T; + + get value() { + return this.#value; + } + + set value(value) { + this.#value = value; + } + } + + new Box().value = 3; + } \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeArgumentInference1.errors.txt b/tests/baselines/reference/genericTypeArgumentInference1.errors.txt index 56a9dee32a153..e2a632b550430 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.errors.txt +++ b/tests/baselines/reference/genericTypeArgumentInference1.errors.txt @@ -1,10 +1,13 @@ +genericTypeArgumentInference1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericTypeArgumentInference1.ts(12,39): error TS2345: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator'. Type 'string | number | boolean' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. -==== genericTypeArgumentInference1.ts (1 errors) ==== +==== genericTypeArgumentInference1.ts (2 errors) ==== module Underscore { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Iterator { (value: T, index: any, list: any): U; } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt index d82ba34a3b0c2..f5eeec8cb4fe0 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt @@ -8,13 +8,14 @@ genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2314: Generic type genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +genericTypeReferenceWithoutTypeArgument.d.ts(18,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericTypeReferenceWithoutTypeArgument.d.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'. genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). -==== genericTypeReferenceWithoutTypeArgument.d.ts (14 errors) ==== +==== genericTypeReferenceWithoutTypeArgument.d.ts (15 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -53,6 +54,8 @@ genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type !!! error TS2314: Generic type 'C' requires 1 type argument(s). declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class E { foo: T } } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt index 1125aaa67c1c2..c0d1c0f78ee7f 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt @@ -15,6 +15,7 @@ genericTypeReferenceWithoutTypeArgument.ts(18,27): error TS2314: Generic type 'C genericTypeReferenceWithoutTypeArgument.ts(18,38): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.ts(20,17): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.ts(23,21): error TS2314: Generic type 'C' requires 1 type argument(s). +genericTypeReferenceWithoutTypeArgument.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericTypeReferenceWithoutTypeArgument.ts(29,18): error TS2314: Generic type 'E' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.ts(30,20): error TS2314: Generic type 'E' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument.ts(31,22): error TS2314: Generic type 'E' requires 1 type argument(s). @@ -24,7 +25,7 @@ genericTypeReferenceWithoutTypeArgument.ts(36,10): error TS2314: Generic type 'C genericTypeReferenceWithoutTypeArgument.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). -==== genericTypeReferenceWithoutTypeArgument.ts (24 errors) ==== +==== genericTypeReferenceWithoutTypeArgument.ts (25 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -84,6 +85,8 @@ genericTypeReferenceWithoutTypeArgument.ts(37,10): error TS2314: Generic type 'E !!! error TS2314: Generic type 'C' requires 1 type argument(s). module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class E { foo: T } } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index e4b96fa496736..df685dfe737fd 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -15,6 +15,7 @@ genericTypeReferenceWithoutTypeArgument2.ts(18,27): error TS2314: Generic type ' genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2689: Cannot extend an interface 'I'. Did you mean 'implements'? genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I' requires 1 type argument(s). +genericTypeReferenceWithoutTypeArgument2.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2708: Cannot use namespace 'M' as a value. genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2694: Namespace 'M' has no exported member 'C'. @@ -24,7 +25,7 @@ genericTypeReferenceWithoutTypeArgument2.ts(36,10): error TS2304: Cannot find na genericTypeReferenceWithoutTypeArgument2.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). -==== genericTypeReferenceWithoutTypeArgument2.ts (24 errors) ==== +==== genericTypeReferenceWithoutTypeArgument2.ts (25 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -84,6 +85,8 @@ genericTypeReferenceWithoutTypeArgument2.ts(37,10): error TS2314: Generic type ' !!! error TS2314: Generic type 'I' requires 1 type argument(s). module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface E { foo: T } } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt index 1a90e42b1ff76..71eb682ad8a47 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt @@ -8,13 +8,14 @@ genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2314: Generic type ' genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +genericTypeReferenceWithoutTypeArgument3.ts(18,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. genericTypeReferenceWithoutTypeArgument3.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'. genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). -==== genericTypeReferenceWithoutTypeArgument3.ts (14 errors) ==== +==== genericTypeReferenceWithoutTypeArgument3.ts (15 errors) ==== // it is an error to use a generic type without type arguments // all of these are errors @@ -53,6 +54,8 @@ genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type ' !!! error TS2314: Generic type 'C' requires 1 type argument(s). declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class E { foo: T } } diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt new file mode 100644 index 0000000000000..5af56e55cfbc7 --- /dev/null +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.errors.txt @@ -0,0 +1,36 @@ +getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== getAccessorWithImpliedReturnTypeAndFunctionClassMerge.ts (2 errors) ==== + declare function _(value: Array): _; + declare function _(value: T): _; + + declare module _ { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function each( + //list: List, + //iterator: ListIterator, + context?: any): void; + + interface ListIterator { + (value: T, index: number, list: T[]): TResult; + } + } + + declare class _ { + each(iterator: _.ListIterator, context?: any): void; + } + + module MyModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class MyClass { + public get myGetter() { + var obj:any = {}; + + return obj; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.types b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.types index fb5309c783291..e50c11234ce42 100644 --- a/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.types +++ b/tests/baselines/reference/getAccessorWithImpliedReturnTypeAndFunctionClassMerge.types @@ -25,6 +25,7 @@ declare module _ { //iterator: ListIterator, context?: any): void; >context : any +> : ^^^ interface ListIterator { (value: T, index: number, list: T[]): TResult; @@ -49,6 +50,7 @@ declare class _ { >_ : any > : ^^^ >context : any +> : ^^^ } module MyModule { @@ -61,14 +63,17 @@ module MyModule { public get myGetter() { >myGetter : any +> : ^^^ var obj:any = {}; >obj : any +> : ^^^ >{} : {} > : ^^ return obj; >obj : any +> : ^^^ } } } diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index 47c79a67ce938..f1fea0ae66fb7 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -19,6 +19,7 @@ giant.ts(36,20): error TS1005: '{' expected. giant.ts(62,5): error TS1021: An index signature must have a type annotation. giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. +giant.ts(78,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. giant.ts(88,24): error TS1005: '{' expected. @@ -40,7 +41,11 @@ giant.ts(100,24): error TS1005: '{' expected. giant.ts(126,9): error TS1021: An index signature must have a type annotation. giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(142,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(147,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(152,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(154,39): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(156,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. giant.ts(167,24): error TS1005: '{' expected. @@ -62,7 +67,11 @@ giant.ts(179,24): error TS1005: '{' expected. giant.ts(205,9): error TS1021: An index signature must have a type annotation. giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(221,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(226,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(231,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(233,39): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(235,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(238,35): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(240,24): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(243,21): error TS1183: An implementation cannot be declared in ambient contexts. @@ -86,9 +95,12 @@ giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'. giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. giant.ts(257,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. +giant.ts(260,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(262,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts. +giant.ts(265,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(267,30): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(270,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. giant.ts(282,20): error TS1005: '{' expected. @@ -110,6 +122,7 @@ giant.ts(294,20): error TS1005: '{' expected. giant.ts(320,5): error TS1021: An index signature must have a type annotation. giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. +giant.ts(336,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. giant.ts(346,24): error TS1005: '{' expected. @@ -131,7 +144,11 @@ giant.ts(358,24): error TS1005: '{' expected. giant.ts(384,9): error TS1021: An index signature must have a type annotation. giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(400,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(405,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(410,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(412,39): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(414,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. giant.ts(425,24): error TS1005: '{' expected. @@ -153,7 +170,11 @@ giant.ts(437,24): error TS1005: '{' expected. giant.ts(463,9): error TS1021: An index signature must have a type annotation. giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(479,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(484,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +giant.ts(489,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(491,39): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(493,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(496,35): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(498,24): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(501,21): error TS1183: An implementation cannot be declared in ambient contexts. @@ -177,9 +198,12 @@ giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'. giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'. giant.ts(515,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'. +giant.ts(518,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(520,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts. +giant.ts(523,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(525,30): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(528,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(532,31): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(534,20): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(537,17): error TS1183: An implementation cannot be declared in ambient contexts. @@ -203,6 +227,7 @@ giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'. giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'. giant.ts(551,18): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'. +giant.ts(554,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(556,18): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts. giant.ts(558,24): error TS1183: An implementation cannot be declared in ambient contexts. @@ -211,14 +236,18 @@ giant.ts(563,21): error TS1183: An implementation cannot be declared in ambient giant.ts(588,9): error TS1021: An index signature must have a type annotation. giant.ts(589,10): error TS1096: An index signature must have exactly one parameter. giant.ts(602,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(604,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(606,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts. +giant.ts(609,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(611,30): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(614,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. giant.ts(616,39): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +giant.ts(618,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(621,26): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(623,24): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(626,21): error TS1183: An implementation cannot be declared in ambient contexts. @@ -226,12 +255,15 @@ giant.ts(628,21): error TS1183: An implementation cannot be declared in ambient giant.ts(654,9): error TS1021: An index signature must have a type annotation. giant.ts(655,10): error TS1096: An index signature must have exactly one parameter. giant.ts(668,9): error TS2386: Overload signatures must all be optional or required. +giant.ts(670,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(672,22): error TS1183: An implementation cannot be declared in ambient contexts. giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts. +giant.ts(674,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient contexts. +giant.ts(679,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== giant.ts (231 errors) ==== +==== giant.ts (263 errors) ==== /* Prefixes p -> public @@ -352,6 +384,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { @@ -458,22 +492,30 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { }; interface I { }; module M { }; + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; export class eC { }; export interface eI { }; export module eM { }; + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare var eaV; export declare function eaF() { }; ~ !!! error TS1183: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } export var eV; export function eF() { }; @@ -581,22 +623,30 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } export module eM { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { }; interface I { }; module M { }; + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; export class eC { }; export interface eI { }; export module eM { }; + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare var eaV; export declare function eaF() { }; ~ !!! error TS1183: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } export declare var eaV; export declare function eaF() { }; @@ -668,6 +718,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; ~ @@ -677,6 +729,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient class C { } interface I { } module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; ~ @@ -684,6 +738,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient export class eC { } export interface eI { } export module eM { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } export var eV; @@ -792,6 +848,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } export module eM { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { @@ -898,22 +956,30 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { }; interface I { }; module M { }; + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; export class eC { }; export interface eI { }; export module eM { }; + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare var eaV; export declare function eaF() { }; ~ !!! error TS1183: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } export var eV; export function eF() { }; @@ -1021,22 +1087,30 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } export module eM { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; class C { }; interface I { }; module M { }; + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; export class eC { }; export interface eI { }; export module eM { }; + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare var eaV; export declare function eaF() { }; ~ !!! error TS1183: An implementation cannot be declared in ambient contexts. export declare class eaC { }; export declare module eaM { }; + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } export declare var eaV; export declare function eaF() { }; @@ -1108,6 +1182,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; ~ @@ -1117,6 +1193,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient class C { } interface I { } module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; ~ @@ -1124,6 +1202,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient export class eC { } export interface eI { } export module eM { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } export declare var eaV; @@ -1196,6 +1276,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2300: Duplicate identifier 'tgF'. } export declare module eaM { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; ~ @@ -1262,6 +1344,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; ~ @@ -1271,6 +1355,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient class C { } interface I { } module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; ~ @@ -1278,6 +1364,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient export class eC { } export interface eI { } export module eM { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export declare var eaV ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -1292,6 +1380,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient export declare module eaM { } ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } export var eV; export function eF() { }; @@ -1358,6 +1448,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS2386: Overload signatures must all be optional or required. } export module eM { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var V; function F() { }; ~ @@ -1366,6 +1458,8 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient !!! error TS1036: Statements are not allowed in ambient contexts. class C { } module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var eV; export function eF() { }; ~ @@ -1373,5 +1467,7 @@ giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient export class eC { } export interface eI { } export module eM { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } \ No newline at end of file diff --git a/tests/baselines/reference/global.errors.txt b/tests/baselines/reference/global.errors.txt new file mode 100644 index 0000000000000..2da832e45ed05 --- /dev/null +++ b/tests/baselines/reference/global.errors.txt @@ -0,0 +1,16 @@ +global.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== global.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f(y:number) { + return x+y; + } + } + + var x=10; + M.f(3); + + \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.errors.txt b/tests/baselines/reference/heterogeneousArrayLiterals.errors.txt new file mode 100644 index 0000000000000..da3f293640fe7 --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayLiterals.errors.txt @@ -0,0 +1,140 @@ +heterogeneousArrayLiterals.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +heterogeneousArrayLiterals.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== heterogeneousArrayLiterals.ts (2 errors) ==== + // type of an array is the best common type of its elements (plus its contextual type if it exists) + + var a = [1, '']; // {}[] + var b = [1, null]; // number[] + var c = [1, '', null]; // {}[] + var d = [{}, 1]; // {}[] + var e = [{}, Object]; // {}[] + + var f = [[], [1]]; // number[][] + var g = [[1], ['']]; // {}[] + + var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] + var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] + + var j = [() => 1, () => '']; // {}[] + var k = [() => 1, () => 1]; // { (): number }[] + var l = [() => 1, () => null]; // { (): any }[] + var m = [() => 1, () => '', () => null]; // { (): any }[] + var n = [[() => 1], [() => '']]; // {}[] + + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Base { baz: string; } + var base: Base; + var derived: Derived; + var derived2: Derived2; + + module Derived { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] + var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] + + var j = [() => base, () => derived]; // { {}: Base } + var k = [() => base, () => 1]; // {}[]~ + var l = [() => base, () => null]; // { (): any }[] + var m = [() => base, () => derived, () => null]; // { (): any }[] + var n = [[() => base], [() => derived]]; // { (): Base }[] + var o = [derived, derived2]; // {}[] + var p = [derived, derived2, base]; // Base[] + var q = [[() => derived2], [() => derived]]; // {}[] + } + + module WithContextualType { + ~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // no errors + var a: Base[] = [derived, derived2]; + var b: Derived[] = [null]; + var c: Derived[] = []; + var d: { (): Base }[] = [() => derived, () => derived2]; + } + + function foo(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + } + + function foo2(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] + } + + function foo3(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // {}[] + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] + } + + function foo4(t: T, u: U) { + var a = [t, t]; // T[] + var b = [t, null]; // T[] + var c = [t, u]; // BUG 821629 + var d = [t, 1]; // {}[] + var e = [() => t, () => u]; // {}[] + var f = [() => t, () => u, () => null]; // { (): any }[] + + var g = [t, base]; // Base[] + var h = [t, derived]; // Derived[] + var i = [u, base]; // Base[] + var j = [u, derived]; // Derived[] + + var k: Base[] = [t, u]; + } + + //function foo3(t: T, u: U) { + // var a = [t, t]; // T[] + // var b = [t, null]; // T[] + // var c = [t, u]; // {}[] + // var d = [t, 1]; // {}[] + // var e = [() => t, () => u]; // {}[] + // var f = [() => t, () => u, () => null]; // { (): any }[] + + // var g = [t, base]; // Base[] + // var h = [t, derived]; // Derived[] + // var i = [u, base]; // Base[] + // var j = [u, derived]; // Derived[] + //} + + //function foo4(t: T, u: U) { + // var a = [t, t]; // T[] + // var b = [t, null]; // T[] + // var c = [t, u]; // BUG 821629 + // var d = [t, 1]; // {}[] + // var e = [() => t, () => u]; // {}[] + // var f = [() => t, () => u, () => null]; // { (): any }[] + + // var g = [t, base]; // Base[] + // var h = [t, derived]; // Derived[] + // var i = [u, base]; // Base[] + // var j = [u, derived]; // Derived[] + + // var k: Base[] = [t, u]; + //} \ No newline at end of file diff --git a/tests/baselines/reference/ifDoWhileStatements.errors.txt b/tests/baselines/reference/ifDoWhileStatements.errors.txt index c103478b4e640..b02f5e81540d2 100644 --- a/tests/baselines/reference/ifDoWhileStatements.errors.txt +++ b/tests/baselines/reference/ifDoWhileStatements.errors.txt @@ -1,3 +1,5 @@ +ifDoWhileStatements.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ifDoWhileStatements.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ifDoWhileStatements.ts(44,5): error TS2873: This kind of expression is always falsy. ifDoWhileStatements.ts(45,8): error TS2873: This kind of expression is always falsy. ifDoWhileStatements.ts(46,13): error TS2873: This kind of expression is always falsy. @@ -30,7 +32,7 @@ ifDoWhileStatements.ts(85,8): error TS2872: This kind of expression is always tr ifDoWhileStatements.ts(86,13): error TS2872: This kind of expression is always truthy. -==== ifDoWhileStatements.ts (30 errors) ==== +==== ifDoWhileStatements.ts (32 errors) ==== interface I { id: number; } @@ -54,6 +56,8 @@ ifDoWhileStatements.ts(86,13): error TS2872: This kind of expression is always t function F2(x: number): boolean { return x < 42; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { name: string; } @@ -62,6 +66,8 @@ ifDoWhileStatements.ts(86,13): error TS2872: This kind of expression is always t } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { id: number; } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt index 4645f6966b440..1bc7e734e0e2e 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt @@ -6,6 +6,7 @@ implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2415: Class Types have separate declarations of a private property 'x'. implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. +implementingAnInterfaceExtendingClassWithPrivates2.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. @@ -14,6 +15,7 @@ implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2415: Clas Types have separate declarations of a private property 'x'. implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'z' is missing in type 'Bar3' but required in type 'I'. +implementingAnInterfaceExtendingClassWithPrivates2.ts(54,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar' but required in type 'I'. implementingAnInterfaceExtendingClassWithPrivates2.ts(73,16): error TS2341: Property 'x' is private and only accessible within class 'Foo'. @@ -28,7 +30,7 @@ implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Clas Property 'y' is missing in type 'Bar3' but required in type 'I'. -==== implementingAnInterfaceExtendingClassWithPrivates2.ts (15 errors) ==== +==== implementingAnInterfaceExtendingClassWithPrivates2.ts (17 errors) ==== class Foo { private x: string; } @@ -65,6 +67,8 @@ implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Clas // another level of indirection module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Foo { private x: string; } @@ -109,6 +113,8 @@ implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Clas // two levels of privates module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Foo { private x: string; } diff --git a/tests/baselines/reference/implicitAnyAmbients.errors.txt b/tests/baselines/reference/implicitAnyAmbients.errors.txt index 009472aac29c8..e5a72208a92b1 100644 --- a/tests/baselines/reference/implicitAnyAmbients.errors.txt +++ b/tests/baselines/reference/implicitAnyAmbients.errors.txt @@ -1,3 +1,4 @@ +implicitAnyAmbients.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. implicitAnyAmbients.ts(2,9): error TS7005: Variable 'x' implicitly has an 'any' type. implicitAnyAmbients.ts(5,14): error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. implicitAnyAmbients.ts(5,16): error TS7006: Parameter 'x' implicitly has an 'any' type. @@ -6,11 +7,14 @@ implicitAnyAmbients.ts(10,9): error TS7010: 'foo', which lacks return-type annot implicitAnyAmbients.ts(11,9): error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. implicitAnyAmbients.ts(16,9): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. implicitAnyAmbients.ts(17,9): error TS7010: 'foo2', which lacks return-type annotation, implicitly has an 'any' return type. +implicitAnyAmbients.ts(21,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. implicitAnyAmbients.ts(22,13): error TS7005: Variable 'y' implicitly has an 'any' type. -==== implicitAnyAmbients.ts (9 errors) ==== +==== implicitAnyAmbients.ts (11 errors) ==== declare module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x; // error ~ !!! error TS7005: Variable 'x' implicitly has an 'any' type. @@ -47,6 +51,8 @@ implicitAnyAmbients.ts(22,13): error TS7005: Variable 'y' implicitly has an 'any } module n { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var y; // error ~ !!! error TS7005: Variable 'y' implicitly has an 'any' type. diff --git a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt index 25bf7f3416a2d..0a342e997065b 100644 --- a/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/implicitAnyInAmbientDeclaration.errors.txt @@ -1,10 +1,13 @@ +implicitAnyInAmbientDeclaration.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. implicitAnyInAmbientDeclaration.ts(3,16): error TS7008: Member 'publicMember' implicitly has an 'any' type. implicitAnyInAmbientDeclaration.ts(6,16): error TS7010: 'publicFunction', which lacks return-type annotation, implicitly has an 'any' return type. implicitAnyInAmbientDeclaration.ts(6,31): error TS7006: Parameter 'x' implicitly has an 'any' type. -==== implicitAnyInAmbientDeclaration.ts (3 errors) ==== +==== implicitAnyInAmbientDeclaration.ts (4 errors) ==== module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class C { public publicMember; // this should be an error ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt new file mode 100644 index 0000000000000..6ef970c596345 --- /dev/null +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.errors.txt @@ -0,0 +1,21 @@ +importAliasAnExternalModuleInsideAnInternalModule_file0.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAliasAnExternalModuleInsideAnInternalModule_file1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importAliasAnExternalModuleInsideAnInternalModule_file1.ts (1 errors) ==== + import r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); + module m_private { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import r2 = require('m'); // would be error + export import C = r; // no error + C.m.foo(); + } + +==== importAliasAnExternalModuleInsideAnInternalModule_file0.ts (1 errors) ==== + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importAliasIdentifiers.errors.txt b/tests/baselines/reference/importAliasIdentifiers.errors.txt new file mode 100644 index 0000000000000..7ecfce4f09819 --- /dev/null +++ b/tests/baselines/reference/importAliasIdentifiers.errors.txt @@ -0,0 +1,58 @@ +importAliasIdentifiers.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAliasIdentifiers.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAliasIdentifiers.ts(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importAliasIdentifiers.ts (3 errors) ==== + module moduleA { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + } + } + + import alias = moduleA; + + var p: alias.Point; + var p: moduleA.Point; + var p: { x: number; y: number; }; + + class clodule { + name: string; + } + + module clodule { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; y: number; + } + var Point: Point = { x: 0, y: 0 }; + } + + import clolias = clodule; + + var p: clolias.Point; + var p: clodule.Point; + var p: { x: number; y: number; }; + + + function fundule() { + return { x: 0, y: 0 }; + } + + module fundule { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; y: number; + } + var Point: Point = { x: 0, y: 0 }; + } + + import funlias = fundule; + + var p: funlias.Point; + var p: fundule.Point; + var p: { x: number; y: number; }; \ No newline at end of file diff --git a/tests/baselines/reference/importAliasWithDottedName.errors.txt b/tests/baselines/reference/importAliasWithDottedName.errors.txt new file mode 100644 index 0000000000000..de6f231b453eb --- /dev/null +++ b/tests/baselines/reference/importAliasWithDottedName.errors.txt @@ -0,0 +1,24 @@ +importAliasWithDottedName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAliasWithDottedName.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAliasWithDottedName.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importAliasWithDottedName.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var y = 2; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import N = M.N; + var r = N.y; + var r2 = M.N.y; + } \ No newline at end of file diff --git a/tests/baselines/reference/importAnImport.errors.txt b/tests/baselines/reference/importAnImport.errors.txt index 4d825215ae691..8b8289af434dc 100644 --- a/tests/baselines/reference/importAnImport.errors.txt +++ b/tests/baselines/reference/importAnImport.errors.txt @@ -1,12 +1,24 @@ +importAnImport.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAnImport.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAnImport.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importAnImport.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importAnImport.ts(6,23): error TS2694: Namespace 'c.a.b' has no exported member 'ma'. -==== importAnImport.ts (1 errors) ==== +==== importAnImport.ts (5 errors) ==== module c.a.b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import ma = a; } module m0 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m8 = c.a.b.ma; ~~ !!! error TS2694: Namespace 'c.a.b' has no exported member 'ma'. diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt index 574ac8736d17e..185f714745697 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict1.errors.txt @@ -1,8 +1,11 @@ +importAndVariableDeclarationConflict1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importAndVariableDeclarationConflict1.ts(5,1): error TS2440: Import declaration conflicts with local declaration of 'x'. -==== importAndVariableDeclarationConflict1.ts (1 errors) ==== +==== importAndVariableDeclarationConflict1.ts (2 errors) ==== module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var m = ''; } diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict2.errors.txt new file mode 100644 index 0000000000000..04098e68c7479 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.errors.txt @@ -0,0 +1,17 @@ +importAndVariableDeclarationConflict2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importAndVariableDeclarationConflict2.ts (1 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m = ''; + } + + import x = m.m; + + class C { + public foo() { + var x = ''; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt index 9a1eba6ab3230..fefeffe89963d 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict3.errors.txt @@ -1,9 +1,12 @@ +importAndVariableDeclarationConflict3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importAndVariableDeclarationConflict3.ts(5,8): error TS2300: Duplicate identifier 'x'. importAndVariableDeclarationConflict3.ts(6,8): error TS2300: Duplicate identifier 'x'. -==== importAndVariableDeclarationConflict3.ts (2 errors) ==== +==== importAndVariableDeclarationConflict3.ts (3 errors) ==== module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var m = ''; } diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt index 9cb984693824f..52a774884c64e 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt +++ b/tests/baselines/reference/importAndVariableDeclarationConflict4.errors.txt @@ -1,8 +1,11 @@ +importAndVariableDeclarationConflict4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importAndVariableDeclarationConflict4.ts(6,1): error TS2440: Import declaration conflicts with local declaration of 'x'. -==== importAndVariableDeclarationConflict4.ts (1 errors) ==== +==== importAndVariableDeclarationConflict4.ts (2 errors) ==== module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var m = ''; } diff --git a/tests/baselines/reference/importDecl.errors.txt b/tests/baselines/reference/importDecl.errors.txt new file mode 100644 index 0000000000000..479e920ff8e92 --- /dev/null +++ b/tests/baselines/reference/importDecl.errors.txt @@ -0,0 +1,88 @@ +importDecl_1.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importDecl_1.ts(32,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importDecl_1.ts (2 errors) ==== + /// + /// + /// + /// + /// + import m4 = require("./importDecl_require"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + //Emit global only usage + import glo_m4 = require("./importDecl_require1"); + export var useGlo_m4_d4 = glo_m4.d; + export var useGlo_m4_f4 = glo_m4.foo(); + + //Emit even when used just in function type + import fncOnly_m4 = require("./importDecl_require2"); + export var useFncOnly_m4_f4 = fncOnly_m4.foo(); + + // only used privately no need to emit + import private_m4 = require("./importDecl_require3"); + export module usePrivate_m4_m1 { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + } + + // Do not emit unused import + import m5 = require("./importDecl_require4"); + export var d = m5.foo2(); + + // Do not emit multiple used import statements + import multiImport_m4 = require("./importDecl_require"); // Emit used + export var useMultiImport_m4_x4 = multiImport_m4.x; + export var useMultiImport_m4_d4 = multiImport_m4.d; + export var useMultiImport_m4_f4 = multiImport_m4.foo(); + +==== importDecl_require.ts (0 errors) ==== + export class d { + foo: string; + } + export var x: d; + export function foo(): d { return null; } + +==== importDecl_require1.ts (0 errors) ==== + export class d { + bar: string; + } + var x: d; + export function foo(): d { return null; } + +==== importDecl_require2.ts (0 errors) ==== + export class d { + baz: string; + } + export var x: d; + export function foo(): d { return null; } + +==== importDecl_require3.ts (0 errors) ==== + export class d { + bing: string; + } + export var x: d; + export function foo(): d { return null; } + +==== importDecl_require4.ts (0 errors) ==== + import m4 = require("./importDecl_require"); + export function foo2(): m4.d { return null; } + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt index 0bfcbbd5ac606..7080415872730 100644 --- a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -1,3 +1,4 @@ +importDeclWithClassModifiers.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module or namespace element. importDeclWithClassModifiers.ts(5,26): error TS2708: Cannot use namespace 'x' as a value. importDeclWithClassModifiers.ts(5,28): error TS2694: Namespace 'x' has no exported member 'c'. @@ -9,8 +10,10 @@ importDeclWithClassModifiers.ts(7,26): error TS2708: Cannot use namespace 'x' as importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no exported member 'c'. -==== importDeclWithClassModifiers.ts (9 errors) ==== +==== importDeclWithClassModifiers.ts (10 errors) ==== module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index eb9308554d6c8..f8c3ef2d4ddd2 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,9 +1,12 @@ +importDeclWithDeclareModifier.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. importDeclWithDeclareModifier.ts(5,29): error TS2694: Namespace 'x' has no exported member 'c'. -==== importDeclWithDeclareModifier.ts (2 errors) ==== +==== importDeclWithDeclareModifier.ts (3 errors) ==== module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt index b1b5a0c638871..e38e5a625a04b 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt @@ -1,9 +1,12 @@ +importDeclWithDeclareModifierInAmbientContext.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithDeclareModifierInAmbientContext.ts(6,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== importDeclWithDeclareModifierInAmbientContext.ts (1 errors) ==== +==== importDeclWithDeclareModifierInAmbientContext.ts (2 errors) ==== declare module "m" { module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithExportModifier.errors.txt b/tests/baselines/reference/importDeclWithExportModifier.errors.txt index e419c438c0413..2a524f5c72bf4 100644 --- a/tests/baselines/reference/importDeclWithExportModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifier.errors.txt @@ -1,9 +1,12 @@ +importDeclWithExportModifier.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithExportModifier.ts(5,19): error TS2708: Cannot use namespace 'x' as a value. importDeclWithExportModifier.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. -==== importDeclWithExportModifier.ts (2 errors) ==== +==== importDeclWithExportModifier.ts (3 errors) ==== module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt index 173d467902e3b..2604ef15e968c 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -1,10 +1,13 @@ +importDeclWithExportModifierAndExportAssignment.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2708: Cannot use namespace 'x' as a value. importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== importDeclWithExportModifierAndExportAssignment.ts (3 errors) ==== +==== importDeclWithExportModifierAndExportAssignment.ts (4 errors) ==== module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt index 62cde19a93336..e950145953b7b 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignmentInAmbientContext.errors.txt @@ -1,9 +1,12 @@ +importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts(7,5): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts (1 errors) ==== +==== importDeclWithExportModifierAndExportAssignmentInAmbientContext.ts (2 errors) ==== declare module "m" { module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface c { } } diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.errors.txt new file mode 100644 index 0000000000000..0eaa13503eb7b --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.errors.txt @@ -0,0 +1,15 @@ +importDeclWithExportModifierInAmbientContext.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importDeclWithExportModifierInAmbientContext.ts (1 errors) ==== + declare module "m" { + module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface c { + } + } + export import a = x.c; + var b: a; + } + \ No newline at end of file diff --git a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt index 5599c200332fe..62572832f8163 100644 --- a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt +++ b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt @@ -1,8 +1,11 @@ +importDeclarationInModuleDeclaration1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importDeclarationInModuleDeclaration1.ts(2,25): error TS1147: Import declarations in a namespace cannot reference a module. -==== importDeclarationInModuleDeclaration1.ts (1 errors) ==== +==== importDeclarationInModuleDeclaration1.ts (2 errors) ==== module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/importInTypePosition.errors.txt b/tests/baselines/reference/importInTypePosition.errors.txt new file mode 100644 index 0000000000000..1083205e41219 --- /dev/null +++ b/tests/baselines/reference/importInTypePosition.errors.txt @@ -0,0 +1,33 @@ +importInTypePosition.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importInTypePosition.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importInTypePosition.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importInTypePosition.ts (3 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + } + export var Origin = new Point(0, 0); + } + + // no code gen expected + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + import a = A; //Error generates 'var = ;' + } + // no code gen expected + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + import a = A; //Error generates 'var = ;' + var m: typeof a; + var p: a.Point; + var p = { x: 0, y: 0 }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt index 6eef346a362fc..08793450a82ac 100644 --- a/tests/baselines/reference/importInsideModule.errors.txt +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -1,9 +1,12 @@ +importInsideModule_file2.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importInsideModule_file2.ts(2,26): error TS1147: Import declarations in a namespace cannot reference a module. importInsideModule_file2.ts(2,26): error TS2307: Cannot find module 'importInsideModule_file1' or its corresponding type declarations. -==== importInsideModule_file2.ts (2 errors) ==== +==== importInsideModule_file2.ts (3 errors) ==== export module myModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import foo = require("importInsideModule_file1"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/importNonExternalModule.errors.txt b/tests/baselines/reference/importNonExternalModule.errors.txt index 1cb0df9bfbfd5..a6748d409afe7 100644 --- a/tests/baselines/reference/importNonExternalModule.errors.txt +++ b/tests/baselines/reference/importNonExternalModule.errors.txt @@ -1,3 +1,4 @@ +foo_0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. foo_1.ts(1,22): error TS2306: File 'foo_0.ts' is not a module. @@ -10,8 +11,10 @@ foo_1.ts(1,22): error TS2306: File 'foo_0.ts' is not a module. } -==== foo_0.ts (0 errors) ==== +==== foo_0.ts (1 errors) ==== module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var answer = 42; } \ No newline at end of file diff --git a/tests/baselines/reference/importOnAliasedIdentifiers.errors.txt b/tests/baselines/reference/importOnAliasedIdentifiers.errors.txt new file mode 100644 index 0000000000000..8d24c0bef4c9e --- /dev/null +++ b/tests/baselines/reference/importOnAliasedIdentifiers.errors.txt @@ -0,0 +1,19 @@ +importOnAliasedIdentifiers.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importOnAliasedIdentifiers.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importOnAliasedIdentifiers.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface X { s: string } + export var X: X; + } + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { n: number } + import Y = A; // Alias only for module A + import Z = A.X; // Alias for both type and member A.X + var v: Z = Z; + } \ No newline at end of file diff --git a/tests/baselines/reference/importStatements.errors.txt b/tests/baselines/reference/importStatements.errors.txt new file mode 100644 index 0000000000000..cef397d18ef1d --- /dev/null +++ b/tests/baselines/reference/importStatements.errors.txt @@ -0,0 +1,52 @@ +importStatements.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatements.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatements.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatements.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatements.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importStatements.ts (5 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + constructor(public x: number, public y: number) { } + } + + export var Origin = new Point(0, 0); + } + + // no code gen expected + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import a = A; //Error generates 'var = ;' + } + + // no code gen expected + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import a = A; //Error generates 'var = ;' + var m: typeof a; + var p: a.Point; + var p = {x:0, y:0 }; + } + + // code gen expected + module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import a = A; + + var p = new a.Point(1, 1); + } + + module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import a = A; + export function xDist(x: a.Point) { + return (a.Origin.x - x.x); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/importStatementsInterfaces.errors.txt b/tests/baselines/reference/importStatementsInterfaces.errors.txt index d2c449abf1ec7..1853c6764da8b 100644 --- a/tests/baselines/reference/importStatementsInterfaces.errors.txt +++ b/tests/baselines/reference/importStatementsInterfaces.errors.txt @@ -1,14 +1,24 @@ +importStatementsInterfaces.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatementsInterfaces.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatementsInterfaces.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatementsInterfaces.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importStatementsInterfaces.ts(23,19): error TS2708: Cannot use namespace 'a' as a value. +importStatementsInterfaces.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importStatementsInterfaces.ts(36,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== importStatementsInterfaces.ts (1 errors) ==== +==== importStatementsInterfaces.ts (7 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point { x: number; y: number; } export module inA { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point3D extends Point { z: number; } @@ -17,11 +27,15 @@ importStatementsInterfaces.ts(23,19): error TS2708: Cannot use namespace 'a' as // no code gen expected module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; } // no code gen expected module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; import b = a.inA; var m: typeof a; @@ -33,6 +47,8 @@ importStatementsInterfaces.ts(23,19): error TS2708: Cannot use namespace 'a' as // no code gen expected module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; var p : a.Point; @@ -40,6 +56,8 @@ importStatementsInterfaces.ts(23,19): error TS2708: Cannot use namespace 'a' as // no code gen expected module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A.inA; export function xDist(x: a.Point3D) { return 0 - x.x; diff --git a/tests/baselines/reference/import_reference-exported-alias.errors.txt b/tests/baselines/reference/import_reference-exported-alias.errors.txt new file mode 100644 index 0000000000000..404b1a592b668 --- /dev/null +++ b/tests/baselines/reference/import_reference-exported-alias.errors.txt @@ -0,0 +1,28 @@ +file1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file2.ts (0 errors) ==== + import appJs = require("file1"); + import Services = appJs.Services; + import UserServices = Services.UserServices; + var x = new UserServices().getUserName(); + +==== file1.ts (2 errors) ==== + module App { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Services { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class UserServices { + public getUserName(): string { + return "Bill Gates"; + } + } + } + } + + import Mod = App; + export = Mod; + \ No newline at end of file diff --git a/tests/baselines/reference/import_reference-to-type-alias.errors.txt b/tests/baselines/reference/import_reference-to-type-alias.errors.txt new file mode 100644 index 0000000000000..99306aa2e1f88 --- /dev/null +++ b/tests/baselines/reference/import_reference-to-type-alias.errors.txt @@ -0,0 +1,24 @@ +file1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file2.ts (0 errors) ==== + import appJs = require("file1"); + import Services = appJs.App.Services; + var x = new Services.UserServices().getUserName(); + +==== file1.ts (2 errors) ==== + export module App { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Services { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class UserServices { + public getUserName(): string { + return "Bill Gates"; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importedAliasesInTypePositions.errors.txt b/tests/baselines/reference/importedAliasesInTypePositions.errors.txt new file mode 100644 index 0000000000000..77d0de0299e63 --- /dev/null +++ b/tests/baselines/reference/importedAliasesInTypePositions.errors.txt @@ -0,0 +1,34 @@ +file1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(1,25): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(1,32): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file1.ts(1,36): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file2.ts(4,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file2.ts (1 errors) ==== + import RT_ALIAS = require("file1"); + import ReferredTo = RT_ALIAS.elaborate.nested.mod.name.ReferredTo; + + export module ImportingModule { + ~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class UsesReferredType { + constructor(private referred: ReferredTo) { } + } + } +==== file1.ts (4 errors) ==== + export module elaborate.nested.mod.name { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ReferredTo { + doSomething(): void { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt index a32d53424e407..2e72e2afe4300 100644 --- a/tests/baselines/reference/importedModuleAddToGlobal.errors.txt +++ b/tests/baselines/reference/importedModuleAddToGlobal.errors.txt @@ -1,20 +1,29 @@ +importedModuleAddToGlobal.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importedModuleAddToGlobal.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +importedModuleAddToGlobal.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. importedModuleAddToGlobal.ts(15,23): error TS2833: Cannot find namespace 'b'. Did you mean 'B'? -==== importedModuleAddToGlobal.ts (1 errors) ==== +==== importedModuleAddToGlobal.ts (4 errors) ==== // Binding for an import statement in a typeref position is being added to the global scope // Shouldn't compile b.B is not defined in C module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = B; import c = C; } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; export class B { } } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; function hello(): b.B { return null; } ~ diff --git a/tests/baselines/reference/importedModuleClassNameClash.errors.txt b/tests/baselines/reference/importedModuleClassNameClash.errors.txt new file mode 100644 index 0000000000000..e2f1854ed59e3 --- /dev/null +++ b/tests/baselines/reference/importedModuleClassNameClash.errors.txt @@ -0,0 +1,12 @@ +importedModuleClassNameClash.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== importedModuleClassNameClash.ts (1 errors) ==== + import foo = m1; + + export module m1 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class foo { } + \ No newline at end of file diff --git a/tests/baselines/reference/importedModuleClassNameClash.types b/tests/baselines/reference/importedModuleClassNameClash.types index f37fab285be1d..607a576ef6061 100644 --- a/tests/baselines/reference/importedModuleClassNameClash.types +++ b/tests/baselines/reference/importedModuleClassNameClash.types @@ -4,7 +4,8 @@ import foo = m1; >foo : typeof foo > : ^^^^^^^^^^ ->m1 : error +>m1 : any +> : ^^^ export module m1 { } diff --git a/tests/baselines/reference/incompatibleExports1.errors.txt b/tests/baselines/reference/incompatibleExports1.errors.txt index f890ae46cc295..c7386fb639d03 100644 --- a/tests/baselines/reference/incompatibleExports1.errors.txt +++ b/tests/baselines/reference/incompatibleExports1.errors.txt @@ -1,8 +1,10 @@ incompatibleExports1.ts(4,5): error TS2309: An export assignment cannot be used in a module with other exported elements. +incompatibleExports1.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +incompatibleExports1.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. incompatibleExports1.ts(16,5): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== incompatibleExports1.ts (2 errors) ==== +==== incompatibleExports1.ts (4 errors) ==== declare module "foo" { export interface x { a: string } interface y { a: Date } @@ -13,10 +15,14 @@ incompatibleExports1.ts(16,5): error TS2309: An export assignment cannot be used declare module "baz" { export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var b: number; } module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c: string; } diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherType.errors.txt new file mode 100644 index 0000000000000..758607a0d19db --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,54 @@ +incrementOperatorWithAnyOtherType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== incrementOperatorWithAnyOtherType.ts (1 errors) ==== + // ++ operator on any type + + var ANY: any; + var ANY1: any; + var ANY2: any[] = ["", ""]; + var obj = {x:1,y:null}; + class A { + public a: any; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = ++ANY; + var ResultIsNumber2 = ++ANY1; + + var ResultIsNumber3 = ANY1++; + var ResultIsNumber4 = ANY1++; + + // expressions + var ResultIsNumber5 = ++ANY2[0]; + var ResultIsNumber6 = ++obj.x; + var ResultIsNumber7 = ++obj.y; + var ResultIsNumber8 = ++objA.a; + var ResultIsNumber = ++M.n; + + var ResultIsNumber9 = ANY2[0]++; + var ResultIsNumber10 = obj.x++; + var ResultIsNumber11 = obj.y++; + var ResultIsNumber12 = objA.a++; + var ResultIsNumber13 = M.n++; + + // miss assignment opertors + ++ANY; + ++ANY1; + ++ANY2[0]; + ++ANY, ++ANY1; + ++objA.a; + ++M.n; + + ANY++; + ANY1++; + ANY2[0]++; + ANY++, ANY1++; + objA.a++; + M.n++; \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index d71b8b164396a..033aa5e9922e7 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -5,9 +5,11 @@ var ANY: any; >ANY : any +> : ^^^ var ANY1: any; >ANY1 : any +> : ^^^ var ANY2: any[] = ["", ""]; >ANY2 : any[] @@ -37,6 +39,7 @@ class A { public a: any; >a : any +> : ^^^ } module M { >M : typeof M @@ -44,6 +47,7 @@ module M { export var n: any; >n : any +> : ^^^ } var objA = new A(); >objA : A @@ -60,6 +64,7 @@ var ResultIsNumber1 = ++ANY; >++ANY : number > : ^^^^^^ >ANY : any +> : ^^^ var ResultIsNumber2 = ++ANY1; >ResultIsNumber2 : number @@ -67,6 +72,7 @@ var ResultIsNumber2 = ++ANY1; >++ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ var ResultIsNumber3 = ANY1++; >ResultIsNumber3 : number @@ -74,6 +80,7 @@ var ResultIsNumber3 = ANY1++; >ANY1++ : number > : ^^^^^^ >ANY1 : any +> : ^^^ var ResultIsNumber4 = ANY1++; >ResultIsNumber4 : number @@ -81,6 +88,7 @@ var ResultIsNumber4 = ANY1++; >ANY1++ : number > : ^^^^^^ >ANY1 : any +> : ^^^ // expressions var ResultIsNumber5 = ++ANY2[0]; @@ -89,6 +97,7 @@ var ResultIsNumber5 = ++ANY2[0]; >++ANY2[0] : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -112,6 +121,7 @@ var ResultIsNumber7 = ++obj.y; >++obj.y : number > : ^^^^^^ >obj.y : any +> : ^^^ >obj : { x: number; y: any; } > : ^^^^^^^^^^^^^^^^^^^^^^ >y : any @@ -123,6 +133,7 @@ var ResultIsNumber8 = ++objA.a; >++objA.a : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -134,6 +145,7 @@ var ResultIsNumber = ++M.n; >++M.n : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -145,6 +157,7 @@ var ResultIsNumber9 = ANY2[0]++; >ANY2[0]++ : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -168,6 +181,7 @@ var ResultIsNumber11 = obj.y++; >obj.y++ : number > : ^^^^^^ >obj.y : any +> : ^^^ >obj : { x: number; y: any; } > : ^^^^^^^^^^^^^^^^^^^^^^ >y : any @@ -179,6 +193,7 @@ var ResultIsNumber12 = objA.a++; >objA.a++ : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -190,6 +205,7 @@ var ResultIsNumber13 = M.n++; >M.n++ : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -200,16 +216,19 @@ var ResultIsNumber13 = M.n++; >++ANY : number > : ^^^^^^ >ANY : any +> : ^^^ ++ANY1; >++ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ ++ANY2[0]; >++ANY2[0] : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -221,14 +240,17 @@ var ResultIsNumber13 = M.n++; >++ANY : number > : ^^^^^^ >ANY : any +> : ^^^ >++ANY1 : number > : ^^^^^^ >ANY1 : any +> : ^^^ ++objA.a; >++objA.a : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -238,6 +260,7 @@ var ResultIsNumber13 = M.n++; >++M.n : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any @@ -247,16 +270,19 @@ ANY++; >ANY++ : number > : ^^^^^^ >ANY : any +> : ^^^ ANY1++; >ANY1++ : number > : ^^^^^^ >ANY1 : any +> : ^^^ ANY2[0]++; >ANY2[0]++ : number > : ^^^^^^ >ANY2[0] : any +> : ^^^ >ANY2 : any[] > : ^^^^^ >0 : 0 @@ -268,14 +294,17 @@ ANY++, ANY1++; >ANY++ : number > : ^^^^^^ >ANY : any +> : ^^^ >ANY1++ : number > : ^^^^^^ >ANY1 : any +> : ^^^ objA.a++; >objA.a++ : number > : ^^^^^^ >objA.a : any +> : ^^^ >objA : A > : ^ >a : any @@ -285,6 +314,7 @@ M.n++; >M.n++ : number > : ^^^^^^ >M.n : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >n : any diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 5992663378457..f4ad2257fe205 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,3 +1,4 @@ +incrementOperatorWithAnyOtherTypeInvalidOperations.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. incrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2629: Cannot assign to 'A' because it is a class. incrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2631: Cannot assign to 'M' because it is a namespace. @@ -47,7 +48,7 @@ incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,10): error TS1005: ';' incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,12): error TS1109: Expression expected. -==== incrementOperatorWithAnyOtherTypeInvalidOperations.ts (47 errors) ==== +==== incrementOperatorWithAnyOtherTypeInvalidOperations.ts (48 errors) ==== // ++ operator on any type var ANY1: any; var ANY2: any[] = [1, 2]; @@ -66,6 +67,8 @@ incrementOperatorWithAnyOtherTypeInvalidOperations.ts(69,12): error TS1109: Expr } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.errors.txt b/tests/baselines/reference/incrementOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..6f159c0f3f031 --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberType.errors.txt @@ -0,0 +1,45 @@ +incrementOperatorWithNumberType.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== incrementOperatorWithNumberType.ts (1 errors) ==== + // ++ operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + class A { + public a: number; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = ++NUMBER; + + var ResultIsNumber2 = NUMBER++; + + // expressions + var ResultIsNumber3 = ++objA.a; + var ResultIsNumber4 = ++M.n; + + var ResultIsNumber5 = objA.a++; + var ResultIsNumber6 = M.n++; + var ResultIsNumber7 = NUMBER1[0]++; + + // miss assignment operators + ++NUMBER; + + ++NUMBER1[0]; + ++objA.a; + ++M.n; + ++objA.a, M.n; + + NUMBER++; + NUMBER1[0]++; + objA.a++; + M.n++; + objA.a++, M.n++; \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt index 0b96118b62cf0..a41ee2da88d82 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.errors.txt @@ -1,3 +1,4 @@ +incrementOperatorWithNumberTypeInvalidOperations.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. incrementOperatorWithNumberTypeInvalidOperations.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithNumberTypeInvalidOperations.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithNumberTypeInvalidOperations.ts(22,25): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. @@ -20,7 +21,7 @@ incrementOperatorWithNumberTypeInvalidOperations.ts(45,1): error TS2356: An arit incrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. -==== incrementOperatorWithNumberTypeInvalidOperations.ts (20 errors) ==== +==== incrementOperatorWithNumberTypeInvalidOperations.ts (21 errors) ==== // ++ operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -32,6 +33,8 @@ incrementOperatorWithNumberTypeInvalidOperations.ts(46,1): error TS2357: The ope static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt index d4dd02cbb079f..9ae712b8da7ff 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedBooleanType.errors.txt @@ -1,3 +1,4 @@ +incrementOperatorWithUnsupportedBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. incrementOperatorWithUnsupportedBooleanType.ts(17,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithUnsupportedBooleanType.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithUnsupportedBooleanType.ts(22,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -29,7 +30,7 @@ incrementOperatorWithUnsupportedBooleanType.ts(54,1): error TS2356: An arithmeti incrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -==== incrementOperatorWithUnsupportedBooleanType.ts (29 errors) ==== +==== incrementOperatorWithUnsupportedBooleanType.ts (30 errors) ==== // ++ operator on boolean type var BOOLEAN: boolean; @@ -40,6 +41,8 @@ incrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmet static foo() { return true; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt index 315c8a46200f4..6360013d1a5fa 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.errors.txt @@ -1,3 +1,4 @@ +incrementOperatorWithUnsupportedStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. incrementOperatorWithUnsupportedStringType.ts(18,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithUnsupportedStringType.ts(19,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. incrementOperatorWithUnsupportedStringType.ts(21,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -39,7 +40,7 @@ incrementOperatorWithUnsupportedStringType.ts(65,1): error TS2356: An arithmetic incrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -==== incrementOperatorWithUnsupportedStringType.ts (39 errors) ==== +==== incrementOperatorWithUnsupportedStringType.ts (40 errors) ==== // ++ operator on string type var STRING: string; var STRING1: string[] = ["", ""]; @@ -51,6 +52,8 @@ incrementOperatorWithUnsupportedStringType.ts(65,11): error TS2356: An arithmeti static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/indexIntoEnum.errors.txt b/tests/baselines/reference/indexIntoEnum.errors.txt new file mode 100644 index 0000000000000..279cf4f4cf453 --- /dev/null +++ b/tests/baselines/reference/indexIntoEnum.errors.txt @@ -0,0 +1,12 @@ +indexIntoEnum.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== indexIntoEnum.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + enum E { } + + var x = E[0]; + } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.errors.txt b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.errors.txt new file mode 100644 index 0000000000000..d2beebb6a1316 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.errors.txt @@ -0,0 +1,23 @@ +inheritanceOfGenericConstructorMethod2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +inheritanceOfGenericConstructorMethod2.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== inheritanceOfGenericConstructorMethod2.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1 { } + export class C2 { } + } + module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class D1 extends M.C1 { } + export class D2 extends M.C2 { } + } + + var c = new M.C2(); // no error + var n = new N.D1(); // no error + var n2 = new N.D2(); // error + var n3 = new N.D2(); // no error, D2 + \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index a5bd20735e4e3..05bed046fa2ba 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,9 +1,10 @@ inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. The types returned by 'foo()' are incompatible between these types. Type 'number' is not assignable to type 'string'. +inheritedModuleMembersForClodule.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== inheritedModuleMembersForClodule.ts (1 errors) ==== +==== inheritedModuleMembersForClodule.ts (2 errors) ==== class C { static foo(): string { return "123"; @@ -18,6 +19,8 @@ inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeo } module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function foo(): number { return 0; }; diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index e50542fa18c7a..2a0ad9702bfd1 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -3,11 +3,12 @@ file1.d.ts(5,16): error TS1039: Initializers are not allowed in ambient contexts file1.d.ts(6,16): error TS1183: An implementation cannot be declared in ambient contexts. file1.d.ts(11,17): error TS1039: Initializers are not allowed in ambient contexts. file1.d.ts(12,17): error TS1039: Initializers are not allowed in ambient contexts. +file1.d.ts(14,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file1.d.ts(15,2): error TS1036: Statements are not allowed in ambient contexts. file1.d.ts(17,18): error TS1039: Initializers are not allowed in ambient contexts. -==== file1.d.ts (7 errors) ==== +==== file1.d.ts (8 errors) ==== // Errors: Initializers & statements in declaration file declare class Foo { @@ -32,6 +33,8 @@ file1.d.ts(17,18): error TS1039: Initializers are not allowed in ambient context !!! error TS1039: Initializers are not allowed in ambient contexts. declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while(true); ~~~~~ !!! error TS1036: Statements are not allowed in ambient contexts. diff --git a/tests/baselines/reference/innerAliases.errors.txt b/tests/baselines/reference/innerAliases.errors.txt index 5f525bf3d9680..fc504d4fb690d 100644 --- a/tests/baselines/reference/innerAliases.errors.txt +++ b/tests/baselines/reference/innerAliases.errors.txt @@ -1,22 +1,37 @@ +innerAliases.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerAliases.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerAliases.ts(3,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerAliases.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerAliases.ts(14,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. innerAliases.ts(19,10): error TS2694: Namespace 'D' has no exported member 'inner'. innerAliases.ts(21,11): error TS2339: Property 'inner' does not exist on type 'typeof D'. -==== innerAliases.ts (2 errors) ==== +==== innerAliases.ts (7 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Class1 {} } } } module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import inner = A.B.C; var c1 = new inner.Class1(); export module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Class2 {} } } diff --git a/tests/baselines/reference/innerAliases2.errors.txt b/tests/baselines/reference/innerAliases2.errors.txt new file mode 100644 index 0000000000000..68272026bda82 --- /dev/null +++ b/tests/baselines/reference/innerAliases2.errors.txt @@ -0,0 +1,28 @@ +innerAliases2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerAliases2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== innerAliases2.ts (2 errors) ==== + module _provider { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class UsefulClass { + public foo() { + } + } + } + + module consumer { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import provider = _provider; + + var g:provider.UsefulClass= null; + + function use():provider.UsefulClass { + var p2:provider.UsefulClass= new provider.UsefulClass(); + return p2; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/innerBoundLambdaEmit.errors.txt b/tests/baselines/reference/innerBoundLambdaEmit.errors.txt new file mode 100644 index 0000000000000..f3f4d8367a95f --- /dev/null +++ b/tests/baselines/reference/innerBoundLambdaEmit.errors.txt @@ -0,0 +1,15 @@ +innerBoundLambdaEmit.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== innerBoundLambdaEmit.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Foo { + } + var bar = () => { }; + } + interface Array { + toFoo(): M.Foo + } + \ No newline at end of file diff --git a/tests/baselines/reference/innerExtern.errors.txt b/tests/baselines/reference/innerExtern.errors.txt new file mode 100644 index 0000000000000..afafed3344186 --- /dev/null +++ b/tests/baselines/reference/innerExtern.errors.txt @@ -0,0 +1,25 @@ +innerExtern.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerExtern.ts(2,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +innerExtern.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== innerExtern.ts (3 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export declare module BB { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Elephant; + } + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + x = BB.Elephant.X; + } + } + } + + + \ No newline at end of file diff --git a/tests/baselines/reference/innerExtern.types b/tests/baselines/reference/innerExtern.types index 8c6a857d3906d..77fa6fdff3701 100644 --- a/tests/baselines/reference/innerExtern.types +++ b/tests/baselines/reference/innerExtern.types @@ -11,6 +11,7 @@ module A { export var Elephant; >Elephant : any +> : ^^^ } export module B { >B : typeof B @@ -22,7 +23,9 @@ module A { x = BB.Elephant.X; >x : any +> : ^^^ >BB.Elephant.X : any +> : ^^^ >BB.Elephant : any > : ^^^ >BB : typeof BB diff --git a/tests/baselines/reference/innerFunc.errors.txt b/tests/baselines/reference/innerFunc.errors.txt new file mode 100644 index 0000000000000..6708178d49624 --- /dev/null +++ b/tests/baselines/reference/innerFunc.errors.txt @@ -0,0 +1,18 @@ +innerFunc.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== innerFunc.ts (1 errors) ==== + function salt() { + function pepper() { return 5;} + return pepper(); + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function tungsten() { + function oxygen() { return 6; }; + return oxygen(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/innerModExport1.errors.txt b/tests/baselines/reference/innerModExport1.errors.txt index 1aa62fd7d503a..2a0847a6fa5dd 100644 --- a/tests/baselines/reference/innerModExport1.errors.txt +++ b/tests/baselines/reference/innerModExport1.errors.txt @@ -1,9 +1,12 @@ +innerModExport1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. innerModExport1.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. innerModExport1.ts(5,12): error TS1437: Namespace must be given a name. -==== innerModExport1.ts (2 errors) ==== +==== innerModExport1.ts (3 errors) ==== module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // inner mod 1 var non_export_var: number; diff --git a/tests/baselines/reference/innerModExport2.errors.txt b/tests/baselines/reference/innerModExport2.errors.txt index 8ee2da64c160c..fbb60052f4f05 100644 --- a/tests/baselines/reference/innerModExport2.errors.txt +++ b/tests/baselines/reference/innerModExport2.errors.txt @@ -1,3 +1,4 @@ +innerModExport2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. innerModExport2.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. innerModExport2.ts(5,12): error TS1437: Namespace must be given a name. innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local. @@ -5,8 +6,10 @@ innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declar innerModExport2.ts(20,7): error TS2551: Property 'NonExportFunc' does not exist on type 'typeof Outer'. Did you mean 'ExportFunc'? -==== innerModExport2.ts (5 errors) ==== +==== innerModExport2.ts (6 errors) ==== module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // inner mod 1 var non_export_var: number; diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt index c1be6890bb1a9..3ec3583aea5be 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt @@ -1,11 +1,15 @@ +instancePropertiesInheritedIntoClassType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. instancePropertiesInheritedIntoClassType.ts(19,16): error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'? Type 'Number' has no call signatures. +instancePropertiesInheritedIntoClassType.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. instancePropertiesInheritedIntoClassType.ts(41,16): error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'? Type 'String' has no call signatures. -==== instancePropertiesInheritedIntoClassType.ts (2 errors) ==== +==== instancePropertiesInheritedIntoClassType.ts (4 errors) ==== module NonGeneric { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { x: string; get y() { @@ -31,6 +35,8 @@ instancePropertiesInheritedIntoClassType.ts(41,16): error TS6234: This expressio } module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { x: T; get y() { diff --git a/tests/baselines/reference/instancePropertyInClassType.errors.txt b/tests/baselines/reference/instancePropertyInClassType.errors.txt index b6f77f8d2e36f..5ee07a4c4acad 100644 --- a/tests/baselines/reference/instancePropertyInClassType.errors.txt +++ b/tests/baselines/reference/instancePropertyInClassType.errors.txt @@ -1,11 +1,15 @@ +instancePropertyInClassType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. instancePropertyInClassType.ts(17,16): error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'? Type 'Number' has no call signatures. +instancePropertyInClassType.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. instancePropertyInClassType.ts(37,16): error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'? Type 'String' has no call signatures. -==== instancePropertyInClassType.ts (2 errors) ==== +==== instancePropertyInClassType.ts (4 errors) ==== module NonGeneric { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { x: string; get y() { @@ -29,6 +33,8 @@ instancePropertyInClassType.ts(37,16): error TS6234: This expression is not call } module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { x: T; get y() { diff --git a/tests/baselines/reference/instanceofOperator.errors.txt b/tests/baselines/reference/instanceofOperator.errors.txt index 032389a10bee2..9216e2fdd5bca 100644 --- a/tests/baselines/reference/instanceofOperator.errors.txt +++ b/tests/baselines/reference/instanceofOperator.errors.txt @@ -1,3 +1,4 @@ +instanceofOperator.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. instanceofOperator.ts(7,11): error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS. instanceofOperator.ts(12,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. instanceofOperator.ts(15,20): error TS2359: The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method. @@ -6,13 +7,15 @@ instanceofOperator.ts(19,5): error TS2358: The left-hand side of an 'instanceof' instanceofOperator.ts(21,5): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. -==== instanceofOperator.ts (6 errors) ==== +==== instanceofOperator.ts (7 errors) ==== // Spec: // The instanceof operator requires the left operand to be of type Any or an object type, and the right // operand to be of type Any or a subtype of the ‘Function’ interface type. The result is always of the // Boolean primitive type. module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Object { } ~~~~~~ !!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module CommonJS. diff --git a/tests/baselines/reference/instantiatedModule.errors.txt b/tests/baselines/reference/instantiatedModule.errors.txt new file mode 100644 index 0000000000000..c4eccd186189c --- /dev/null +++ b/tests/baselines/reference/instantiatedModule.errors.txt @@ -0,0 +1,72 @@ +instantiatedModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +instantiatedModule.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +instantiatedModule.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== instantiatedModule.ts (3 errors) ==== + // adding the var makes this an instantiated module + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { x: number; y: number } + export var Point = 1; + } + + // primary expression + var m: typeof M; + var m = M; + + var a1: number; + var a1 = M.Point; + var a1 = m.Point; + + var p1: { x: number; y: number; } + var p1: M.Point; + + // making the point a class instead of an interface + // makes this an instantiated mmodule + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Point { + x: number; + y: number; + static Origin(): Point { + return { x: 0, y: 0 }; + } + } + } + + var m2: typeof M2; + var m2 = M2; + + // static side of the class + var a2: typeof M2.Point; + var a2 = m2.Point; + var a2 = M2.Point; + var o: M2.Point = a2.Origin(); + + var p2: { x: number; y: number } + var p2: M2.Point; + var p2 = new m2.Point(); + var p2 = new M2.Point(); + + module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Color { Blue, Red } + } + + var m3: typeof M3; + var m3 = M3; + + var a3: typeof M3.Color; + var a3 = m3.Color; + var a3 = M3.Color; + var blue: M3.Color = a3.Blue; + + var p3: M3.Color; + var p3 = M3.Color.Red; + var p3 = m3.Color.Blue; + \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces0.errors.txt new file mode 100644 index 0000000000000..4f70870149c00 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces0.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces0.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces0.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces0.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): B { + return null; + } + } + + export interface B { + name: string; + value: number; + } + } + + var x: A.B = A.B.createB(); \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces1.errors.txt new file mode 100644 index 0000000000000..e0a71fc435569 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces1.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces1.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces1.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface B { + name: string; + value: number; + } + + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): B { + return null; + } + } + } + + var x: A.B = A.B.createB(); \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces2.errors.txt new file mode 100644 index 0000000000000..822575314977d --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces2.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces2.ts(8,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces2.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface B { + name: string; + value: number; + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): B { + return null; + } + } + } + + var x: A.B = null; \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces3.errors.txt new file mode 100644 index 0000000000000..6a21512f64ee6 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces3.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces3.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces3.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): B { + return null; + } + } + + export interface B { + name: string; + value: number; + } + } + + var x: A.B = null; \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces4.errors.txt new file mode 100644 index 0000000000000..0c5d6a13b2e2a --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces4.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces4.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces4.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): number { + return null; + } + } + + interface B { + name: string; + value: number; + } + } + + var x : number = A.B.createB(); \ No newline at end of file diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.errors.txt b/tests/baselines/reference/interMixingModulesInterfaces5.errors.txt new file mode 100644 index 0000000000000..274423f6f9cea --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces5.errors.txt @@ -0,0 +1,24 @@ +interMixingModulesInterfaces5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interMixingModulesInterfaces5.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interMixingModulesInterfaces5.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface B { + name: string; + value: number; + } + + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createB(): number { + return null; + } + } + } + + var x: number = A.B.createB(); \ No newline at end of file diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index 1b16cb3a0d4de..bdbee55e111d7 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,3 +1,4 @@ +interfaceAssignmentCompat.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. Types of parameters 'a' and 'a' are incompatible. Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'. @@ -7,8 +8,10 @@ interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignabl Property 'coleur' is missing in type 'IEye' but required in type 'IFrenchEye'. -==== interfaceAssignmentCompat.ts (4 errors) ==== +==== interfaceAssignmentCompat.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Color { Green, Blue, diff --git a/tests/baselines/reference/interfaceDeclaration2.errors.txt b/tests/baselines/reference/interfaceDeclaration2.errors.txt new file mode 100644 index 0000000000000..016f6e50de37a --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration2.errors.txt @@ -0,0 +1,19 @@ +interfaceDeclaration2.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interfaceDeclaration2.ts (1 errors) ==== + interface I1 { } + module I1 { } + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface I2 { } + class I2 { } + + interface I3 { } + function I3() { } + + interface I4 { } + var I4:number; + + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration3.errors.txt b/tests/baselines/reference/interfaceDeclaration3.errors.txt index 2c1cad0c9cf47..081e10a06322f 100644 --- a/tests/baselines/reference/interfaceDeclaration3.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration3.errors.txt @@ -1,5 +1,8 @@ +interfaceDeclaration3.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceDeclaration3.ts(7,16): error TS2416: Property 'item' in type 'C1' is not assignable to the same property in base type 'I1'. Type 'number' is not assignable to type 'string'. +interfaceDeclaration3.ts(25,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interfaceDeclaration3.ts(28,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceDeclaration3.ts(32,16): error TS2416: Property 'item' in type 'C1' is not assignable to the same property in base type 'I1'. Type 'number' is not assignable to type 'string'. interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extends interface 'I1'. @@ -7,10 +10,12 @@ interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extend Type 'string' is not assignable to type 'number'. -==== interfaceDeclaration3.ts (3 errors) ==== +==== interfaceDeclaration3.ts (6 errors) ==== interface I1 { item:number; } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I1 { item:string; } interface I2 { item:number; } class C1 implements I1 { @@ -36,9 +41,13 @@ interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extend } export module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I1 { item:string; } export interface I2 { item:string; } export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I1 { item:string; } } class C1 implements I1 { diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt index e19ccdeae1391..283031ffb6d5a 100644 --- a/tests/baselines/reference/interfaceDeclaration4.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -1,3 +1,4 @@ +interfaceDeclaration4.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'. Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. @@ -10,10 +11,12 @@ interfaceDeclaration4.ts(39,15): error TS1434: Unexpected keyword or identifier. interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'. -==== interfaceDeclaration4.ts (6 errors) ==== +==== interfaceDeclaration4.ts (7 errors) ==== // Import this module when test harness supports external modules. Also remove the internal module below. // import Foo = require("interfaceDeclaration5") module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I1 { item: string; } export class C1 { } } diff --git a/tests/baselines/reference/interfaceInReopenedModule.errors.txt b/tests/baselines/reference/interfaceInReopenedModule.errors.txt new file mode 100644 index 0000000000000..a75a48da27a2a --- /dev/null +++ b/tests/baselines/reference/interfaceInReopenedModule.errors.txt @@ -0,0 +1,20 @@ +interfaceInReopenedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +interfaceInReopenedModule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interfaceInReopenedModule.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + // In second instance of same module, exported interface is not visible + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface f {} + export class n { + private n: f; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt index 15cd072ad9638..dbd83dc9617c9 100644 --- a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt +++ b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt @@ -1,8 +1,9 @@ interfaceNameAsIdentifier.ts(4,1): error TS2693: 'C' only refers to a type, but is being used as a value here. +interfaceNameAsIdentifier.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceNameAsIdentifier.ts(12,1): error TS2708: Cannot use namespace 'm2' as a value. -==== interfaceNameAsIdentifier.ts (2 errors) ==== +==== interfaceNameAsIdentifier.ts (3 errors) ==== interface C { (): void; } @@ -11,6 +12,8 @@ interfaceNameAsIdentifier.ts(12,1): error TS2708: Cannot use namespace 'm2' as a !!! error TS2693: 'C' only refers to a type, but is being used as a value here. module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface C { (): void; } diff --git a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt index 2d20eda507329..c44ffee7a4135 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt @@ -1,10 +1,11 @@ interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical. +interfacePropertiesWithSameName2.ts(15,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical. -==== interfacePropertiesWithSameName2.ts (2 errors) ==== +==== interfacePropertiesWithSameName2.ts (3 errors) ==== interface Mover { move(): void; getStatus(): { speed: number; }; @@ -23,6 +24,8 @@ interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker // Inside a module declare module MoversAndShakers { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Mover { move(): void; getStatus(): { speed: number; }; diff --git a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt index 6115e058ab48f..d293ee5897da8 100644 --- a/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt +++ b/tests/baselines/reference/interfaceThatIndirectlyInheritsFromItself.errors.txt @@ -1,12 +1,13 @@ interfaceThatIndirectlyInheritsFromItself.ts(1,11): error TS2310: Type 'Base' recursively references itself as a base type. interfaceThatIndirectlyInheritsFromItself.ts(5,11): error TS2310: Type 'Derived' recursively references itself as a base type. interfaceThatIndirectlyInheritsFromItself.ts(9,11): error TS2310: Type 'Derived2' recursively references itself as a base type. +interfaceThatIndirectlyInheritsFromItself.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceThatIndirectlyInheritsFromItself.ts(14,15): error TS2310: Type 'Base' recursively references itself as a base type. interfaceThatIndirectlyInheritsFromItself.ts(18,15): error TS2310: Type 'Derived' recursively references itself as a base type. interfaceThatIndirectlyInheritsFromItself.ts(22,15): error TS2310: Type 'Derived2' recursively references itself as a base type. -==== interfaceThatIndirectlyInheritsFromItself.ts (6 errors) ==== +==== interfaceThatIndirectlyInheritsFromItself.ts (7 errors) ==== interface Base extends Derived2 { // error ~~~~ !!! error TS2310: Type 'Base' recursively references itself as a base type. @@ -26,6 +27,8 @@ interfaceThatIndirectlyInheritsFromItself.ts(22,15): error TS2310: Type 'Derived } module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base extends Derived2 { // error ~~~~ !!! error TS2310: Type 'Base' recursively references itself as a base type. diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt index be02808aa9a7b..f7d522d19a683 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt @@ -1,6 +1,7 @@ interfaceWithMultipleBaseTypes.ts(21,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. The types of 'x.b' are incompatible between these types. Type 'number' is not assignable to type 'string'. +interfaceWithMultipleBaseTypes.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. Named property 'x' of types 'Base1' and 'Base2' are not identical. interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. @@ -17,7 +18,7 @@ interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' Type 'T' is not assignable to type '{ b: T; }'. -==== interfaceWithMultipleBaseTypes.ts (6 errors) ==== +==== interfaceWithMultipleBaseTypes.ts (7 errors) ==== // an interface may have multiple bases with properties of the same name as long as the interface's implementation satisfies all base type versions interface Base1 { @@ -49,6 +50,8 @@ interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' } module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base1 { x: { a: T; diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.errors.txt b/tests/baselines/reference/interfaceWithPropertyOfEveryType.errors.txt new file mode 100644 index 0000000000000..7aa4c3c5dffd8 --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.errors.txt @@ -0,0 +1,48 @@ +interfaceWithPropertyOfEveryType.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== interfaceWithPropertyOfEveryType.ts (1 errors) ==== + class C { foo: string; } + function f1() { } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var y = 1; + } + enum E { A } + + interface Foo { + a: number; + b: string; + c: boolean; + d: any; + e: void; + f: number[]; + g: Object; + h: (x: number) => number; + i: (x: T) => T; + j: Foo; + k: C; + l: typeof f1; + m: typeof M; + n: {}; + o: E; + } + + var a: Foo = { + a: 1, + b: '', + c: true, + d: {}, + e: null , + f: [1], + g: {}, + h: (x: number) => 1, + i: (x: T) => x, + j: null, + k: new C(), + l: f1, + m: M, + n: {}, + o: E.A + } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index ebe5752bb6c6a..2fbe0234439fc 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -42,6 +42,7 @@ interface Foo { d: any; >d : any +> : ^^^ e: void; >e : void diff --git a/tests/baselines/reference/internalAliasClass.errors.txt b/tests/baselines/reference/internalAliasClass.errors.txt new file mode 100644 index 0000000000000..4631c21a89785 --- /dev/null +++ b/tests/baselines/reference/internalAliasClass.errors.txt @@ -0,0 +1,18 @@ +internalAliasClass.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClass.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasClass.ts (2 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.c; + export var x: b = new b(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..88df96fde7639 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,29 @@ +internalAliasClassInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithExport.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasClassInsideLocalModuleWithExport.ts (3 errors) ==== + export module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + foo(a: number) { + return a; + } + } + } + + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } + } + + export var d = new m2.m3.c(); \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..34f4817c66104 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,27 @@ +internalAliasClassInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithoutExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithoutExport.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasClassInsideLocalModuleWithoutExport.ts (3 errors) ==== + export module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + foo(a: number) { + return a; + } + } + } + + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import c = x.c; + export var cProp = new c(); + var cReturnVal = cProp.foo(10); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt index c2308deeee511..7ae5422ffe6fb 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,8 +1,13 @@ +internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(10,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(17,26): error TS2339: Property 'c' does not exist on type 'typeof m3'. -==== internalAliasClassInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasClassInsideLocalModuleWithoutExportAccessError.ts (4 errors) ==== export module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c { foo(a: number) { return a; @@ -11,7 +16,11 @@ internalAliasClassInsideLocalModuleWithoutExportAccessError.ts(17,26): error TS2 } export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import c = x.c; export var cProp = new c(); var cReturnVal = cProp.foo(10); diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..a1060bac3338d --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,17 @@ +internalAliasClassInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasClassInsideTopLevelModuleWithExport.ts (1 errors) ==== + export module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + foo(a: number) { + return a; + } + } + } + + export import xc = x.c; + export var cProp = new xc(); + var cReturnVal = cProp.foo(10); \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..2d7d0ed842a5a --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,17 @@ +internalAliasClassInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasClassInsideTopLevelModuleWithoutExport.ts (1 errors) ==== + export module x { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + foo(a: number) { + return a; + } + } + } + + import xc = x.c; + export var cProp = new xc(); + var cReturnVal = cProp.foo(10); \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnum.errors.txt b/tests/baselines/reference/internalAliasEnum.errors.txt new file mode 100644 index 0000000000000..f0e0cb57e4507 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnum.errors.txt @@ -0,0 +1,22 @@ +internalAliasEnum.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasEnum.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasEnum.ts (2 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.weekend; + export var bVal: b = b.Sunday; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..daae301d0c735 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,22 @@ +internalAliasEnumInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasEnumInsideLocalModuleWithExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasEnumInsideLocalModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.weekend; + export var bVal: b = b.Sunday; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..04120c1c598fd --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,22 @@ +internalAliasEnumInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasEnumInsideLocalModuleWithoutExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasEnumInsideLocalModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.weekend; + export var bVal: b = b.Sunday; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt index bfb69ade57898..4f561c33b3311 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,8 +1,12 @@ +internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts(14,21): error TS2339: Property 'b' does not exist on type 'typeof c'. -==== internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts (3 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum weekend { Friday, Saturday, @@ -11,6 +15,8 @@ internalAliasEnumInsideLocalModuleWithoutExportAccessError.ts(14,21): error TS23 } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.weekend; export var bVal: b = b.Sunday; } diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..53ff87e48a74f --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,17 @@ +internalAliasEnumInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasEnumInsideTopLevelModuleWithExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + export import b = a.weekend; + export var bVal: b = b.Sunday; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..03ff2f1b8c968 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,17 @@ +internalAliasEnumInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasEnumInsideTopLevelModuleWithoutExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum weekend { + Friday, + Saturday, + Sunday + } + } + + import b = a.weekend; + export var bVal: b = b.Sunday; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunction.errors.txt b/tests/baselines/reference/internalAliasFunction.errors.txt new file mode 100644 index 0000000000000..cc03087b6622d --- /dev/null +++ b/tests/baselines/reference/internalAliasFunction.errors.txt @@ -0,0 +1,21 @@ +internalAliasFunction.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasFunction.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasFunction.ts (2 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: number) { + return x; + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..f2ece1e48f470 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,21 @@ +internalAliasFunctionInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasFunctionInsideLocalModuleWithExport.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasFunctionInsideLocalModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: number) { + return x; + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..093bf082e9b75 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,21 @@ +internalAliasFunctionInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasFunctionInsideLocalModuleWithoutExport.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasFunctionInsideLocalModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: number) { + return x; + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.foo; + var bVal = b(10); + export var bVal2 = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt index e5aeb0fe3a841..43b7859bc91e4 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,14 +1,20 @@ +internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts(12,11): error TS2339: Property 'b' does not exist on type 'typeof c'. -==== internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasFunctionInsideLocalModuleWithoutExportAccessError.ts (3 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function foo(x: number) { return x; } } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.foo; var bVal = b(10); export var bVal2 = b; diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..26cddb46ba580 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,16 @@ +internalAliasFunctionInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasFunctionInsideTopLevelModuleWithExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: number) { + return x; + } + } + + export import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..fadc07d5d230f --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,16 @@ +internalAliasFunctionInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasFunctionInsideTopLevelModuleWithoutExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: number) { + return x; + } + } + + import b = a.foo; + export var bVal = b(10); + export var bVal2 = b; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModule.errors.txt b/tests/baselines/reference/internalAliasInitializedModule.errors.txt new file mode 100644 index 0000000000000..4b5af6488454e --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModule.errors.txt @@ -0,0 +1,23 @@ +internalAliasInitializedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModule.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModule.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInitializedModule.ts (3 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.b; + export var x: b.c = new b.c(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..d8d2ad6bf817e --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,23 @@ +internalAliasInitializedModuleInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithExport.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInitializedModuleInsideLocalModuleWithExport.ts (3 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.b; + export var x: b.c = new b.c(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..1d0b53171803a --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,23 @@ +internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts (3 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.b; + export var x: b.c = new b.c(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt index 408c37a10fad3..472e676324c2e 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,15 +1,24 @@ +internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts(13,22): error TS2339: Property 'b' does not exist on type 'typeof c'. -==== internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasInitializedModuleInsideLocalModuleWithoutExportAccessError.ts (4 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c { } } } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.b; export var x: b.c = new b.c(); } diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..6c50939f63318 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,18 @@ +internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + + export import b = a.b; + export var x: b.c = new b.c(); \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..f791bf3d50bb6 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,18 @@ +internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + } + + import b = a.b; + export var x: b.c = new b.c(); \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterface.errors.txt b/tests/baselines/reference/internalAliasInterface.errors.txt new file mode 100644 index 0000000000000..dd07ed207d871 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterface.errors.txt @@ -0,0 +1,19 @@ +internalAliasInterface.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInterface.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInterface.ts (2 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.I; + export var x: b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..fe6150f804be3 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,19 @@ +internalAliasInterfaceInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInterfaceInsideLocalModuleWithExport.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInterfaceInsideLocalModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.I; + export var x: b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..28ec4e2569d69 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,19 @@ +internalAliasInterfaceInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInterfaceInsideLocalModuleWithoutExport.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInterfaceInsideLocalModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.I; + export var x: b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt index 50f7568527293..64659c3e6d52d 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,13 +1,19 @@ +internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,10): error TS2694: Namespace '"internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. -==== internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (3 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { } } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.I; export var x: b; } diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..e0860cd05e614 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,14 @@ +internalAliasInterfaceInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInterfaceInsideTopLevelModuleWithExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + + export import b = a.I; + export var x: b; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..36384fcbeaa09 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,14 @@ +internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + } + } + + import b = a.I; + export var x: b; + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModule.errors.txt b/tests/baselines/reference/internalAliasUninitializedModule.errors.txt new file mode 100644 index 0000000000000..753b2edd66534 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModule.errors.txt @@ -0,0 +1,25 @@ +internalAliasUninitializedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModule.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModule.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasUninitializedModule.ts (3 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.b; + export var x: b.I; + x.foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModule.types b/tests/baselines/reference/internalAliasUninitializedModule.types index 2949b717564bd..6e46f98cec618 100644 --- a/tests/baselines/reference/internalAliasUninitializedModule.types +++ b/tests/baselines/reference/internalAliasUninitializedModule.types @@ -31,6 +31,7 @@ module c { x.foo(); >x.foo() : any +> : ^^^ >x.foo : () => any > : ^^^^^^^^^ >x : b.I diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..628c1a852de09 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,25 @@ +internalAliasUninitializedModuleInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasUninitializedModuleInsideLocalModuleWithExport.ts (3 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.b; + export var x: b.I; + x.foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types index 42a3443b6984d..9b4b0437c4acf 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types @@ -31,6 +31,7 @@ export module c { x.foo(); >x.foo() : any +> : ^^^ >x.foo : () => any > : ^^^^^^^^^ >x : b.I diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..4dc9a875a292f --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,25 @@ +internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts (3 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.b; + export var x: b.I; + x.foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types index 15e8889c9c901..7f5da39a91372 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types @@ -31,6 +31,7 @@ export module c { x.foo(); >x.foo() : any +> : ^^^ >x.foo : () => any > : ^^^^^^^^^ >x : b.I diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt index be07530d9d519..fbb6f77168c82 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,9 +1,16 @@ +internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(9,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,17): error TS2694: Namespace '"internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. -==== internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (4 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { foo(); } @@ -11,6 +18,8 @@ internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16, } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.b; export var x: b.I; x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..c54688acf474c --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,21 @@ +internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + } + + export import b = a.b; + export var x: b.I; + x.foo(); + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types index 847e487499192..2dd2e86c9ccfe 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types @@ -27,6 +27,7 @@ export var x: b.I; x.foo(); >x.foo() : any +> : ^^^ >x.foo : () => any > : ^^^^^^^^^ >x : b.I diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..2c059d3a5cab5 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,21 @@ +internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + foo(); + } + } + } + + import b = a.b; + export var x: b.I; + x.foo(); + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types index 5f0d1537f6cd0..fd4082ad78dab 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types @@ -27,6 +27,7 @@ export var x: b.I; x.foo(); >x.foo() : any +> : ^^^ >x.foo : () => any > : ^^^^^^^^^ >x : b.I diff --git a/tests/baselines/reference/internalAliasVar.errors.txt b/tests/baselines/reference/internalAliasVar.errors.txt new file mode 100644 index 0000000000000..6573c96dcd054 --- /dev/null +++ b/tests/baselines/reference/internalAliasVar.errors.txt @@ -0,0 +1,18 @@ +internalAliasVar.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasVar.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasVar.ts (2 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.x; + export var bVal = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.errors.txt new file mode 100644 index 0000000000000..5cf8458fb186d --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,18 @@ +internalAliasVarInsideLocalModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasVarInsideLocalModuleWithExport.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasVarInsideLocalModuleWithExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import b = a.x; + export var bVal = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..9ccc6847d341c --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.errors.txt @@ -0,0 +1,18 @@ +internalAliasVarInsideLocalModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasVarInsideLocalModuleWithoutExport.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasVarInsideLocalModuleWithoutExport.ts (2 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + + export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import b = a.x; + export var bVal = b; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt index dd54dd8123a75..12e2e1562a143 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,12 +1,18 @@ +internalAliasVarInsideLocalModuleWithoutExportAccessError.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasVarInsideLocalModuleWithoutExportAccessError.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalAliasVarInsideLocalModuleWithoutExportAccessError.ts(10,18): error TS2339: Property 'b' does not exist on type 'typeof c'. -==== internalAliasVarInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== +==== internalAliasVarInsideLocalModuleWithoutExportAccessError.ts (3 errors) ==== export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 10; } export module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import b = a.x; export var bVal = b; } diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.errors.txt b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 0000000000000..ee0b738a5f0bb --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,14 @@ +internalAliasVarInsideTopLevelModuleWithExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasVarInsideTopLevelModuleWithExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + + export import b = a.x; + export var bVal = b; + + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.errors.txt b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.errors.txt new file mode 100644 index 0000000000000..1a8183fc21df2 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.errors.txt @@ -0,0 +1,14 @@ +internalAliasVarInsideTopLevelModuleWithoutExport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasVarInsideTopLevelModuleWithoutExport.ts (1 errors) ==== + export module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 10; + } + + import b = a.x; + export var bVal = b; + + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.errors.txt b/tests/baselines/reference/internalAliasWithDottedNameEmit.errors.txt new file mode 100644 index 0000000000000..e181366f5c531 --- /dev/null +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.errors.txt @@ -0,0 +1,28 @@ +internalAliasWithDottedNameEmit.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasWithDottedNameEmit.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasWithDottedNameEmit.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasWithDottedNameEmit.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasWithDottedNameEmit.ts(4,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalAliasWithDottedNameEmit.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalAliasWithDottedNameEmit.ts (6 errors) ==== + module a.b.c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var d; + } + module a.e.f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import g = b.c; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.types b/tests/baselines/reference/internalAliasWithDottedNameEmit.types index ba127ab9a87e8..18611b68175cd 100644 --- a/tests/baselines/reference/internalAliasWithDottedNameEmit.types +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.types @@ -11,6 +11,7 @@ module a.b.c { export var d; >d : any +> : ^^^ } module a.e.f { import g = b.c; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt index 48e3e5e593a4a..2f981369f1c8d 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt @@ -1,16 +1,22 @@ +internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts(11,16): error TS2437: Module 'A' is hidden by a local declaration with the same name. -==== internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts (1 errors) ==== +==== internalImportInstantiatedModuleMergedWithClassNotReferencingInstance.ts (3 errors) ==== class A { aProp: string; } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface X { s: string } export var a = 10; } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = 1; import Y = A; ~ diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt new file mode 100644 index 0000000000000..909580d2bc772 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt @@ -0,0 +1,21 @@ +internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts (2 errors) ==== + class A { + aProp: string; + } + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface X { s: string } + export var a = 10; + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import Y = A; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt index 4d5964a227041..88c34224dda0d 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportInstantiatedModuleNotReferencingInstance.errors.txt @@ -1,13 +1,19 @@ +internalImportInstantiatedModuleNotReferencingInstance.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportInstantiatedModuleNotReferencingInstance.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalImportInstantiatedModuleNotReferencingInstance.ts(8,16): error TS2437: Module 'A' is hidden by a local declaration with the same name. -==== internalImportInstantiatedModuleNotReferencingInstance.ts (1 errors) ==== +==== internalImportInstantiatedModuleNotReferencingInstance.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface X { s: string } export var a = 10; } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = 1; import Y = A; ~ diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt index 1f0885c8f9a30..e9c103373b11c 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.errors.txt @@ -1,15 +1,21 @@ +internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts(10,16): error TS2437: Module 'A' is hidden by a local declaration with the same name. -==== internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts (1 errors) ==== +==== internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstance.ts (3 errors) ==== class A { aProp: string; } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface X { s: string } } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = 1; import Y = A; ~ diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt new file mode 100644 index 0000000000000..1d6af9f752afc --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.errors.txt @@ -0,0 +1,20 @@ +internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts (2 errors) ==== + class A { + aProp: string; + } + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface X { s: string } + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import Y = A; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.errors.txt b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.errors.txt new file mode 100644 index 0000000000000..a186af6b57802 --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.errors.txt @@ -0,0 +1,18 @@ +internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface X { s: string } + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var A = 1; + import Y = A; + } + \ No newline at end of file diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types index f130a5f0f94f2..aa70027a36e41 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types @@ -20,6 +20,7 @@ module B { import Y = A; >Y : any > : ^^^ ->A : error +>A : any +> : ^^^ } diff --git a/tests/baselines/reference/intrinsics.errors.txt b/tests/baselines/reference/intrinsics.errors.txt index 59c337081a22c..5db3e5c785aae 100644 --- a/tests/baselines/reference/intrinsics.errors.txt +++ b/tests/baselines/reference/intrinsics.errors.txt @@ -1,13 +1,16 @@ intrinsics.ts(1,21): error TS2749: 'hasOwnProperty' refers to a value, but is being used as a type here. Did you mean 'typeof hasOwnProperty'? +intrinsics.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. intrinsics.ts(10,1): error TS2304: Cannot find name '__proto__'. -==== intrinsics.ts (2 errors) ==== +==== intrinsics.ts (3 errors) ==== var hasOwnProperty: hasOwnProperty; // Error ~~~~~~~~~~~~~~ !!! error TS2749: 'hasOwnProperty' refers to a value, but is being used as a type here. Did you mean 'typeof hasOwnProperty'? module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var __proto__; interface __proto__ {} diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index 64c5dd8499730..5334bd6593d72 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -5,12 +5,13 @@ invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to t invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'. invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'. invalidAssignmentsToVoid.ts(14,1): error TS2322: Type 'I' is not assignable to type 'void'. +invalidAssignmentsToVoid.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidAssignmentsToVoid.ts(17,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. invalidAssignmentsToVoid.ts(20,5): error TS2322: Type 'T' is not assignable to type 'void'. invalidAssignmentsToVoid.ts(22,5): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. -==== invalidAssignmentsToVoid.ts (10 errors) ==== +==== invalidAssignmentsToVoid.ts (11 errors) ==== var x: void; x = 1; ~ @@ -41,6 +42,8 @@ invalidAssignmentsToVoid.ts(22,5): error TS2322: Type '(a: T) => void' is not !!! error TS2322: Type 'I' is not assignable to type 'void'. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. x = M; ~ !!! error TS2322: Type 'typeof M' is not assignable to type 'void'. diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 15f46942c2b1f..2bd029b74e2da 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -5,13 +5,14 @@ invalidBooleanAssignments.ts(9,5): error TS2322: Type 'true' is not assignable t invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. +invalidBooleanAssignments.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidBooleanAssignments.ts(21,1): error TS2631: Cannot assign to 'M' because it is a namespace. invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'. invalidBooleanAssignments.ts(26,1): error TS2630: Cannot assign to 'i' because it is a function. -==== invalidBooleanAssignments.ts (10 errors) ==== +==== invalidBooleanAssignments.ts (11 errors) ==== var x = true; var a: number = x; @@ -46,6 +47,8 @@ invalidBooleanAssignments.ts(26,1): error TS2630: Cannot assign to 'i' because i var h2: { toString(): string } = x; // no error module M { export var a = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = x; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/invalidInstantiatedModule.errors.txt b/tests/baselines/reference/invalidInstantiatedModule.errors.txt index 539dbba4c8305..eefcbe13e1f5f 100644 --- a/tests/baselines/reference/invalidInstantiatedModule.errors.txt +++ b/tests/baselines/reference/invalidInstantiatedModule.errors.txt @@ -1,10 +1,14 @@ +invalidInstantiatedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidInstantiatedModule.ts(2,18): error TS2300: Duplicate identifier 'Point'. invalidInstantiatedModule.ts(3,16): error TS2300: Duplicate identifier 'Point'. +invalidInstantiatedModule.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidInstantiatedModule.ts(12,8): error TS2833: Cannot find namespace 'm'. Did you mean 'M'? -==== invalidInstantiatedModule.ts (3 errors) ==== +==== invalidInstantiatedModule.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { x: number; y: number } ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. @@ -14,6 +18,8 @@ invalidInstantiatedModule.ts(12,8): error TS2833: Cannot find namespace 'm'. Did } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point { x: number; y: number } export var Point = 1; } diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt index 689e6cf633e7b..0286ed5958919 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.errors.txt @@ -1,30 +1,47 @@ +invalidModuleWithStatementsOfEveryKind.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(4,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(6,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(12,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(13,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(15,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(19,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidModuleWithStatementsOfEveryKind.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(25,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(29,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(31,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(36,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(37,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(38,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(40,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(43,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(44,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(44,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidModuleWithStatementsOfEveryKind.ts(49,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(50,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(54,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(55,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(57,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(62,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(63,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(64,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. invalidModuleWithStatementsOfEveryKind.ts(66,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(69,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(70,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. +invalidModuleWithStatementsOfEveryKind.ts(70,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidModuleWithStatementsOfEveryKind.ts(75,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. -==== invalidModuleWithStatementsOfEveryKind.ts (21 errors) ==== +==== invalidModuleWithStatementsOfEveryKind.ts (36 errors) ==== // All of these should be an error module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public class A { s: string } ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. @@ -37,6 +54,8 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module Y2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public class AA { s: T } ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. @@ -50,20 +69,28 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module Y3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public module Module { ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { s: string } } } module Y4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public enum Color { Blue, Red } ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. } module YY { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private class A { s: string } ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. @@ -76,6 +103,8 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module YY2 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private class AA { s: T } ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. @@ -89,14 +118,20 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module YY3 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private module Module { ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { s: string } } } module YY4 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private enum Color { Blue, Red } ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. @@ -104,6 +139,8 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier module YYY { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static class A { s: string } ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. @@ -116,6 +153,8 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module YYY2 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static class AA { s: T } ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. @@ -129,14 +168,20 @@ invalidModuleWithStatementsOfEveryKind.ts(76,5): error TS1044: 'static' modifier } module YYY3 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static module Module { ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { s: string } } } module YYY4 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static enum Color { Blue, Red } ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. diff --git a/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt index 938bd07b5f310..9408dd188ce9a 100644 --- a/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt +++ b/tests/baselines/reference/invalidModuleWithVarStatements.errors.txt @@ -1,39 +1,55 @@ +invalidModuleWithVarStatements.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(4,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithVarStatements.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(8,5): error TS1044: 'public' modifier cannot appear on a module or namespace element. +invalidModuleWithVarStatements.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(12,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. +invalidModuleWithVarStatements.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(16,5): error TS1044: 'static' modifier cannot appear on a module or namespace element. +invalidModuleWithVarStatements.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(20,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. +invalidModuleWithVarStatements.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidModuleWithVarStatements.ts(25,5): error TS1044: 'private' modifier cannot appear on a module or namespace element. -==== invalidModuleWithVarStatements.ts (6 errors) ==== +==== invalidModuleWithVarStatements.ts (12 errors) ==== // All of these should be an error module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public var x: number = 0; ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. } module Y2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. public function fn(x: string) { } ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. } module Y4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static var x: number = 0; ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. } module YY { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. static function fn(x: string) { } ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. } module YY2 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private var x: number = 0; ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. @@ -41,6 +57,8 @@ invalidModuleWithVarStatements.ts(25,5): error TS1044: 'private' modifier cannot module YY3 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. private function fn(x: string) { } ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt index d7854a8b3e1c7..62b32a7f3bdf1 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt @@ -1,3 +1,4 @@ +invalidMultipleVariableDeclarations.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'. invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'. invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'. @@ -12,7 +13,7 @@ invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. -==== invalidMultipleVariableDeclarations.ts (12 errors) ==== +==== invalidMultipleVariableDeclarations.ts (13 errors) ==== interface I { id: number; } @@ -35,6 +36,8 @@ invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable function F(x: string): number { return 42; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { name: string; } diff --git a/tests/baselines/reference/invalidNestedModules.errors.txt b/tests/baselines/reference/invalidNestedModules.errors.txt index 112c2a706cfe3..8621113cb9885 100644 --- a/tests/baselines/reference/invalidNestedModules.errors.txt +++ b/tests/baselines/reference/invalidNestedModules.errors.txt @@ -1,10 +1,25 @@ +invalidNestedModules.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidNestedModules.ts(1,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +invalidNestedModules.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(16,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidNestedModules.ts(17,18): error TS2300: Duplicate identifier 'Point'. +invalidNestedModules.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +invalidNestedModules.ts(23,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. -==== invalidNestedModules.ts (3 errors) ==== +==== invalidNestedModules.ts (12 errors) ==== module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. export class Point { @@ -14,7 +29,11 @@ invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. } module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { // Error name: string; } @@ -22,6 +41,10 @@ invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. } module M2.X { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Point { ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. @@ -30,7 +53,11 @@ invalidNestedModules.ts(24,20): error TS2300: Duplicate identifier 'Point'. } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Point: number; // Error ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index fb57c501bccf7..62befbb607f8f 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -5,13 +5,14 @@ invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +invalidNumberAssignments.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidNumberAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'. invalidNumberAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it is a function. -==== invalidNumberAssignments.ts (10 errors) ==== +==== invalidNumberAssignments.ts (11 errors) ==== var x = 1; var a: boolean = x; @@ -43,6 +44,8 @@ invalidNumberAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = x; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index a7800011cddb4..84e28e7c17ca7 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -5,6 +5,7 @@ invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +invalidStringAssignments.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidStringAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. @@ -12,7 +13,7 @@ invalidStringAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'. -==== invalidStringAssignments.ts (11 errors) ==== +==== invalidStringAssignments.ts (12 errors) ==== var x = ''; var a: boolean = x; @@ -44,6 +45,8 @@ invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = x; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt index b095878feebb7..1d8388f530842 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -2,11 +2,12 @@ invalidUndefinedAssignments.ts(4,1): error TS2628: Cannot assign to 'E' because invalidUndefinedAssignments.ts(5,3): error TS2540: Cannot assign to 'A' because it is a read-only property. invalidUndefinedAssignments.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class. invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here. +invalidUndefinedAssignments.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidUndefinedAssignments.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace. invalidUndefinedAssignments.ts(21,1): error TS2630: Cannot assign to 'i' because it is a function. -==== invalidUndefinedAssignments.ts (6 errors) ==== +==== invalidUndefinedAssignments.ts (7 errors) ==== var x: typeof undefined; enum E { A } @@ -31,6 +32,8 @@ invalidUndefinedAssignments.ts(21,1): error TS2630: Cannot assign to 'i' because !!! error TS2693: 'I' only refers to a type, but is being used as a value here. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = x; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/invalidUndefinedValues.errors.txt b/tests/baselines/reference/invalidUndefinedValues.errors.txt new file mode 100644 index 0000000000000..a77e497b5bd3e --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedValues.errors.txt @@ -0,0 +1,37 @@ +invalidUndefinedValues.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== invalidUndefinedValues.ts (1 errors) ==== + var x: typeof undefined; + + x = 1; + x = ''; + x = true; + var a: void; + x = a; + x = null; + + class C { foo: string } + var b: C; + x = C; + x = b; + + interface I { foo: string } + var c: I; + x = c; + + module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + x = M; + + x = { f() { } } + + function f(a: T) { + x = a; + } + x = f; + + enum E { A } + x = E; + x = E.A; \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index d87d4a6668827..74029a94c7c11 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -3,6 +3,7 @@ === invalidUndefinedValues.ts === var x: typeof undefined; >x : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ @@ -10,6 +11,7 @@ x = 1; >x = 1 : 1 > : ^ >x : any +> : ^^^ >1 : 1 > : ^ @@ -17,6 +19,7 @@ x = ''; >x = '' : "" > : ^^ >x : any +> : ^^^ >'' : "" > : ^^ @@ -24,6 +27,7 @@ x = true; >x = true : true > : ^^^^ >x : any +> : ^^^ >true : true > : ^^^^ @@ -35,6 +39,7 @@ x = a; >x = a : void > : ^^^^ >x : any +> : ^^^ >a : void > : ^^^^ @@ -42,6 +47,7 @@ x = null; >x = null : null > : ^^^^ >x : any +> : ^^^ class C { foo: string } >C : C @@ -57,6 +63,7 @@ x = C; >x = C : typeof C > : ^^^^^^^^ >x : any +> : ^^^ >C : typeof C > : ^^^^^^^^ @@ -64,6 +71,7 @@ x = b; >x = b : C > : ^ >x : any +> : ^^^ >b : C > : ^ @@ -79,6 +87,7 @@ x = c; >x = c : I > : ^ >x : any +> : ^^^ >c : I > : ^ @@ -94,6 +103,7 @@ x = M; >x = M : typeof M > : ^^^^^^^^ >x : any +> : ^^^ >M : typeof M > : ^^^^^^^^ @@ -101,6 +111,7 @@ x = { f() { } } >x = { f() { } } : { f(): void; } > : ^^^^^^^^^^^^^^ >x : any +> : ^^^ >{ f() { } } : { f(): void; } > : ^^^^^^^^^^^^^^ >f : () => void @@ -116,6 +127,7 @@ function f(a: T) { >x = a : T > : ^ >x : any +> : ^^^ >a : T > : ^ } @@ -123,6 +135,7 @@ x = f; >x = f : (a: T) => void > : ^ ^^ ^^ ^^^^^^^^^ >x : any +> : ^^^ >f : (a: T) => void > : ^ ^^ ^^ ^^^^^^^^^ @@ -136,6 +149,7 @@ x = E; >x = E : typeof E > : ^^^^^^^^ >x : any +> : ^^^ >E : typeof E > : ^^^^^^^^ @@ -143,6 +157,7 @@ x = E.A; >x = E.A : E > : ^ >x : any +> : ^^^ >E.A : E > : ^ >E : typeof E diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index dee819985c8d5..e97d5dade2a5a 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -5,6 +5,7 @@ invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to t invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +invalidVoidAssignments.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidVoidAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. @@ -14,7 +15,7 @@ invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to typ invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. -==== invalidVoidAssignments.ts (13 errors) ==== +==== invalidVoidAssignments.ts (14 errors) ==== var x: void; var a: boolean = x; @@ -46,6 +47,8 @@ invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f(): void; }' is not assi !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = x; ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index 4b6127fe2ec23..7b584d301df31 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -6,12 +6,13 @@ invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'voi invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'. invalidVoidValues.ts(18,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. +invalidVoidValues.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'. invalidVoidValues.ts(26,5): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. -==== invalidVoidValues.ts (11 errors) ==== +==== invalidVoidValues.ts (12 errors) ==== var x: void; x = 1; ~ @@ -48,6 +49,8 @@ invalidVoidValues.ts(26,5): error TS2322: Type '(a: T) => void' is not assign !!! error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. x = M; ~ !!! error TS2322: Type 'typeof M' is not assignable to type 'void'. diff --git a/tests/baselines/reference/ipromise2.errors.txt b/tests/baselines/reference/ipromise2.errors.txt new file mode 100644 index 0000000000000..57953c8cbd585 --- /dev/null +++ b/tests/baselines/reference/ipromise2.errors.txt @@ -0,0 +1,30 @@ +ipromise2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ipromise2.ts(1,24): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ipromise2.ts (2 errors) ==== + declare module Windows.Foundation { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + value: T; + } + } + + var p: Windows.Foundation.IPromise; + + var p2 = p.then(function (s) { + return 34; + } ); + + + var x: number = p2.value; + + \ No newline at end of file diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index c1aa41840d674..bb3ce72986b35 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -13,9 +13,11 @@ declare module Windows.Foundation { >error : (error: any) => IPromise > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -31,9 +33,11 @@ declare module Windows.Foundation { >error : (error: any) => U > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -49,9 +53,11 @@ declare module Windows.Foundation { >error : (error: any) => IPromise > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -67,9 +73,11 @@ declare module Windows.Foundation { >error : (error: any) => U > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -85,9 +93,11 @@ declare module Windows.Foundation { >error : (error: any) => any > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ value: T; >value : T diff --git a/tests/baselines/reference/ipromise4.errors.txt b/tests/baselines/reference/ipromise4.errors.txt new file mode 100644 index 0000000000000..0c9ab1ddcc6bc --- /dev/null +++ b/tests/baselines/reference/ipromise4.errors.txt @@ -0,0 +1,25 @@ +ipromise4.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +ipromise4.ts(1,24): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ipromise4.ts (2 errors) ==== + declare module Windows.Foundation { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IPromise { + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + } + } + + var p: Windows.Foundation.IPromise = null; + + p.then(function (x) { } ); // should not error + p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // should not error + + \ No newline at end of file diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index 46e5e4a020eea..1ce5a3a4c9733 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -13,9 +13,11 @@ declare module Windows.Foundation { >error : (error: any) => IPromise > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -31,9 +33,11 @@ declare module Windows.Foundation { >error : (error: any) => U > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -49,9 +53,11 @@ declare module Windows.Foundation { >error : (error: any) => IPromise > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -67,9 +73,11 @@ declare module Windows.Foundation { >error : (error: any) => U > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ >Windows : any > : ^^^ >Foundation : any @@ -85,9 +93,11 @@ declare module Windows.Foundation { >error : (error: any) => any > : ^ ^^ ^^^^^ >error : any +> : ^^^ >progress : (progress: any) => void > : ^ ^^ ^^^^^ >progress : any +> : ^^^ } } diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt b/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt new file mode 100644 index 0000000000000..3177d8caf3bb8 --- /dev/null +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.errors.txt @@ -0,0 +1,98 @@ +isDeclarationVisibleNodeKinds.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(38,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(52,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +isDeclarationVisibleNodeKinds.ts(59,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== isDeclarationVisibleNodeKinds.ts (9 errors) ==== + // Function types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator1(schema: any): (data: T) => T { + return undefined; + } + } + + // Constructor types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator2(schema: any): new (data: T) => T { + return undefined; + } + } + + // union types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator3(schema: any): number | { new (data: T): T; } { + return undefined; + } + } + + // Array types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator4(schema: any): { new (data: T): T; }[] { + return undefined; + } + } + + + // TypeLiterals + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator5(schema: any): { new (data: T): T } { + return undefined; + } + } + + // Tuple types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator6(schema: any): [ new (data: T) => T, number] { + return undefined; + } + } + + // Paren Types + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator7(schema: any): (new (data: T)=>T )[] { + return undefined; + } + } + + // Type reference + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function createValidator8(schema: any): Array<{ (data: T) : T}> { + return undefined; + } + } + + + module schema { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class T { + get createValidator9(): (data: T) => T { + return undefined; + } + + set createValidator10(v: (data: T) => T) { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.types b/tests/baselines/reference/isDeclarationVisibleNodeKinds.types index 7cec3b3c7d565..f3af61305a2ca 100644 --- a/tests/baselines/reference/isDeclarationVisibleNodeKinds.types +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.types @@ -10,6 +10,7 @@ module schema { >createValidator1 : (schema: any) => (data: T) => T > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -28,6 +29,7 @@ module schema { >createValidator2 : (schema: any) => new (data: T) => T > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -46,6 +48,7 @@ module schema { >createValidator3 : (schema: any) => number | { new (data: T): T; } > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -64,6 +67,7 @@ module schema { >createValidator4 : (schema: any) => { new (data: T): T; }[] > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -83,6 +87,7 @@ module schema { >createValidator5 : (schema: any) => { new (data: T): T; } > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -101,6 +106,7 @@ module schema { >createValidator6 : (schema: any) => [new (data: T) => T, number] > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -119,6 +125,7 @@ module schema { >createValidator7 : (schema: any) => (new (data: T) => T)[] > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ @@ -137,6 +144,7 @@ module schema { >createValidator8 : (schema: any) => Array<{ (data: T): T; }> > : ^ ^^ ^^^^^ >schema : any +> : ^^^ >data : T > : ^ diff --git a/tests/baselines/reference/jsxElementsAsIdentifierNames.errors.txt b/tests/baselines/reference/jsxElementsAsIdentifierNames.errors.txt new file mode 100644 index 0000000000000..82a5f3dbc3db0 --- /dev/null +++ b/tests/baselines/reference/jsxElementsAsIdentifierNames.errors.txt @@ -0,0 +1,21 @@ +a.tsx(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.tsx (1 errors) ==== + declare const React: any; + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface IntrinsicElements { + ["package"]: any; + } + } + + function A() { + return + } + + function B() { + return + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxElementsAsIdentifierNames.types b/tests/baselines/reference/jsxElementsAsIdentifierNames.types index 3dc93d5340ab6..d918363830faf 100644 --- a/tests/baselines/reference/jsxElementsAsIdentifierNames.types +++ b/tests/baselines/reference/jsxElementsAsIdentifierNames.types @@ -3,11 +3,13 @@ === a.tsx === declare const React: any; >React : any +> : ^^^ declare module JSX { interface IntrinsicElements { ["package"]: any; >["package"] : any +> : ^^^ >"package" : "package" > : ^^^^^^^^^ } @@ -18,7 +20,8 @@ function A() { > : ^^^^^^^^^ return -> : error +> : any +> : ^^^ >package : any > : ^^^ } @@ -28,7 +31,8 @@ function B() { > : ^^^^^^^^^ return -> : error +> : any +> : ^^^ >package : any > : ^^^ >package : any diff --git a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.errors.txt b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.errors.txt new file mode 100644 index 0000000000000..76cdf8961b299 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.errors.txt @@ -0,0 +1,18 @@ +test.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== test.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface IntrinsicElements { + [s: string]: any; + } + } + + export class AppComponent { + render(createElement) { + return
; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.types b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.types index aae2038929eed..61ece4923b21c 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.types +++ b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.types @@ -17,9 +17,11 @@ export class AppComponent { >render : (createElement: any) => any > : ^ ^^^^^^^^^^^^^ >createElement : any +> : ^^^ return
; ->
: error +>
: any +> : ^^^ >div : any > : ^^^ } diff --git a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.errors.txt b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.errors.txt index 12f0c6873c89f..8f7be50eb3bcb 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.errors.txt +++ b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.errors.txt @@ -1,8 +1,11 @@ +test.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.tsx(9,17): error TS2552: Cannot find name 'createElement'. Did you mean 'frameElement'? -==== test.tsx (1 errors) ==== +==== test.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface IntrinsicElements { [s: string]: any; } diff --git a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.errors.txt b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.errors.txt index 869be8017a463..547772441a032 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.errors.txt +++ b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.errors.txt @@ -1,8 +1,11 @@ +test.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.tsx(9,17): error TS2552: Cannot find name 'MyElement'. Did you mean 'Element'? -==== test.tsx (1 errors) ==== +==== test.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface IntrinsicElements { [s: string]: any; } diff --git a/tests/baselines/reference/jsxParsingError1.errors.txt b/tests/baselines/reference/jsxParsingError1.errors.txt index 7d8811dc51eca..a71219e3e27e5 100644 --- a/tests/baselines/reference/jsxParsingError1.errors.txt +++ b/tests/baselines/reference/jsxParsingError1.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(11,30): error TS2695: Left side of comma operator is unused and has no side effects. file.tsx(11,30): error TS18007: JSX expressions may not use the comma operator. Did you mean to write an array? -==== file.tsx (2 errors) ==== +==== file.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/jsxParsingError2.errors.txt b/tests/baselines/reference/jsxParsingError2.errors.txt index 5331d6576b655..57ee5f675b615 100644 --- a/tests/baselines/reference/jsxParsingError2.errors.txt +++ b/tests/baselines/reference/jsxParsingError2.errors.txt @@ -8,10 +8,13 @@ Error4.tsx(2,1): error TS1005: ''}` or `>`? Error5.tsx(1,15): error TS1381: Unexpected token. Did you mean `{'}'}` or `}`? Error6.tsx(1,15): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`? +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== file.tsx (0 errors) ==== +==== file.tsx (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element {} interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/jsxViaImport.2.errors.txt b/tests/baselines/reference/jsxViaImport.2.errors.txt new file mode 100644 index 0000000000000..5467988ca92f9 --- /dev/null +++ b/tests/baselines/reference/jsxViaImport.2.errors.txt @@ -0,0 +1,29 @@ +component.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +component.d.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consumer.tsx (0 errors) ==== + /// + import BaseComponent from 'BaseComponent'; + class TestComponent extends React.Component { + render() { + return ; + } + } + +==== component.d.ts (2 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface ElementAttributesProperty { props; } + } + declare module React { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Component { } + } + declare module "BaseComponent" { + export default class extends React.Component { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxViaImport.2.types b/tests/baselines/reference/jsxViaImport.2.types index 363bee08dfd85..f09950d09b50c 100644 --- a/tests/baselines/reference/jsxViaImport.2.types +++ b/tests/baselines/reference/jsxViaImport.2.types @@ -21,7 +21,8 @@ class TestComponent extends React.Component { > : ^^^^^^^^^ return ; -> : error +> : any +> : ^^^ >BaseComponent : typeof BaseComponent > : ^^^^^^^^^^^^^^^^^^^^ } @@ -31,6 +32,7 @@ class TestComponent extends React.Component { declare module JSX { interface ElementAttributesProperty { props; } >props : any +> : ^^^ } declare module React { >React : typeof React diff --git a/tests/baselines/reference/jsxViaImport.errors.txt b/tests/baselines/reference/jsxViaImport.errors.txt index 0326a74ec9eb0..dda65a129284b 100644 --- a/tests/baselines/reference/jsxViaImport.errors.txt +++ b/tests/baselines/reference/jsxViaImport.errors.txt @@ -1,3 +1,5 @@ +component.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +component.d.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. consumer.tsx(5,17): error TS2604: JSX element type 'BaseComponent' does not have any construct or call signatures. @@ -12,11 +14,15 @@ consumer.tsx(5,17): error TS2604: JSX element type 'BaseComponent' does not have } } -==== component.d.ts (0 errors) ==== +==== component.d.ts (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface ElementAttributesProperty { props; } } declare module React { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Component { } } declare module "BaseComponent" { diff --git a/tests/baselines/reference/knockout.errors.txt b/tests/baselines/reference/knockout.errors.txt index 1bdb8f61a6ab7..6dfb75cd6c2ab 100644 --- a/tests/baselines/reference/knockout.errors.txt +++ b/tests/baselines/reference/knockout.errors.txt @@ -1,8 +1,11 @@ +knockout.ts(1,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. knockout.ts(21,20): error TS2339: Property 'd' does not exist on type 'Observable'. -==== knockout.ts (1 errors) ==== +==== knockout.ts (2 errors) ==== declare module ko { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Observable { (): T; (value: T): any; diff --git a/tests/baselines/reference/labeledStatementWithLabel.errors.txt b/tests/baselines/reference/labeledStatementWithLabel.errors.txt index 4d167ded413cb..28dd98bf85662 100644 --- a/tests/baselines/reference/labeledStatementWithLabel.errors.txt +++ b/tests/baselines/reference/labeledStatementWithLabel.errors.txt @@ -1,8 +1,9 @@ labeledStatementWithLabel.ts(11,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +labeledStatementWithLabel.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. labeledStatementWithLabel.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. -==== labeledStatementWithLabel.ts (2 errors) ==== +==== labeledStatementWithLabel.ts (3 errors) ==== label: function fn() { } label: function* gen() { } label: async function gen1() { } @@ -16,6 +17,8 @@ labeledStatementWithLabel.ts(12,8): error TS1235: A namespace declaration is onl label: module M { } ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. label: namespace N {} ~~~~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. diff --git a/tests/baselines/reference/labeledStatementWithLabel_es2015.errors.txt b/tests/baselines/reference/labeledStatementWithLabel_es2015.errors.txt index 9009aca4d1575..1c8fe61b4d4ce 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_es2015.errors.txt +++ b/tests/baselines/reference/labeledStatementWithLabel_es2015.errors.txt @@ -1,8 +1,9 @@ labeledStatementWithLabel_es2015.ts(11,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +labeledStatementWithLabel_es2015.ts(11,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. labeledStatementWithLabel_es2015.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. -==== labeledStatementWithLabel_es2015.ts (2 errors) ==== +==== labeledStatementWithLabel_es2015.ts (3 errors) ==== label: function fn() { } label: function* gen() { } label: async function gen1() { } @@ -16,6 +17,8 @@ labeledStatementWithLabel_es2015.ts(12,8): error TS1235: A namespace declaration label: module M { } ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. label: namespace N {} ~~~~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. diff --git a/tests/baselines/reference/labeledStatementWithLabel_strict.errors.txt b/tests/baselines/reference/labeledStatementWithLabel_strict.errors.txt index 7fa2b04c4039e..8d8c443d0a547 100644 --- a/tests/baselines/reference/labeledStatementWithLabel_strict.errors.txt +++ b/tests/baselines/reference/labeledStatementWithLabel_strict.errors.txt @@ -9,12 +9,13 @@ labeledStatementWithLabel_strict.ts(9,1): error TS1344: 'A label is not allowed labeledStatementWithLabel_strict.ts(10,1): error TS1344: 'A label is not allowed here. labeledStatementWithLabel_strict.ts(12,1): error TS1344: 'A label is not allowed here. labeledStatementWithLabel_strict.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +labeledStatementWithLabel_strict.ts(12,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. labeledStatementWithLabel_strict.ts(13,1): error TS1344: 'A label is not allowed here. labeledStatementWithLabel_strict.ts(13,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. labeledStatementWithLabel_strict.ts(14,1): error TS1344: 'A label is not allowed here. -==== labeledStatementWithLabel_strict.ts (14 errors) ==== +==== labeledStatementWithLabel_strict.ts (15 errors) ==== "use strict" label: function fn() { } ~~~~~ @@ -49,6 +50,8 @@ labeledStatementWithLabel_strict.ts(14,1): error TS1344: 'A label is not allowed !!! error TS1344: 'A label is not allowed here. ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. label: namespace N {} ~~~~~ !!! error TS1344: 'A label is not allowed here. diff --git a/tests/baselines/reference/lambdaPropSelf.errors.txt b/tests/baselines/reference/lambdaPropSelf.errors.txt index 4bc36121a9bca..3e3533814f1c9 100644 --- a/tests/baselines/reference/lambdaPropSelf.errors.txt +++ b/tests/baselines/reference/lambdaPropSelf.errors.txt @@ -1,7 +1,8 @@ +lambdaPropSelf.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. lambdaPropSelf.ts(21,13): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== lambdaPropSelf.ts (1 errors) ==== +==== lambdaPropSelf.ts (2 errors) ==== declare var ko: any; class Person { @@ -22,6 +23,8 @@ lambdaPropSelf.ts(21,13): error TS2331: 'this' cannot be referenced in a module } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x = this; ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. diff --git a/tests/baselines/reference/letAndVarRedeclaration.errors.txt b/tests/baselines/reference/letAndVarRedeclaration.errors.txt index 32dde58a19b01..767be3f95726b 100644 --- a/tests/baselines/reference/letAndVarRedeclaration.errors.txt +++ b/tests/baselines/reference/letAndVarRedeclaration.errors.txt @@ -7,9 +7,11 @@ letAndVarRedeclaration.ts(8,14): error TS2300: Duplicate identifier 'x1'. letAndVarRedeclaration.ts(12,9): error TS2451: Cannot redeclare block-scoped variable 'x'. letAndVarRedeclaration.ts(14,13): error TS2451: Cannot redeclare block-scoped variable 'x'. letAndVarRedeclaration.ts(17,18): error TS2451: Cannot redeclare block-scoped variable 'x'. +letAndVarRedeclaration.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. letAndVarRedeclaration.ts(22,9): error TS2300: Duplicate identifier 'x2'. letAndVarRedeclaration.ts(23,9): error TS2300: Duplicate identifier 'x2'. letAndVarRedeclaration.ts(24,14): error TS2300: Duplicate identifier 'x2'. +letAndVarRedeclaration.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. letAndVarRedeclaration.ts(28,9): error TS2451: Cannot redeclare block-scoped variable 'x2'. letAndVarRedeclaration.ts(30,13): error TS2451: Cannot redeclare block-scoped variable 'x2'. letAndVarRedeclaration.ts(33,18): error TS2451: Cannot redeclare block-scoped variable 'x2'. @@ -17,11 +19,12 @@ letAndVarRedeclaration.ts(37,5): error TS2451: Cannot redeclare block-scoped var letAndVarRedeclaration.ts(38,10): error TS2451: Cannot redeclare block-scoped variable 'x11'. letAndVarRedeclaration.ts(42,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. letAndVarRedeclaration.ts(43,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. +letAndVarRedeclaration.ts(47,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. letAndVarRedeclaration.ts(48,9): error TS2451: Cannot redeclare block-scoped variable 'x11'. letAndVarRedeclaration.ts(49,14): error TS2451: Cannot redeclare block-scoped variable 'x11'. -==== letAndVarRedeclaration.ts (21 errors) ==== +==== letAndVarRedeclaration.ts (24 errors) ==== let e0 ~~ !!! error TS2300: Duplicate identifier 'e0'. @@ -61,6 +64,8 @@ letAndVarRedeclaration.ts(49,14): error TS2451: Cannot redeclare block-scoped va } module M0 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let x2; ~~ !!! error TS2300: Duplicate identifier 'x2'. @@ -73,6 +78,8 @@ letAndVarRedeclaration.ts(49,14): error TS2451: Cannot redeclare block-scoped va } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let x2; ~~ !!! error TS2451: Cannot redeclare block-scoped variable 'x2'. @@ -107,6 +114,8 @@ letAndVarRedeclaration.ts(49,14): error TS2451: Cannot redeclare block-scoped va } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let x11; ~~~ !!! error TS2451: Cannot redeclare block-scoped variable 'x11'. diff --git a/tests/baselines/reference/letDeclarations-scopes.errors.txt b/tests/baselines/reference/letDeclarations-scopes.errors.txt index 821b2e4dcf71f..5996c13074c40 100644 --- a/tests/baselines/reference/letDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes.errors.txt @@ -1,7 +1,8 @@ letDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +letDeclarations-scopes.ts(110,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== letDeclarations-scopes.ts (1 errors) ==== +==== letDeclarations-scopes.ts (2 errors) ==== // global let l = "string"; @@ -114,6 +115,8 @@ letDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not suppo // modules module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let l = 0; n = l; diff --git a/tests/baselines/reference/letDeclarations-validContexts.errors.txt b/tests/baselines/reference/letDeclarations-validContexts.errors.txt index 4c449306eaf6b..ea7fbd47e2074 100644 --- a/tests/baselines/reference/letDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/letDeclarations-validContexts.errors.txt @@ -1,7 +1,9 @@ letDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +letDeclarations-validContexts.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +letDeclarations-validContexts.ts(136,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== letDeclarations-validContexts.ts (1 errors) ==== +==== letDeclarations-validContexts.ts (3 errors) ==== // Control flow statements with blocks if (true) { let l1 = 0; @@ -89,6 +91,8 @@ letDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is no // modules module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. let l22 = 0; { @@ -140,6 +144,8 @@ letDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is no } module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. label: let l34 = 0; { label2: let l35 = 0; diff --git a/tests/baselines/reference/letDeclarations2.errors.txt b/tests/baselines/reference/letDeclarations2.errors.txt new file mode 100644 index 0000000000000..c265e33f70044 --- /dev/null +++ b/tests/baselines/reference/letDeclarations2.errors.txt @@ -0,0 +1,10 @@ +letDeclarations2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== letDeclarations2.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + let l1 = "s"; + export let l2 = 0; + } \ No newline at end of file diff --git a/tests/baselines/reference/letKeepNamesOfTopLevelItems.errors.txt b/tests/baselines/reference/letKeepNamesOfTopLevelItems.errors.txt new file mode 100644 index 0000000000000..853eb6495c89e --- /dev/null +++ b/tests/baselines/reference/letKeepNamesOfTopLevelItems.errors.txt @@ -0,0 +1,14 @@ +letKeepNamesOfTopLevelItems.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== letKeepNamesOfTopLevelItems.ts (1 errors) ==== + let x; + function foo() { + let x; + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + let x; + } \ No newline at end of file diff --git a/tests/baselines/reference/letKeepNamesOfTopLevelItems.types b/tests/baselines/reference/letKeepNamesOfTopLevelItems.types index 127a6345c598d..254852a01718a 100644 --- a/tests/baselines/reference/letKeepNamesOfTopLevelItems.types +++ b/tests/baselines/reference/letKeepNamesOfTopLevelItems.types @@ -3,6 +3,7 @@ === letKeepNamesOfTopLevelItems.ts === let x; >x : any +> : ^^^ function foo() { >foo : () => void @@ -10,6 +11,7 @@ function foo() { let x; >x : any +> : ^^^ } module A { @@ -18,4 +20,5 @@ module A { let x; >x : any +> : ^^^ } diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt index b1d326c817969..32e916e87a9e3 100644 --- a/tests/baselines/reference/libMembers.errors.txt +++ b/tests/baselines/reference/libMembers.errors.txt @@ -1,9 +1,10 @@ libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'. +libMembers.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. libMembers.ts(9,17): error TS1011: An element access expression should take an argument. libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'. -==== libMembers.ts (3 errors) ==== +==== libMembers.ts (4 errors) ==== var s="hello"; s.substring(0); s.substring(3,4); @@ -12,6 +13,8 @@ libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type !!! error TS2339: Property 'subby' does not exist on type 'string'. String.fromCharCode(12); module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } var a=new C[]; diff --git a/tests/baselines/reference/listFailure.errors.txt b/tests/baselines/reference/listFailure.errors.txt new file mode 100644 index 0000000000000..a20cea17fff0a --- /dev/null +++ b/tests/baselines/reference/listFailure.errors.txt @@ -0,0 +1,47 @@ +listFailure.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== listFailure.ts (1 errors) ==== + module Editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Buffer { + lines: List = ListMakeHead(); + + addLine(lineText: string): List { + + var line: Line = new Line(); + var lineEntry = this.lines.add(line); + + return lineEntry; + } + } + + export function ListRemoveEntry(entry: List): List { + return entry; + } + + export function ListMakeHead(): List { + return null; + } + + export function ListMakeEntry(data: U): List { + return null; + } + + class List { + public next: List; + + add(data: T): List { + this.next = ListMakeEntry(data); + return this.next; + } + + popEntry(head: List): List { + return (ListRemoveEntry(this.next)); + } + } + + export class Line {} + } \ No newline at end of file diff --git a/tests/baselines/reference/localImportNameVsGlobalName.errors.txt b/tests/baselines/reference/localImportNameVsGlobalName.errors.txt new file mode 100644 index 0000000000000..58cd4e36dd547 --- /dev/null +++ b/tests/baselines/reference/localImportNameVsGlobalName.errors.txt @@ -0,0 +1,22 @@ +localImportNameVsGlobalName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +localImportNameVsGlobalName.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== localImportNameVsGlobalName.ts (2 errors) ==== + module Keyboard { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Key { UP, DOWN, LEFT, RIGHT } + } + + module App { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import Key = Keyboard.Key; + + export function foo(key: Key): void {} + + foo(Key.UP); + foo(Key.DOWN); + foo(Key.LEFT); + } \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index a6a8a41cdf887..1e9cf36f52255 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,4 @@ +logicalNotOperatorWithAnyOtherType.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. logicalNotOperatorWithAnyOtherType.ts(33,25): error TS2873: This kind of expression is always falsy. logicalNotOperatorWithAnyOtherType.ts(34,25): error TS2873: This kind of expression is always falsy. logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. @@ -6,7 +7,7 @@ logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== logicalNotOperatorWithAnyOtherType.ts (6 errors) ==== +==== logicalNotOperatorWithAnyOtherType.ts (7 errors) ==== // ! operator on any type var ANY: any; @@ -26,6 +27,8 @@ logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2695: Left side of comma op } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt index 981e44fe46d48..f7560dab84fd5 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt @@ -1,8 +1,9 @@ +logicalNotOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. logicalNotOperatorWithBooleanType.ts(21,25): error TS2872: This kind of expression is always truthy. logicalNotOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== logicalNotOperatorWithBooleanType.ts (2 errors) ==== +==== logicalNotOperatorWithBooleanType.ts (3 errors) ==== // ! operator on boolean type var BOOLEAN: boolean; @@ -13,6 +14,8 @@ logicalNotOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma ope static foo() { return false; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt index 03ced35d64485..fee1697910d64 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt @@ -1,9 +1,10 @@ +logicalNotOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. logicalNotOperatorWithNumberType.ts(23,25): error TS2872: This kind of expression is always truthy. logicalNotOperatorWithNumberType.ts(24,25): error TS2872: This kind of expression is always truthy. logicalNotOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== logicalNotOperatorWithNumberType.ts (3 errors) ==== +==== logicalNotOperatorWithNumberType.ts (4 errors) ==== // ! operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -15,6 +16,8 @@ logicalNotOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma oper static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt index 6ea2e395e8038..f6633de35a2aa 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt @@ -1,3 +1,4 @@ +logicalNotOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. logicalNotOperatorWithStringType.ts(22,25): error TS2873: This kind of expression is always falsy. logicalNotOperatorWithStringType.ts(23,25): error TS2872: This kind of expression is always truthy. logicalNotOperatorWithStringType.ts(24,25): error TS2872: This kind of expression is always truthy. @@ -5,7 +6,7 @@ logicalNotOperatorWithStringType.ts(40,2): error TS2873: This kind of expression logicalNotOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== logicalNotOperatorWithStringType.ts (5 errors) ==== +==== logicalNotOperatorWithStringType.ts (6 errors) ==== // ! operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -17,6 +18,8 @@ logicalNotOperatorWithStringType.ts(44,1): error TS2695: Left side of comma oper static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/memberScope.errors.txt b/tests/baselines/reference/memberScope.errors.txt index f18e264bf6ad6..35baa2fda6d8c 100644 --- a/tests/baselines/reference/memberScope.errors.txt +++ b/tests/baselines/reference/memberScope.errors.txt @@ -1,10 +1,16 @@ +memberScope.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +memberScope.ts(3,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. memberScope.ts(4,11): error TS2708: Cannot use namespace 'Basil' as a value. -==== memberScope.ts (1 errors) ==== +==== memberScope.ts (3 errors) ==== module Salt { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Pepper {} export module Basil { } + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var z = Basil.Pepper; ~~~~~ !!! error TS2708: Cannot use namespace 'Basil' as a value. diff --git a/tests/baselines/reference/mergeClassInterfaceAndModule.errors.txt b/tests/baselines/reference/mergeClassInterfaceAndModule.errors.txt new file mode 100644 index 0000000000000..557c72058022c --- /dev/null +++ b/tests/baselines/reference/mergeClassInterfaceAndModule.errors.txt @@ -0,0 +1,30 @@ +mergeClassInterfaceAndModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeClassInterfaceAndModule.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeClassInterfaceAndModule.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeClassInterfaceAndModule.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergeClassInterfaceAndModule.ts (4 errors) ==== + interface C1 {} + declare class C1 {} + module C1 {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + declare class C2 {} + interface C2 {} + module C2 {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + declare class C3 {} + module C3 {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface C3 {} + + module C4 {} + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare class C4 {} // error -- class declaration must precede module declaration + interface C4 {} \ No newline at end of file diff --git a/tests/baselines/reference/mergeThreeInterfaces.errors.txt b/tests/baselines/reference/mergeThreeInterfaces.errors.txt new file mode 100644 index 0000000000000..1932bdf10bc33 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces.errors.txt @@ -0,0 +1,84 @@ +mergeThreeInterfaces.ts(40,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergeThreeInterfaces.ts (1 errors) ==== + // interfaces with the same root module should merge + + // basic case + interface A { + foo: string; + } + + interface A { + bar: number; + } + + interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + var r3 = a.baz; + + // basic generic case + interface B { + foo: T; + } + + interface B { + bar: T; + } + + interface B { + baz: T; + } + + var b: B; + var r4 = b.foo + var r5 = b.bar; + var r6 = b.baz; + + // basic non-generic and generic case inside a module + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + foo: string; + } + + interface A { + bar: number; + } + + interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo; + // BUG 856491 + var r2 = a.bar; // any, should be number + // BUG 856491 + var r3 = a.baz; // any, should be boolean + + interface B { + foo: T; + } + + interface B { + bar: T; + } + + interface B { + baz: T; + } + + var b: B; + var r4 = b.foo + // BUG 856491 + var r5 = b.bar; // any, should be number + // BUG 856491 + var r6 = b.baz; // any, should be boolean + } \ No newline at end of file diff --git a/tests/baselines/reference/mergeThreeInterfaces2.errors.txt b/tests/baselines/reference/mergeThreeInterfaces2.errors.txt new file mode 100644 index 0000000000000..83c999f6d4603 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces2.errors.txt @@ -0,0 +1,94 @@ +mergeThreeInterfaces2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(30,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(31,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(43,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(56,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeThreeInterfaces2.ts(57,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergeThreeInterfaces2.ts (8 errors) ==== + // two interfaces with the same root module should merge + + // root module now multiple module declarations + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + bar: number; + } + + export interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; + var r3 = a.baz; + } + + // same as above but with an additional level of nesting and third module declaration + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo; + var r2 = a.bar; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + bar: number; + } + + var a: A; + + var r1 = a.foo + var r2 = a.bar; + var r3 = a.baz; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + baz: boolean; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + var r3 = a.baz; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergeTwoInterfaces.errors.txt b/tests/baselines/reference/mergeTwoInterfaces.errors.txt new file mode 100644 index 0000000000000..c3955bbd43ced --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces.errors.txt @@ -0,0 +1,63 @@ +mergeTwoInterfaces.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergeTwoInterfaces.ts (1 errors) ==== + // two interfaces with the same root module should merge + + // basic case + interface A { + foo: string; + } + + interface A { + bar: number; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + + // basic generic case + interface B { + baz: string; + foo: T; + } + + interface B { + bar: T; + } + + var b: B; + var r3 = b.foo + var r4 = b.bar; + + // basic non-generic and generic case inside a module + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + foo: string; + } + + interface A { + bar: number; + } + + var a: A; + var r1 = a.foo; + // BUG 856491 + var r2 = a.bar; // any, should be number + + interface B { + foo: T; + } + + interface B { + bar: T; + } + + var b: B; + var r3 = b.foo + // BUG 856491 + var r4 = b.bar; // any, should be string + } \ No newline at end of file diff --git a/tests/baselines/reference/mergeTwoInterfaces2.errors.txt b/tests/baselines/reference/mergeTwoInterfaces2.errors.txt new file mode 100644 index 0000000000000..51a7a581ce999 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces2.errors.txt @@ -0,0 +1,68 @@ +mergeTwoInterfaces2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeTwoInterfaces2.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeTwoInterfaces2.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeTwoInterfaces2.ts(26,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeTwoInterfaces2.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergeTwoInterfaces2.ts(38,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergeTwoInterfaces2.ts (6 errors) ==== + // two interfaces with the same root module should merge + + // root module now multiple module declarations + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + bar: number; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } + + // same as above but with an additional level of nesting + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + foo: string; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + bar: number; + } + + var a: A; + var r1 = a.foo + var r2 = a.bar; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedDeclarations1.errors.txt b/tests/baselines/reference/mergedDeclarations1.errors.txt new file mode 100644 index 0000000000000..9c75039d37793 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations1.errors.txt @@ -0,0 +1,22 @@ +mergedDeclarations1.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedDeclarations1.ts (1 errors) ==== + interface Point { + x: number; + y: number; + } + function point(x: number, y: number): Point { + return { x: x, y: y }; + } + module point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var origin = point(0, 0); + export function equals(p1: Point, p2: Point) { + return p1.x == p2.x && p1.y == p2.y; + } + } + var p1 = point(0, 0); + var p2 = point.origin; + var b = point.equals(p1, p2); \ No newline at end of file diff --git a/tests/baselines/reference/mergedDeclarations2.errors.txt b/tests/baselines/reference/mergedDeclarations2.errors.txt index d7b6912c9426c..bd7b8a1690935 100644 --- a/tests/baselines/reference/mergedDeclarations2.errors.txt +++ b/tests/baselines/reference/mergedDeclarations2.errors.txt @@ -1,7 +1,8 @@ +mergedDeclarations2.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. mergedDeclarations2.ts(9,20): error TS2304: Cannot find name 'b'. -==== mergedDeclarations2.ts (1 errors) ==== +==== mergedDeclarations2.ts (2 errors) ==== enum Foo { b } @@ -10,6 +11,8 @@ mergedDeclarations2.ts(9,20): error TS2304: Cannot find name 'b'. } module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = b ~ !!! error TS2304: Cannot find name 'b'. diff --git a/tests/baselines/reference/mergedDeclarations3.errors.txt b/tests/baselines/reference/mergedDeclarations3.errors.txt index 099768868618f..5809d866cdfdd 100644 --- a/tests/baselines/reference/mergedDeclarations3.errors.txt +++ b/tests/baselines/reference/mergedDeclarations3.errors.txt @@ -1,39 +1,69 @@ +mergedDeclarations3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(19,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(25,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(30,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations3.ts(31,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. mergedDeclarations3.ts(37,7): error TS2339: Property 'x' does not exist on type 'typeof foo'. mergedDeclarations3.ts(39,7): error TS2339: Property 'z' does not exist on type 'typeof foo'. -==== mergedDeclarations3.ts (2 errors) ==== +==== mergedDeclarations3.ts (12 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum Color { Red, Green } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Color { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Blue = 4; } } var p = M.Color.Blue; // ok module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function foo() { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = 2 } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var z = 1; } } diff --git a/tests/baselines/reference/mergedDeclarations4.errors.txt b/tests/baselines/reference/mergedDeclarations4.errors.txt new file mode 100644 index 0000000000000..42f8ea55062bd --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations4.errors.txt @@ -0,0 +1,30 @@ +mergedDeclarations4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations4.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedDeclarations4.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedDeclarations4.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + f(); + M.f(); + var r = f.hello; + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var hello = 1; + } + f(); + M.f(); + var r = f.hello; + } + + M.f(); + M.f.hello; \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt index 4d94b9ee13242..537c463e68fca 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -1,9 +1,14 @@ mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. +mergedInterfacesWithConflictingPropertyNames.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. +mergedInterfacesWithConflictingPropertyNames.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. -==== mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ==== +==== mergedInterfacesWithConflictingPropertyNames.ts (8 errors) ==== interface A { x: string; // error } @@ -16,6 +21,8 @@ mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { x: T; } @@ -29,24 +36,32 @@ mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2717: Subsequent } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { x: T; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { x: number; // ok, different declaration space than other M2 } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { x: T; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { x: number; // error ~ diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt new file mode 100644 index 0000000000000..bca36ff7d2bdf --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames2.errors.txt @@ -0,0 +1,59 @@ +mergedInterfacesWithConflictingPropertyNames2.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames2.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames2.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames2.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedInterfacesWithConflictingPropertyNames2.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedInterfacesWithConflictingPropertyNames2.ts (5 errors) ==== + interface A { + x: string; // error + } + + interface A { + x: string; // error + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + x: T; + } + + interface A { + x: T; // error + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + x: T; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + x: T; // ok, different declaration space than other M2 + } + } + + module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + x: T; + } + } + + module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + x: T; // error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt index 00f383b07b34c..d93e33e22ed4d 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt @@ -1,10 +1,11 @@ mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named property 'x' of types 'C' and 'C2' are not identical. +mergedInterfacesWithInheritedPrivates3.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named property 'x' of types 'C' and 'C2' are not identical. -==== mergedInterfacesWithInheritedPrivates3.ts (2 errors) ==== +==== mergedInterfacesWithInheritedPrivates3.ts (3 errors) ==== class C { private x: number; } @@ -30,6 +31,8 @@ mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' ca } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { private x: string; } diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases.errors.txt new file mode 100644 index 0000000000000..48fa9b785f410 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases.errors.txt @@ -0,0 +1,60 @@ +mergedInterfacesWithMultipleBases.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedInterfacesWithMultipleBases.ts (1 errors) ==== + // merged interfaces behave as if all extends clauses from each declaration are merged together + // no errors expected + + class C { + a: number; + } + + class C2 { + b: number; + } + + interface A extends C { + y: string; + } + + interface A extends C2 { + z: string; + } + + class D implements A { + a: number; + b: number; + y: string; + z: string; + } + + var a: A; + var r = a.a; + + // generic interfaces in a module + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + a: T; + } + + class C2 { + b: T; + } + + interface A extends C { + y: T; + } + + interface A extends C2 { + z: T; + } + + class D implements A { + a: boolean; + b: string; + y: boolean; + z: boolean; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.errors.txt new file mode 100644 index 0000000000000..c0dcd1c375df5 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.errors.txt @@ -0,0 +1,81 @@ +mergedInterfacesWithMultipleBases2.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedInterfacesWithMultipleBases2.ts (1 errors) ==== + // merged interfaces behave as if all extends clauses from each declaration are merged together + // no errors expected + + class C { + a: number; + } + + class C2 { + b: number; + } + + class C3 { + c: string; + } + + class C4 { + d: string; + } + + + interface A extends C, C3 { + y: string; + } + + interface A extends C2, C4 { + z: string; + } + + class D implements A { + a: number; + b: number; + c: string; + d: string; + y: string; + z: string; + } + + var a: A; + var r = a.a; + + // generic interfaces in a module + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + a: T; + } + + class C2 { + b: T; + } + + class C3 { + c: T; + } + + class C4 { + d: T; + } + + interface A extends C, C3 { + y: T; + } + + interface A extends C2, C4 { + z: T; + } + + class D implements A { + a: boolean; + b: string; + c: boolean; + d: string; + y: boolean; + z: boolean; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt new file mode 100644 index 0000000000000..5a06360ad5b18 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.errors.txt @@ -0,0 +1,30 @@ +mergedModuleDeclarationCodeGen.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen.ts(10,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen.ts(11,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationCodeGen.ts (4 errors) ==== + export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + constructor(Y: any) { + new B(); + } + } + } + } + export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class B { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen.types index fcf9b2e57fe09..245dafc0bd546 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen.types @@ -15,6 +15,7 @@ export module X { constructor(Y: any) { >Y : any +> : ^^^ new B(); >new B() : B diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.errors.txt new file mode 100644 index 0000000000000..df5b1fc6cf4d8 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.errors.txt @@ -0,0 +1,26 @@ +mergedModuleDeclarationCodeGen2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen2.ts(1,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen2.ts(4,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationCodeGen2.ts (5 errors) ==== + module my.data.foo { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function buz() { } + } + module my.data { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function data(my) { + foo.buz(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types index 6ddf233e5d6e7..a0de119638ba8 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types @@ -23,6 +23,7 @@ module my.data { >data : (my: any) => void > : ^ ^^^^^^^^^^^^^^ >my : any +> : ^^^ foo.buz(); >foo.buz() : void diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.errors.txt new file mode 100644 index 0000000000000..c7f91ee59f369 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.errors.txt @@ -0,0 +1,26 @@ +mergedModuleDeclarationCodeGen3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen3.ts(1,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen3.ts(4,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen3.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationCodeGen3.ts (5 errors) ==== + module my.data { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function buz() { } + } + module my.data.foo { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function data(my, foo) { + buz(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types index aa57fb252bd81..9ac1b9266a534 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types @@ -23,7 +23,9 @@ module my.data.foo { >data : (my: any, foo: any) => void > : ^ ^^^^^^^ ^^^^^^^^^^^^^^ >my : any +> : ^^^ >foo : any +> : ^^^ buz(); >buz() : void diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.errors.txt new file mode 100644 index 0000000000000..6ca1156ed6275 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.errors.txt @@ -0,0 +1,43 @@ +mergedModuleDeclarationCodeGen4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(3,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(3,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(4,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(8,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(8,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen4.ts(9,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationCodeGen4.ts (8 errors) ==== + module superContain { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module contain { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module my.buz { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module data { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { } + } + } + export module my.buz { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module data { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar(contain, my, buz, data) { + foo(); + } + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types index d38c5bea8c3d7..311e6addb823c 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types @@ -38,9 +38,13 @@ module superContain { >bar : (contain: any, my: any, buz: any, data: any) => void > : ^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^ >contain : any +> : ^^^ >my : any +> : ^^^ >buz : any +> : ^^^ >data : any +> : ^^^ foo(); >foo() : void diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.errors.txt b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.errors.txt new file mode 100644 index 0000000000000..5c890a78e0534 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.errors.txt @@ -0,0 +1,39 @@ +mergedModuleDeclarationCodeGen5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen5.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen5.ts(1,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen5.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen5.ts(5,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationCodeGen5.ts(5,14): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationCodeGen5.ts (6 errors) ==== + module M.buz.plop { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function doom() { } + export function M() { } + } + module M.buz.plop { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function gunk() { } + function buz() { } + export class fudge { } + export enum plop { } + + // Emit these references as follows + var v1 = gunk; // gunk + var v2 = buz; // buz + export var v3 = doom; // _plop.doom + export var v4 = M; // _plop.M + export var v5 = fudge; // fudge + export var v6 = plop; // plop + } \ No newline at end of file diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.errors.txt b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.errors.txt new file mode 100644 index 0000000000000..f8d6cda34ff13 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.errors.txt @@ -0,0 +1,16 @@ +mergedModuleDeclarationWithSharedExportedVar.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mergedModuleDeclarationWithSharedExportedVar.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mergedModuleDeclarationWithSharedExportedVar.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var v = 10; + v; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + v; + } \ No newline at end of file diff --git a/tests/baselines/reference/metadataOfClassFromModule.errors.txt b/tests/baselines/reference/metadataOfClassFromModule.errors.txt new file mode 100644 index 0000000000000..c8d121393292f --- /dev/null +++ b/tests/baselines/reference/metadataOfClassFromModule.errors.txt @@ -0,0 +1,17 @@ +metadataOfClassFromModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== metadataOfClassFromModule.ts (1 errors) ==== + module MyModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export function inject(target: any, key: string): void { } + + export class Leg { } + + export class Person { + @inject leftLeg: Leg; + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/metadataOfClassFromModule.types b/tests/baselines/reference/metadataOfClassFromModule.types index fef7de3fb5480..6e77771dc78ee 100644 --- a/tests/baselines/reference/metadataOfClassFromModule.types +++ b/tests/baselines/reference/metadataOfClassFromModule.types @@ -9,6 +9,7 @@ module MyModule { >inject : (target: any, key: string) => void > : ^ ^^ ^^ ^^ ^^^^^ >target : any +> : ^^^ >key : string > : ^^^^^^ diff --git a/tests/baselines/reference/methodContainingLocalFunction.errors.txt b/tests/baselines/reference/methodContainingLocalFunction.errors.txt new file mode 100644 index 0000000000000..c9e771cf35fa2 --- /dev/null +++ b/tests/baselines/reference/methodContainingLocalFunction.errors.txt @@ -0,0 +1,56 @@ +methodContainingLocalFunction.ts(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== methodContainingLocalFunction.ts (1 errors) ==== + // The first case here (BugExhibition) caused a crash. Try with different permutations of features. + class BugExhibition { + public exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + } + } + + class BugExhibition2 { + private static get exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + return null; + } + } + + class BugExhibition3 { + public exhibitBug() { + function localGenericFunction(u?: U) { } + var x: { (): void; }; + x = localGenericFunction; + } + } + + class C { + exhibit() { + var funcExpr = (u?: U) => { }; + var x: { (): void; }; + x = funcExpr; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function exhibitBug() { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + } + } + + enum E { + A = (() => { + function localFunction() { } + var x: { (): void; }; + x = localFunction; + return 0; + })() + } \ No newline at end of file diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 16e730b1e4543..28d8436b51e59 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -34,6 +34,7 @@ class BugExhibition2 { private static get exhibitBug() { >exhibitBug : any +> : ^^^ function localFunction() { } >localFunction : () => void diff --git a/tests/baselines/reference/missingReturnStatement.errors.txt b/tests/baselines/reference/missingReturnStatement.errors.txt index 816c39956d55f..efb656e2f4b33 100644 --- a/tests/baselines/reference/missingReturnStatement.errors.txt +++ b/tests/baselines/reference/missingReturnStatement.errors.txt @@ -1,8 +1,11 @@ +missingReturnStatement.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. missingReturnStatement.ts(3,22): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value. -==== missingReturnStatement.ts (1 errors) ==== +==== missingReturnStatement.ts (2 errors) ==== module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Bug { public foo():string { ~~~~~~ diff --git a/tests/baselines/reference/missingTypeArguments3.errors.txt b/tests/baselines/reference/missingTypeArguments3.errors.txt new file mode 100644 index 0000000000000..8a4f6e4ca1739 --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments3.errors.txt @@ -0,0 +1,47 @@ +missingTypeArguments3.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== missingTypeArguments3.ts (1 errors) ==== + declare module linq { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface Enumerable { + OrderByDescending(keySelector?: string): OrderedEnumerable; + GroupBy(keySelector: (element: T) => TKey): Enumerable>; + GroupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): Enumerable>; + ToDictionary(keySelector: (element: T) => TKey): Dictionary; + } + + interface OrderedEnumerable extends Enumerable { + ThenBy(keySelector: (element: T) => TCompare): OrderedEnumerable; // used to incorrectly think this was missing a type argument + } + + interface Grouping extends Enumerable { + Key(): TKey; + } + + interface Lookup { + Count(): number; + Get(key): Enumerable; + Contains(key): boolean; + ToEnumerable(): Enumerable>; + } + + interface Dictionary { + Add(key: TKey, value: TValue): void; + Get(ke: TKey): TValue; + Set(key: TKey, value: TValue): boolean; + Contains(key: TKey): boolean; + Clear(): void; + Remove(key: TKey): void; + Count(): number; + ToEnumerable(): Enumerable>; + } + + interface KeyValuePair { + Key: TKey; + Value: TValue; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/missingTypeArguments3.types b/tests/baselines/reference/missingTypeArguments3.types index 15361f8b7f2e6..d49f269276433 100644 --- a/tests/baselines/reference/missingTypeArguments3.types +++ b/tests/baselines/reference/missingTypeArguments3.types @@ -64,11 +64,13 @@ declare module linq { >Get : (key: any) => Enumerable > : ^ ^^^^^^^^^^ >key : any +> : ^^^ Contains(key): boolean; >Contains : (key: any) => boolean > : ^ ^^^^^^^^^^ >key : any +> : ^^^ ToEnumerable(): Enumerable>; >ToEnumerable : () => Enumerable> diff --git a/tests/baselines/reference/mixedExports.errors.txt b/tests/baselines/reference/mixedExports.errors.txt new file mode 100644 index 0000000000000..1a4baf3f49e67 --- /dev/null +++ b/tests/baselines/reference/mixedExports.errors.txt @@ -0,0 +1,31 @@ +mixedExports.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixedExports.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixedExports.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixedExports.ts(14,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mixedExports.ts (4 errors) ==== + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo(); + export function foo(); + function foo(); + } + + declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Foo {} + interface Foo {} + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface X {x} + export module X {} + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface X {y} + } \ No newline at end of file diff --git a/tests/baselines/reference/mixedExports.types b/tests/baselines/reference/mixedExports.types index 1bd470ab57aff..344e6d37d192a 100644 --- a/tests/baselines/reference/mixedExports.types +++ b/tests/baselines/reference/mixedExports.types @@ -26,8 +26,10 @@ declare module M1 { module A { interface X {x} >x : any +> : ^^^ export module X {} interface X {y} >y : any +> : ^^^ } diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.errors.txt b/tests/baselines/reference/mixingFunctionAndAmbientModule1.errors.txt new file mode 100644 index 0000000000000..09b066090dba4 --- /dev/null +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.errors.txt @@ -0,0 +1,78 @@ +mixingFunctionAndAmbientModule1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(2,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(9,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(17,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(24,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(33,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +mixingFunctionAndAmbientModule1.ts(37,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== mixingFunctionAndAmbientModule1.ts (11 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + function My(s: string) { } + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + function My(s: boolean); + function My(s: any) { } + } + + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + declare function My(s: boolean); + } + + module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + declare function My(s: boolean); + declare function My(s: any); + } + + + module E { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: number; + } + declare function My(s: boolean); + declare module My { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var y: number; + } + declare function My(s: any); + } + \ No newline at end of file diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.types b/tests/baselines/reference/mixingFunctionAndAmbientModule1.types index 96351887a1861..907796c36a0ce 100644 --- a/tests/baselines/reference/mixingFunctionAndAmbientModule1.types +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.types @@ -42,6 +42,7 @@ module B { >My : typeof My > : ^^^^^^^^^ >s : any +> : ^^^ } module C { @@ -85,6 +86,7 @@ module D { >My : typeof My > : ^^^^^^^^^ >s : any +> : ^^^ } @@ -118,5 +120,6 @@ module E { >My : typeof My > : ^^^^^^^^^ >s : any +> : ^^^ } diff --git a/tests/baselines/reference/modFunctionCrash.errors.txt b/tests/baselines/reference/modFunctionCrash.errors.txt new file mode 100644 index 0000000000000..e82a693d6d907 --- /dev/null +++ b/tests/baselines/reference/modFunctionCrash.errors.txt @@ -0,0 +1,12 @@ +modFunctionCrash.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== modFunctionCrash.ts (1 errors) ==== + declare module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function f(fn:()=>void); // typechecking the function type shouldnot crash the compiler + } + + + Q.f(function() {this;}); \ No newline at end of file diff --git a/tests/baselines/reference/modFunctionCrash.types b/tests/baselines/reference/modFunctionCrash.types index debfc1b57fdd9..f1313756047ed 100644 --- a/tests/baselines/reference/modFunctionCrash.types +++ b/tests/baselines/reference/modFunctionCrash.types @@ -15,6 +15,7 @@ declare module Q { Q.f(function() {this;}); >Q.f(function() {this;}) : any +> : ^^^ >Q.f : (fn: () => void) => any > : ^ ^^ ^^^^^^^^ >Q : typeof Q @@ -24,4 +25,5 @@ Q.f(function() {this;}); >function() {this;} : () => void > : ^^^^^^^^^^ >this : any +> : ^^^ diff --git a/tests/baselines/reference/moduleAliasInterface.errors.txt b/tests/baselines/reference/moduleAliasInterface.errors.txt new file mode 100644 index 0000000000000..b09de89e97a82 --- /dev/null +++ b/tests/baselines/reference/moduleAliasInterface.errors.txt @@ -0,0 +1,76 @@ +moduleAliasInterface.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAliasInterface.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAliasInterface.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAliasInterface.ts(37,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAliasInterface.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAliasInterface.ts(49,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleAliasInterface.ts (6 errors) ==== + module _modes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IMode { + + } + + export class Mode { + + } + } + + // _modes. // produces an internal error - please implement in derived class + + module editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import modes = _modes; + + var i : modes.IMode; + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { + constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported + public foo(p1:modes.IMode) { + + } + } + } + + import modesOuter = _modes; + module editor2 { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + var i : modesOuter.IMode; + + class Bug { + constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally + + } + + module Foo { export class Bar{} } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class Bug2 { + constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } + } + } + + module A1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A1I1 {} + export class A1C1 {} + } + + module B1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import A1Alias1 = A1; + + var i : A1Alias1.A1I1; + var c : A1Alias1.A1C1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName.errors.txt new file mode 100644 index 0000000000000..e38024338d05a --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.errors.txt @@ -0,0 +1,17 @@ +moduleAndInterfaceSharingName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceSharingName.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleAndInterfaceSharingName.ts (2 errors) ==== + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { } + } + export interface Y { } + } + var z: X.Y.Z = null; + var z2: X.Y; \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt index 7b6e0888e1d1d..eda554ec62d9c 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt +++ b/tests/baselines/reference/moduleAndInterfaceSharingName2.errors.txt @@ -1,9 +1,15 @@ +moduleAndInterfaceSharingName2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceSharingName2.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAndInterfaceSharingName2.ts(8,9): error TS2315: Type 'Y' is not generic. -==== moduleAndInterfaceSharingName2.ts (1 errors) ==== +==== moduleAndInterfaceSharingName2.ts (3 errors) ==== module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Z { } } export interface Y { } diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName3.errors.txt new file mode 100644 index 0000000000000..6c22cc2cb0163 --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.errors.txt @@ -0,0 +1,17 @@ +moduleAndInterfaceSharingName3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceSharingName3.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleAndInterfaceSharingName3.ts (2 errors) ==== + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { } + } + export interface Y { } + } + var z: X.Y.Z = null; + var z2: X.Y; \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.errors.txt b/tests/baselines/reference/moduleAndInterfaceSharingName4.errors.txt new file mode 100644 index 0000000000000..24a2f14651d9b --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.errors.txt @@ -0,0 +1,18 @@ +moduleAndInterfaceSharingName4.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceSharingName4.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleAndInterfaceSharingName4.ts (2 errors) ==== + declare module D3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x: D3.Color.Color; + + module Color { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Color { + darker: Color; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt index 2a7726c5c87ec..0b8b29e0f8392 100644 --- a/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt +++ b/tests/baselines/reference/moduleAndInterfaceWithSameName.errors.txt @@ -1,9 +1,19 @@ +moduleAndInterfaceWithSameName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceWithSameName.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceWithSameName.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceWithSameName.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAndInterfaceWithSameName.ts(21,15): error TS2339: Property 'Bar' does not exist on type 'typeof Foo2'. +moduleAndInterfaceWithSameName.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAndInterfaceWithSameName.ts(24,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== moduleAndInterfaceWithSameName.ts (1 errors) ==== +==== moduleAndInterfaceWithSameName.ts (7 errors) ==== module Foo1 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 42; } @@ -13,7 +23,11 @@ moduleAndInterfaceWithSameName.ts(21,15): error TS2339: Property 'Bar' does not } module Foo2 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 42; } @@ -27,7 +41,11 @@ moduleAndInterfaceWithSameName.ts(21,15): error TS2339: Property 'Bar' does not !!! error TS2339: Property 'Bar' does not exist on type 'typeof Foo2'. module Foo3 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 42; } diff --git a/tests/baselines/reference/moduleAsBaseType.errors.txt b/tests/baselines/reference/moduleAsBaseType.errors.txt index 7d1e45521eb67..c9d3a39dca707 100644 --- a/tests/baselines/reference/moduleAsBaseType.errors.txt +++ b/tests/baselines/reference/moduleAsBaseType.errors.txt @@ -1,10 +1,13 @@ +moduleAsBaseType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAsBaseType.ts(2,17): error TS2708: Cannot use namespace 'M' as a value. moduleAsBaseType.ts(3,21): error TS2709: Cannot use namespace 'M' as a type. moduleAsBaseType.ts(4,21): error TS2709: Cannot use namespace 'M' as a type. -==== moduleAsBaseType.ts (3 errors) ==== +==== moduleAsBaseType.ts (4 errors) ==== module M {} + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C extends M {} ~ !!! error TS2708: Cannot use namespace 'M' as a value. diff --git a/tests/baselines/reference/moduleAssignmentCompat1.errors.txt b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt index 93c6c91a2a8e2..6745bb20bb566 100644 --- a/tests/baselines/reference/moduleAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat1.errors.txt @@ -1,12 +1,18 @@ +moduleAssignmentCompat1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat1.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAssignmentCompat1.ts(9,8): error TS2709: Cannot use namespace 'A' as a type. moduleAssignmentCompat1.ts(10,8): error TS2709: Cannot use namespace 'B' as a type. -==== moduleAssignmentCompat1.ts (2 errors) ==== +==== moduleAssignmentCompat1.ts (4 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } class D { } } diff --git a/tests/baselines/reference/moduleAssignmentCompat2.errors.txt b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt index ed8c40902bfb4..3d0c9d2f6fbd1 100644 --- a/tests/baselines/reference/moduleAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat2.errors.txt @@ -1,12 +1,18 @@ +moduleAssignmentCompat2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAssignmentCompat2.ts(9,8): error TS2709: Cannot use namespace 'A' as a type. moduleAssignmentCompat2.ts(10,8): error TS2709: Cannot use namespace 'B' as a type. -==== moduleAssignmentCompat2.ts (2 errors) ==== +==== moduleAssignmentCompat2.ts (4 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } export class D { } } diff --git a/tests/baselines/reference/moduleAssignmentCompat3.errors.txt b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt index 1643bfe42d87f..6cd6ef45a711e 100644 --- a/tests/baselines/reference/moduleAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat3.errors.txt @@ -1,12 +1,18 @@ +moduleAssignmentCompat3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAssignmentCompat3.ts(8,8): error TS2709: Cannot use namespace 'A' as a type. moduleAssignmentCompat3.ts(9,8): error TS2709: Cannot use namespace 'B' as a type. -==== moduleAssignmentCompat3.ts (2 errors) ==== +==== moduleAssignmentCompat3.ts (4 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = ""; } diff --git a/tests/baselines/reference/moduleAssignmentCompat4.errors.txt b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt index 0220f7c46e6d3..627910fbea6ff 100644 --- a/tests/baselines/reference/moduleAssignmentCompat4.errors.txt +++ b/tests/baselines/reference/moduleAssignmentCompat4.errors.txt @@ -1,15 +1,27 @@ +moduleAssignmentCompat4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat4.ts(2,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat4.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleAssignmentCompat4.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleAssignmentCompat4.ts(12,8): error TS2709: Cannot use namespace 'A' as a type. moduleAssignmentCompat4.ts(13,8): error TS2709: Cannot use namespace 'B' as a type. -==== moduleAssignmentCompat4.ts (2 errors) ==== +==== moduleAssignmentCompat4.ts (6 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { } } } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class D { } } } diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt new file mode 100644 index 0000000000000..e2c24fff9de31 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt @@ -0,0 +1,31 @@ +map.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== map.ts (1 errors) ==== + import { Observable } from "./observable" + + (Observable.prototype).map = function() { } + + declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + class Bar {} + let y: number, z: string; + let {a: x, b: x1}: {a: number, b: number}; + module Z {} + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + +==== observable.ts (0 errors) ==== + export declare class Observable { + filter(pred: (e:T) => boolean): Observable; + } + +==== main.ts (0 errors) ==== + import { Observable } from "./observable" + import "./map"; + + let x: Observable; + let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.types b/tests/baselines/reference/moduleAugmentationNoNewNames.types index 0e7be89f26576..20da945ddb558 100644 --- a/tests/baselines/reference/moduleAugmentationNoNewNames.types +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.types @@ -9,9 +9,11 @@ import { Observable } from "./observable" >(Observable.prototype).map = function() { } : () => void > : ^^^^^^^^^^ >(Observable.prototype).map : any +> : ^^^ >(Observable.prototype) : any > : ^^^ >Observable.prototype : any +> : ^^^ >Observable.prototype : Observable > : ^^^^^^^^^^^^^^^ >Observable : typeof Observable diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt index d3fe9ca151c49..37d863d4f7250 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt @@ -1,10 +1,13 @@ +moduleClassArrayCodeGenTest.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleClassArrayCodeGenTest.ts(10,11): error TS2694: Namespace 'M' has no exported member 'B'. -==== moduleClassArrayCodeGenTest.ts (1 errors) ==== +==== moduleClassArrayCodeGenTest.ts (2 errors) ==== // Invalid code gen for Array of Module class module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { export class A { } class B{ } diff --git a/tests/baselines/reference/moduleCodeGenTest3.errors.txt b/tests/baselines/reference/moduleCodeGenTest3.errors.txt new file mode 100644 index 0000000000000..dfbaa73fc5ce2 --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest3.errors.txt @@ -0,0 +1,9 @@ +moduleCodeGenTest3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleCodeGenTest3.ts (1 errors) ==== + module Baz { export var x = "hello"; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + Baz.x = "goodbye"; \ No newline at end of file diff --git a/tests/baselines/reference/moduleCodegenTest4.errors.txt b/tests/baselines/reference/moduleCodegenTest4.errors.txt new file mode 100644 index 0000000000000..df2dfaa4a1010 --- /dev/null +++ b/tests/baselines/reference/moduleCodegenTest4.errors.txt @@ -0,0 +1,10 @@ +moduleCodegenTest4.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleCodegenTest4.ts (1 errors) ==== + export module Baz { export var x = "hello"; } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + Baz.x = "goodbye"; + void 0; \ No newline at end of file diff --git a/tests/baselines/reference/moduleCrashBug1.errors.txt b/tests/baselines/reference/moduleCrashBug1.errors.txt index e7ad457d04b5e..b91f0a1ec9a3b 100644 --- a/tests/baselines/reference/moduleCrashBug1.errors.txt +++ b/tests/baselines/reference/moduleCrashBug1.errors.txt @@ -1,8 +1,12 @@ +moduleCrashBug1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleCrashBug1.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleCrashBug1.ts(18,9): error TS2709: Cannot use namespace '_modes' as a type. -==== moduleCrashBug1.ts (1 errors) ==== +==== moduleCrashBug1.ts (3 errors) ==== module _modes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IMode { } @@ -15,6 +19,8 @@ moduleCrashBug1.ts(18,9): error TS2709: Cannot use namespace '_modes' as a type. //_modes. // produces an internal error - please implement in derived class module editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import modes = _modes; } diff --git a/tests/baselines/reference/moduleElementsInWrongContext.errors.txt b/tests/baselines/reference/moduleElementsInWrongContext.errors.txt index 205ad33b96f35..b3d1f324ea9e6 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext.errors.txt +++ b/tests/baselines/reference/moduleElementsInWrongContext.errors.txt @@ -1,4 +1,5 @@ moduleElementsInWrongContext.ts(2,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +moduleElementsInWrongContext.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleElementsInWrongContext.ts(3,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext.ts(7,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext.ts(9,5): error TS1234: An ambient module declaration is only allowed at the top level in a file. @@ -17,11 +18,13 @@ moduleElementsInWrongContext.ts(27,5): error TS1232: An import declaration can o moduleElementsInWrongContext.ts(28,5): error TS1232: An import declaration can only be used at the top level of a namespace or module. -==== moduleElementsInWrongContext.ts (17 errors) ==== +==== moduleElementsInWrongContext.ts (18 errors) ==== { module M { } ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace N { ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. diff --git a/tests/baselines/reference/moduleElementsInWrongContext2.errors.txt b/tests/baselines/reference/moduleElementsInWrongContext2.errors.txt index c841e04874c2c..174baacc64013 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext2.errors.txt +++ b/tests/baselines/reference/moduleElementsInWrongContext2.errors.txt @@ -1,4 +1,5 @@ moduleElementsInWrongContext2.ts(2,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +moduleElementsInWrongContext2.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleElementsInWrongContext2.ts(3,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext2.ts(7,5): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext2.ts(9,5): error TS1234: An ambient module declaration is only allowed at the top level in a file. @@ -17,11 +18,13 @@ moduleElementsInWrongContext2.ts(27,5): error TS1232: An import declaration can moduleElementsInWrongContext2.ts(28,5): error TS1232: An import declaration can only be used at the top level of a namespace or module. -==== moduleElementsInWrongContext2.ts (17 errors) ==== +==== moduleElementsInWrongContext2.ts (18 errors) ==== function blah () { module M { } ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace N { ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. diff --git a/tests/baselines/reference/moduleElementsInWrongContext3.errors.txt b/tests/baselines/reference/moduleElementsInWrongContext3.errors.txt index 52720f8a0b7c2..d4a4b1e8ff4f0 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext3.errors.txt +++ b/tests/baselines/reference/moduleElementsInWrongContext3.errors.txt @@ -1,4 +1,6 @@ +moduleElementsInWrongContext3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleElementsInWrongContext3.ts(3,9): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. +moduleElementsInWrongContext3.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleElementsInWrongContext3.ts(4,9): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext3.ts(8,9): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. moduleElementsInWrongContext3.ts(10,9): error TS1234: An ambient module declaration is only allowed at the top level in a file. @@ -17,12 +19,16 @@ moduleElementsInWrongContext3.ts(28,9): error TS1232: An import declaration can moduleElementsInWrongContext3.ts(29,9): error TS1232: An import declaration can only be used at the top level of a namespace or module. -==== moduleElementsInWrongContext3.ts (17 errors) ==== +==== moduleElementsInWrongContext3.ts (19 errors) ==== module P { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { module M { } ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export namespace N { ~~~~~~ !!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module. diff --git a/tests/baselines/reference/moduleExports1.errors.txt b/tests/baselines/reference/moduleExports1.errors.txt index 299a23e0e3243..03efb0d8072bc 100644 --- a/tests/baselines/reference/moduleExports1.errors.txt +++ b/tests/baselines/reference/moduleExports1.errors.txt @@ -1,9 +1,18 @@ +moduleExports1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleExports1.ts(1,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleExports1.ts(1,34): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleExports1.ts(13,6): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. moduleExports1.ts(13,22): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== moduleExports1.ts (2 errors) ==== +==== moduleExports1.ts (5 errors) ==== export module TypeScript.Strasse.Street { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Rue { public address:string; } diff --git a/tests/baselines/reference/moduleIdentifiers.errors.txt b/tests/baselines/reference/moduleIdentifiers.errors.txt new file mode 100644 index 0000000000000..9ef41780e50cf --- /dev/null +++ b/tests/baselines/reference/moduleIdentifiers.errors.txt @@ -0,0 +1,16 @@ +moduleIdentifiers.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleIdentifiers.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface P { x: number; y: number; } + export var a = 1 + } + + //var p: M.P; + //var m: M = M; + var x1 = M.a; + //var x2 = m.a; + //var q: m.P; \ No newline at end of file diff --git a/tests/baselines/reference/moduleImport.errors.txt b/tests/baselines/reference/moduleImport.errors.txt index 585eb6dfe19d6..3122ce2258c51 100644 --- a/tests/baselines/reference/moduleImport.errors.txt +++ b/tests/baselines/reference/moduleImport.errors.txt @@ -1,8 +1,18 @@ +moduleImport.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleImport.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleImport.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleImport.ts(2,17): error TS2694: Namespace 'X' has no exported member 'Y'. +moduleImport.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== moduleImport.ts (1 errors) ==== +==== moduleImport.ts (5 errors) ==== module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import XYZ = X.Y.Z; ~ !!! error TS2694: Namespace 'X' has no exported member 'Y'. @@ -12,6 +22,8 @@ moduleImport.ts(2,17): error TS2694: Namespace 'X' has no exported member 'Y'. } module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import ABC = A.B.C; export function pong(x: number) { if (x > 0) ABC.ping(x-1); diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.errors.txt b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.errors.txt new file mode 100644 index 0000000000000..5b2d3326f8fb2 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.errors.txt @@ -0,0 +1,67 @@ +moduleMemberWithoutTypeAnnotation1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation1.ts(1,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation1.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation1.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation1.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation1.ts(37,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleMemberWithoutTypeAnnotation1.ts (6 errors) ==== + module TypeScript.Parser { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class SyntaxCursor { + public currentNode(): SyntaxNode { + return null; + } + } + } + + module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface ISyntaxElement { }; + export interface ISyntaxToken { }; + + export class PositionedElement { + public childIndex(child: ISyntaxElement) { + return Syntax.childIndex(); + } + } + + export class PositionedToken { + constructor(parent: PositionedElement, token: ISyntaxToken, fullStart: number) { + } + } + } + + module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class SyntaxNode { + public findToken(position: number, includeSkippedTokens: boolean = false): PositionedToken { + var positionedToken = this.findTokenInternal(null, position, 0); + return null; + } + findTokenInternal(x, y, z) { + return null; + } + } + } + + module TypeScript.Syntax { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function childIndex() { } + + export class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { + private findTokenInternal(parent: PositionedElement, position: number, fullStart: number) { + return new PositionedToken(parent, this, fullStart); + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index 6d1a1d52fda04..0ef462853f0b4 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -84,7 +84,9 @@ module TypeScript { var positionedToken = this.findTokenInternal(null, position, 0); >positionedToken : any +> : ^^^ >this.findTokenInternal(null, position, 0) : any +> : ^^^ >this.findTokenInternal : (x: any, y: any, z: any) => any > : ^ ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^ >this : this @@ -102,8 +104,11 @@ module TypeScript { >findTokenInternal : (x: any, y: any, z: any) => any > : ^ ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >y : any +> : ^^^ >z : any +> : ^^^ return null; } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.errors.txt b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.errors.txt new file mode 100644 index 0000000000000..ca3fb641ec015 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.errors.txt @@ -0,0 +1,26 @@ +moduleMemberWithoutTypeAnnotation2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMemberWithoutTypeAnnotation2.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleMemberWithoutTypeAnnotation2.ts (2 errors) ==== + module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module CompilerDiagnostics { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface IDiagnosticWriter { + Alert(output: string): void; + } + + export var diagnosticWriter = null; + + export function Alert(output: string) { + if (diagnosticWriter) { + diagnosticWriter.Alert(output); + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types index b67cc2c13d03c..8e555c25e92f3 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types @@ -19,6 +19,7 @@ module TypeScript { export var diagnosticWriter = null; >diagnosticWriter : any +> : ^^^ export function Alert(output: string) { >Alert : (output: string) => void @@ -28,10 +29,13 @@ module TypeScript { if (diagnosticWriter) { >diagnosticWriter : any +> : ^^^ diagnosticWriter.Alert(output); >diagnosticWriter.Alert(output) : any +> : ^^^ >diagnosticWriter.Alert : any +> : ^^^ >diagnosticWriter : any > : ^^^ >Alert : any diff --git a/tests/baselines/reference/moduleMerge.errors.txt b/tests/baselines/reference/moduleMerge.errors.txt new file mode 100644 index 0000000000000..0a17bade5cf90 --- /dev/null +++ b/tests/baselines/reference/moduleMerge.errors.txt @@ -0,0 +1,32 @@ +moduleMerge.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleMerge.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleMerge.ts (2 errors) ==== + // This should not compile both B classes are in the same module this should be a collission + + module A + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + class B + { + public Hello(): string + { + return "from private B"; + } + } + } + + module A + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export class B + { + public Hello(): string + { + return "from export B"; + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleNewExportBug.errors.txt b/tests/baselines/reference/moduleNewExportBug.errors.txt index 24739911f895e..9512dd5df6306 100644 --- a/tests/baselines/reference/moduleNewExportBug.errors.txt +++ b/tests/baselines/reference/moduleNewExportBug.errors.txt @@ -1,8 +1,11 @@ +moduleNewExportBug.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleNewExportBug.ts(10,14): error TS2694: Namespace 'mod1' has no exported member 'C'. -==== moduleNewExportBug.ts (1 errors) ==== +==== moduleNewExportBug.ts (2 errors) ==== module mod1 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface mInt { new (bar:any):any; foo (bar:any):any; diff --git a/tests/baselines/reference/moduleNoEmit.errors.txt b/tests/baselines/reference/moduleNoEmit.errors.txt new file mode 100644 index 0000000000000..3c2c194b5cfcc --- /dev/null +++ b/tests/baselines/reference/moduleNoEmit.errors.txt @@ -0,0 +1,9 @@ +moduleNoEmit.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleNoEmit.ts (1 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + 1+1; + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleOuterQualification.errors.txt b/tests/baselines/reference/moduleOuterQualification.errors.txt new file mode 100644 index 0000000000000..89f7beefb02ce --- /dev/null +++ b/tests/baselines/reference/moduleOuterQualification.errors.txt @@ -0,0 +1,17 @@ +moduleOuterQualification.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleOuterQualification.ts(3,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleOuterQualification.ts (2 errors) ==== + declare module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Beta { } + module inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // .d.ts emit: should be 'extends outer.Beta' + export interface Beta extends outer.Beta { } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleProperty1.errors.txt b/tests/baselines/reference/moduleProperty1.errors.txt index 19e7bab740400..5f951a8507f4c 100644 --- a/tests/baselines/reference/moduleProperty1.errors.txt +++ b/tests/baselines/reference/moduleProperty1.errors.txt @@ -1,16 +1,22 @@ +moduleProperty1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleProperty1.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleProperty1.ts(9,5): error TS1128: Declaration or statement expected. moduleProperty1.ts(9,13): error TS2304: Cannot find name 'y'. moduleProperty1.ts(10,20): error TS2304: Cannot find name 'y'. -==== moduleProperty1.ts (3 errors) ==== +==== moduleProperty1.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x=10; // variable local to this module body var y=x; // property visible only in module export var z=y; // property visible to any code } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x = 10; // variable local to this module body private y = x; // can't use private in modules ~~~~~~~ diff --git a/tests/baselines/reference/moduleProperty2.errors.txt b/tests/baselines/reference/moduleProperty2.errors.txt index 6e2a19391d5f1..3ae94dfcac3bf 100644 --- a/tests/baselines/reference/moduleProperty2.errors.txt +++ b/tests/baselines/reference/moduleProperty2.errors.txt @@ -1,9 +1,13 @@ +moduleProperty2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleProperty2.ts(7,15): error TS2304: Cannot find name 'x'. +moduleProperty2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleProperty2.ts(12,17): error TS2339: Property 'y' does not exist on type 'typeof M'. -==== moduleProperty2.ts (2 errors) ==== +==== moduleProperty2.ts (4 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function f() { var x; } @@ -16,6 +20,8 @@ moduleProperty2.ts(12,17): error TS2339: Property 'y' does not exist on type 'ty } module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var test3=M.y; // nope y private property of M ~ !!! error TS2339: Property 'y' does not exist on type 'typeof M'. diff --git a/tests/baselines/reference/moduleRedifinitionErrors.errors.txt b/tests/baselines/reference/moduleRedifinitionErrors.errors.txt new file mode 100644 index 0000000000000..cb68aea33b117 --- /dev/null +++ b/tests/baselines/reference/moduleRedifinitionErrors.errors.txt @@ -0,0 +1,11 @@ +moduleRedifinitionErrors.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleRedifinitionErrors.ts (1 errors) ==== + class A { + } + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.errors.txt b/tests/baselines/reference/moduleReopenedTypeOtherBlock.errors.txt new file mode 100644 index 0000000000000..c93c90f17c319 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.errors.txt @@ -0,0 +1,17 @@ +moduleReopenedTypeOtherBlock.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleReopenedTypeOtherBlock.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleReopenedTypeOtherBlock.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1 { } + export interface I { n: number; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C2 { f(): I { return null; } } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.errors.txt b/tests/baselines/reference/moduleReopenedTypeSameBlock.errors.txt new file mode 100644 index 0000000000000..c711ed60a0f38 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.errors.txt @@ -0,0 +1,15 @@ +moduleReopenedTypeSameBlock.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleReopenedTypeSameBlock.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleReopenedTypeSameBlock.ts (2 errors) ==== + module M { export class C1 { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { n: number; } + export class C2 { f(): I { return null; } } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleScopingBug.errors.txt b/tests/baselines/reference/moduleScopingBug.errors.txt new file mode 100644 index 0000000000000..9e53a87109881 --- /dev/null +++ b/tests/baselines/reference/moduleScopingBug.errors.txt @@ -0,0 +1,38 @@ +moduleScopingBug.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleScopingBug.ts(21,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleScopingBug.ts (2 errors) ==== + module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + { + + var outer: number; + + function f() { + + var inner = outer; // Ok + + } + + class C { + + constructor() { + var inner = outer; // Ok + } + + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + var inner = outer; // Error: outer not visible + + } + + } + + \ No newline at end of file diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.errors.txt new file mode 100644 index 0000000000000..5c32c6a8a666b --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.errors.txt @@ -0,0 +1,26 @@ +moduleSharesNameWithImportDeclarationInsideIt.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleSharesNameWithImportDeclarationInsideIt.ts (4 errors) ==== + module Z.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar() { + return ""; + } + } + module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import M = Z.M; + export function bar() { + } + M.bar(); // Should call Z.M.bar + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.errors.txt new file mode 100644 index 0000000000000..562028acf6886 --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.errors.txt @@ -0,0 +1,26 @@ +moduleSharesNameWithImportDeclarationInsideIt2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt2.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt2.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt2.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleSharesNameWithImportDeclarationInsideIt2.ts (4 errors) ==== + module Z.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar() { + return ""; + } + } + module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import M = Z.M; + export function bar() { + } + M.bar(); // Should call Z.M.bar + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt3.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt3.errors.txt index 33f779f295c0e..5727478aafd21 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt3.errors.txt +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt3.errors.txt @@ -1,10 +1,18 @@ +moduleSharesNameWithImportDeclarationInsideIt3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt3.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt3.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt3.ts(9,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleSharesNameWithImportDeclarationInsideIt3.ts(10,12): error TS2300: Duplicate identifier 'M'. moduleSharesNameWithImportDeclarationInsideIt3.ts(11,12): error TS2300: Duplicate identifier 'M'. -==== moduleSharesNameWithImportDeclarationInsideIt3.ts (2 errors) ==== +==== moduleSharesNameWithImportDeclarationInsideIt3.ts (6 errors) ==== module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function bar() { return ""; } @@ -12,6 +20,10 @@ moduleSharesNameWithImportDeclarationInsideIt3.ts(11,12): error TS2300: Duplicat export interface I { } } module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import M = Z.M; ~ !!! error TS2300: Duplicate identifier 'M'. diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.errors.txt new file mode 100644 index 0000000000000..ac3100a20c483 --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.errors.txt @@ -0,0 +1,27 @@ +moduleSharesNameWithImportDeclarationInsideIt4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt4.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt4.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt4.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleSharesNameWithImportDeclarationInsideIt4.ts (4 errors) ==== + module Z.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar() { + return ""; + } + } + module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface M { } + import M = Z.M; + export function bar() { + } + M.bar(); // Should call Z.M.bar + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt5.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt5.errors.txt index bd51066e00919..0cf87aff75acb 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt5.errors.txt +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt5.errors.txt @@ -1,10 +1,18 @@ +moduleSharesNameWithImportDeclarationInsideIt5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt5.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt5.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt5.ts(9,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleSharesNameWithImportDeclarationInsideIt5.ts(10,12): error TS2300: Duplicate identifier 'M'. moduleSharesNameWithImportDeclarationInsideIt5.ts(11,12): error TS2300: Duplicate identifier 'M'. -==== moduleSharesNameWithImportDeclarationInsideIt5.ts (2 errors) ==== +==== moduleSharesNameWithImportDeclarationInsideIt5.ts (6 errors) ==== module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function bar() { return ""; } @@ -12,6 +20,10 @@ moduleSharesNameWithImportDeclarationInsideIt5.ts(11,12): error TS2300: Duplicat export interface I { } } module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import M = Z.I; ~ !!! error TS2300: Duplicate identifier 'M'. diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.errors.txt b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.errors.txt new file mode 100644 index 0000000000000..e4a77d59c4ba8 --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.errors.txt @@ -0,0 +1,25 @@ +moduleSharesNameWithImportDeclarationInsideIt6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt6.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt6.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleSharesNameWithImportDeclarationInsideIt6.ts(6,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleSharesNameWithImportDeclarationInsideIt6.ts (4 errors) ==== + module Z.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar() { + return ""; + } + } + module A.M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import M = Z.M; + export function bar() { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleSymbolMerging.errors.txt b/tests/baselines/reference/moduleSymbolMerging.errors.txt new file mode 100644 index 0000000000000..094629c99bcd6 --- /dev/null +++ b/tests/baselines/reference/moduleSymbolMerging.errors.txt @@ -0,0 +1,22 @@ +A.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +B.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +B.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== B.ts (2 errors) ==== + /// + module A { ; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f(): A.I { return null; } + } + + +==== A.ts (1 errors) ==== + module A { export interface I {} } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + \ No newline at end of file diff --git a/tests/baselines/reference/moduleUnassignedVariable.errors.txt b/tests/baselines/reference/moduleUnassignedVariable.errors.txt new file mode 100644 index 0000000000000..dc14e9d73a725 --- /dev/null +++ b/tests/baselines/reference/moduleUnassignedVariable.errors.txt @@ -0,0 +1,14 @@ +moduleUnassignedVariable.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleUnassignedVariable.ts (1 errors) ==== + module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var a = 1; + function fooA() { return a; } // Correct: return Bar.a + + export var b; + function fooB() { return b; } // Incorrect: return b + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index bd13d33b35ca9..49bcc4bf63129 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -19,10 +19,12 @@ module Bar { export var b; >b : any +> : ^^^ function fooB() { return b; } // Incorrect: return b >fooB : () => any > : ^^^^^^^^^ >b : any +> : ^^^ } diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.errors.txt b/tests/baselines/reference/moduleVariableArrayIndexer.errors.txt index 65b74f01de5d0..7530070395f2a 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.errors.txt +++ b/tests/baselines/reference/moduleVariableArrayIndexer.errors.txt @@ -1,8 +1,11 @@ +moduleVariableArrayIndexer.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleVariableArrayIndexer.ts(3,13): error TS18050: The value 'undefined' cannot be used here. -==== moduleVariableArrayIndexer.ts (1 errors) ==== +==== moduleVariableArrayIndexer.ts (2 errors) ==== module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a = 1; var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; ~~~~~~~~~ diff --git a/tests/baselines/reference/moduleVariables.errors.txt b/tests/baselines/reference/moduleVariables.errors.txt new file mode 100644 index 0000000000000..62ceedbbb7732 --- /dev/null +++ b/tests/baselines/reference/moduleVariables.errors.txt @@ -0,0 +1,29 @@ +moduleVariables.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVariables.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVariables.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleVariables.ts (3 errors) ==== + declare var console: any; + + var x = 1; + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 2; + console.log(x); // 2 + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + console.log(x); // 2 + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 3; + console.log(x); // 3 + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleVariables.types b/tests/baselines/reference/moduleVariables.types index 4adb04889fa80..9529798f1e22b 100644 --- a/tests/baselines/reference/moduleVariables.types +++ b/tests/baselines/reference/moduleVariables.types @@ -3,6 +3,7 @@ === moduleVariables.ts === declare var console: any; >console : any +> : ^^^ var x = 1; >x : number @@ -22,7 +23,9 @@ module M { console.log(x); // 2 >console.log(x) : any +> : ^^^ >console.log : any +> : ^^^ >console : any > : ^^^ >log : any @@ -37,7 +40,9 @@ module M { console.log(x); // 2 >console.log(x) : any +> : ^^^ >console.log : any +> : ^^^ >console : any > : ^^^ >log : any @@ -58,7 +63,9 @@ module M { console.log(x); // 3 >console.log(x) : any +> : ^^^ >console.log : any +> : ^^^ >console : any > : ^^^ >log : any diff --git a/tests/baselines/reference/moduleVisibilityTest1.errors.txt b/tests/baselines/reference/moduleVisibilityTest1.errors.txt new file mode 100644 index 0000000000000..5853e7a54ee9d --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest1.errors.txt @@ -0,0 +1,83 @@ +moduleVisibilityTest1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest1.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest1.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest1.ts(13,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest1.ts(53,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleVisibilityTest1.ts (5 errors) ==== + module OuterMod { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function someExportedOuterFunc() { return -1; } + + export module OuterInnerMod { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function someExportedOuterInnerFunc() { return "foo"; } + } + } + + import OuterInnerAlias = OuterMod.OuterInnerMod; + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export module InnerMod { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function someExportedInnerFunc() { return -2; } + } + + export enum E { + A, + B, + C, + } + + export var x = 5; + export declare var exported_var; + + var y = x + x; + + + export interface I { + someMethod():number; + } + + class B {public b = 0;} + + export class C implements I { + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} + public someMethod() { return 0; } + public someProp = 1; + + constructor() { + function someInnerFunc() { return 2; } + var someInnerVar = 3; + } + } + + var someModuleVar = 4; + + function someModuleFunction() { return 5;} + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c = x; + export var meb = M.E.B; + } + + var cprime : M.I = null; + + var c = new M.C(); + var z = M.x; + var alpha = M.E.A; + var omega = M.exported_var; + c.someMethodThatCallsAnOuterMethod(); + \ No newline at end of file diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index d300bd0a6437c..1af975ff8d8d4 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -75,6 +75,7 @@ module M { export declare var exported_var; >exported_var : any +> : ^^^ var y = x + x; >y : number @@ -254,7 +255,9 @@ var alpha = M.E.A; var omega = M.exported_var; >omega : any +> : ^^^ >M.exported_var : any +> : ^^^ >M : typeof M > : ^^^^^^^^ >exported_var : any diff --git a/tests/baselines/reference/moduleVisibilityTest2.errors.txt b/tests/baselines/reference/moduleVisibilityTest2.errors.txt index 0fd8fbeb7a0d0..b0fa900cb2f1f 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest2.errors.txt @@ -1,3 +1,8 @@ +moduleVisibilityTest2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest2.ts(4,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest2.ts(13,9): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest2.ts(54,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleVisibilityTest2.ts(55,17): error TS2304: Cannot find name 'x'. moduleVisibilityTest2.ts(56,21): error TS2339: Property 'E' does not exist on type 'typeof M'. moduleVisibilityTest2.ts(59,16): error TS2694: Namespace 'M' has no exported member 'I'. @@ -6,11 +11,15 @@ moduleVisibilityTest2.ts(62,11): error TS2339: Property 'x' does not exist on ty moduleVisibilityTest2.ts(63,15): error TS2339: Property 'E' does not exist on type 'typeof M'. -==== moduleVisibilityTest2.ts (6 errors) ==== +==== moduleVisibilityTest2.ts (11 errors) ==== module OuterMod { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function someExportedOuterFunc() { return -1; } export module OuterInnerMod { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function someExportedOuterInnerFunc() { return "foo"; } } } @@ -18,8 +27,12 @@ moduleVisibilityTest2.ts(63,15): error TS2339: Property 'E' does not exist on ty import OuterInnerAlias = OuterMod.OuterInnerMod; module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module InnerMod { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function someExportedInnerFunc() { return -2; } } @@ -61,6 +74,8 @@ moduleVisibilityTest2.ts(63,15): error TS2339: Property 'E' does not exist on ty } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c = x; ~ !!! error TS2304: Cannot find name 'x'. diff --git a/tests/baselines/reference/moduleVisibilityTest3.errors.txt b/tests/baselines/reference/moduleVisibilityTest3.errors.txt index 588c7dcaf4b94..d94a7689ef143 100644 --- a/tests/baselines/reference/moduleVisibilityTest3.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest3.errors.txt @@ -1,10 +1,14 @@ +moduleVisibilityTest3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleVisibilityTest3.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleVisibilityTest3.ts(20,22): error TS2709: Cannot use namespace 'modes' as a type. moduleVisibilityTest3.ts(20,39): error TS2724: '_modes' has no exported member named 'Mode'. Did you mean 'IMode'? moduleVisibilityTest3.ts(21,22): error TS2724: '_modes' has no exported member named 'Mode'. Did you mean 'IMode'? -==== moduleVisibilityTest3.ts (3 errors) ==== +==== moduleVisibilityTest3.ts (5 errors) ==== module _modes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IMode { } @@ -17,6 +21,8 @@ moduleVisibilityTest3.ts(21,22): error TS2724: '_modes' has no exported member n //_modes. // produces an internal error - please implement in derived class module editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import modes = _modes; var i : modes.IMode; diff --git a/tests/baselines/reference/moduleVisibilityTest4.errors.txt b/tests/baselines/reference/moduleVisibilityTest4.errors.txt index 9bea2e3c23db7..e155b88cbd8e8 100644 --- a/tests/baselines/reference/moduleVisibilityTest4.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest4.errors.txt @@ -1,11 +1,14 @@ +moduleVisibilityTest4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleVisibilityTest4.ts(9,11): error TS2724: 'M' has no exported member named 'num'. Did you mean 'nums'? moduleVisibilityTest4.ts(11,11): error TS2694: Namespace 'M' has no exported member 'bar'. moduleVisibilityTest4.ts(13,11): error TS2724: 'N' has no exported member named 'num'. Did you mean 'nums'? moduleVisibilityTest4.ts(15,11): error TS2694: Namespace 'N' has no exported member 'bar'. -==== moduleVisibilityTest4.ts (4 errors) ==== +==== moduleVisibilityTest4.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export type nums = number; } diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt index d2a123782666b..b5bc7c59108bc 100644 --- a/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt +++ b/tests/baselines/reference/moduleWithNoValuesAsType.errors.txt @@ -1,15 +1,23 @@ +moduleWithNoValuesAsType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleWithNoValuesAsType.ts(2,8): error TS2709: Cannot use namespace 'A' as a type. +moduleWithNoValuesAsType.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleWithNoValuesAsType.ts(7,8): error TS2709: Cannot use namespace 'B' as a type. +moduleWithNoValuesAsType.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleWithNoValuesAsType.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleWithNoValuesAsType.ts(15,8): error TS2709: Cannot use namespace 'C' as a type. -==== moduleWithNoValuesAsType.ts (3 errors) ==== +==== moduleWithNoValuesAsType.ts (7 errors) ==== module A { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a: A; // error ~ !!! error TS2709: Cannot use namespace 'A' as a type. module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I {} } var b: B; // error @@ -17,7 +25,11 @@ moduleWithNoValuesAsType.ts(15,8): error TS2709: Cannot use namespace 'C' as a t !!! error TS2709: Cannot use namespace 'B' as a type. module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I {} } } diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.errors.txt b/tests/baselines/reference/moduleWithStatementsOfEveryKind.errors.txt new file mode 100644 index 0000000000000..6e79dd814d9d4 --- /dev/null +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.errors.txt @@ -0,0 +1,73 @@ +moduleWithStatementsOfEveryKind.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleWithStatementsOfEveryKind.ts(11,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleWithStatementsOfEveryKind.ts(30,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduleWithStatementsOfEveryKind.ts(40,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleWithStatementsOfEveryKind.ts (4 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { s: string } + class AA { s: T } + interface I { id: number } + + class B extends AA implements I { id: number } + class BB extends A { + id: number; + } + + module Module { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { s: string } + } + enum Color { Blue, Red } + var x = 12; + function F(s: string): number { + return 2; + } + var array: I[] = null; + var fn = (s: string) => { + return 'hello ' + s; + } + var ol = { s: 'hello', id: 2, isvalid: true }; + + declare class DC { + static x: number; + } + } + + module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { s: string } + export class AA { s: T } + export interface I { id: number } + + export class B extends AA implements I { id: number } + export class BB extends A { + id: number; + } + + export module Module { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { s: string } + } + export enum Color { Blue, Red } + export var x = 12; + export function F(s: string): number { + return 2; + } + export var array: I[] = null; + export var fn = (s: string) => { + return 'hello ' + s; + } + export var ol = { s: 'hello', id: 2, isvalid: true }; + + export declare class DC { + static x: number; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithTryStatement1.errors.txt b/tests/baselines/reference/moduleWithTryStatement1.errors.txt new file mode 100644 index 0000000000000..f9f60fe0123ba --- /dev/null +++ b/tests/baselines/reference/moduleWithTryStatement1.errors.txt @@ -0,0 +1,14 @@ +moduleWithTryStatement1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduleWithTryStatement1.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + try { + } + catch (e) { + } + } + var v = M; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleWithTryStatement1.types b/tests/baselines/reference/moduleWithTryStatement1.types index d17142683cc1f..d02225e7e7270 100644 --- a/tests/baselines/reference/moduleWithTryStatement1.types +++ b/tests/baselines/reference/moduleWithTryStatement1.types @@ -9,6 +9,7 @@ module M { } catch (e) { >e : any +> : ^^^ } } var v = M; diff --git a/tests/baselines/reference/moduleWithValuesAsType.errors.txt b/tests/baselines/reference/moduleWithValuesAsType.errors.txt index 52a7f8c38b477..530a39941e03f 100644 --- a/tests/baselines/reference/moduleWithValuesAsType.errors.txt +++ b/tests/baselines/reference/moduleWithValuesAsType.errors.txt @@ -1,8 +1,11 @@ +moduleWithValuesAsType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. moduleWithValuesAsType.ts(5,8): error TS2709: Cannot use namespace 'A' as a type. -==== moduleWithValuesAsType.ts (1 errors) ==== +==== moduleWithValuesAsType.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var b = 1; } diff --git a/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt index 65c5918ed50af..4337fe65a0eea 100644 --- a/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt +++ b/tests/baselines/reference/module_augmentExistingAmbientVariable.errors.txt @@ -1,14 +1,17 @@ module_augmentExistingAmbientVariable.ts(1,13): error TS2300: Duplicate identifier 'console'. +module_augmentExistingAmbientVariable.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module_augmentExistingAmbientVariable.ts(3,8): error TS2300: Duplicate identifier 'console'. -==== module_augmentExistingAmbientVariable.ts (2 errors) ==== +==== module_augmentExistingAmbientVariable.ts (3 errors) ==== declare var console: any; ~~~~~~~ !!! error TS2300: Duplicate identifier 'console'. module console { ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ !!! error TS2300: Duplicate identifier 'console'. export var x = 2; } \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentExistingVariable.errors.txt b/tests/baselines/reference/module_augmentExistingVariable.errors.txt index abcdfd4fd27a1..f1c662ab94e0a 100644 --- a/tests/baselines/reference/module_augmentExistingVariable.errors.txt +++ b/tests/baselines/reference/module_augmentExistingVariable.errors.txt @@ -1,14 +1,17 @@ module_augmentExistingVariable.ts(1,5): error TS2300: Duplicate identifier 'console'. +module_augmentExistingVariable.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module_augmentExistingVariable.ts(3,8): error TS2300: Duplicate identifier 'console'. -==== module_augmentExistingVariable.ts (2 errors) ==== +==== module_augmentExistingVariable.ts (3 errors) ==== var console: any; ~~~~~~~ !!! error TS2300: Duplicate identifier 'console'. module console { ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ !!! error TS2300: Duplicate identifier 'console'. export var x = 2; } \ No newline at end of file diff --git a/tests/baselines/reference/module_augmentUninstantiatedModule2.errors.txt b/tests/baselines/reference/module_augmentUninstantiatedModule2.errors.txt new file mode 100644 index 0000000000000..a9a0f7f9736eb --- /dev/null +++ b/tests/baselines/reference/module_augmentUninstantiatedModule2.errors.txt @@ -0,0 +1,21 @@ +module_augmentUninstantiatedModule2.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== module_augmentUninstantiatedModule2.ts (1 errors) ==== + declare var ng: ng.IAngularStatic; + + declare module ng { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IModule { + name: string; + } + + export interface IAngularStatic { + module: (s: string) => IModule; + } + } + + export = ng; + + \ No newline at end of file diff --git a/tests/baselines/reference/moduledecl.errors.txt b/tests/baselines/reference/moduledecl.errors.txt new file mode 100644 index 0000000000000..95414497699f1 --- /dev/null +++ b/tests/baselines/reference/moduledecl.errors.txt @@ -0,0 +1,313 @@ +moduledecl.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(4,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(7,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(7,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(18,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(47,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(84,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(85,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(90,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(95,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(97,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(98,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(104,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(105,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(106,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(107,27): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(118,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(122,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(126,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(130,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(138,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(178,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +moduledecl.ts(195,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== moduledecl.ts (26 errors) ==== + module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + module b.a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + + module c.a.b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import ma = a; + } + + module mImport { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import d = a; + import e = b.a; + import d1 = a; + import e1 = b.a; + } + + module m0 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function f1() { + } + + function f2(s: string); + function f2(n: number); + function f2(ns: any) { + } + + class c1 { + public a : ()=>string; + private b: ()=>number; + private static s1; + public static s2; + } + + interface i1 { + () : Object; + [n: number]: c1; + } + + import m2 = a; + import m3 = b; + import m4 = b.a; + import m5 = c; + import m6 = c.a; + import m7 = c.a.b; + } + + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f1() { + } + + export function f2(s: string); + export function f2(n: number); + export function f2(ns: any) { + } + + export class c1 { + public a: () =>string; + private b: () =>number; + private static s1; + public static s2; + + public d() { + return "Hello"; + } + + public e: { x: number; y: string; }; + constructor (public n, public n2: number, private n3, private n4: string) { + } + } + + export interface i1 { + () : Object; + [n: number]: c1; + } + + import m2 = a; + import m3 = b; + import m4 = b.a; + import m5 = c; + import m6 = c.a; + import m7 = c.a.b; + } + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a = 10; + export var b: number; + } + + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c: number; + } + } + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export module m25 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c: number; + } + } + } + + module m13 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c: number; + } + } + + export function f() { + return 20; + } + } + } + + declare module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var b; + } + + declare module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c; + } + + declare module m43 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var b; + } + + declare module m55 { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var c; + } + + declare module "m3" { + export var b: number; + } + + module exportTests { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f2() { + return 30; + } + + public f3() { + return "string"; + } + } + class C2_private { + private f2() { + return 30; + } + + public f3() { + return "string"; + } + } + + export class C3_public { + private getC2_private() { + return new C2_private(); + } + private setC2_private(arg: C2_private) { + } + private get c2() { + return new C2_private(); + } + public getC1_public() { + return new C1_public(); + } + public setC1_public(arg: C1_public) { + } + public get c1() { + return new C1_public(); + } + } + } + + declare module mAmbient { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + public myProp: number; + } + + function foo() : C; + var aVar: C; + interface B { + x: number; + y: C; + } + enum e { + x, + y, + z + } + + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + public myProp: number; + } + + function foo(): C; + var aVar: C; + interface B { + x: number; + y: C; + } + enum e { + x, + y, + z + } + } + } + + function foo() { + return mAmbient.foo(); + } + + var cVar = new mAmbient.C(); + var aVar = mAmbient.aVar; + var bB: mAmbient.B; + var eVar: mAmbient.e; + + function m3foo() { + return mAmbient.m3.foo(); + } + + var m3cVar = new mAmbient.m3.C(); + var m3aVar = mAmbient.m3.aVar; + var m3bB: mAmbient.m3.B; + var m3eVar: mAmbient.m3.e; + + \ No newline at end of file diff --git a/tests/baselines/reference/moduledecl.types b/tests/baselines/reference/moduledecl.types index 184d5e917e68a..fe5288129947d 100644 --- a/tests/baselines/reference/moduledecl.types +++ b/tests/baselines/reference/moduledecl.types @@ -11,14 +11,16 @@ module c.a.b { import ma = a; >ma : any > : ^^^ ->a : error +>a : any +> : ^^^ } module mImport { import d = a; >d : any > : ^^^ ->a : error +>a : any +> : ^^^ import e = b.a; >e : any @@ -31,7 +33,8 @@ module mImport { import d1 = a; >d1 : any > : ^^^ ->a : error +>a : any +> : ^^^ import e1 = b.a; >e1 : any @@ -67,6 +70,7 @@ module m0 { >f2 : { (s: string): any; (n: number): any; } > : ^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ >ns : any +> : ^^^ } class c1 { @@ -83,9 +87,11 @@ module m0 { private static s1; >s1 : any +> : ^^^ public static s2; >s2 : any +> : ^^^ } interface i1 { @@ -98,12 +104,14 @@ module m0 { import m2 = a; >m2 : any > : ^^^ ->a : error +>a : any +> : ^^^ import m3 = b; >m3 : any > : ^^^ ->b : error +>b : any +> : ^^^ import m4 = b.a; >m4 : any @@ -116,7 +124,8 @@ module m0 { import m5 = c; >m5 : any > : ^^^ ->c : error +>c : any +> : ^^^ import m6 = c.a; >m6 : any @@ -162,6 +171,7 @@ module m1 { >f2 : { (s: string): any; (n: number): any; } > : ^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ >ns : any +> : ^^^ } export class c1 { @@ -178,9 +188,11 @@ module m1 { private static s1; >s1 : any +> : ^^^ public static s2; >s2 : any +> : ^^^ public d() { >d : () => string @@ -201,9 +213,11 @@ module m1 { constructor (public n, public n2: number, private n3, private n4: string) { >n : any +> : ^^^ >n2 : number > : ^^^^^^ >n3 : any +> : ^^^ >n4 : string > : ^^^^^^ } @@ -219,12 +233,14 @@ module m1 { import m2 = a; >m2 : any > : ^^^ ->a : error +>a : any +> : ^^^ import m3 = b; >m3 : any > : ^^^ ->b : error +>b : any +> : ^^^ import m4 = b.a; >m4 : any @@ -237,7 +253,8 @@ module m1 { import m5 = c; >m5 : any > : ^^^ ->c : error +>c : any +> : ^^^ import m6 = c.a; >m6 : any @@ -345,6 +362,7 @@ declare module m4 { export var b; >b : any +> : ^^^ } declare module m5 { @@ -353,6 +371,7 @@ declare module m5 { export var c; >c : any +> : ^^^ } declare module m43 { @@ -361,6 +380,7 @@ declare module m43 { export var b; >b : any +> : ^^^ } declare module m55 { @@ -369,6 +389,7 @@ declare module m55 { export var c; >c : any +> : ^^^ } declare module "m3" { diff --git a/tests/baselines/reference/multiModuleClodule1.errors.txt b/tests/baselines/reference/multiModuleClodule1.errors.txt new file mode 100644 index 0000000000000..d7adc9f4d2b9d --- /dev/null +++ b/tests/baselines/reference/multiModuleClodule1.errors.txt @@ -0,0 +1,27 @@ +multiModuleClodule1.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +multiModuleClodule1.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== multiModuleClodule1.ts (2 errors) ==== + class C { + constructor(x: number) { } + foo() { } + bar() { } + static boo() { } + } + + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + var y = 2; + } + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { } + function baz() { return ''; } + } + + var c = new C(C.x); + c.foo = C.foo; \ No newline at end of file diff --git a/tests/baselines/reference/multiModuleFundule1.errors.txt b/tests/baselines/reference/multiModuleFundule1.errors.txt new file mode 100644 index 0000000000000..d24f59e3427cc --- /dev/null +++ b/tests/baselines/reference/multiModuleFundule1.errors.txt @@ -0,0 +1,21 @@ +multiModuleFundule1.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +multiModuleFundule1.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== multiModuleFundule1.ts (2 errors) ==== + function C(x: number) { } + + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 1; + } + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { } + } + + var r = C(2); + var r2 = new C(2); // using void returning function as constructor + var r3 = C.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index 0b5b16a5a2130..4ce37971ecbd8 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -38,7 +38,9 @@ var r = C(2); var r2 = new C(2); // using void returning function as constructor >r2 : any +> : ^^^ >new C(2) : any +> : ^^^ >C : typeof C > : ^^^^^^^^ >2 : 2 diff --git a/tests/baselines/reference/multipleExports.errors.txt b/tests/baselines/reference/multipleExports.errors.txt index 4898356ca11bb..3a8a71802b0e1 100644 --- a/tests/baselines/reference/multipleExports.errors.txt +++ b/tests/baselines/reference/multipleExports.errors.txt @@ -1,15 +1,21 @@ +multipleExports.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +multipleExports.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. multipleExports.ts(9,5): error TS1194: Export declarations are not permitted in a namespace. multipleExports.ts(9,13): error TS2484: Export declaration conflicts with exported declaration of 'x'. -==== multipleExports.ts (2 errors) ==== +==== multipleExports.ts (4 errors) ==== export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var v = 0; export let x; } const x = 0; export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. v; export {x}; ~~~~~~~~~~~ diff --git a/tests/baselines/reference/multivar.errors.txt b/tests/baselines/reference/multivar.errors.txt index 60d2469c7276f..827cac165a8f8 100644 --- a/tests/baselines/reference/multivar.errors.txt +++ b/tests/baselines/reference/multivar.errors.txt @@ -1,12 +1,15 @@ +multivar.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. multivar.ts(6,19): error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local. multivar.ts(22,9): error TS2395: Individual declarations in merged declaration 'b2' must be all exported or all local. -==== multivar.ts (2 errors) ==== +==== multivar.ts (3 errors) ==== var a,b,c; var x=1,y=2,z=3; module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a, b2: number = 10, b; ~~ diff --git a/tests/baselines/reference/nameCollision.errors.txt b/tests/baselines/reference/nameCollision.errors.txt new file mode 100644 index 0000000000000..37c30b310f1f3 --- /dev/null +++ b/tests/baselines/reference/nameCollision.errors.txt @@ -0,0 +1,76 @@ +nameCollision.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(22,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(24,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(32,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollision.ts(40,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nameCollision.ts (9 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // these 2 statements force an underscore before the 'A' + // in the generated function call. + var A = 12; + var _A = ''; + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var A = 12; + } + + module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // re-opened module with colliding name + // this should add an underscore. + class B { + name: string; + } + } + + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var X = 13; + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Y = 13; + export module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var X = 12; + var Y = 12; + var Z = 12; + } + } + } + + module Y.Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export enum Y { + Red, Blue + } + } + + // no collision, since interface doesn't + // generate code. + module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface D { + id: number; + } + + export var E = 'hello'; + } \ No newline at end of file diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.errors.txt b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.errors.txt new file mode 100644 index 0000000000000..2a4b4f7faa680 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.errors.txt @@ -0,0 +1,18 @@ +nameCollisionWithBlockScopedVariable1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nameCollisionWithBlockScopedVariable1.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nameCollisionWithBlockScopedVariable1.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + let M = 0; + new C(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nameCollisions.errors.txt b/tests/baselines/reference/nameCollisions.errors.txt index 8d1a833330241..0f647b7ebb4df 100644 --- a/tests/baselines/reference/nameCollisions.errors.txt +++ b/tests/baselines/reference/nameCollisions.errors.txt @@ -1,8 +1,13 @@ +nameCollisions.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nameCollisions.ts(2,9): error TS2300: Duplicate identifier 'x'. +nameCollisions.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nameCollisions.ts(4,12): error TS2300: Duplicate identifier 'x'. +nameCollisions.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nameCollisions.ts(10,12): error TS2300: Duplicate identifier 'z'. nameCollisions.ts(13,9): error TS2300: Duplicate identifier 'z'. +nameCollisions.ts(15,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nameCollisions.ts(15,12): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. +nameCollisions.ts(22,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nameCollisions.ts(24,9): error TS2300: Duplicate identifier 'f'. nameCollisions.ts(25,14): error TS2300: Duplicate identifier 'f'. nameCollisions.ts(27,14): error TS2300: Duplicate identifier 'f2'. @@ -13,14 +18,18 @@ nameCollisions.ts(36,14): error TS2814: Function with bodies can only merge with nameCollisions.ts(37,11): error TS2813: Class declaration cannot implement overload list for 'C2'. -==== nameCollisions.ts (13 errors) ==== +==== nameCollisions.ts (18 errors) ==== module T { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x = 2; ~ !!! error TS2300: Duplicate identifier 'x'. module x { // error ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2300: Duplicate identifier 'x'. export class Bar { test: number; @@ -29,6 +38,8 @@ nameCollisions.ts(37,11): error TS2813: Class declaration cannot implement overl module z { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2300: Duplicate identifier 'z'. var t; } @@ -38,6 +49,8 @@ nameCollisions.ts(37,11): error TS2813: Class declaration cannot implement overl module y { ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. var b; } @@ -46,6 +59,8 @@ nameCollisions.ts(37,11): error TS2813: Class declaration cannot implement overl var w; module w { } //ok + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var f; ~ diff --git a/tests/baselines/reference/nameWithRelativePaths.errors.txt b/tests/baselines/reference/nameWithRelativePaths.errors.txt new file mode 100644 index 0000000000000..324b6beef8af2 --- /dev/null +++ b/tests/baselines/reference/nameWithRelativePaths.errors.txt @@ -0,0 +1,27 @@ +test/foo_2.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== test/foo_3.ts (0 errors) ==== + import foo0 = require('../foo_0'); + import foo1 = require('./test/foo_1'); + import foo2 = require('./.././test/foo_2'); + + if(foo2.M2.x){ + var x = foo0.foo + foo1.f(); + } + +==== foo_0.ts (0 errors) ==== + export var foo = 42; + +==== test/test/foo_1.ts (0 errors) ==== + export function f(){ + return 42; + } + +==== test/foo_2.ts (1 errors) ==== + export module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = true; + } + \ No newline at end of file diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.errors.txt b/tests/baselines/reference/namedFunctionExpressionInModule.errors.txt new file mode 100644 index 0000000000000..f885f27bc023d --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionInModule.errors.txt @@ -0,0 +1,12 @@ +namedFunctionExpressionInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== namedFunctionExpressionInModule.ts (1 errors) ==== + module Variables{ + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = function bar(a, b, c) { + } + x(1, 2, 3); + } + \ No newline at end of file diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 64f8af41eeeff..c2aaca4c14142 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -13,8 +13,11 @@ module Variables{ >bar : (a: any, b: any, c: any) => void > : ^ ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^ >a : any +> : ^^^ >b : any +> : ^^^ >c : any +> : ^^^ } x(1, 2, 3); >x(1, 2, 3) : void diff --git a/tests/baselines/reference/namespaces1.errors.txt b/tests/baselines/reference/namespaces1.errors.txt new file mode 100644 index 0000000000000..fb8c0ff27ccce --- /dev/null +++ b/tests/baselines/reference/namespaces1.errors.txt @@ -0,0 +1,18 @@ +namespaces1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +namespaces1.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== namespaces1.ts (2 errors) ==== + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Z { } + } + export interface Y { } + } + + var x: X.Y.Z; + var x2: X.Y; \ No newline at end of file diff --git a/tests/baselines/reference/namespaces2.errors.txt b/tests/baselines/reference/namespaces2.errors.txt new file mode 100644 index 0000000000000..b0e8dca9628b0 --- /dev/null +++ b/tests/baselines/reference/namespaces2.errors.txt @@ -0,0 +1,16 @@ +namespaces2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +namespaces2.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== namespaces2.ts (2 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { } + } + } + + var c: A.B.C = new A.B.C(); \ No newline at end of file diff --git a/tests/baselines/reference/namespacesDeclaration1.errors.txt b/tests/baselines/reference/namespacesDeclaration1.errors.txt new file mode 100644 index 0000000000000..577806fb8360a --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration1.errors.txt @@ -0,0 +1,16 @@ +namespacesDeclaration1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +namespacesDeclaration1.ts(3,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== namespacesDeclaration1.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export namespace N { + export module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I {} + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/namespacesDeclaration2.errors.txt b/tests/baselines/reference/namespacesDeclaration2.errors.txt index 57b79004be78b..5f9a16a5271ef 100644 --- a/tests/baselines/reference/namespacesDeclaration2.errors.txt +++ b/tests/baselines/reference/namespacesDeclaration2.errors.txt @@ -1,13 +1,16 @@ +namespacesDeclaration2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. namespacesDeclaration2.ts(12,13): error TS2694: Namespace 'N' has no exported member 'S'. namespacesDeclaration2.ts(13,12): error TS2694: Namespace 'M' has no exported member 'F'. namespacesDeclaration2.ts(14,11): error TS2694: Namespace 'ns' has no exported member 'A'. -==== namespacesDeclaration2.ts (3 errors) ==== +==== namespacesDeclaration2.ts (4 errors) ==== namespace N { function S() {} } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function F() {} } diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt index dac9e9f08c8c3..5e63e457b4ee5 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ +negateOperatorWithAnyOtherType.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. negateOperatorWithAnyOtherType.ts(34,24): error TS18050: The value 'undefined' cannot be used here. negateOperatorWithAnyOtherType.ts(35,23): error TS18050: The value 'null' cannot be used here. negateOperatorWithAnyOtherType.ts(51,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== negateOperatorWithAnyOtherType.ts (3 errors) ==== +==== negateOperatorWithAnyOtherType.ts (4 errors) ==== // - operator on any type var ANY: any; @@ -24,6 +25,8 @@ negateOperatorWithAnyOtherType.ts(51,1): error TS2695: Left side of comma operat } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt index 20bbd09ba5b78..f4f9c70977c59 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt @@ -1,7 +1,8 @@ +negateOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. negateOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== negateOperatorWithBooleanType.ts (1 errors) ==== +==== negateOperatorWithBooleanType.ts (2 errors) ==== // - operator on boolean type var BOOLEAN: boolean; @@ -12,6 +13,8 @@ negateOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operato static foo() { return false; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt index 39755ca934ccb..418660790131a 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt @@ -1,7 +1,8 @@ +negateOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. negateOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== negateOperatorWithNumberType.ts (1 errors) ==== +==== negateOperatorWithNumberType.ts (2 errors) ==== // - operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -13,6 +14,8 @@ negateOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/negateOperatorWithStringType.errors.txt b/tests/baselines/reference/negateOperatorWithStringType.errors.txt index de62b955974f5..1d30e8a77708d 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithStringType.errors.txt @@ -1,7 +1,8 @@ +negateOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. negateOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== negateOperatorWithStringType.ts (1 errors) ==== +==== negateOperatorWithStringType.ts (2 errors) ==== // - operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -13,6 +14,8 @@ negateOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/nestedModulePrivateAccess.errors.txt b/tests/baselines/reference/nestedModulePrivateAccess.errors.txt new file mode 100644 index 0000000000000..21c9148d78d8d --- /dev/null +++ b/tests/baselines/reference/nestedModulePrivateAccess.errors.txt @@ -0,0 +1,15 @@ +nestedModulePrivateAccess.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModulePrivateAccess.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nestedModulePrivateAccess.ts (2 errors) ==== + module a{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x:number; + module b{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var y = x; // should not be an error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nestedModules.errors.txt b/tests/baselines/reference/nestedModules.errors.txt new file mode 100644 index 0000000000000..217b4a78b3ee3 --- /dev/null +++ b/tests/baselines/reference/nestedModules.errors.txt @@ -0,0 +1,62 @@ +nestedModules.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(14,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModules.ts(21,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nestedModules.ts (9 errors) ==== + module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; + y: number; + } + } + + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' + } + } + + module M2.X { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; y: number; + } + } + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Point: number; + } + } + + var m = M2.X; + var point: number; + var point = m.Point; + + var p: { x: number; y: number; } + var p: M2.X.Point; + \ No newline at end of file diff --git a/tests/baselines/reference/nestedSelf.errors.txt b/tests/baselines/reference/nestedSelf.errors.txt new file mode 100644 index 0000000000000..7ffc376b27b9c --- /dev/null +++ b/tests/baselines/reference/nestedSelf.errors.txt @@ -0,0 +1,14 @@ +nestedSelf.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nestedSelf.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + public n = 42; + public foo() { [1,2,3].map((x) => { return this.n * x; })} + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/newArrays.errors.txt b/tests/baselines/reference/newArrays.errors.txt new file mode 100644 index 0000000000000..f9e22bb481aee --- /dev/null +++ b/tests/baselines/reference/newArrays.errors.txt @@ -0,0 +1,18 @@ +newArrays.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== newArrays.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Foo {} + class Gar { + public fa: Foo[]; + public x = 10; + public y = 10; + + public m () { + this.fa = new Array(this.x * this.y); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.errors.txt b/tests/baselines/reference/newNamesInGlobalAugmentations1.errors.txt new file mode 100644 index 0000000000000..04332a4b0425f --- /dev/null +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.errors.txt @@ -0,0 +1,27 @@ +f1.d.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +f1.d.ts(3,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== f1.d.ts (2 errors) ==== + export {}; + + declare module M.M1 { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export let x: number; + } + declare global { + interface SymbolConstructor { + observable: symbol; + } + class Cls {x} + let [a, b]: number[]; + export import X = M.M1.x; + } + +==== main.ts (0 errors) ==== + Symbol.observable; + new Cls().x + let c = a + b + X; \ No newline at end of file diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.types b/tests/baselines/reference/newNamesInGlobalAugmentations1.types index 324a8b494003a..f46c99b0c5bca 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.types +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.types @@ -26,6 +26,7 @@ declare global { >Cls : Cls > : ^^^ >x : any +> : ^^^ let [a, b]: number[]; >a : number @@ -55,6 +56,7 @@ Symbol.observable; new Cls().x >new Cls().x : any +> : ^^^ >new Cls() : Cls > : ^^^ >Cls : typeof Cls diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index c12003b73e5c9..d862796b3746c 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -18,10 +18,11 @@ newOperator.ts(42,5): error TS2351: This expression is not constructable. Type '{ a: string; }' has no construct signatures. newOperator.ts(46,5): error TS2351: This expression is not constructable. Each member of the union type '(new (a: T) => void) | (new (a: string) => void)' has construct signatures, but none of those signatures are compatible with each other. +newOperator.ts(48,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. newOperator.ts(56,24): error TS1011: An element access expression should take an argument. -==== newOperator.ts (14 errors) ==== +==== newOperator.ts (15 errors) ==== interface ifc { } // Attempting to 'new' an interface yields poor error var i = new ifc(); @@ -103,6 +104,8 @@ newOperator.ts(56,24): error TS1011: An element access expression should take an !!! error TS2351: Each member of the union type '(new (a: T) => void) | (new (a: string) => void)' has construct signatures, but none of those signatures are compatible with each other. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class T { x: number; } diff --git a/tests/baselines/reference/noImplicitAnyModule.errors.txt b/tests/baselines/reference/noImplicitAnyModule.errors.txt index 21e6ac3676167..53357d06fc510 100644 --- a/tests/baselines/reference/noImplicitAnyModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyModule.errors.txt @@ -1,11 +1,14 @@ +noImplicitAnyModule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. noImplicitAnyModule.ts(4,9): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. noImplicitAnyModule.ts(9,18): error TS7006: Parameter 'x' implicitly has an 'any' type. noImplicitAnyModule.ts(10,16): error TS7010: 'g', which lacks return-type annotation, implicitly has an 'any' return type. noImplicitAnyModule.ts(17,14): error TS7010: 'f', which lacks return-type annotation, implicitly has an 'any' return type. -==== noImplicitAnyModule.ts (4 errors) ==== +==== noImplicitAnyModule.ts (5 errors) ==== declare module Module { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Interface { // Should return error for implicit any on return type. new (); diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt index 2d32b2f64f541..4d3adc62ef7eb 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt @@ -1,3 +1,4 @@ +noImplicitAnyParametersInAmbientModule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. noImplicitAnyParametersInAmbientModule.ts(6,20): error TS7006: Parameter 'x' implicitly has an 'any' type. noImplicitAnyParametersInAmbientModule.ts(12,20): error TS7006: Parameter 'x' implicitly has an 'any' type. noImplicitAnyParametersInAmbientModule.ts(12,23): error TS7006: Parameter 'y' implicitly has an 'any' type. @@ -22,8 +23,10 @@ noImplicitAnyParametersInAmbientModule.ts(44,18): error TS7006: Parameter 'x' im noImplicitAnyParametersInAmbientModule.ts(44,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. -==== noImplicitAnyParametersInAmbientModule.ts (22 errors) ==== +==== noImplicitAnyParametersInAmbientModule.ts (23 errors) ==== declare module D_M { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // No implicit-'any' errors. function dm_f1(): void; diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt index 1813c2559b1f0..0ec59c87d9562 100644 --- a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt +++ b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt @@ -1,3 +1,4 @@ +noImplicitAnyParametersInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. noImplicitAnyParametersInModule.ts(6,19): error TS7006: Parameter 'x' implicitly has an 'any' type. noImplicitAnyParametersInModule.ts(12,19): error TS7006: Parameter 'x' implicitly has an 'any' type. noImplicitAnyParametersInModule.ts(12,22): error TS7006: Parameter 'y' implicitly has an 'any' type. @@ -22,8 +23,10 @@ noImplicitAnyParametersInModule.ts(44,18): error TS7006: Parameter 'x' implicitl noImplicitAnyParametersInModule.ts(44,21): error TS7019: Rest parameter 'r' implicitly has an 'any[]' type. -==== noImplicitAnyParametersInModule.ts (22 errors) ==== +==== noImplicitAnyParametersInModule.ts (23 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // No implicit-'any' errors. function m_f1(): void { } diff --git a/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt index 9122941c6ff6e..8ddf07a0dfb07 100644 --- a/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt +++ b/tests/baselines/reference/nonExportedElementsOfMergedModules.errors.txt @@ -1,17 +1,29 @@ +nonExportedElementsOfMergedModules.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonExportedElementsOfMergedModules.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonExportedElementsOfMergedModules.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonExportedElementsOfMergedModules.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. nonExportedElementsOfMergedModules.ts(13,7): error TS2339: Property 'x' does not exist on type 'typeof B'. -==== nonExportedElementsOfMergedModules.ts (1 errors) ==== +==== nonExportedElementsOfMergedModules.ts (5 errors) ==== module One { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum A { X } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x; } } module One { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum A { Y } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y; } B.x; diff --git a/tests/baselines/reference/nonInstantiatedModule.errors.txt b/tests/baselines/reference/nonInstantiatedModule.errors.txt new file mode 100644 index 0000000000000..5835582635186 --- /dev/null +++ b/tests/baselines/reference/nonInstantiatedModule.errors.txt @@ -0,0 +1,63 @@ +nonInstantiatedModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonInstantiatedModule.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonInstantiatedModule.ts(17,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonInstantiatedModule.ts(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nonInstantiatedModule.ts(36,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nonInstantiatedModule.ts (5 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { x: number; y: number } + export var a = 1; + } + + // primary expression + var m : typeof M; + var m = M; + + var a1: number; + var a1 = M.a; + + var a2: number; + var a2 = m.a; + + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Point { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function Origin(): Point { + return { x: 0, y: 0 }; + } + } + + export interface Point { + x: number; + y: number; + } + } + + var p: { x: number; y: number; }; + var p: M2.Point; + + var p2: { Origin() : { x: number; y: number; } }; + var p2: typeof M2.Point; + + module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module Utils { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Point { + x: number; y: number; + } + } + + export class Utils { + name: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.errors.txt b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.errors.txt new file mode 100644 index 0000000000000..79e5904c0cdaf --- /dev/null +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.errors.txt @@ -0,0 +1,100 @@ +nullIsSubtypeOfEverythingButUndefined.ts(57,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nullIsSubtypeOfEverythingButUndefined.ts(65,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nullIsSubtypeOfEverythingButUndefined.ts (2 errors) ==== + // null is a subtype of any other types except undefined + + var r0 = true ? null : null; + var r0 = true ? null : null; + + var u: typeof undefined; + var r0b = true ? u : null; + var r0b = true ? null : u; + + var r1 = true ? 1 : null; + var r1 = true ? null : 1; + + var r2 = true ? '' : null; + var r2 = true ? null : ''; + + var r3 = true ? true : null; + var r3 = true ? null : true; + + var r4 = true ? new Date() : null; + var r4 = true ? null : new Date(); + + var r5 = true ? /1/ : null; + var r5 = true ? null : /1/; + + var r6 = true ? { foo: 1 } : null; + var r6 = true ? null : { foo: 1 }; + + var r7 = true ? () => { } : null; + var r7 = true ? null : () => { }; + + var r8 = true ? (x: T) => { return x } : null; + var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations + + interface I1 { foo: number; } + var i1: I1; + var r9 = true ? i1 : null; + var r9 = true ? null : i1; + + class C1 { foo: number; } + var c1: C1; + var r10 = true ? c1 : null; + var r10 = true ? null : c1; + + class C2 { foo: T; } + var c2: C2; + var r12 = true ? c2 : null; + var r12 = true ? null : c2; + + enum E { A } + var r13 = true ? E : null; + var r13 = true ? null : E; + + var r14 = true ? E.A : null; + var r14 = true ? null : E.A; + + function f() { } + module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + var af: typeof f; + var r15 = true ? af : null; + var r15 = true ? null : af; + + class c { baz: string } + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + var ac: typeof c; + var r16 = true ? ac : null; + var r16 = true ? null : ac; + + function f17(x: T) { + var r17 = true ? x : null; + var r17 = true ? null : x; + } + + function f18(x: U) { + var r18 = true ? x : null; + var r18 = true ? null : x; + } + //function f18(x: U) { + // var r18 = true ? x : null; + // var r18 = true ? null : x; + //} + + var r19 = true ? new Object() : null; + var r19 = true ? null : new Object(); + + var r20 = true ? {} : null; + var r20 = true ? null : {}; + \ No newline at end of file diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 222e52de3e669..23c006af39fa8 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -5,6 +5,7 @@ var r0 = true ? null : null; >r0 : any +> : ^^^ >true ? null : null : null > : ^^^^ >true : true @@ -12,6 +13,7 @@ var r0 = true ? null : null; var r0 = true ? null : null; >r0 : any +> : ^^^ >true ? null : null : null > : ^^^^ >true : true @@ -19,22 +21,29 @@ var r0 = true ? null : null; var u: typeof undefined; >u : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ var r0b = true ? u : null; >r0b : any +> : ^^^ >true ? u : null : any +> : ^^^ >true : true > : ^^^^ >u : any +> : ^^^ var r0b = true ? null : u; >r0b : any +> : ^^^ >true ? null : u : any +> : ^^^ >true : true > : ^^^^ >u : any +> : ^^^ var r1 = true ? 1 : null; >r1 : number diff --git a/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt index 710f8d4f01013..df636a4997e1c 100644 --- a/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt +++ b/tests/baselines/reference/objectLitArrayDeclNoNew.errors.txt @@ -1,11 +1,14 @@ +objectLitArrayDeclNoNew.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. objectLitArrayDeclNoNew.ts(22,20): error TS1011: An element access expression should take an argument. objectLitArrayDeclNoNew.ts(27,1): error TS1128: Declaration or statement expected. -==== objectLitArrayDeclNoNew.ts (2 errors) ==== +==== objectLitArrayDeclNoNew.ts (3 errors) ==== declare var console; "use strict"; module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IState { } diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt index ca2bf88013094..0492931568240 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt @@ -1,15 +1,21 @@ +objectLiteralShorthandPropertiesErrorWithModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +objectLiteralShorthandPropertiesErrorWithModule.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ',' expected. objectLiteralShorthandPropertiesErrorWithModule.ts(14,3): error TS2339: Property 'y' does not exist on type 'typeof m'. -==== objectLiteralShorthandPropertiesErrorWithModule.ts (2 errors) ==== +==== objectLiteralShorthandPropertiesErrorWithModule.ts (4 errors) ==== // module export var x = "Foo"; module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x; } module n { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var z = 10000; export var y = { m.x // error diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.errors.txt new file mode 100644 index 0000000000000..49ab8890bf0f9 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.errors.txt @@ -0,0 +1,23 @@ +objectLiteralShorthandPropertiesWithModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +objectLiteralShorthandPropertiesWithModule.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== objectLiteralShorthandPropertiesWithModule.ts (2 errors) ==== + // module export + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var z = x; + var y = { + a: x, + x + }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types index 56be0034acbe1..cfcfed0257178 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types @@ -9,6 +9,7 @@ module m { export var x; >x : any +> : ^^^ } module m { @@ -17,7 +18,9 @@ module m { var z = x; >z : any +> : ^^^ >x : any +> : ^^^ var y = { >y : { a: any; x: any; } @@ -27,10 +30,13 @@ module m { a: x, >a : any +> : ^^^ >x : any +> : ^^^ x >x : any +> : ^^^ }; } diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.errors.txt new file mode 100644 index 0000000000000..b4d24e2857146 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.errors.txt @@ -0,0 +1,21 @@ +objectLiteralShorthandPropertiesWithModuleES6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +objectLiteralShorthandPropertiesWithModuleES6.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== objectLiteralShorthandPropertiesWithModuleES6.ts (2 errors) ==== + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x; + } + + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var z = x; + var y = { + a: x, + x + }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types index 123bef1ce64a8..f217ac5049842 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types @@ -7,6 +7,7 @@ module m { export var x; >x : any +> : ^^^ } module m { @@ -15,7 +16,9 @@ module m { var z = x; >z : any +> : ^^^ >x : any +> : ^^^ var y = { >y : { a: any; x: any; } @@ -25,10 +28,13 @@ module m { a: x, >a : any +> : ^^^ >x : any +> : ^^^ x >x : any +> : ^^^ }; } diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index 5a000bae8bd24..2672ae5c6be8d 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -1,3 +1,4 @@ +overload1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'. overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'. overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. @@ -10,8 +11,10 @@ overload1.ts(34,5): error TS2769: No overload matches this call. Argument of type 'number' is not assignable to parameter of type 'string'. -==== overload1.ts (6 errors) ==== +==== overload1.ts (7 errors) ==== module O { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { } diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.errors.txt b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.errors.txt new file mode 100644 index 0000000000000..8d82f5811660b --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.errors.txt @@ -0,0 +1,29 @@ +overloadResolutionOverNonCTLambdas.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== overloadResolutionOverNonCTLambdas.ts (1 errors) ==== + module Bugs { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + } + + // replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + function bug2(message:string, ...args:any[]):string { + var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) { + var index= rest[0]; + return typeof args[index] !== 'undefined' + ? args[index] + : match; + }); + return result; + } + } + + function bug3(f:(x:string)=>string) { return f("s") } + + function fprime(x:string):string { return x; } + + bug3(fprime); + + bug3(function(x:string):string { return x; }); \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 1543da64f1476..baa08f697d3da 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -41,7 +41,9 @@ module Bugs { var index= rest[0]; >index : any +> : ^^^ >rest[0] : any +> : ^^^ >rest : any[] > : ^^^^^ >0 : 0 @@ -49,22 +51,27 @@ module Bugs { return typeof args[index] !== 'undefined' >typeof args[index] !== 'undefined' ? args[index] : match : any +> : ^^^ >typeof args[index] !== 'undefined' : boolean > : ^^^^^^^ >typeof args[index] : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >args[index] : any +> : ^^^ >args : any[] > : ^^^^^ >index : any +> : ^^^ >'undefined' : "undefined" > : ^^^^^^^^^^^ ? args[index] >args[index] : any +> : ^^^ >args : any[] > : ^^^^^ >index : any +> : ^^^ : match; >match : string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.errors.txt b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.errors.txt new file mode 100644 index 0000000000000..bff7a8a4577a9 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.errors.txt @@ -0,0 +1,27 @@ +overloadResolutionOverNonCTObjectLit.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== overloadResolutionOverNonCTObjectLit.ts (1 errors) ==== + module Bugs { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IToken { + startIndex:number; + type:string; + bracket:number; + } + + export interface IState { + } + + export interface IStateToken extends IToken { + state: IState; + length: number; + } + + function bug3() { + var tokens:IToken[]= []; + tokens.push({ startIndex: 1, type: '', bracket: 3 }); + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt index 17a0a2a27f781..cc8f62bd45171 100644 --- a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt +++ b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt @@ -1,13 +1,19 @@ +overloadsInDifferentContainersDisagreeOnAmbient.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +overloadsInDifferentContainersDisagreeOnAmbient.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. overloadsInDifferentContainersDisagreeOnAmbient.ts(7,21): error TS2384: Overload signatures must all be ambient or non-ambient. -==== overloadsInDifferentContainersDisagreeOnAmbient.ts (1 errors) ==== +==== overloadsInDifferentContainersDisagreeOnAmbient.ts (3 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Error because body is not ambient and this overload is export function f(); } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function f() { } ~ !!! error TS2384: Overload signatures must all be ambient or non-ambient. diff --git a/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt index 07b25b5ac150f..e6d84eceda8fc 100644 --- a/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt +++ b/tests/baselines/reference/parameterPropertyInConstructor1.errors.txt @@ -1,8 +1,11 @@ +parameterPropertyInConstructor1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parameterPropertyInConstructor1.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation. -==== parameterPropertyInConstructor1.ts (1 errors) ==== +==== parameterPropertyInConstructor1.ts (2 errors) ==== declare module mod { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Customers { constructor(public names: string); ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt index 4bfba6c77cd0d..8c215009634bb 100644 --- a/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt +++ b/tests/baselines/reference/parameterPropertyInConstructor2.errors.txt @@ -1,10 +1,13 @@ +parameterPropertyInConstructor2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parameterPropertyInConstructor2.ts(3,5): error TS2394: This overload signature is not compatible with its implementation signature. parameterPropertyInConstructor2.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation. parameterPropertyInConstructor2.ts(4,24): error TS2300: Duplicate identifier 'names'. -==== parameterPropertyInConstructor2.ts (3 errors) ==== +==== parameterPropertyInConstructor2.ts (4 errors) ==== module mod { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Customers { constructor(public names: string); ~~~~~~~~~~~ diff --git a/tests/baselines/reference/parser509618.errors.txt b/tests/baselines/reference/parser509618.errors.txt index c9d41143d4738..49dccf0e21d34 100644 --- a/tests/baselines/reference/parser509618.errors.txt +++ b/tests/baselines/reference/parser509618.errors.txt @@ -1,8 +1,11 @@ +parser509618.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parser509618.ts(2,20): error TS1036: Statements are not allowed in ambient contexts. -==== parser509618.ts (1 errors) ==== +==== parser509618.ts (2 errors) ==== declare module ambiModule { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface i1 { }; ~ !!! error TS1036: Statements are not allowed in ambient contexts. diff --git a/tests/baselines/reference/parserClassDeclaration7.errors.txt b/tests/baselines/reference/parserClassDeclaration7.errors.txt index 482e70500840e..858f6fc06beb5 100644 --- a/tests/baselines/reference/parserClassDeclaration7.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration7.errors.txt @@ -1,8 +1,11 @@ +parserClassDeclaration7.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserClassDeclaration7.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== parserClassDeclaration7.ts (1 errors) ==== +==== parserClassDeclaration7.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare class C { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. diff --git a/tests/baselines/reference/parserEnumDeclaration2.errors.txt b/tests/baselines/reference/parserEnumDeclaration2.errors.txt index de0fdb0802b4f..e32a5bbd954f3 100644 --- a/tests/baselines/reference/parserEnumDeclaration2.errors.txt +++ b/tests/baselines/reference/parserEnumDeclaration2.errors.txt @@ -1,8 +1,11 @@ +parserEnumDeclaration2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserEnumDeclaration2.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== parserEnumDeclaration2.ts (1 errors) ==== +==== parserEnumDeclaration2.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare enum E { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. diff --git a/tests/baselines/reference/parserErrantAccessibilityModifierInModule1.errors.txt b/tests/baselines/reference/parserErrantAccessibilityModifierInModule1.errors.txt index 815f05181903c..9221f14913855 100644 --- a/tests/baselines/reference/parserErrantAccessibilityModifierInModule1.errors.txt +++ b/tests/baselines/reference/parserErrantAccessibilityModifierInModule1.errors.txt @@ -1,10 +1,13 @@ +parserErrantAccessibilityModifierInModule1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserErrantAccessibilityModifierInModule1.ts(3,5): error TS1128: Declaration or statement expected. parserErrantAccessibilityModifierInModule1.ts(3,13): error TS2304: Cannot find name 'y'. parserErrantAccessibilityModifierInModule1.ts(4,18): error TS2304: Cannot find name 'y'. -==== parserErrantAccessibilityModifierInModule1.ts (3 errors) ==== +==== parserErrantAccessibilityModifierInModule1.ts (4 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x=10; // variable local to this module body private y=x; // property visible only in module ~~~~~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement2.errors.txt b/tests/baselines/reference/parserErrorRecovery_ClassElement2.errors.txt index 8a2971e8af2d9..cbf0f66edc35c 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement2.errors.txt @@ -1,8 +1,11 @@ +parserErrorRecovery_ClassElement2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserErrorRecovery_ClassElement2.ts(4,3): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -==== parserErrorRecovery_ClassElement2.ts (1 errors) ==== +==== parserErrorRecovery_ClassElement2.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { enum E { diff --git a/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt b/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt index ef7a80f1ff4bd..a9363b5830d28 100644 --- a/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ClassElement3.errors.txt @@ -1,11 +1,14 @@ +parserErrorRecovery_ClassElement3.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserErrorRecovery_ClassElement3.ts(2,4): error TS1127: Invalid character. parserErrorRecovery_ClassElement3.ts(6,4): error TS1109: Expression expected. parserErrorRecovery_ClassElement3.ts(7,4): error TS1127: Invalid character. parserErrorRecovery_ClassElement3.ts(7,5): error TS1005: '}' expected. -==== parserErrorRecovery_ClassElement3.ts (4 errors) ==== +==== parserErrorRecovery_ClassElement3.ts (5 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ¬ ~ !!! error TS1127: Invalid character. diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt new file mode 100644 index 0000000000000..a8c2ef299d058 --- /dev/null +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.errors.txt @@ -0,0 +1,34 @@ +parserErrorRecovery_IncompleteMemberVariable1.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserErrorRecovery_IncompleteMemberVariable1.ts (1 errors) ==== + // Interface + interface IPoint { + getDist(): number; + } + + // Module + module Shapes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Class + export class Point implements IPoint { + + public con: "hello"; + // Constructor + constructor (public x: number, public y: number) { } + + // Instance member + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + + // Static member + static origin = new Point(0, 0); + } + + } + + // Local variables + var p: IPoint = new Shapes.Point(3, 4); + var dist = p.getDist(); + \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.errors.txt b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.errors.txt index 0156814f35b72..37c68f7170f1b 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable2.errors.txt @@ -1,8 +1,9 @@ +parserErrorRecovery_IncompleteMemberVariable2.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserErrorRecovery_IncompleteMemberVariable2.ts(12,20): error TS2304: Cannot find name 'C'. parserErrorRecovery_IncompleteMemberVariable2.ts(12,22): error TS1442: Expected '=' for property initializer. -==== parserErrorRecovery_IncompleteMemberVariable2.ts (2 errors) ==== +==== parserErrorRecovery_IncompleteMemberVariable2.ts (3 errors) ==== // Interface interface IPoint { getDist(): number; @@ -10,6 +11,8 @@ parserErrorRecovery_IncompleteMemberVariable2.ts(12,22): error TS1442: Expected // Module module Shapes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Class export class Point implements IPoint { diff --git a/tests/baselines/reference/parserExportAssignment5.errors.txt b/tests/baselines/reference/parserExportAssignment5.errors.txt index 861eba34262c5..7b6f7eb9804bd 100644 --- a/tests/baselines/reference/parserExportAssignment5.errors.txt +++ b/tests/baselines/reference/parserExportAssignment5.errors.txt @@ -1,8 +1,11 @@ +parserExportAssignment5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in a namespace. -==== parserExportAssignment5.ts (1 errors) ==== +==== parserExportAssignment5.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export = A; ~~~~~~~~~~~ !!! error TS1063: An export assignment cannot be used in a namespace. diff --git a/tests/baselines/reference/parserExportAssignment9.errors.txt b/tests/baselines/reference/parserExportAssignment9.errors.txt index 55a5a4e95bdbc..5865fd404fb33 100644 --- a/tests/baselines/reference/parserExportAssignment9.errors.txt +++ b/tests/baselines/reference/parserExportAssignment9.errors.txt @@ -1,8 +1,9 @@ parserExportAssignment9.ts(2,3): error TS1319: A default export can only be used in an ECMAScript-style module. +parserExportAssignment9.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserExportAssignment9.ts(6,3): error TS1319: A default export can only be used in an ECMAScript-style module. -==== parserExportAssignment9.ts (2 errors) ==== +==== parserExportAssignment9.ts (3 errors) ==== namespace Foo { export default foo; ~~~~~~~~~~~~~~~~~~~ @@ -10,6 +11,8 @@ parserExportAssignment9.ts(6,3): error TS1319: A default export can only be used } module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default bar; ~~~~~~~~~~~~~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. diff --git a/tests/baselines/reference/parserFunctionDeclaration1.errors.txt b/tests/baselines/reference/parserFunctionDeclaration1.errors.txt index 0a60c8a717fe0..70a8944cb5481 100644 --- a/tests/baselines/reference/parserFunctionDeclaration1.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration1.errors.txt @@ -1,8 +1,11 @@ +parserFunctionDeclaration1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserFunctionDeclaration1.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== parserFunctionDeclaration1.ts (1 errors) ==== +==== parserFunctionDeclaration1.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare function F(); ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. diff --git a/tests/baselines/reference/parserFunctionDeclaration7.errors.txt b/tests/baselines/reference/parserFunctionDeclaration7.errors.txt index 91b641b2774b4..1e1c55cf23c6f 100644 --- a/tests/baselines/reference/parserFunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration7.errors.txt @@ -1,8 +1,11 @@ +parserFunctionDeclaration7.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserFunctionDeclaration7.ts(2,13): error TS2391: Function implementation is missing or not immediately following the declaration. -==== parserFunctionDeclaration7.ts (1 errors) ==== +==== parserFunctionDeclaration7.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function foo(); ~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. diff --git a/tests/baselines/reference/parserFunctionDeclaration8.errors.txt b/tests/baselines/reference/parserFunctionDeclaration8.errors.txt new file mode 100644 index 0000000000000..9701635389a80 --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration8.errors.txt @@ -0,0 +1,9 @@ +parserFunctionDeclaration8.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserFunctionDeclaration8.ts (1 errors) ==== + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModule1.errors.txt b/tests/baselines/reference/parserModule1.errors.txt new file mode 100644 index 0000000000000..35ac8173e52d2 --- /dev/null +++ b/tests/baselines/reference/parserModule1.errors.txt @@ -0,0 +1,37 @@ +parserModule1.ts(1,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModule1.ts (1 errors) ==== + export module CompilerDiagnostics { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var debug = false; + export interface IDiagnosticWriter { + Alert(output: string): void; + } + + export var diagnosticWriter: IDiagnosticWriter = null; + + export var analysisPass: number = 0; + + export function Alert(output: string) { + if (diagnosticWriter) { + diagnosticWriter.Alert(output); + } + } + + export function debugPrint(s: string) { + if (debug) { + Alert(s); + } + } + + export function assert(condition: boolean, s: string) { + if (debug) { + if (!condition) { + Alert(s); + } + } + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration11.errors.txt b/tests/baselines/reference/parserModuleDeclaration11.errors.txt new file mode 100644 index 0000000000000..56db636082486 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration11.errors.txt @@ -0,0 +1,13 @@ +parserModuleDeclaration11.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration11.ts (1 errors) ==== + declare module string { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface X { } + export function foo(s: string); + } + string.foo("abc"); + var x: string.X; + \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index b2f62f9dd5eaa..90992dc480635 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -14,6 +14,7 @@ declare module string { } string.foo("abc"); >string.foo("abc") : any +> : ^^^ >string.foo : (s: string) => any > : ^ ^^ ^^^^^^^^ >string : typeof string diff --git a/tests/baselines/reference/parserModuleDeclaration12.errors.txt b/tests/baselines/reference/parserModuleDeclaration12.errors.txt new file mode 100644 index 0000000000000..cbf67edd98cd0 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration12.errors.txt @@ -0,0 +1,11 @@ +parserModuleDeclaration12.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration12.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration12.ts (2 errors) ==== + module A.string { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration2.d.errors.txt b/tests/baselines/reference/parserModuleDeclaration2.d.errors.txt index cfe9971abc6c1..df47d4aab3096 100644 --- a/tests/baselines/reference/parserModuleDeclaration2.d.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration2.d.errors.txt @@ -1,8 +1,11 @@ parserModuleDeclaration2.d.ts(1,1): error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. +parserModuleDeclaration2.d.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserModuleDeclaration2.d.ts (1 errors) ==== +==== parserModuleDeclaration2.d.ts (2 errors) ==== module M { ~~~~~~ !!! error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration3.d.errors.txt b/tests/baselines/reference/parserModuleDeclaration3.d.errors.txt new file mode 100644 index 0000000000000..e071f0e6e711e --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration3.d.errors.txt @@ -0,0 +1,8 @@ +parserModuleDeclaration3.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration3.d.ts (1 errors) ==== + declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration3.errors.txt b/tests/baselines/reference/parserModuleDeclaration3.errors.txt index e8ecb4cc7b801..390d087129031 100644 --- a/tests/baselines/reference/parserModuleDeclaration3.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration3.errors.txt @@ -1,10 +1,16 @@ +parserModuleDeclaration3.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserModuleDeclaration3.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +parserModuleDeclaration3.ts(2,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserModuleDeclaration3.ts (1 errors) ==== +==== parserModuleDeclaration3.ts (3 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module M2 { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt b/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt index cab9abc357d69..50675e53d4c5d 100644 --- a/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt @@ -1,13 +1,19 @@ parserModuleDeclaration4.d.ts(1,1): error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. +parserModuleDeclaration4.d.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserModuleDeclaration4.d.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +parserModuleDeclaration4.d.ts(2,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserModuleDeclaration4.d.ts (2 errors) ==== +==== parserModuleDeclaration4.d.ts (4 errors) ==== module M { ~~~~~~ !!! error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module M1 { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration4.errors.txt b/tests/baselines/reference/parserModuleDeclaration4.errors.txt new file mode 100644 index 0000000000000..343762f464759 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration4.errors.txt @@ -0,0 +1,18 @@ +parserModuleDeclaration4.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration4.ts(2,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration4.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration4.ts (3 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration5.errors.txt b/tests/baselines/reference/parserModuleDeclaration5.errors.txt index 42fdd4795e59c..de48f7e0b1bb3 100644 --- a/tests/baselines/reference/parserModuleDeclaration5.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration5.errors.txt @@ -1,12 +1,21 @@ +parserModuleDeclaration5.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration5.ts(2,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserModuleDeclaration5.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. +parserModuleDeclaration5.ts(3,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserModuleDeclaration5.ts (1 errors) ==== +==== parserModuleDeclaration5.ts (4 errors) ==== module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module M3 { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration6.errors.txt b/tests/baselines/reference/parserModuleDeclaration6.errors.txt new file mode 100644 index 0000000000000..11d2044b57deb --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration6.errors.txt @@ -0,0 +1,8 @@ +parserModuleDeclaration6.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration6.ts (1 errors) ==== + module number { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration7.errors.txt b/tests/baselines/reference/parserModuleDeclaration7.errors.txt new file mode 100644 index 0000000000000..172ad0a969f9f --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration7.errors.txt @@ -0,0 +1,11 @@ +parserModuleDeclaration7.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration7.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration7.ts (2 errors) ==== + module number.a { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration8.errors.txt b/tests/baselines/reference/parserModuleDeclaration8.errors.txt new file mode 100644 index 0000000000000..959b3456834d9 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration8.errors.txt @@ -0,0 +1,11 @@ +parserModuleDeclaration8.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration8.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration8.ts (2 errors) ==== + module a.number { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration9.errors.txt b/tests/baselines/reference/parserModuleDeclaration9.errors.txt new file mode 100644 index 0000000000000..a953406f4d8ad --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration9.errors.txt @@ -0,0 +1,14 @@ +parserModuleDeclaration9.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration9.ts(1,10): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserModuleDeclaration9.ts(1,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== parserModuleDeclaration9.ts (3 errors) ==== + module a.number.b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserRealSource1.errors.txt b/tests/baselines/reference/parserRealSource1.errors.txt index e7d69ba104562..0702c542c75c7 100644 --- a/tests/baselines/reference/parserRealSource1.errors.txt +++ b/tests/baselines/reference/parserRealSource1.errors.txt @@ -1,7 +1,9 @@ parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource1.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserRealSource1.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserRealSource1.ts (1 errors) ==== +==== parserRealSource1.ts (3 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -10,7 +12,11 @@ parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module CompilerDiagnostics { + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var debug = false; export interface IDiagnosticWriter { Alert(output: string): void; diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index e0e0ea045ae97..9247a0aa5dccd 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -1,4 +1,5 @@ parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource10.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -343,7 +344,7 @@ parserRealSource10.ts(356,53): error TS2304: Cannot find name 'NodeType'. parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. -==== parserRealSource10.ts (343 errors) ==== +==== parserRealSource10.ts (344 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -352,6 +353,8 @@ parserRealSource10.ts(449,41): error TS1011: An element access expression should !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export enum TokenID { // Keywords Any, diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index fd0b98343ed89..28430a2b14279 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -1,4 +1,5 @@ parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource11.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -511,7 +512,7 @@ parserRealSource11.ts(2356,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== parserRealSource11.ts (511 errors) ==== +==== parserRealSource11.ts (512 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -520,6 +521,8 @@ parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class ASTSpan { public minChar: number = -1; // -1 = "undefined" or "compiler generated" public limChar: number = -1; // -1 = "undefined" or "compiler generated" diff --git a/tests/baselines/reference/parserRealSource12.errors.txt b/tests/baselines/reference/parserRealSource12.errors.txt index 5d507e5b46af4..42ca5dab0988c 100644 --- a/tests/baselines/reference/parserRealSource12.errors.txt +++ b/tests/baselines/reference/parserRealSource12.errors.txt @@ -1,4 +1,5 @@ parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource12.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. @@ -120,6 +121,7 @@ parserRealSource12.ts(198,34): error TS2304: Cannot find name 'NodeType'. parserRealSource12.ts(199,34): error TS2304: Cannot find name 'NodeType'. parserRealSource12.ts(200,34): error TS2304: Cannot find name 'NodeType'. parserRealSource12.ts(203,33): error TS2304: Cannot find name 'NodeType'. +parserRealSource12.ts(220,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource12.ts(221,42): error TS2304: Cannot find name 'ASTList'. parserRealSource12.ts(221,59): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(225,50): error TS2304: Cannot find name 'ASTList'. @@ -209,7 +211,7 @@ parserRealSource12.ts(523,88): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. -==== parserRealSource12.ts (209 errors) ==== +==== parserRealSource12.ts (211 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -218,6 +220,8 @@ parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IAstWalker { walk(ast: AST, parent: AST): AST; ~~~ @@ -674,6 +678,8 @@ parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. } module ChildrenWalkers { + ~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function walkNone(preAst: ASTList, parent: AST, walker: IAstWalker): void { ~~~~~~~ !!! error TS2304: Cannot find name 'ASTList'. diff --git a/tests/baselines/reference/parserRealSource13.errors.txt b/tests/baselines/reference/parserRealSource13.errors.txt index 2170deb93c140..7dbe3157944a6 100644 --- a/tests/baselines/reference/parserRealSource13.errors.txt +++ b/tests/baselines/reference/parserRealSource13.errors.txt @@ -1,4 +1,6 @@ parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource13.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserRealSource13.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. @@ -116,7 +118,7 @@ parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(135,36): error TS2304: Cannot find name 'NodeType'. -==== parserRealSource13.ts (116 errors) ==== +==== parserRealSource13.ts (118 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -125,6 +127,10 @@ parserRealSource13.ts(135,36): error TS2304: Cannot find name 'NodeType'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface AstWalkerDetailCallback { EmptyCallback? (pre, ast: AST): boolean; ~~~ diff --git a/tests/baselines/reference/parserRealSource14.errors.txt b/tests/baselines/reference/parserRealSource14.errors.txt index 417b0c7c6bb3e..f72ce635daa87 100644 --- a/tests/baselines/reference/parserRealSource14.errors.txt +++ b/tests/baselines/reference/parserRealSource14.errors.txt @@ -1,4 +1,5 @@ parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource14.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. @@ -160,7 +161,7 @@ parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no expor parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource14.ts (160 errors) ==== +==== parserRealSource14.ts (161 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -169,6 +170,8 @@ parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function lastOf(items: any[]): any { return (items === null || items.length === 0) ? null : items[items.length - 1]; } diff --git a/tests/baselines/reference/parserRealSource2.errors.txt b/tests/baselines/reference/parserRealSource2.errors.txt index fe21785dbda33..3ef5fec15fc1e 100644 --- a/tests/baselines/reference/parserRealSource2.errors.txt +++ b/tests/baselines/reference/parserRealSource2.errors.txt @@ -1,7 +1,8 @@ parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource2.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserRealSource2.ts (1 errors) ==== +==== parserRealSource2.ts (2 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -10,6 +11,8 @@ parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function hasFlag(val: number, flag: number) { return (val & flag) != 0; diff --git a/tests/baselines/reference/parserRealSource3.errors.txt b/tests/baselines/reference/parserRealSource3.errors.txt index ad9c1f9ac64b5..98080721593be 100644 --- a/tests/baselines/reference/parserRealSource3.errors.txt +++ b/tests/baselines/reference/parserRealSource3.errors.txt @@ -1,7 +1,8 @@ parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource3.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserRealSource3.ts (1 errors) ==== +==== parserRealSource3.ts (2 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -10,6 +11,8 @@ parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback export enum NodeType { None, diff --git a/tests/baselines/reference/parserRealSource4.errors.txt b/tests/baselines/reference/parserRealSource4.errors.txt index d20b223402471..b51a0d71aad1f 100644 --- a/tests/baselines/reference/parserRealSource4.errors.txt +++ b/tests/baselines/reference/parserRealSource4.errors.txt @@ -1,8 +1,9 @@ parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource4.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. -==== parserRealSource4.ts (2 errors) ==== +==== parserRealSource4.ts (3 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -11,6 +12,8 @@ parserRealSource4.ts(195,38): error TS1011: An element access expression should !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class BlockIntrinsics { public prototype = undefined; diff --git a/tests/baselines/reference/parserRealSource5.errors.txt b/tests/baselines/reference/parserRealSource5.errors.txt index 9166edb4e681e..7132b1a0b3eef 100644 --- a/tests/baselines/reference/parserRealSource5.errors.txt +++ b/tests/baselines/reference/parserRealSource5.errors.txt @@ -1,4 +1,5 @@ parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource5.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. @@ -9,7 +10,7 @@ parserRealSource5.ts(61,52): error TS2304: Cannot find name 'AST'. parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. -==== parserRealSource5.ts (9 errors) ==== +==== parserRealSource5.ts (10 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -18,6 +19,8 @@ parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // TODO: refactor indent logic for use in emit export class PrintContext { public builder = ""; diff --git a/tests/baselines/reference/parserRealSource6.errors.txt b/tests/baselines/reference/parserRealSource6.errors.txt index 9099081e6cd29..c8a32899559b5 100644 --- a/tests/baselines/reference/parserRealSource6.errors.txt +++ b/tests/baselines/reference/parserRealSource6.errors.txt @@ -1,4 +1,5 @@ parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource6.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. @@ -60,7 +61,7 @@ parserRealSource6.ts(212,81): error TS2304: Cannot find name 'ISourceText'. parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource6.ts (60 errors) ==== +==== parserRealSource6.ts (61 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -69,6 +70,8 @@ parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class TypeCollectionContext { public script: Script = null; ~~~~~~ diff --git a/tests/baselines/reference/parserRealSource7.errors.txt b/tests/baselines/reference/parserRealSource7.errors.txt index bb52a1a2e0c45..3ab000d96d3b6 100644 --- a/tests/baselines/reference/parserRealSource7.errors.txt +++ b/tests/baselines/reference/parserRealSource7.errors.txt @@ -1,4 +1,5 @@ parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource7.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? @@ -304,7 +305,7 @@ parserRealSource7.ts(827,34): error TS2304: Cannot find name 'NodeType'. parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. -==== parserRealSource7.ts (304 errors) ==== +==== parserRealSource7.ts (305 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -313,6 +314,8 @@ parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionS !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Continuation { public exceptionBlock = -1; constructor (public normalBlock: number) { } diff --git a/tests/baselines/reference/parserRealSource8.errors.txt b/tests/baselines/reference/parserRealSource8.errors.txt index 9a767155b9ea9..9d86eb9bae13e 100644 --- a/tests/baselines/reference/parserRealSource8.errors.txt +++ b/tests/baselines/reference/parserRealSource8.errors.txt @@ -1,4 +1,5 @@ parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource8.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -130,7 +131,7 @@ parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. parserRealSource8.ts(454,35): error TS2304: Cannot find name 'Catch'. -==== parserRealSource8.ts (130 errors) ==== +==== parserRealSource8.ts (131 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -139,6 +140,8 @@ parserRealSource8.ts(454,35): error TS2304: Cannot find name 'Catch'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class AssignScopeContext { constructor (public scopeChain: ScopeChain, diff --git a/tests/baselines/reference/parserRealSource9.errors.txt b/tests/baselines/reference/parserRealSource9.errors.txt index c8c7ac6a30ca2..903b50cf268f9 100644 --- a/tests/baselines/reference/parserRealSource9.errors.txt +++ b/tests/baselines/reference/parserRealSource9.errors.txt @@ -1,4 +1,5 @@ parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. +parserRealSource9.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -39,7 +40,7 @@ parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -==== parserRealSource9.ts (39 errors) ==== +==== parserRealSource9.ts (40 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. @@ -48,6 +49,8 @@ parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. !!! error TS6053: File 'typescript.ts' not found. module TypeScript { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Binder { constructor (public checker: TypeChecker) { } ~~~~~~~~~~~ diff --git a/tests/baselines/reference/parserSkippedTokens16.errors.txt b/tests/baselines/reference/parserSkippedTokens16.errors.txt index 3926fe4647c47..34bf0ea2cf2e9 100644 --- a/tests/baselines/reference/parserSkippedTokens16.errors.txt +++ b/tests/baselines/reference/parserSkippedTokens16.errors.txt @@ -4,11 +4,12 @@ parserSkippedTokens16.ts(1,8): error TS1434: Unexpected keyword or identifier. parserSkippedTokens16.ts(1,8): error TS2304: Cannot find name 'Bar'. parserSkippedTokens16.ts(2,22): error TS1127: Invalid character. parserSkippedTokens16.ts(3,3): error TS1109: Expression expected. +parserSkippedTokens16.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserSkippedTokens16.ts(6,5): error TS1138: Parameter declaration expected. parserSkippedTokens16.ts(8,14): error TS1109: Expression expected. -==== parserSkippedTokens16.ts (8 errors) ==== +==== parserSkippedTokens16.ts (9 errors) ==== foo(): Bar { } ~~~ !!! error TS2552: Cannot find name 'foo'. Did you mean 'Foo'? @@ -26,6 +27,8 @@ parserSkippedTokens16.ts(8,14): error TS1109: Expression expected. ~ !!! error TS1109: Expression expected. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function a( : T) { } ~ diff --git a/tests/baselines/reference/parserSuperExpression1.errors.txt b/tests/baselines/reference/parserSuperExpression1.errors.txt index 20dea88856f8e..cc0f79aaa8790 100644 --- a/tests/baselines/reference/parserSuperExpression1.errors.txt +++ b/tests/baselines/reference/parserSuperExpression1.errors.txt @@ -1,8 +1,10 @@ parserSuperExpression1.ts(3,9): error TS2335: 'super' can only be referenced in a derived class. +parserSuperExpression1.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserSuperExpression1.ts(7,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserSuperExpression1.ts(10,13): error TS2335: 'super' can only be referenced in a derived class. -==== parserSuperExpression1.ts (2 errors) ==== +==== parserSuperExpression1.ts (4 errors) ==== class C { private foo() { super.foo(); @@ -12,6 +14,10 @@ parserSuperExpression1.ts(10,13): error TS2335: 'super' can only be referenced i } module M1.M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { private foo() { super.foo(); diff --git a/tests/baselines/reference/parserSuperExpression4.errors.txt b/tests/baselines/reference/parserSuperExpression4.errors.txt index c7e2dd601c604..4571f32e58e9c 100644 --- a/tests/baselines/reference/parserSuperExpression4.errors.txt +++ b/tests/baselines/reference/parserSuperExpression4.errors.txt @@ -1,8 +1,10 @@ parserSuperExpression4.ts(3,9): error TS2335: 'super' can only be referenced in a derived class. +parserSuperExpression4.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserSuperExpression4.ts(7,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserSuperExpression4.ts(10,13): error TS2335: 'super' can only be referenced in a derived class. -==== parserSuperExpression4.ts (2 errors) ==== +==== parserSuperExpression4.ts (4 errors) ==== class C { private foo() { super.foo = 1 @@ -12,6 +14,10 @@ parserSuperExpression4.ts(10,13): error TS2335: 'super' can only be referenced i } module M1.M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { private foo() { super.foo = 1 diff --git a/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt b/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt index ba7bc354c5562..17ecc6e52bbd1 100644 --- a/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt +++ b/tests/baselines/reference/parserUnfinishedTypeNameBeforeKeyword1.errors.txt @@ -1,13 +1,16 @@ parserUnfinishedTypeNameBeforeKeyword1.ts(1,8): error TS2833: Cannot find namespace 'TypeModule1'. Did you mean 'TypeModule2'? parserUnfinishedTypeNameBeforeKeyword1.ts(1,20): error TS1003: Identifier expected. +parserUnfinishedTypeNameBeforeKeyword1.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== parserUnfinishedTypeNameBeforeKeyword1.ts (2 errors) ==== +==== parserUnfinishedTypeNameBeforeKeyword1.ts (3 errors) ==== var x: TypeModule1. ~~~~~~~~~~~ !!! error TS2833: Cannot find namespace 'TypeModule1'. Did you mean 'TypeModule2'? !!! error TS1003: Identifier expected. module TypeModule2 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } \ No newline at end of file diff --git a/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt b/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt index 55c36a4780baf..8aac16f98eabc 100644 --- a/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt +++ b/tests/baselines/reference/parserUnterminatedGeneric2.errors.txt @@ -1,3 +1,4 @@ +parserUnterminatedGeneric2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserUnterminatedGeneric2.ts(2,5): error TS1435: Unknown keyword or identifier. Did you mean 'interface ICompiledExpression'? parserUnterminatedGeneric2.ts(2,5): error TS2304: Cannot find name 'interfaceICompiledExpression'. parserUnterminatedGeneric2.ts(3,42): error TS1005: '=>' expected. @@ -15,8 +16,10 @@ parserUnterminatedGeneric2.ts(8,45): error TS2552: Cannot find name 'IPromise'. parserUnterminatedGeneric2.ts(8,54): error TS1005: '>' expected. -==== parserUnterminatedGeneric2.ts (15 errors) ==== +==== parserUnterminatedGeneric2.ts (16 errors) ==== declare module ng { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interfaceICompiledExpression { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1435: Unknown keyword or identifier. Did you mean 'interface ICompiledExpression'? diff --git a/tests/baselines/reference/parserVariableDeclaration4.errors.txt b/tests/baselines/reference/parserVariableDeclaration4.errors.txt index e0795fa850d70..c5afa9ce710c5 100644 --- a/tests/baselines/reference/parserVariableDeclaration4.errors.txt +++ b/tests/baselines/reference/parserVariableDeclaration4.errors.txt @@ -1,8 +1,11 @@ +parserVariableDeclaration4.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserVariableDeclaration4.ts(2,4): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== parserVariableDeclaration4.ts (1 errors) ==== +==== parserVariableDeclaration4.ts (2 errors) ==== declare module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare var v; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index 67cb9950d30c9..e6459ff27dcad 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -7,11 +7,19 @@ parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. parserharness.ts(43,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. parserharness.ts(44,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +parserharness.ts(50,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(55,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(81,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(354,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(354,35): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? +parserharness.ts(499,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(500,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(504,28): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(508,28): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(687,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserharness.ts(691,50): error TS2304: Cannot find name 'ITextWriter'. parserharness.ts(716,47): error TS2503: Cannot find namespace 'TypeScript'. parserharness.ts(721,62): error TS2304: Cannot find name 'ITextWriter'. @@ -77,6 +85,7 @@ parserharness.ts(1321,21): error TS2304: Cannot find name 'TypeScript'. parserharness.ts(1340,38): error TS2503: Cannot find namespace 'TypeScript'. parserharness.ts(1344,165): error TS2503: Cannot find namespace 'TypeScript'. parserharness.ts(1345,26): error TS2503: Cannot find namespace 'TypeScript'. +parserharness.ts(1414,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserharness.ts(1426,25): error TS2503: Cannot find namespace 'TypeScript'. parserharness.ts(1430,9): error TS1128: Declaration or statement expected. parserharness.ts(1430,17): error TS2304: Cannot find name 'optionRegex'. @@ -107,10 +116,12 @@ parserharness.ts(1784,61): error TS2503: Cannot find namespace 'Services'. parserharness.ts(1785,25): error TS2503: Cannot find namespace 'Services'. parserharness.ts(1787,38): error TS2503: Cannot find namespace 'Services'. parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. +parserharness.ts(1869,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +parserharness.ts(1910,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. -==== parserharness.ts (110 errors) ==== +==== parserharness.ts (121 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -179,11 +190,15 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. } declare module process { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function nextTick(callback: () => any): void; export function on(event: string, listener: Function); } module Harness { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Settings export var userSpecifiedroot = ""; var global = Function("return this").call(null); @@ -210,6 +225,8 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. // Assert functions export module Assert { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bugIds: string[] = []; export var throwAssertError = (error: Error) => { throw error; @@ -638,15 +655,23 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. // Performance test export module Perf { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Clock { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var now: () => number; export var resolution: number; declare module WScript { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function InitializeProjection(); } declare module TestUtilities { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function QueryPerformanceCounter(): number; export function QueryPerformanceFrequency(): number; } @@ -826,6 +851,8 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. /** Functionality for compiling TypeScript code */ export module Compiler { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. /** Aggregate various writes into a single array of lines. Useful for passing to the * TypeScript compiler to fill with source code or errors. */ @@ -1683,6 +1710,8 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. * extracts options and individual files in a multifile test */ export module TestCaseParser { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. /** all the necesarry information to set the right compiler settings */ export interface CompilerSetting { flag: string; @@ -2198,6 +2227,8 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. /** Runs TypeScript or Javascript code. */ export module Runner { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function runCollateral(path: string, callback: (error: Error, result: any) => void ) { path = switchToForwardSlashes(path); runString(readFile(path), path.match(/[^\/]*$/)[0], callback); @@ -2239,6 +2270,8 @@ parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. /** Support class for baseline files */ export module Baseline { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var reportFilename = 'baseline-report.html'; var firstRun = true; diff --git a/tests/baselines/reference/parserindenter.errors.txt b/tests/baselines/reference/parserindenter.errors.txt index 2edf551b1e5c1..8c7590863b2d0 100644 --- a/tests/baselines/reference/parserindenter.errors.txt +++ b/tests/baselines/reference/parserindenter.errors.txt @@ -1,4 +1,5 @@ parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. +parserindenter.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -128,7 +129,7 @@ parserindenter.ts(735,42): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. -==== parserindenter.ts (128 errors) ==== +==== parserindenter.ts (129 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -150,6 +151,8 @@ parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. module Formatting { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Indenter implements ILineIndenationResolver { ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'ILineIndenationResolver'. diff --git a/tests/baselines/reference/partiallyAmbientClodule.errors.txt b/tests/baselines/reference/partiallyAmbientClodule.errors.txt new file mode 100644 index 0000000000000..d7bccb562090e --- /dev/null +++ b/tests/baselines/reference/partiallyAmbientClodule.errors.txt @@ -0,0 +1,10 @@ +partiallyAmbientClodule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== partiallyAmbientClodule.ts (1 errors) ==== + declare module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function x(): any; + } + class foo { } // Legal, because module is ambient \ No newline at end of file diff --git a/tests/baselines/reference/partiallyAmbientFundule.errors.txt b/tests/baselines/reference/partiallyAmbientFundule.errors.txt new file mode 100644 index 0000000000000..44b67be19029d --- /dev/null +++ b/tests/baselines/reference/partiallyAmbientFundule.errors.txt @@ -0,0 +1,10 @@ +partiallyAmbientFundule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== partiallyAmbientFundule.ts (1 errors) ==== + declare module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function x(): any; + } + function foo () { } // Legal, because module is ambient \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index 1f09f5ef99902..e10c7717edfa9 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -1,3 +1,4 @@ +plusOperatorWithAnyOtherType.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. plusOperatorWithAnyOtherType.ts(34,24): error TS18050: The value 'undefined' cannot be used here. plusOperatorWithAnyOtherType.ts(35,24): error TS18050: The value 'null' cannot be used here. plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. @@ -6,7 +7,7 @@ plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be app plusOperatorWithAnyOtherType.ts(54,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== plusOperatorWithAnyOtherType.ts (6 errors) ==== +==== plusOperatorWithAnyOtherType.ts (7 errors) ==== // + operator on any type var ANY: any; @@ -27,6 +28,8 @@ plusOperatorWithAnyOtherType.ts(54,1): error TS2695: Left side of comma operator } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt index 5492f9a16da33..c1fea8b754229 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt @@ -1,7 +1,8 @@ +plusOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. plusOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== plusOperatorWithBooleanType.ts (1 errors) ==== +==== plusOperatorWithBooleanType.ts (2 errors) ==== // + operator on boolean type var BOOLEAN: boolean; @@ -12,6 +13,8 @@ plusOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator static foo() { return false; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt index bfb09cd1fed73..10edfbf151d0d 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt @@ -1,7 +1,8 @@ +plusOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. plusOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== plusOperatorWithNumberType.ts (1 errors) ==== +==== plusOperatorWithNumberType.ts (2 errors) ==== // + operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -13,6 +14,8 @@ plusOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator i static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/plusOperatorWithStringType.errors.txt b/tests/baselines/reference/plusOperatorWithStringType.errors.txt index d225fade925f3..5473da5e5b7fb 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithStringType.errors.txt @@ -1,7 +1,8 @@ +plusOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. plusOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== plusOperatorWithStringType.ts (1 errors) ==== +==== plusOperatorWithStringType.ts (2 errors) ==== // + operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -13,6 +14,8 @@ plusOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator i static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/primaryExpressionMods.errors.txt b/tests/baselines/reference/primaryExpressionMods.errors.txt index 92495911da304..1e65798704019 100644 --- a/tests/baselines/reference/primaryExpressionMods.errors.txt +++ b/tests/baselines/reference/primaryExpressionMods.errors.txt @@ -1,9 +1,12 @@ +primaryExpressionMods.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. primaryExpressionMods.ts(7,8): error TS2709: Cannot use namespace 'M' as a type. primaryExpressionMods.ts(11,8): error TS2833: Cannot find namespace 'm'. Did you mean 'M'? -==== primaryExpressionMods.ts (2 errors) ==== +==== primaryExpressionMods.ts (3 errors) ==== module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { export interface P { x: number; y: number; } export var a = 1; diff --git a/tests/baselines/reference/primitiveTypeAsmoduleName.errors.txt b/tests/baselines/reference/primitiveTypeAsmoduleName.errors.txt new file mode 100644 index 0000000000000..f08f909809a12 --- /dev/null +++ b/tests/baselines/reference/primitiveTypeAsmoduleName.errors.txt @@ -0,0 +1,7 @@ +primitiveTypeAsmoduleName.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== primitiveTypeAsmoduleName.ts (1 errors) ==== + module string {} + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt new file mode 100644 index 0000000000000..d30d81e6457ab --- /dev/null +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -0,0 +1,1071 @@ +privacyAccessorDeclFile_GlobalFile.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyAccessorDeclFile_GlobalFile.ts(49,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyAccessorDeclFile_externalModule.ts(203,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyAccessorDeclFile_externalModule.ts(406,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyAccessorDeclFile_externalModule.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { // Error + } + private set myPrivateMethod(param: privateClass) { + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + set myPublicMethod(param: privateModule.publicClass) { // Error + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { // Error + } + private set myPrivateMethod(param: privateClass) { + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + set myPublicMethod(param: privateModule.publicClass) { // Error + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + } + +==== privacyAccessorDeclFile_GlobalFile.ts (2 errors) ==== + class publicClassInGlobal { + } + + class publicClassInGlobalWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClassInGlobal { + return null; + } + private static get myPrivateStaticMethod(): publicClassInGlobal { + return null; + } + get myPublicMethod(): publicClassInGlobal { + return null; + } + private get myPrivateMethod(): publicClassInGlobal { + return null; + } + static get myPublicStaticMethod1() { + return new publicClassInGlobal(); + } + private static get myPrivateStaticMethod1() { + return new publicClassInGlobal(); + } + get myPublicMethod1() { + return new publicClassInGlobal(); + } + private get myPrivateMethod1() { + return new publicClassInGlobal(); + } + } + + class publicClassInGlobalWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClassInGlobal) { + } + private static set myPrivateStaticMethod(param: publicClassInGlobal) { + } + set myPublicMethod(param: publicClassInGlobal) { + } + private set myPrivateMethod(param: publicClassInGlobal) { + } + } + + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + } + + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { // Error + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { // Error + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { // Error + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod(): privateClass { + return null; + } + private static get myPrivateStaticMethod(): privateClass { + return null; + } + get myPublicMethod(): privateClass { + return null; + } + private get myPrivateMethod(): privateClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateClass(); + } + private static get myPrivateStaticMethod1() { + return new privateClass(); + } + get myPublicMethod1() { + return new privateClass(); + } + private get myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicGetAccessorTypes { + static get myPublicStaticMethod(): publicClass { + return null; + } + private static get myPrivateStaticMethod(): publicClass { + return null; + } + get myPublicMethod(): publicClass { + return null; + } + private get myPrivateMethod(): publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new publicClass(); + } + private static get myPrivateStaticMethod1() { + return new publicClass(); + } + get myPublicMethod1() { + return new publicClass(); + } + private get myPrivateMethod1() { + return new publicClass(); + } + } + + export class publicClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { // Error + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { // Error + } + private set myPrivateMethod(param: privateClass) { + } + } + + export class publicClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + class privateClassWithWithPrivateSetAccessorTypes { + static set myPublicStaticMethod(param: privateClass) { + } + private static set myPrivateStaticMethod(param: privateClass) { + } + set myPublicMethod(param: privateClass) { + } + private set myPrivateMethod(param: privateClass) { + } + } + + class privateClassWithWithPublicSetAccessorTypes { + static set myPublicStaticMethod(param: publicClass) { + } + private static set myPrivateStaticMethod(param: publicClass) { + } + set myPublicMethod(param: publicClass) { + } + private set myPrivateMethod(param: publicClass) { + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + get myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static get myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + get myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + + export class publicClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + set myPublicMethod(param: privateModule.publicClass) { // Error + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod(): privateModule.publicClass { + return null; + } + get myPublicMethod(): privateModule.publicClass { + return null; + } + static get myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + get myPublicMethod1() { + return new privateModule.publicClass(); + } + } + + class privateClassWithPrivateModuleSetAccessorTypes { + static set myPublicStaticMethod(param: privateModule.publicClass) { + } + set myPublicMethod(param: privateModule.publicClass) { + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyCannotNameAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.errors.txt new file mode 100644 index 0000000000000..d7e0e21362b7a --- /dev/null +++ b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.errors.txt @@ -0,0 +1,142 @@ +privacyCannotNameAccessorDeclFile_GlobalWidgets.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyCannotNameAccessorDeclFile_Widgets.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCannotNameAccessorDeclFile_consumer.ts (0 errors) ==== + import exporter = require("./privacyCannotNameAccessorDeclFile_exporter"); + export class publicClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod() { // Error + return exporter.createExportedWidget1(); + } + private static get myPrivateStaticMethod() { + return exporter.createExportedWidget1(); + } + get myPublicMethod() { // Error + return exporter.createExportedWidget1(); + } + private get myPrivateMethod() { + return exporter.createExportedWidget1(); + } + static get myPublicStaticMethod1() { // Error + return exporter.createExportedWidget3(); + } + private static get myPrivateStaticMethod1() { + return exporter.createExportedWidget3(); + } + get myPublicMethod1() { // Error + return exporter.createExportedWidget3(); + } + private get myPrivateMethod1() { + return exporter.createExportedWidget3(); + } + } + + class privateClassWithWithPrivateGetAccessorTypes { + static get myPublicStaticMethod() { + return exporter.createExportedWidget1(); + } + private static get myPrivateStaticMethod() { + return exporter.createExportedWidget1(); + } + get myPublicMethod() { + return exporter.createExportedWidget1(); + } + private get myPrivateMethod() { + return exporter.createExportedWidget1(); + } + static get myPublicStaticMethod1() { + return exporter.createExportedWidget3(); + } + private static get myPrivateStaticMethod1() { + return exporter.createExportedWidget3(); + } + get myPublicMethod1() { + return exporter.createExportedWidget3(); + } + private get myPrivateMethod1() { + return exporter.createExportedWidget3(); + } + } + + export class publicClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod() { // Error + return exporter.createExportedWidget2(); + } + get myPublicMethod() { // Error + return exporter.createExportedWidget2(); + } + static get myPublicStaticMethod1() { // Error + return exporter.createExportedWidget4(); + } + get myPublicMethod1() { // Error + return exporter.createExportedWidget4(); + } + } + + class privateClassWithPrivateModuleGetAccessorTypes { + static get myPublicStaticMethod() { + return exporter.createExportedWidget2(); + } + get myPublicMethod() { + return exporter.createExportedWidget2(); + } + static get myPublicStaticMethod1() { + return exporter.createExportedWidget4(); + } + get myPublicMethod1() { + return exporter.createExportedWidget4(); + } + } +==== privacyCannotNameAccessorDeclFile_GlobalWidgets.ts (1 errors) ==== + declare module "GlobalWidgets" { + export class Widget3 { + name: string; + } + export function createWidget3(): Widget3; + + export module SpecializedGlobalWidget { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget4 { + name: string; + } + function createWidget4(): Widget4; + } + } + +==== privacyCannotNameAccessorDeclFile_Widgets.ts (1 errors) ==== + export class Widget1 { + name = 'one'; + } + export function createWidget1() { + return new Widget1(); + } + + export module SpecializedWidget { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget2 { + name = 'one'; + } + export function createWidget2() { + return new Widget2(); + } + } + +==== privacyCannotNameAccessorDeclFile_exporter.ts (0 errors) ==== + /// + import Widgets = require("./privacyCannotNameAccessorDeclFile_Widgets"); + import Widgets1 = require("GlobalWidgets"); + export function createExportedWidget1() { + return Widgets.createWidget1(); + } + export function createExportedWidget2() { + return Widgets.SpecializedWidget.createWidget2(); + } + export function createExportedWidget3() { + return Widgets1.createWidget3(); + } + export function createExportedWidget4() { + return Widgets1.SpecializedGlobalWidget.createWidget4(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js index afacb29591540..e6a1005044db3 100644 --- a/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js +++ b/tests/baselines/reference/privacyCannotNameAccessorDeclFile.js @@ -432,74 +432,3 @@ export declare class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; get myPublicMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; } - - -//// [DtsFileErrors] - - -privacyCannotNameAccessorDeclFile_consumer.d.ts(6,48): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameAccessorDeclFile_consumer.d.ts(8,35): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameAccessorDeclFile_consumer.d.ts(14,48): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameAccessorDeclFile_consumer.d.ts(15,35): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - - -==== privacyCannotNameAccessorDeclFile_consumer.d.ts (4 errors) ==== - export declare class publicClassWithWithPrivateGetAccessorTypes { - static get myPublicStaticMethod(): import("./privacyCannotNameAccessorDeclFile_Widgets").Widget1; - private static get myPrivateStaticMethod(); - get myPublicMethod(): import("./privacyCannotNameAccessorDeclFile_Widgets").Widget1; - private get myPrivateMethod(); - static get myPublicStaticMethod1(): import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private static get myPrivateStaticMethod1(); - get myPublicMethod1(): import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private get myPrivateMethod1(); - } - export declare class publicClassWithPrivateModuleGetAccessorTypes { - static get myPublicStaticMethod(): import("./privacyCannotNameAccessorDeclFile_Widgets").SpecializedWidget.Widget2; - get myPublicMethod(): import("./privacyCannotNameAccessorDeclFile_Widgets").SpecializedWidget.Widget2; - static get myPublicStaticMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - get myPublicMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - } - -==== privacyCannotNameAccessorDeclFile_GlobalWidgets.d.ts (0 errors) ==== - declare module "GlobalWidgets" { - class Widget3 { - name: string; - } - function createWidget3(): Widget3; - namespace SpecializedGlobalWidget { - class Widget4 { - name: string; - } - function createWidget4(): Widget4; - } - } - -==== privacyCannotNameAccessorDeclFile_Widgets.d.ts (0 errors) ==== - export declare class Widget1 { - name: string; - } - export declare function createWidget1(): Widget1; - export declare namespace SpecializedWidget { - class Widget2 { - name: string; - } - function createWidget2(): Widget2; - } - -==== privacyCannotNameAccessorDeclFile_exporter.d.ts (0 errors) ==== - import Widgets = require("./privacyCannotNameAccessorDeclFile_Widgets"); - import Widgets1 = require("GlobalWidgets"); - export declare function createExportedWidget1(): Widgets.Widget1; - export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2; - export declare function createExportedWidget3(): Widgets1.Widget3; - export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4; - \ No newline at end of file diff --git a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.errors.txt b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.errors.txt new file mode 100644 index 0000000000000..129a6c321a259 --- /dev/null +++ b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.errors.txt @@ -0,0 +1,105 @@ +privacyCannotNameVarTypeDeclFile_GlobalWidgets.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyCannotNameVarTypeDeclFile_Widgets.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCannotNameVarTypeDeclFile_consumer.ts (0 errors) ==== + import exporter = require("./privacyCannotNameVarTypeDeclFile_exporter"); + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty = exporter.createExportedWidget1(); // Error + private static myPrivateStaticProperty = exporter.createExportedWidget1(); + myPublicProperty = exporter.createExportedWidget1(); // Error + private myPrivateProperty = exporter.createExportedWidget1(); + + static myPublicStaticProperty1 = exporter.createExportedWidget3(); // Error + private static myPrivateStaticProperty1 = exporter.createExportedWidget3(); + myPublicProperty1 = exporter.createExportedWidget3(); // Error + private myPrivateProperty1 = exporter.createExportedWidget3(); + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty = exporter.createExportedWidget1(); + private static myPrivateStaticProperty = exporter.createExportedWidget1(); + myPublicProperty = exporter.createExportedWidget1(); + private myPrivateProperty = exporter.createExportedWidget1(); + + static myPublicStaticProperty1 = exporter.createExportedWidget3(); + private static myPrivateStaticProperty1 = exporter.createExportedWidget3(); + myPublicProperty1 = exporter.createExportedWidget3(); + private myPrivateProperty1 = exporter.createExportedWidget3(); + } + + export var publicVarWithPrivatePropertyTypes= exporter.createExportedWidget1(); // Error + var privateVarWithPrivatePropertyTypes= exporter.createExportedWidget1(); + export var publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); // Error + var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); + + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty= exporter.createExportedWidget2(); // Error + myPublicProperty = exporter.createExportedWidget2(); // Error + static myPublicStaticProperty1 = exporter.createExportedWidget4(); // Error + myPublicProperty1 = exporter.createExportedWidget4(); // Error + } + export var publicVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2(); // Error + export var publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); // Error + + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty= exporter.createExportedWidget2(); + myPublicProperty= exporter.createExportedWidget2(); + static myPublicStaticProperty1 = exporter.createExportedWidget4(); + myPublicProperty1 = exporter.createExportedWidget4(); + } + var privateVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2(); + var privateVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); +==== privacyCannotNameVarTypeDeclFile_GlobalWidgets.ts (1 errors) ==== + declare module "GlobalWidgets" { + export class Widget3 { + name: string; + } + export function createWidget3(): Widget3; + + export module SpecializedGlobalWidget { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget4 { + name: string; + } + function createWidget4(): Widget4; + } + } + +==== privacyCannotNameVarTypeDeclFile_Widgets.ts (1 errors) ==== + export class Widget1 { + name = 'one'; + } + export function createWidget1() { + return new Widget1(); + } + + export module SpecializedWidget { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget2 { + name = 'one'; + } + export function createWidget2() { + return new Widget2(); + } + } + +==== privacyCannotNameVarTypeDeclFile_exporter.ts (0 errors) ==== + /// + import Widgets = require("./privacyCannotNameVarTypeDeclFile_Widgets"); + import Widgets1 = require("GlobalWidgets"); + export function createExportedWidget1() { + return Widgets.createWidget1(); + } + export function createExportedWidget2() { + return Widgets.SpecializedWidget.createWidget2(); + } + export function createExportedWidget3() { + return Widgets1.createWidget3(); + } + export function createExportedWidget4() { + return Widgets1.SpecializedGlobalWidget.createWidget4(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js index 20183ab0cb733..cbc244a0a175a 100644 --- a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js +++ b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js @@ -263,84 +263,3 @@ export declare class publicClassWithPrivateModulePropertyTypes { } export declare var publicVarWithPrivateModulePropertyTypes: import("./privacyCannotNameVarTypeDeclFile_Widgets").SpecializedWidget.Widget2; export declare var publicVarWithPrivateModulePropertyTypes1: import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - - -//// [DtsFileErrors] - - -privacyCannotNameVarTypeDeclFile_consumer.d.ts(6,44): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameVarTypeDeclFile_consumer.d.ts(8,31): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameVarTypeDeclFile_consumer.d.ts(12,63): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameVarTypeDeclFile_consumer.d.ts(16,44): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameVarTypeDeclFile_consumer.d.ts(17,31): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyCannotNameVarTypeDeclFile_consumer.d.ts(20,69): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - - -==== privacyCannotNameVarTypeDeclFile_consumer.d.ts (6 errors) ==== - export declare class publicClassWithWithPrivatePropertyTypes { - static myPublicStaticProperty: import("./privacyCannotNameVarTypeDeclFile_Widgets").Widget1; - private static myPrivateStaticProperty; - myPublicProperty: import("./privacyCannotNameVarTypeDeclFile_Widgets").Widget1; - private myPrivateProperty; - static myPublicStaticProperty1: import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private static myPrivateStaticProperty1; - myPublicProperty1: import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private myPrivateProperty1; - } - export declare var publicVarWithPrivatePropertyTypes: import("./privacyCannotNameVarTypeDeclFile_Widgets").Widget1; - export declare var publicVarWithPrivatePropertyTypes1: import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - export declare class publicClassWithPrivateModulePropertyTypes { - static myPublicStaticProperty: import("./privacyCannotNameVarTypeDeclFile_Widgets").SpecializedWidget.Widget2; - myPublicProperty: import("./privacyCannotNameVarTypeDeclFile_Widgets").SpecializedWidget.Widget2; - static myPublicStaticProperty1: import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - myPublicProperty1: import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - } - export declare var publicVarWithPrivateModulePropertyTypes: import("./privacyCannotNameVarTypeDeclFile_Widgets").SpecializedWidget.Widget2; - export declare var publicVarWithPrivateModulePropertyTypes1: import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - -==== privacyCannotNameVarTypeDeclFile_GlobalWidgets.d.ts (0 errors) ==== - declare module "GlobalWidgets" { - class Widget3 { - name: string; - } - function createWidget3(): Widget3; - namespace SpecializedGlobalWidget { - class Widget4 { - name: string; - } - function createWidget4(): Widget4; - } - } - -==== privacyCannotNameVarTypeDeclFile_Widgets.d.ts (0 errors) ==== - export declare class Widget1 { - name: string; - } - export declare function createWidget1(): Widget1; - export declare namespace SpecializedWidget { - class Widget2 { - name: string; - } - function createWidget2(): Widget2; - } - -==== privacyCannotNameVarTypeDeclFile_exporter.d.ts (0 errors) ==== - import Widgets = require("./privacyCannotNameVarTypeDeclFile_Widgets"); - import Widgets1 = require("GlobalWidgets"); - export declare function createExportedWidget1(): Widgets.Widget1; - export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2; - export declare function createExportedWidget3(): Widgets1.Widget3; - export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4; - \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.errors.txt b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.errors.txt new file mode 100644 index 0000000000000..24b4eff5c04a2 --- /dev/null +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.errors.txt @@ -0,0 +1,22 @@ +privacyCheckAnonymousFunctionParameter.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckAnonymousFunctionParameter.ts (1 errors) ==== + export var x = 1; // Makes this an external module + interface Iterator { + } + + module Query { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function fromDoWhile(doWhile: (test: Iterator) => boolean): Iterator { + return null; + } + + function fromOrderBy() { + return fromDoWhile(test => { + return true; + }); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.errors.txt b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.errors.txt new file mode 100644 index 0000000000000..01f7f7c6c6d1c --- /dev/null +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.errors.txt @@ -0,0 +1,23 @@ +privacyCheckAnonymousFunctionParameter2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyCheckAnonymousFunctionParameter2.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckAnonymousFunctionParameter2.ts (2 errors) ==== + export var x = 1; // Makes this an external module + interface Iterator { x: T } + + module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo(x: (a: Iterator) => number) { + return x; + } + } + + module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function bar() { + foo(null); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.errors.txt b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.errors.txt new file mode 100644 index 0000000000000..34c7777931cf6 --- /dev/null +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.errors.txt @@ -0,0 +1,14 @@ +privacyCheckExportAssignmentOnExportedGenericInterface1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckExportAssignmentOnExportedGenericInterface1.ts (1 errors) ==== + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface A { + } + } + interface Foo { + } + var Foo: new () => Foo.A>; + export = Foo; \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.errors.txt b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.errors.txt new file mode 100644 index 0000000000000..4131800fbf190 --- /dev/null +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.errors.txt @@ -0,0 +1,19 @@ +privacyCheckExportAssignmentOnExportedGenericInterface2.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckExportAssignmentOnExportedGenericInterface2.ts (1 errors) ==== + export = Foo; + + interface Foo { + } + + function Foo(array: T[]): Foo { + return undefined; + } + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = "hello"; + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt new file mode 100644 index 0000000000000..9d0d17d019b25 --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt @@ -0,0 +1,17 @@ +privacyCheckTypeOfInvisibleModuleError.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyCheckTypeOfInvisibleModuleError.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckTypeOfInvisibleModuleError.ts (2 errors) ==== + module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module Inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m: typeof Inner; + } + + export var f: typeof Inner; + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt new file mode 100644 index 0000000000000..114e544e0873e --- /dev/null +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt @@ -0,0 +1,17 @@ +privacyCheckTypeOfInvisibleModuleNoError.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyCheckTypeOfInvisibleModuleNoError.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyCheckTypeOfInvisibleModuleNoError.ts (2 errors) ==== + module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module Inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m: number; + } + + export var f: typeof Inner; // Since we dont unwind inner any more, it is error here + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyClass.errors.txt b/tests/baselines/reference/privacyClass.errors.txt new file mode 100644 index 0000000000000..fa01ee25b6041 --- /dev/null +++ b/tests/baselines/reference/privacyClass.errors.txt @@ -0,0 +1,136 @@ +privacyClass.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyClass.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyClass.ts (2 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m1_i_public { + } + + interface m1_i_private { + } + + export class m1_c_public { + private f1() { + } + } + + class m1_c_private { + } + + class m1_C1_private extends m1_c_public { + } + class m1_C2_private extends m1_c_private { + } + export class m1_C3_public extends m1_c_public { + } + export class m1_C4_public extends m1_c_private { + } + + class m1_C5_private implements m1_i_public { + } + class m1_C6_private implements m1_i_private { + } + export class m1_C7_public implements m1_i_public { + } + export class m1_C8_public implements m1_i_private { + } + + class m1_C9_private extends m1_c_public implements m1_i_private, m1_i_public { + } + class m1_C10_private extends m1_c_private implements m1_i_private, m1_i_public { + } + export class m1_C11_public extends m1_c_public implements m1_i_private, m1_i_public { + } + export class m1_C12_public extends m1_c_private implements m1_i_private, m1_i_public { + } + } + + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m2_i_public { + } + + interface m2_i_private { + } + + export class m2_c_public { + private f1() { + } + } + + class m2_c_private { + } + + class m2_C1_private extends m2_c_public { + } + class m2_C2_private extends m2_c_private { + } + export class m2_C3_public extends m2_c_public { + } + export class m2_C4_public extends m2_c_private { + } + + class m2_C5_private implements m2_i_public { + } + class m2_C6_private implements m2_i_private { + } + export class m2_C7_public implements m2_i_public { + } + export class m2_C8_public implements m2_i_private { + } + + class m2_C9_private extends m2_c_public implements m2_i_private, m2_i_public { + } + class m2_C10_private extends m2_c_private implements m2_i_private, m2_i_public { + } + export class m2_C11_public extends m2_c_public implements m2_i_private, m2_i_public { + } + export class m2_C12_public extends m2_c_private implements m2_i_private, m2_i_public { + } + } + + export interface glo_i_public { + } + + interface glo_i_private { + } + + export class glo_c_public { + private f1() { + } + } + + class glo_c_private { + } + + class glo_C1_private extends glo_c_public { + } + class glo_C2_private extends glo_c_private { + } + export class glo_C3_public extends glo_c_public { + } + export class glo_C4_public extends glo_c_private { + } + + class glo_C5_private implements glo_i_public { + } + class glo_C6_private implements glo_i_private { + } + export class glo_C7_public implements glo_i_public { + } + export class glo_C8_public implements glo_i_private { + } + + class glo_C9_private extends glo_c_public implements glo_i_private, glo_i_public { + } + class glo_C10_private extends glo_c_private implements glo_i_private, glo_i_public { + } + export class glo_C11_public extends glo_c_public implements glo_i_private, glo_i_public { + } + export class glo_C12_public extends glo_c_private implements glo_i_private, glo_i_public { + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index 045bd3483869c..d756edaf33687 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -1,9 +1,14 @@ +privacyClassExtendsClauseDeclFile_GlobalFile.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyClassExtendsClauseDeclFile_externalModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyClassExtendsClauseDeclFile_externalModule.ts(19,77): error TS2449: Class 'publicClassInPrivateModule' used before its declaration. privacyClassExtendsClauseDeclFile_externalModule.ts(21,83): error TS2449: Class 'publicClassInPrivateModule' used before its declaration. +privacyClassExtendsClauseDeclFile_externalModule.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== privacyClassExtendsClauseDeclFile_externalModule.ts (2 errors) ==== +==== privacyClassExtendsClauseDeclFile_externalModule.ts (4 errors) ==== export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class publicClassInPublicModule { private f1() { } @@ -34,6 +39,8 @@ privacyClassExtendsClauseDeclFile_externalModule.ts(21,83): error TS2449: Class } module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class publicClassInPrivateModule { private f1() { } @@ -79,8 +86,10 @@ privacyClassExtendsClauseDeclFile_externalModule.ts(21,83): error TS2449: Class export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error } -==== privacyClassExtendsClauseDeclFile_GlobalFile.ts (0 errors) ==== +==== privacyClassExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class publicClassInPublicModule { private f1() { } diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt new file mode 100644 index 0000000000000..bb7b7446f4bbe --- /dev/null +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt @@ -0,0 +1,103 @@ +privacyClassImplementsClauseDeclFile_GlobalFile.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyClassImplementsClauseDeclFile_externalModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyClassImplementsClauseDeclFile_externalModule.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyClassImplementsClauseDeclFile_externalModule.ts (2 errors) ==== + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPublicModule { + } + + interface privateInterfaceInPublicModule { + } + + class privateClassImplementingPublicInterfaceInModule implements publicInterfaceInPublicModule { + } + class privateClassImplementingPrivateInterfaceInModule implements privateInterfaceInPublicModule { + } + export class publicClassImplementingPublicInterfaceInModule implements publicInterfaceInPublicModule { + } + export class publicClassImplementingPrivateInterfaceInModule implements privateInterfaceInPublicModule { // Should error + } + + class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { + } + export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error + } + + export class publicClassImplementingPrivateAndPublicInterface implements privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error + } + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPrivateModule { + + } + + interface privateInterfaceInPrivateModule { + } + + class privateClassImplementingPublicInterfaceInModule implements publicInterfaceInPrivateModule { + } + class privateClassImplementingPrivateInterfaceInModule implements privateInterfaceInPrivateModule { + } + export class publicClassImplementingPublicInterfaceInModule implements publicInterfaceInPrivateModule { + } + export class publicClassImplementingPrivateInterfaceInModule implements privateInterfaceInPrivateModule { + } + + class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { + } + export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { + } + } + + export interface publicInterface { + + } + + interface privateInterface { + } + + class privateClassImplementingPublicInterface implements publicInterface { + } + class privateClassImplementingPrivateInterfaceInModule implements privateInterface { + } + export class publicClassImplementingPublicInterface implements publicInterface { + } + export class publicClassImplementingPrivateInterface implements privateInterface { // Should error + } + + class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { + } + export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error + } + +==== privacyClassImplementsClauseDeclFile_GlobalFile.ts (1 errors) ==== + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPublicModule { + } + + interface privateInterfaceInPublicModule { + } + + class privateClassImplementingPublicInterfaceInModule implements publicInterfaceInPublicModule { + } + class privateClassImplementingPrivateInterfaceInModule implements privateInterfaceInPublicModule { + } + export class publicClassImplementingPublicInterfaceInModule implements publicInterfaceInPublicModule { + } + export class publicClassImplementingPrivateInterfaceInModule implements privateInterfaceInPublicModule { // Should error + } + } + interface publicInterfaceInGlobal { + } + class publicClassImplementingPublicInterfaceInGlobal implements publicInterfaceInGlobal { + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunc.errors.txt b/tests/baselines/reference/privacyFunc.errors.txt new file mode 100644 index 0000000000000..62e58e4c15594 --- /dev/null +++ b/tests/baselines/reference/privacyFunc.errors.txt @@ -0,0 +1,234 @@ +privacyFunc.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyFunc.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + constructor (m1_c3_c1: C1_public); + constructor (m1_c3_c2: C2_private); //error + constructor (m1_c3_c1_2: any) { + } + + private f1_private(m1_c3_f1_arg: C1_public) { + } + + public f2_public(m1_c3_f2_arg: C1_public) { + } + + private f3_private(m1_c3_f3_arg: C2_private) { + } + + public f4_public(m1_c3_f4_arg: C2_private) { // error + } + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); // error + } + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + class C4_private { + constructor (m1_c4_c1: C1_public); + constructor (m1_c4_c2: C2_private); + constructor (m1_c4_c1_2: any) { + } + private f1_private(m1_c4_f1_arg: C1_public) { + } + + public f2_public(m1_c4_f2_arg: C1_public) { + } + + private f3_private(m1_c4_f3_arg: C2_private) { + } + + public f4_public(m1_c4_f4_arg: C2_private) { + } + + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); + } + + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { + return new C2_private(); + } + } + + export class C5_public { + constructor (m1_c5_c: C1_public) { + } + } + + class C6_private { + constructor (m1_c6_c: C1_public) { + } + } + export class C7_public { + constructor (m1_c7_c: C2_private) { // error + } + } + + class C8_private { + constructor (m1_c8_c: C2_private) { + } + } + + function f1_public(m1_f1_arg: C1_public) { + } + + export function f2_public(m1_f2_arg: C1_public) { + } + + function f3_public(m1_f3_arg: C2_private) { + } + + export function f4_public(m1_f4_arg: C2_private) { // error + } + + + function f5_public() { + return new C1_public(); + } + + export function f6_public() { + return new C1_public(); + } + + function f7_public() { + return new C2_private(); + } + + export function f8_public() { + return new C2_private(); // error + } + + + function f9_private(): C1_public { + return new C1_public(); + } + + export function f10_public(): C1_public { + return new C1_public(); + } + + function f11_private(): C2_private { + return new C2_private(); + } + + export function f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + class C6_public { + } + + class C7_public { + constructor (c7_c2: C6_public); + constructor (c7_c1_2: any) { + } + private f1_private(c7_f1_arg: C6_public) { + } + + public f2_public(c7_f2_arg: C6_public) { + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } + } + + class C9_public { + constructor (c9_c: C6_public) { + } + } + + + function f4_public(f4_arg: C6_public) { + } + + + + function f6_public() { + return new C6_public(); + } + + + function f10_public(): C6_public { + return new C6_public(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunc.types b/tests/baselines/reference/privacyFunc.types index 1ca0f4c140a1a..f72ae00489bfd 100644 --- a/tests/baselines/reference/privacyFunc.types +++ b/tests/baselines/reference/privacyFunc.types @@ -34,6 +34,7 @@ module m1 { constructor (m1_c3_c1_2: any) { >m1_c3_c1_2 : any +> : ^^^ } private f1_private(m1_c3_f1_arg: C1_public) { @@ -167,6 +168,7 @@ module m1 { constructor (m1_c4_c1_2: any) { >m1_c4_c1_2 : any +> : ^^^ } private f1_private(m1_c4_f1_arg: C1_public) { >f1_private : (m1_c4_f1_arg: C1_public) => void @@ -460,6 +462,7 @@ class C7_public { constructor (c7_c1_2: any) { >c7_c1_2 : any +> : ^^^ } private f1_private(c7_f1_arg: C6_public) { >f1_private : (c7_f1_arg: C6_public) => void diff --git a/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.errors.txt new file mode 100644 index 0000000000000..0cf508caa07ef --- /dev/null +++ b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.errors.txt @@ -0,0 +1,161 @@ +privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionCannotNameParameterTypeDeclFile_Widgets.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyFunctionCannotNameParameterTypeDeclFile_consumer.ts (0 errors) ==== + import exporter = require("./privacyFunctionCannotNameParameterTypeDeclFile_exporter"); + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param = exporter.createExportedWidget1()) { // Error + } + private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) { + } + myPublicMethod(param = exporter.createExportedWidget1()) { // Error + } + private myPrivateMethod(param = exporter.createExportedWidget1()) { + } + constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) { // Error + } + } + export class publicClassWithWithPrivateParmeterTypes1 { + static myPublicStaticMethod(param = exporter.createExportedWidget3()) { // Error + } + private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) { + } + myPublicMethod(param = exporter.createExportedWidget3()) { // Error + } + private myPrivateMethod(param = exporter.createExportedWidget3()) { + } + constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) { // Error + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param = exporter.createExportedWidget1()) { + } + private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) { + } + myPublicMethod(param = exporter.createExportedWidget1()) { + } + private myPrivateMethod(param = exporter.createExportedWidget1()) { + } + constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) { + } + } + class privateClassWithWithPrivateParmeterTypes2 { + static myPublicStaticMethod(param = exporter.createExportedWidget3()) { + } + private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) { + } + myPublicMethod(param = exporter.createExportedWidget3()) { + } + private myPrivateMethod(param = exporter.createExportedWidget3()) { + } + constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) { // Error + } + function privateFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) { + } + export function publicFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) { // Error + } + function privateFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) { + } + + + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param= exporter.createExportedWidget2()) { // Error + } + myPublicMethod(param= exporter.createExportedWidget2()) { // Error + } + constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) { // Error + } + } + export class publicClassWithPrivateModuleParameterTypes2 { + static myPublicStaticMethod(param= exporter.createExportedWidget4()) { // Error + } + myPublicMethod(param= exporter.createExportedWidget4()) { // Error + } + constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) { // Error + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) { // Error + } + export function publicFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) { // Error + } + + + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param= exporter.createExportedWidget2()) { + } + myPublicMethod(param= exporter.createExportedWidget2()) { + } + constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) { + } + } + class privateClassWithPrivateModuleParameterTypes1 { + static myPublicStaticMethod(param= exporter.createExportedWidget4()) { + } + myPublicMethod(param= exporter.createExportedWidget4()) { + } + constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) { + } + function privateFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) { + } +==== privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.ts (1 errors) ==== + declare module "GlobalWidgets" { + export class Widget3 { + name: string; + } + export function createWidget3(): Widget3; + + export module SpecializedGlobalWidget { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget4 { + name: string; + } + function createWidget4(): Widget4; + } + } + +==== privacyFunctionCannotNameParameterTypeDeclFile_Widgets.ts (1 errors) ==== + export class Widget1 { + name = 'one'; + } + export function createWidget1() { + return new Widget1(); + } + + export module SpecializedWidget { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget2 { + name = 'one'; + } + export function createWidget2() { + return new Widget2(); + } + } + +==== privacyFunctionCannotNameParameterTypeDeclFile_exporter.ts (0 errors) ==== + /// + import Widgets = require("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets"); + import Widgets1 = require("GlobalWidgets"); + export function createExportedWidget1() { + return Widgets.createWidget1(); + } + export function createExportedWidget2() { + return Widgets.SpecializedWidget.createWidget2(); + } + export function createExportedWidget3() { + return Widgets1.createWidget3(); + } + export function createExportedWidget4() { + return Widgets1.SpecializedGlobalWidget.createWidget4(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js index 78b540204a9c3..a6eb83c8cb756 100644 --- a/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js +++ b/tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.js @@ -465,124 +465,3 @@ export declare class publicClassWithPrivateModuleParameterTypes2 { } export declare function publicFunctionWithPrivateModuleParameterTypes(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2): void; export declare function publicFunctionWithPrivateModuleParameterTypes1(param?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4): void; - - -//// [DtsFileErrors] - - -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(12,20): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(13,48): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(15,35): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(17,32): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(17,74): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(17,116): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(20,80): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(30,20): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(31,48): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(32,35): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(33,32): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(33,98): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(33,164): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts(36,87): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - - -==== privacyFunctionCannotNameParameterTypeDeclFile_consumer.d.ts (14 errors) ==== - export declare class publicClassWithWithPrivateParmeterTypes { - private param1; - param2: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1; - static myPublicStaticMethod(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1): void; - private static myPrivateStaticMethod; - myPublicMethod(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1): void; - private myPrivateMethod; - constructor(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1, param1?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1, param2?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1); - } - export declare class publicClassWithWithPrivateParmeterTypes1 { - private param1; - param2: import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - static myPublicStaticMethod(param?: import("GlobalWidgets").Widget3): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private static myPrivateStaticMethod; - myPublicMethod(param?: import("GlobalWidgets").Widget3): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private myPrivateMethod; - constructor(param?: import("GlobalWidgets").Widget3, param1?: import("GlobalWidgets").Widget3, param2?: import("GlobalWidgets").Widget3); - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - } - export declare function publicFunctionWithPrivateParmeterTypes(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").Widget1): void; - export declare function publicFunctionWithPrivateParmeterTypes1(param?: import("GlobalWidgets").Widget3): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - export declare class publicClassWithPrivateModuleParameterTypes { - private param1; - param2: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2; - static myPublicStaticMethod(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2): void; - myPublicMethod(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2): void; - constructor(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2, param1?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2, param2?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2); - } - export declare class publicClassWithPrivateModuleParameterTypes2 { - private param1; - param2: import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - static myPublicStaticMethod(param?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - myPublicMethod(param?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - constructor(param?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4, param1?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4, param2?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4); - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - } - export declare function publicFunctionWithPrivateModuleParameterTypes(param?: import("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets").SpecializedWidget.Widget2): void; - export declare function publicFunctionWithPrivateModuleParameterTypes1(param?: import("GlobalWidgets").SpecializedGlobalWidget.Widget4): void; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - -==== privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.d.ts (0 errors) ==== - declare module "GlobalWidgets" { - class Widget3 { - name: string; - } - function createWidget3(): Widget3; - namespace SpecializedGlobalWidget { - class Widget4 { - name: string; - } - function createWidget4(): Widget4; - } - } - -==== privacyFunctionCannotNameParameterTypeDeclFile_Widgets.d.ts (0 errors) ==== - export declare class Widget1 { - name: string; - } - export declare function createWidget1(): Widget1; - export declare namespace SpecializedWidget { - class Widget2 { - name: string; - } - function createWidget2(): Widget2; - } - -==== privacyFunctionCannotNameParameterTypeDeclFile_exporter.d.ts (0 errors) ==== - import Widgets = require("./privacyFunctionCannotNameParameterTypeDeclFile_Widgets"); - import Widgets1 = require("GlobalWidgets"); - export declare function createExportedWidget1(): Widgets.Widget1; - export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2; - export declare function createExportedWidget3(): Widgets1.Widget3; - export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4; - \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt new file mode 100644 index 0000000000000..308481e5c7286 --- /dev/null +++ b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt @@ -0,0 +1,168 @@ +privacyFunctionReturnTypeDeclFile_GlobalWidgets.ts(7,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionReturnTypeDeclFile_Widgets.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyFunctionReturnTypeDeclFile_consumer.ts (0 errors) ==== + import exporter = require("./privacyFunctionReturnTypeDeclFile_exporter"); + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod() { // Error + return exporter.createExportedWidget1(); + } + private static myPrivateStaticMethod() { + return exporter.createExportedWidget1();; + } + myPublicMethod() { // Error + return exporter.createExportedWidget1();; + } + private myPrivateMethod() { + return exporter.createExportedWidget1();; + } + static myPublicStaticMethod1() { // Error + return exporter.createExportedWidget3(); + } + private static myPrivateStaticMethod1() { + return exporter.createExportedWidget3();; + } + myPublicMethod1() { // Error + return exporter.createExportedWidget3();; + } + private myPrivateMethod1() { + return exporter.createExportedWidget3();; + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod() { + return exporter.createExportedWidget1(); + } + private static myPrivateStaticMethod() { + return exporter.createExportedWidget1();; + } + myPublicMethod() { + return exporter.createExportedWidget1();; + } + private myPrivateMethod() { + return exporter.createExportedWidget1();; + } + static myPublicStaticMethod1() { + return exporter.createExportedWidget3(); + } + private static myPrivateStaticMethod1() { + return exporter.createExportedWidget3();; + } + myPublicMethod1() { + return exporter.createExportedWidget3();; + } + private myPrivateMethod1() { + return exporter.createExportedWidget3();; + } + } + + export function publicFunctionWithPrivateParmeterTypes() { // Error + return exporter.createExportedWidget1(); + } + function privateFunctionWithPrivateParmeterTypes() { + return exporter.createExportedWidget1(); + } + export function publicFunctionWithPrivateParmeterTypes1() { // Error + return exporter.createExportedWidget3(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return exporter.createExportedWidget3(); + } + + export class publicClassWithPrivateModuleReturnTypes { + static myPublicStaticMethod() { // Error + return exporter.createExportedWidget2(); + } + myPublicMethod() { // Error + return exporter.createExportedWidget2(); + } + static myPublicStaticMethod1() { // Error + return exporter.createExportedWidget4(); + } + myPublicMethod1() { // Error + return exporter.createExportedWidget4(); + } + } + export function publicFunctionWithPrivateModuleReturnTypes() { // Error + return exporter.createExportedWidget2(); + } + export function publicFunctionWithPrivateModuleReturnTypes1() { // Error + return exporter.createExportedWidget4(); + } + + class privateClassWithPrivateModuleReturnTypes { + static myPublicStaticMethod() { + return exporter.createExportedWidget2(); + } + myPublicMethod() { + return exporter.createExportedWidget2(); + } + static myPublicStaticMethod1() { // Error + return exporter.createExportedWidget4(); + } + myPublicMethod1() { // Error + return exporter.createExportedWidget4(); + } + } + function privateFunctionWithPrivateModuleReturnTypes() { + return exporter.createExportedWidget2(); + } + function privateFunctionWithPrivateModuleReturnTypes1() { + return exporter.createExportedWidget4(); + } + +==== privacyFunctionReturnTypeDeclFile_GlobalWidgets.ts (1 errors) ==== + declare module "GlobalWidgets" { + export class Widget3 { + name: string; + } + export function createWidget3(): Widget3; + + export module SpecializedGlobalWidget { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget4 { + name: string; + } + function createWidget4(): Widget4; + } + } + +==== privacyFunctionReturnTypeDeclFile_Widgets.ts (1 errors) ==== + export class Widget1 { + name = 'one'; + } + export function createWidget1() { + return new Widget1(); + } + + export module SpecializedWidget { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Widget2 { + name = 'one'; + } + export function createWidget2() { + return new Widget2(); + } + } + +==== privacyFunctionReturnTypeDeclFile_exporter.ts (0 errors) ==== + /// + import Widgets = require("./privacyFunctionReturnTypeDeclFile_Widgets"); + import Widgets1 = require("GlobalWidgets"); + export function createExportedWidget1() { + return Widgets.createWidget1(); + } + export function createExportedWidget2() { + return Widgets.SpecializedWidget.createWidget2(); + } + export function createExportedWidget3() { + return Widgets1.createWidget3(); + } + export function createExportedWidget4() { + return Widgets1.SpecializedGlobalWidget.createWidget4(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js index cf19484879882..621cecf45493d 100644 --- a/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js +++ b/tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.js @@ -406,84 +406,3 @@ export declare class publicClassWithPrivateModuleReturnTypes { } export declare function publicFunctionWithPrivateModuleReturnTypes(): import("./privacyFunctionReturnTypeDeclFile_Widgets").SpecializedWidget.Widget2; export declare function publicFunctionWithPrivateModuleReturnTypes1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - - -//// [DtsFileErrors] - - -privacyFunctionReturnTypeDeclFile_consumer.d.ts(6,44): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionReturnTypeDeclFile_consumer.d.ts(8,31): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionReturnTypeDeclFile_consumer.d.ts(12,75): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionReturnTypeDeclFile_consumer.d.ts(16,44): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionReturnTypeDeclFile_consumer.d.ts(17,31): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. -privacyFunctionReturnTypeDeclFile_consumer.d.ts(20,79): error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - - -==== privacyFunctionReturnTypeDeclFile_consumer.d.ts (6 errors) ==== - export declare class publicClassWithWithPrivateParmeterTypes { - static myPublicStaticMethod(): import("./privacyFunctionReturnTypeDeclFile_Widgets").Widget1; - private static myPrivateStaticMethod; - myPublicMethod(): import("./privacyFunctionReturnTypeDeclFile_Widgets").Widget1; - private myPrivateMethod; - static myPublicStaticMethod1(): import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private static myPrivateStaticMethod1; - myPublicMethod1(): import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - private myPrivateMethod1; - } - export declare function publicFunctionWithPrivateParmeterTypes(): import("./privacyFunctionReturnTypeDeclFile_Widgets").Widget1; - export declare function publicFunctionWithPrivateParmeterTypes1(): import("GlobalWidgets").Widget3; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - export declare class publicClassWithPrivateModuleReturnTypes { - static myPublicStaticMethod(): import("./privacyFunctionReturnTypeDeclFile_Widgets").SpecializedWidget.Widget2; - myPublicMethod(): import("./privacyFunctionReturnTypeDeclFile_Widgets").SpecializedWidget.Widget2; - static myPublicStaticMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - myPublicMethod1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - } - export declare function publicFunctionWithPrivateModuleReturnTypes(): import("./privacyFunctionReturnTypeDeclFile_Widgets").SpecializedWidget.Widget2; - export declare function publicFunctionWithPrivateModuleReturnTypes1(): import("GlobalWidgets").SpecializedGlobalWidget.Widget4; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'GlobalWidgets' or its corresponding type declarations. - -==== privacyFunctionReturnTypeDeclFile_GlobalWidgets.d.ts (0 errors) ==== - declare module "GlobalWidgets" { - class Widget3 { - name: string; - } - function createWidget3(): Widget3; - namespace SpecializedGlobalWidget { - class Widget4 { - name: string; - } - function createWidget4(): Widget4; - } - } - -==== privacyFunctionReturnTypeDeclFile_Widgets.d.ts (0 errors) ==== - export declare class Widget1 { - name: string; - } - export declare function createWidget1(): Widget1; - export declare namespace SpecializedWidget { - class Widget2 { - name: string; - } - function createWidget2(): Widget2; - } - -==== privacyFunctionReturnTypeDeclFile_exporter.d.ts (0 errors) ==== - import Widgets = require("./privacyFunctionReturnTypeDeclFile_Widgets"); - import Widgets1 = require("GlobalWidgets"); - export declare function createExportedWidget1(): Widgets.Widget1; - export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2; - export declare function createExportedWidget3(): Widgets1.Widget3; - export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4; - \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt new file mode 100644 index 0000000000000..afe3f59203d4c --- /dev/null +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt @@ -0,0 +1,698 @@ +privacyFunctionParameterDeclFile_GlobalFile.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionParameterDeclFile_GlobalFile.ts(31,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionParameterDeclFile_externalModule.ts(131,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionParameterDeclFile_externalModule.ts(265,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyFunctionParameterDeclFile_externalModule.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (param: privateClass): publicClass; // Error + (param: privateClass): publicClass; // Error + myMethod(param: privateClass): void; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (param: privateClass): privateClass; + (param: privateClass): privateClass; + myMethod(param: privateClass): void; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { // Error + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { // Error + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error + } + export function publicFunctionWithPublicParmeterTypes(param: publicClass) { + } + function privateFunctionWithPrivateParmeterTypes(param: privateClass) { + } + function privateFunctionWithPublicParmeterTypes(param: publicClass) { + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + declare function privateAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; // Error + (param: privateModule.publicClass): publicClass; // Error + myMethod(param: privateModule.publicClass): void; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + myPublicMethod(param: privateModule.publicClass) { // Error + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + + export interface publicInterfaceWithPrivateParmeterTypes { + new (param: privateClass): publicClass; // Error + (param: privateClass): publicClass; // Error + myMethod(param: privateClass): void; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (param: privateClass): privateClass; + (param: privateClass): privateClass; + myMethod(param: privateClass): void; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { // Error + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { // Error + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error + } + export function publicFunctionWithPublicParmeterTypes(param: publicClass) { + } + function privateFunctionWithPrivateParmeterTypes(param: privateClass) { + } + function privateFunctionWithPublicParmeterTypes(param: publicClass) { + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + declare function privateAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; // Error + (param: privateModule.publicClass): publicClass; // Error + myMethod(param: privateModule.publicClass): void; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + myPublicMethod(param: privateModule.publicClass) { // Error + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (param: privateClass): publicClass; + (param: privateClass): publicClass; + myMethod(param: privateClass): void; + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (param: privateClass): privateClass; + (param: privateClass): privateClass; + myMethod(param: privateClass): void; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { + } + export function publicFunctionWithPublicParmeterTypes(param: publicClass) { + } + function privateFunctionWithPrivateParmeterTypes(param: privateClass) { + } + function privateFunctionWithPublicParmeterTypes(param: publicClass) { + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + declare function privateAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + } + +==== privacyFunctionParameterDeclFile_GlobalFile.ts (2 errors) ==== + class publicClassInGlobal { + } + interface publicInterfaceWithPublicParmeterTypesInGlobal { + new (param: publicClassInGlobal): publicClassInGlobal; + (param: publicClassInGlobal): publicClassInGlobal; + myMethod(param: publicClassInGlobal): void; + } + class publicClassWithWithPublicParmeterTypesInGlobal { + static myPublicStaticMethod(param: publicClassInGlobal) { + } + private static myPrivateStaticMethod(param: publicClassInGlobal) { + } + myPublicMethod(param: publicClassInGlobal) { + } + private myPrivateMethod(param: publicClassInGlobal) { + } + constructor(param: publicClassInGlobal, private param1: publicClassInGlobal, public param2: publicClassInGlobal) { + } + } + function publicFunctionWithPublicParmeterTypesInGlobal(param: publicClassInGlobal) { + } + declare function publicAmbientFunctionWithPublicParmeterTypesInGlobal(param: publicClassInGlobal): void; + + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (param: privateClass): publicClass; + (param: privateClass): publicClass; + myMethod(param: privateClass): void; + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (param: privateClass): privateClass; + (param: privateClass): privateClass; + myMethod(param: privateClass): void; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { + } + export function publicFunctionWithPublicParmeterTypes(param: publicClass) { + } + function privateFunctionWithPrivateParmeterTypes(param: privateClass) { + } + function privateFunctionWithPublicParmeterTypes(param: publicClass) { + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + declare function privateAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (param: privateClass): publicClass; // Error + (param: privateClass): publicClass; // Error + myMethod(param: privateClass): void; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (param: privateClass): privateClass; + (param: privateClass): privateClass; + myMethod(param: privateClass): void; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (param: publicClass): publicClass; + (param: publicClass): publicClass; + myMethod(param: publicClass): void; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { // Error + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { // Error + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(param: privateClass) { + } + private static myPrivateStaticMethod(param: privateClass) { + } + myPublicMethod(param: privateClass) { + } + private myPrivateMethod(param: privateClass) { + } + constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(param: publicClass) { + } + private static myPrivateStaticMethod(param: publicClass) { + } + myPublicMethod(param: publicClass) { + } + private myPrivateMethod(param: publicClass) { + } + constructor(param: publicClass, private param1: publicClass, public param2: publicClass) { + } + } + + export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error + } + export function publicFunctionWithPublicParmeterTypes(param: publicClass) { + } + function privateFunctionWithPrivateParmeterTypes(param: privateClass) { + } + function privateFunctionWithPublicParmeterTypes(param: publicClass) { + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; + declare function privateAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; // Error + (param: privateModule.publicClass): publicClass; // Error + myMethod(param: privateModule.publicClass): void; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { // Error + } + myPublicMethod(param: privateModule.publicClass) { // Error + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error + } + } + export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (param: privateModule.publicClass): publicClass; + (param: privateModule.publicClass): publicClass; + myMethod(param: privateModule.publicClass): void; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(param: privateModule.publicClass) { + } + myPublicMethod(param: privateModule.publicClass) { + } + constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { + } + } + function privateFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt new file mode 100644 index 0000000000000..922dd84679bf4 --- /dev/null +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt @@ -0,0 +1,1205 @@ +privacyFunctionReturnTypeDeclFile_GlobalFile.ts(43,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionReturnTypeDeclFile_GlobalFile.ts(50,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionReturnTypeDeclFile_externalModule.ts(229,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyFunctionReturnTypeDeclFile_externalModule.ts(459,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyFunctionReturnTypeDeclFile_externalModule.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (): privateClass; // Error + (): privateClass; // Error + [x: number]: privateClass; // Error + myMethod(): privateClass; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { // Error + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { // Error + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { // Error + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error + return null; + } + export function publicFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + function privateFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + function privateFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + export function publicFunctionWithPrivateParmeterTypes1() { // Error + return new privateClass(); + } + export function publicFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + function privateFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; + declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; + declare function privateAmbientFunctionWithPublicParmeterTypes(): publicClass; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; // Error + (): privateModule.publicClass; // Error + [x: number]: privateModule.publicClass // Error + myMethod(): privateModule.publicClass; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error + return null; + } + export function publicFunctionWithPrivateModuleParameterTypes1() { // Error + return new privateModule.publicClass(); + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass + myMethod(): privateModule.publicClass; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + function privateFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + function privateFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (): privateClass; // Error + (): privateClass; // Error + [x: number]: privateClass; // Error + myMethod(): privateClass; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { // Error + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { // Error + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { // Error + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error + return null; + } + export function publicFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + function privateFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + function privateFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + export function publicFunctionWithPrivateParmeterTypes1() { // Error + return new privateClass(); + } + export function publicFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + function privateFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; + declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; + declare function privateAmbientFunctionWithPublicParmeterTypes(): publicClass; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; // Error + (): privateModule.publicClass; // Error + [x: number]: privateModule.publicClass; // Error + myMethod(): privateModule.publicClass; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error + return null; + } + export function publicFunctionWithPrivateModuleParameterTypes1() { // Error + return new privateModule.publicClass(); + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + function privateFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + function privateFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + export function publicFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + export function publicFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + function privateFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + function privateFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + export function publicFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + export function publicFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + function privateFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; + export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; + declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; + declare function privateAmbientFunctionWithPublicParmeterTypes(): publicClass; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + export function publicFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + function privateFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + function privateFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + } + +==== privacyFunctionReturnTypeDeclFile_GlobalFile.ts (2 errors) ==== + class publicClassInGlobal { + } + interface publicInterfaceWithPublicParmeterTypesInGlobal { + new (): publicClassInGlobal; + (): publicClassInGlobal; + [x: number]: publicClassInGlobal; + myMethod(): publicClassInGlobal; + } + class publicClassWithWithPublicParmeterTypesInGlobal { + static myPublicStaticMethod(): publicClassInGlobal { + return null; + } + private static myPrivateStaticMethod(): publicClassInGlobal { + return null; + } + myPublicMethod(): publicClassInGlobal { + return null; + } + private myPrivateMethod(): publicClassInGlobal { + return null; + } + static myPublicStaticMethod1() { + return new publicClassInGlobal(); + } + private static myPrivateStaticMethod1() { + return new publicClassInGlobal(); + } + myPublicMethod1() { + return new publicClassInGlobal(); + } + private myPrivateMethod1() { + return new publicClassInGlobal(); + } + } + function publicFunctionWithPublicParmeterTypesInGlobal(): publicClassInGlobal { + return null; + } + function publicFunctionWithPublicParmeterTypesInGlobal1() { + return new publicClassInGlobal(); + } + declare function publicAmbientFunctionWithPublicParmeterTypesInGlobal(): publicClassInGlobal; + + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + export function publicFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + export function publicFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + function privateFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + function privateFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + export function publicFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + export function publicFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + function privateFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; + export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; + declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; + declare function privateAmbientFunctionWithPublicParmeterTypes(): publicClass; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + export function publicFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + function privateFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + function privateFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + } + + export interface publicInterfaceWithPrivateParmeterTypes { + new (): privateClass; // Error + (): privateClass; // Error + [x: number]: privateClass; // Error + myMethod(): privateClass; // Error + } + + export interface publicInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateParmeterTypes { + new (): privateClass; + (): privateClass; + [x: number]: privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicParmeterTypes { + new (): publicClass; + (): publicClass; + [x: number]: publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { // Error + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { // Error + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { // Error + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { // Error + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + export class publicClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + class privateClassWithWithPrivateParmeterTypes { + static myPublicStaticMethod(): privateClass { + return null; + } + private static myPrivateStaticMethod(): privateClass { + return null; + } + myPublicMethod(): privateClass { + return null; + } + private myPrivateMethod(): privateClass { + return null; + } + static myPublicStaticMethod1() { + return new privateClass(); + } + private static myPrivateStaticMethod1() { + return new privateClass(); + } + myPublicMethod1() { + return new privateClass(); + } + private myPrivateMethod1() { + return new privateClass(); + } + } + + class privateClassWithWithPublicParmeterTypes { + static myPublicStaticMethod(): publicClass { + return null; + } + private static myPrivateStaticMethod(): publicClass { + return null; + } + myPublicMethod(): publicClass { + return null; + } + private myPrivateMethod(): publicClass { + return null; + } + static myPublicStaticMethod1() { + return new publicClass(); + } + private static myPrivateStaticMethod1() { + return new publicClass(); + } + myPublicMethod1() { + return new publicClass(); + } + private myPrivateMethod1() { + return new publicClass(); + } + } + + export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error + return null; + } + export function publicFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + function privateFunctionWithPrivateParmeterTypes(): privateClass { + return null; + } + function privateFunctionWithPublicParmeterTypes(): publicClass { + return null; + } + export function publicFunctionWithPrivateParmeterTypes1() { // Error + return new privateClass(); + } + export function publicFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + function privateFunctionWithPrivateParmeterTypes1() { + return new privateClass(); + } + function privateFunctionWithPublicParmeterTypes1() { + return new publicClass(); + } + + export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error + export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; + declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; + declare function privateAmbientFunctionWithPublicParmeterTypes(): publicClass; + + export interface publicInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; // Error + (): privateModule.publicClass; // Error + [x: number]: privateModule.publicClass; // Error + myMethod(): privateModule.publicClass; // Error + } + export class publicClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { // Error + return null; + } + myPublicMethod(): privateModule.publicClass { // Error + return null; + } + static myPublicStaticMethod1() { // Error + return new privateModule.publicClass(); + } + myPublicMethod1() { // Error + return new privateModule.publicClass(); + } + } + export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error + return null; + } + export function publicFunctionWithPrivateModuleParameterTypes1() { // Error + return new privateModule.publicClass(); + } + export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModuleParameterTypes { + new (): privateModule.publicClass; + (): privateModule.publicClass; + [x: number]: privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithPrivateModuleParameterTypes { + static myPublicStaticMethod(): privateModule.publicClass { + return null; + } + myPublicMethod(): privateModule.publicClass { + return null; + } + static myPublicStaticMethod1() { + return new privateModule.publicClass(); + } + myPublicMethod1() { + return new privateModule.publicClass(); + } + } + function privateFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { + return null; + } + function privateFunctionWithPrivateModuleParameterTypes1() { + return new privateModule.publicClass(); + } + declare function privateAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGetter.errors.txt b/tests/baselines/reference/privacyGetter.errors.txt new file mode 100644 index 0000000000000..55542505ff971 --- /dev/null +++ b/tests/baselines/reference/privacyGetter.errors.txt @@ -0,0 +1,216 @@ +privacyGetter.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGetter.ts(71,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGetter.ts (2 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private get p1_private() { + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + } + + private get p2_private() { + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + } + + private get p3_private() { + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + } + + public get p4_public(): C2_private { // error + return new C2_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C2_private) { // error + } + } + + class C4_private { + private get p1_private() { + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + } + + private get p2_private() { + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + } + + private get p3_private() { + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + } + + public get p4_public(): C2_private { + return new C2_private(); + } + + public set p4_public(m1_c3_p4_arg: C2_private) { + } + } + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m2_C1_public { + private f1() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + private get p1_private() { + return new m2_C1_public(); + } + + private set p1_private(m2_c3_p1_arg: m2_C1_public) { + } + + private get p2_private() { + return new m2_C1_public(); + } + + private set p2_private(m2_c3_p2_arg: m2_C1_public) { + } + + private get p3_private() { + return new m2_C2_private(); + } + + private set p3_private(m2_c3_p3_arg: m2_C2_private) { + } + + public get p4_public(): m2_C2_private { + return new m2_C2_private(); + } + + public set p4_public(m2_c3_p4_arg: m2_C2_private) { + } + } + + class m2_C4_private { + private get p1_private() { + return new m2_C1_public(); + } + + private set p1_private(m2_c3_p1_arg: m2_C1_public) { + } + + private get p2_private() { + return new m2_C1_public(); + } + + private set p2_private(m2_c3_p2_arg: m2_C1_public) { + } + + private get p3_private() { + return new m2_C2_private(); + } + + private set p3_private(m2_c3_p3_arg: m2_C2_private) { + } + + public get p4_public(): m2_C2_private { + return new m2_C2_private(); + } + + public set p4_public(m2_c3_p4_arg: m2_C2_private) { + } + } + } + + class C5_private { + private f() { + } + } + + export class C6_public { + } + + export class C7_public { + private get p1_private() { + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + } + + private get p2_private() { + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + } + + private get p3_private() { + return new C5_private(); + } + + private set p3_private(m1_c3_p3_arg: C5_private) { + } + + public get p4_public(): C5_private { // error + return new C5_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C5_private) { // error + } + } + + class C8_private { + private get p1_private() { + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + } + + private get p2_private() { + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + } + + private get p3_private() { + return new C5_private(); + } + + private set p3_private(m1_c3_p3_arg: C5_private) { + } + + public get p4_public(): C5_private { + return new C5_private(); + } + + public set p4_public(m1_c3_p4_arg: C5_private) { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloClass.errors.txt b/tests/baselines/reference/privacyGloClass.errors.txt new file mode 100644 index 0000000000000..6c5eda4e07abe --- /dev/null +++ b/tests/baselines/reference/privacyGloClass.errors.txt @@ -0,0 +1,66 @@ +privacyGloClass.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloClass.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m1_i_public { + } + + interface m1_i_private { + } + + export class m1_c_public { + private f1() { + } + } + + class m1_c_private { + } + + class m1_C1_private extends m1_c_public { + } + class m1_C2_private extends m1_c_private { + } + export class m1_C3_public extends m1_c_public { + } + export class m1_C4_public extends m1_c_private { + } + + class m1_C5_private implements m1_i_public { + } + class m1_C6_private implements m1_i_private { + } + export class m1_C7_public implements m1_i_public { + } + export class m1_C8_public implements m1_i_private { + } + + class m1_C9_private extends m1_c_public implements m1_i_private, m1_i_public { + } + class m1_C10_private extends m1_c_private implements m1_i_private, m1_i_public { + } + export class m1_C11_public extends m1_c_public implements m1_i_private, m1_i_public { + } + export class m1_C12_public extends m1_c_private implements m1_i_private, m1_i_public { + } + } + + interface glo_i_public { + } + + class glo_c_public { + private f1() { + } + } + + class glo_C3_public extends glo_c_public { + } + + class glo_C7_public implements glo_i_public { + } + + class glo_C11_public extends glo_c_public implements glo_i_public { + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloFunc.errors.txt b/tests/baselines/reference/privacyGloFunc.errors.txt new file mode 100644 index 0000000000000..51a5cd87757e3 --- /dev/null +++ b/tests/baselines/reference/privacyGloFunc.errors.txt @@ -0,0 +1,539 @@ +privacyGloFunc.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloFunc.ts(179,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloFunc.ts (2 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + constructor (m1_c3_c1: C1_public); + constructor (m1_c3_c2: C2_private); //error + constructor (m1_c3_c1_2: any) { + } + + private f1_private(m1_c3_f1_arg: C1_public) { + } + + public f2_public(m1_c3_f2_arg: C1_public) { + } + + private f3_private(m1_c3_f3_arg: C2_private) { + } + + public f4_public(m1_c3_f4_arg: C2_private) { // error + } + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); // error + } + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + class C4_private { + constructor (m1_c4_c1: C1_public); + constructor (m1_c4_c2: C2_private); + constructor (m1_c4_c1_2: any) { + } + private f1_private(m1_c4_f1_arg: C1_public) { + } + + public f2_public(m1_c4_f2_arg: C1_public) { + } + + private f3_private(m1_c4_f3_arg: C2_private) { + } + + public f4_public(m1_c4_f4_arg: C2_private) { + } + + + private f5_private() { + return new C1_public(); + } + + public f6_public() { + return new C1_public(); + } + + private f7_private() { + return new C2_private(); + } + + public f8_public() { + return new C2_private(); + } + + + private f9_private(): C1_public { + return new C1_public(); + } + + public f10_public(): C1_public { + return new C1_public(); + } + + private f11_private(): C2_private { + return new C2_private(); + } + + public f12_public(): C2_private { + return new C2_private(); + } + } + + export class C5_public { + constructor (m1_c5_c: C1_public) { + } + } + + class C6_private { + constructor (m1_c6_c: C1_public) { + } + } + export class C7_public { + constructor (m1_c7_c: C2_private) { // error + } + } + + class C8_private { + constructor (m1_c8_c: C2_private) { + } + } + + function f1_public(m1_f1_arg: C1_public) { + } + + export function f2_public(m1_f2_arg: C1_public) { + } + + function f3_public(m1_f3_arg: C2_private) { + } + + export function f4_public(m1_f4_arg: C2_private) { // error + } + + + function f5_public() { + return new C1_public(); + } + + export function f6_public() { + return new C1_public(); + } + + function f7_public() { + return new C2_private(); + } + + export function f8_public() { + return new C2_private(); // error + } + + + function f9_private(): C1_public { + return new C1_public(); + } + + export function f10_public(): C1_public { + return new C1_public(); + } + + function f11_private(): C2_private { + return new C2_private(); + } + + export function f12_public(): C2_private { // error + return new C2_private(); //error + } + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m2_C1_public { + private f() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + constructor (m2_c3_c1: m2_C1_public); + constructor (m2_c3_c2: m2_C2_private); + constructor (m2_c3_c1_2: any) { + } + + private f1_private(m2_c3_f1_arg: m2_C1_public) { + } + + public f2_public(m2_c3_f2_arg: m2_C1_public) { + } + + private f3_private(m2_c3_f3_arg: m2_C2_private) { + } + + public f4_public(m2_c3_f4_arg: m2_C2_private) { + } + + private f5_private() { + return new m2_C1_public(); + } + + public f6_public() { + return new m2_C1_public(); + } + + private f7_private() { + return new m2_C2_private(); + } + + public f8_public() { + return new m2_C2_private(); + } + + private f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + public f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + private f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + public f12_public(): m2_C2_private { + return new m2_C2_private(); + } + } + + class m2_C4_private { + constructor (m2_c4_c1: m2_C1_public); + constructor (m2_c4_c2: m2_C2_private); + constructor (m2_c4_c1_2: any) { + } + + private f1_private(m2_c4_f1_arg: m2_C1_public) { + } + + public f2_public(m2_c4_f2_arg: m2_C1_public) { + } + + private f3_private(m2_c4_f3_arg: m2_C2_private) { + } + + public f4_public(m2_c4_f4_arg: m2_C2_private) { + } + + + private f5_private() { + return new m2_C1_public(); + } + + public f6_public() { + return new m2_C1_public(); + } + + private f7_private() { + return new m2_C2_private(); + } + + public f8_public() { + return new m2_C2_private(); + } + + + private f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + public f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + private f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + public f12_public(): m2_C2_private { + return new m2_C2_private(); + } + } + + export class m2_C5_public { + constructor (m2_c5_c: m2_C1_public) { + } + } + + class m2_C6_private { + constructor (m2_c6_c: m2_C1_public) { + } + } + export class m2_C7_public { + constructor (m2_c7_c: m2_C2_private) { + } + } + + class m2_C8_private { + constructor (m2_c8_c: m2_C2_private) { + } + } + + function f1_public(m2_f1_arg: m2_C1_public) { + } + + export function f2_public(m2_f2_arg: m2_C1_public) { + } + + function f3_public(m2_f3_arg: m2_C2_private) { + } + + export function f4_public(m2_f4_arg: m2_C2_private) { + } + + + function f5_public() { + return new m2_C1_public(); + } + + export function f6_public() { + return new m2_C1_public(); + } + + function f7_public() { + return new m2_C2_private(); + } + + export function f8_public() { + return new m2_C2_private(); + } + + + function f9_private(): m2_C1_public { + return new m2_C1_public(); + } + + export function f10_public(): m2_C1_public { + return new m2_C1_public(); + } + + function f11_private(): m2_C2_private { + return new m2_C2_private(); + } + + export function f12_public(): m2_C2_private { + return new m2_C2_private(); + } + } + + class C5_private { + private f() { + } + } + + export class C6_public { + } + + export class C7_public { + constructor (c7_c1: C5_private); // error + constructor (c7_c2: C6_public); + constructor (c7_c1_2: any) { + } + private f1_private(c7_f1_arg: C6_public) { + } + + public f2_public(c7_f2_arg: C6_public) { + } + + private f3_private(c7_f3_arg: C5_private) { + } + + public f4_public(c7_f4_arg: C5_private) { //error + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f7_private() { + return new C5_private(); + } + + public f8_public() { + return new C5_private(); //error + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } + + private f11_private(): C5_private { + return new C5_private(); + } + + public f12_public(): C5_private { //error + return new C5_private(); //error + } + } + + class C8_private { + constructor (c8_c1: C5_private); + constructor (c8_c2: C6_public); + constructor (c8_c1_2: any) { + } + + private f1_private(c8_f1_arg: C6_public) { + } + + public f2_public(c8_f2_arg: C6_public) { + } + + private f3_private(c8_f3_arg: C5_private) { + } + + public f4_public(c8_f4_arg: C5_private) { + } + + private f5_private() { + return new C6_public(); + } + + public f6_public() { + return new C6_public(); + } + + private f7_private() { + return new C5_private(); + } + + public f8_public() { + return new C5_private(); + } + + private f9_private(): C6_public { + return new C6_public(); + } + + public f10_public(): C6_public { + return new C6_public(); + } + + private f11_private(): C5_private { + return new C5_private(); + } + + public f12_public(): C5_private { + return new C5_private(); + } + } + + + export class C9_public { + constructor (c9_c: C6_public) { + } + } + + class C10_private { + constructor (c10_c: C6_public) { + } + } + export class C11_public { + constructor (c11_c: C5_private) { // error + } + } + + class C12_private { + constructor (c12_c: C5_private) { + } + } + + function f1_private(f1_arg: C5_private) { + } + + export function f2_public(f2_arg: C5_private) { // error + } + + function f3_private(f3_arg: C6_public) { + } + + export function f4_public(f4_arg: C6_public) { + } + + function f5_private() { + return new C6_public(); + } + + export function f6_public() { + return new C6_public(); + } + + function f7_private() { + return new C5_private(); + } + + export function f8_public() { + return new C5_private(); //error + } + + function f9_private(): C6_public { + return new C6_public(); + } + + export function f10_public(): C6_public { + return new C6_public(); + } + + function f11_private(): C5_private { + return new C5_private(); + } + + export function f12_public(): C5_private { //error + return new C5_private(); //error + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloFunc.types b/tests/baselines/reference/privacyGloFunc.types index 46a8ca6c38256..720918c8accf4 100644 --- a/tests/baselines/reference/privacyGloFunc.types +++ b/tests/baselines/reference/privacyGloFunc.types @@ -34,6 +34,7 @@ export module m1 { constructor (m1_c3_c1_2: any) { >m1_c3_c1_2 : any +> : ^^^ } private f1_private(m1_c3_f1_arg: C1_public) { @@ -167,6 +168,7 @@ export module m1 { constructor (m1_c4_c1_2: any) { >m1_c4_c1_2 : any +> : ^^^ } private f1_private(m1_c4_f1_arg: C1_public) { >f1_private : (m1_c4_f1_arg: C1_public) => void @@ -478,6 +480,7 @@ module m2 { constructor (m2_c3_c1_2: any) { >m2_c3_c1_2 : any +> : ^^^ } private f1_private(m2_c3_f1_arg: m2_C1_public) { @@ -611,6 +614,7 @@ module m2 { constructor (m2_c4_c1_2: any) { >m2_c4_c1_2 : any +> : ^^^ } private f1_private(m2_c4_f1_arg: m2_C1_public) { @@ -919,6 +923,7 @@ export class C7_public { constructor (c7_c1_2: any) { >c7_c1_2 : any +> : ^^^ } private f1_private(c7_f1_arg: C6_public) { >f1_private : (c7_f1_arg: C6_public) => void @@ -1051,6 +1056,7 @@ class C8_private { constructor (c8_c1_2: any) { >c8_c1_2 : any +> : ^^^ } private f1_private(c8_f1_arg: C6_public) { diff --git a/tests/baselines/reference/privacyGloGetter.errors.txt b/tests/baselines/reference/privacyGloGetter.errors.txt new file mode 100644 index 0000000000000..6217f865062d1 --- /dev/null +++ b/tests/baselines/reference/privacyGloGetter.errors.txt @@ -0,0 +1,94 @@ +privacyGloGetter.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloGetter.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private get p1_private() { + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + } + + private get p2_private() { + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + } + + private get p3_private() { + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + } + + public get p4_public(): C2_private { // error + return new C2_private(); //error + } + + public set p4_public(m1_c3_p4_arg: C2_private) { // error + } + } + + class C4_private { + private get p1_private() { + return new C1_public(); + } + + private set p1_private(m1_c3_p1_arg: C1_public) { + } + + private get p2_private() { + return new C1_public(); + } + + private set p2_private(m1_c3_p2_arg: C1_public) { + } + + private get p3_private() { + return new C2_private(); + } + + private set p3_private(m1_c3_p3_arg: C2_private) { + } + + public get p4_public(): C2_private { + return new C2_private(); + } + + public set p4_public(m1_c3_p4_arg: C2_private) { + } + } + } + + class C6_public { + } + + class C7_public { + private get p1_private() { + return new C6_public(); + } + + private set p1_private(m1_c3_p1_arg: C6_public) { + } + + private get p2_private() { + return new C6_public(); + } + + private set p2_private(m1_c3_p2_arg: C6_public) { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloImport.errors.txt b/tests/baselines/reference/privacyGloImport.errors.txt new file mode 100644 index 0000000000000..0c798d2cd39eb --- /dev/null +++ b/tests/baselines/reference/privacyGloImport.errors.txt @@ -0,0 +1,185 @@ +privacyGloImport.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(120,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(124,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(132,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(137,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(145,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImport.ts(147,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloImport.ts (10 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m1_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m1_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + //export declare module "m1_M3_public" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + //declare module "m1_M4_private" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + import m1_im1_private = m1_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m1_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + //import m1_im3_private = require("m1_M3_public"); + //export var m1_im3_private_v1_public = m1_im3_private.c1; + //export var m1_im3_private_v2_public = new m1_im3_private.c1(); + //export var m1_im3_private_v3_public = m1_im3_private.f1; + //export var m1_im3_private_v4_public = m1_im3_private.f1(); + //var m1_im3_private_v1_private = m1_im3_private.c1; + //var m1_im3_private_v2_private = new m1_im3_private.c1(); + //var m1_im3_private_v3_private = m1_im3_private.f1; + //var m1_im3_private_v4_private = m1_im3_private.f1(); + + //import m1_im4_private = require("m1_M4_private"); + //export var m1_im4_private_v1_public = m1_im4_private.c1; + //export var m1_im4_private_v2_public = new m1_im4_private.c1(); + //export var m1_im4_private_v3_public = m1_im4_private.f1; + //export var m1_im4_private_v4_public = m1_im4_private.f1(); + //var m1_im4_private_v1_private = m1_im4_private.c1; + //var m1_im4_private_v2_private = new m1_im4_private.c1(); + //var m1_im4_private_v3_private = m1_im4_private.f1; + //var m1_im4_private_v4_private = m1_im4_private.f1(); + + export import m1_im1_public = m1_M1_public; + export import m1_im2_public = m1_M2_private; + //export import m1_im3_public = require("m1_M3_public"); + //export import m1_im4_public = require("m1_M4_private"); + } + + module glo_M1_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + declare module "glo_M2_public" { + export function f1(); + export class c1 { + } + export var v1: { new (): c1; }; + export var v2: c1; + } + + declare module "use_glo_M1_public" { + import use_glo_M1_public = glo_M1_public; + export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; + export var use_glo_M1_public_v2_public: typeof use_glo_M1_public; + export var use_glo_M1_public_v3_public: ()=> use_glo_M1_public.c1; + var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; }; + var use_glo_M1_public_v2_private: typeof use_glo_M1_public; + var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; + + import use_glo_M2_public = require("glo_M2_public"); + export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; + export var use_glo_M2_public_v2_public: typeof use_glo_M2_public; + export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; + var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; }; + var use_glo_M2_public_v2_private: typeof use_glo_M2_public; + var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import errorImport = require("glo_M2_public"); + import nonerrorImport = glo_M1_public; + + module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import m5_errorImport = require("glo_M2_public"); + import m5_nonerrorImport = glo_M1_public; + } + } + } + + declare module "anotherParseError" { + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //declare module "abc" { + //} + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //module "abc2" { + //} + } + //module "abc3" { + //} + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import m3 = require("use_glo_M1_public"); + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a = 10; + //import m2 = require("use_glo_M1_public"); + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index 358f2ba95a5f6..5b03efd916352 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,3 +1,6 @@ +privacyGloImportParseErrors.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImportParseErrors.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImportParseErrors.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(22,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -7,18 +10,29 @@ privacyGloImportParseErrors.ts(69,37): error TS1147: Import declarations in a na privacyGloImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private' or its corresponding type declarations. privacyGloImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. privacyGloImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. +privacyGloImportParseErrors.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloImportParseErrors.ts(120,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in a namespace cannot reference a module. +privacyGloImportParseErrors.ts(124,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(125,45): error TS1147: Import declarations in a namespace cannot reference a module. +privacyGloImportParseErrors.ts(132,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +privacyGloImportParseErrors.ts(137,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +privacyGloImportParseErrors.ts(145,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in a namespace cannot reference a module. +privacyGloImportParseErrors.ts(147,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a namespace cannot reference a module. -==== privacyGloImportParseErrors.ts (16 errors) ==== +==== privacyGloImportParseErrors.ts (26 errors) ==== module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m1_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -29,6 +43,8 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n } module m1_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -120,6 +136,8 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n } module glo_M1_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -155,12 +173,16 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M1_public; module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m5_errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. @@ -171,6 +193,8 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n declare module "anotherParseError" { module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -180,6 +204,8 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module "abc2" { ~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -190,10 +216,14 @@ privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a n } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/privacyGloInterface.errors.txt b/tests/baselines/reference/privacyGloInterface.errors.txt new file mode 100644 index 0000000000000..d842ad0905c1f --- /dev/null +++ b/tests/baselines/reference/privacyGloInterface.errors.txt @@ -0,0 +1,128 @@ +privacyGloInterface.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyGloInterface.ts(89,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloInterface.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + } + + class C5_public { + private f1() { + } + } + + + interface C7_public { + (c1: C5_public); + (): C5_public; + + new (c1: C5_public); + new (): C5_public; + + [c: number]: C5_public; + + x: C5_public; + + a?: C5_public; + + f1(a1: C5_public); + f3(): C5_public; + } + + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m3_i_public { + f1(): number; + } + + interface m3_i_private { + f2(): string; + } + + interface m3_C1_private extends m3_i_public { + } + interface m3_C2_private extends m3_i_private { + } + export interface m3_C3_public extends m3_i_public { + } + export interface m3_C4_public extends m3_i_private { + } + + interface m3_C5_private extends m3_i_private, m3_i_public { + } + export interface m3_C6_public extends m3_i_private, m3_i_public { + } + } + + interface glo_i_public { + f1(): number; + } + + interface glo_C3_public extends glo_i_public { + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyGloVar.errors.txt b/tests/baselines/reference/privacyGloVar.errors.txt new file mode 100644 index 0000000000000..3e39db8339f1e --- /dev/null +++ b/tests/baselines/reference/privacyGloVar.errors.txt @@ -0,0 +1,86 @@ +privacyGloVar.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyGloVar.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private C3_v1_private: C1_public; + public C3_v2_public: C1_public; + private C3_v3_private: C2_private; + public C3_v4_public: C2_private; // error + + private C3_v11_private = new C1_public(); + public C3_v12_public = new C1_public(); + private C3_v13_private = new C2_private(); + public C3_v14_public = new C2_private(); // error + + private C3_v21_private: C1_public = new C1_public(); + public C3_v22_public: C1_public = new C1_public(); + private C3_v23_private: C2_private = new C2_private(); + public C3_v24_public: C2_private = new C2_private(); // error + } + + class C4_public { + private C4_v1_private: C1_public; + public C4_v2_public: C1_public; + private C4_v3_private: C2_private; + public C4_v4_public: C2_private; + + private C4_v11_private = new C1_public(); + public C4_v12_public = new C1_public(); + private C4_v13_private = new C2_private(); + public C4_v14_public = new C2_private(); + + private C4_v21_private: C1_public = new C1_public(); + public C4_v22_public: C1_public = new C1_public(); + private C4_v23_private: C2_private = new C2_private(); + public C4_v24_public: C2_private = new C2_private(); + } + + var m1_v1_private: C1_public; + export var m1_v2_public: C1_public; + var m1_v3_private: C2_private; + export var m1_v4_public: C2_private; // error + + var m1_v11_private = new C1_public(); + export var m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + export var m1_v14_public = new C2_private(); //error + + var m1_v21_private: C1_public = new C1_public(); + export var m1_v22_public: C1_public = new C1_public(); + var m1_v23_private: C2_private = new C2_private(); + export var m1_v24_public: C2_private = new C2_private(); // error + } + + class glo_C1_public { + private f1() { + } + } + + class glo_C3_public { + private glo_C3_v1_private: glo_C1_public; + public glo_C3_v2_public: glo_C1_public; + + private glo_C3_v11_private = new glo_C1_public(); + public glo_C3_v12_public = new glo_C1_public(); + + private glo_C3_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C3_v22_public: glo_C1_public = new glo_C1_public(); + } + + + var glo_v2_public: glo_C1_public; + var glo_v12_public = new glo_C1_public(); + var glo_v22_public: glo_C1_public = new glo_C1_public(); + \ No newline at end of file diff --git a/tests/baselines/reference/privacyImport.errors.txt b/tests/baselines/reference/privacyImport.errors.txt new file mode 100644 index 0000000000000..a35c0e6048e7b --- /dev/null +++ b/tests/baselines/reference/privacyImport.errors.txt @@ -0,0 +1,395 @@ +privacyImport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(86,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(96,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(170,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(188,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(340,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(342,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(349,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImport.ts(351,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyImport.ts (12 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m1_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m1_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + //export declare module "m1_M3_public" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + //declare module "m1_M4_private" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + import m1_im1_private = m1_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m1_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + //import m1_im3_private = require("m1_M3_public"); + //export var m1_im3_private_v1_public = m1_im3_private.c1; + //export var m1_im3_private_v2_public = new m1_im3_private.c1(); + //export var m1_im3_private_v3_public = m1_im3_private.f1; + //export var m1_im3_private_v4_public = m1_im3_private.f1(); + //var m1_im3_private_v1_private = m1_im3_private.c1; + //var m1_im3_private_v2_private = new m1_im3_private.c1(); + //var m1_im3_private_v3_private = m1_im3_private.f1; + //var m1_im3_private_v4_private = m1_im3_private.f1(); + + //import m1_im4_private = require("m1_M4_private"); + //export var m1_im4_private_v1_public = m1_im4_private.c1; + //export var m1_im4_private_v2_public = new m1_im4_private.c1(); + //export var m1_im4_private_v3_public = m1_im4_private.f1; + //export var m1_im4_private_v4_public = m1_im4_private.f1(); + //var m1_im4_private_v1_private = m1_im4_private.c1; + //var m1_im4_private_v2_private = new m1_im4_private.c1(); + //var m1_im4_private_v3_private = m1_im4_private.f1; + //var m1_im4_private_v4_private = m1_im4_private.f1(); + + export import m1_im1_public = m1_M1_public; + export import m1_im2_public = m1_M2_private; + //export import m1_im3_public = require("m1_M3_public"); + //export import m1_im4_public = require("m1_M4_private"); + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module m2_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + module m2_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + //export declare module "m2_M3_public" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + //declare module "m2_M4_private" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + import m1_im1_private = m2_M1_public; + export var m1_im1_private_v1_public = m1_im1_private.c1; + export var m1_im1_private_v2_public = new m1_im1_private.c1(); + export var m1_im1_private_v3_public = m1_im1_private.f1; + export var m1_im1_private_v4_public = m1_im1_private.f1(); + var m1_im1_private_v1_private = m1_im1_private.c1; + var m1_im1_private_v2_private = new m1_im1_private.c1(); + var m1_im1_private_v3_private = m1_im1_private.f1; + var m1_im1_private_v4_private = m1_im1_private.f1(); + + + import m1_im2_private = m2_M2_private; + export var m1_im2_private_v1_public = m1_im2_private.c1; + export var m1_im2_private_v2_public = new m1_im2_private.c1(); + export var m1_im2_private_v3_public = m1_im2_private.f1; + export var m1_im2_private_v4_public = m1_im2_private.f1(); + var m1_im2_private_v1_private = m1_im2_private.c1; + var m1_im2_private_v2_private = new m1_im2_private.c1(); + var m1_im2_private_v3_private = m1_im2_private.f1; + var m1_im2_private_v4_private = m1_im2_private.f1(); + + //import m1_im3_private = require("m2_M3_public"); + //export var m1_im3_private_v1_public = m1_im3_private.c1; + //export var m1_im3_private_v2_public = new m1_im3_private.c1(); + //export var m1_im3_private_v3_public = m1_im3_private.f1; + //export var m1_im3_private_v4_public = m1_im3_private.f1(); + //var m1_im3_private_v1_private = m1_im3_private.c1; + //var m1_im3_private_v2_private = new m1_im3_private.c1(); + //var m1_im3_private_v3_private = m1_im3_private.f1; + //var m1_im3_private_v4_private = m1_im3_private.f1(); + + //import m1_im4_private = require("m2_M4_private"); + //export var m1_im4_private_v1_public = m1_im4_private.c1; + //export var m1_im4_private_v2_public = new m1_im4_private.c1(); + //export var m1_im4_private_v3_public = m1_im4_private.f1; + //export var m1_im4_private_v4_public = m1_im4_private.f1(); + //var m1_im4_private_v1_private = m1_im4_private.c1; + //var m1_im4_private_v2_private = new m1_im4_private.c1(); + //var m1_im4_private_v3_private = m1_im4_private.f1; + //var m1_im4_private_v4_private = m1_im4_private.f1(); + + // Parse error to export module + export import m1_im1_public = m2_M1_public; + export import m1_im2_public = m2_M2_private; + //export import m1_im3_public = require("m2_M3_public"); + //export import m1_im4_public = require("m2_M4_private"); + } + + export module glo_M1_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + //export declare module "glo_M2_public" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + export module glo_M3_private { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + export function f1() { + return new c1; + } + export var v1 = c1; + export var v2: c1; + } + + //export declare module "glo_M4_private" { + // export function f1(); + // export class c1 { + // } + // export var v1: { new (): c1; }; + // export var v2: c1; + //} + + + import glo_im1_private = glo_M1_public; + export var glo_im1_private_v1_public = glo_im1_private.c1; + export var glo_im1_private_v2_public = new glo_im1_private.c1(); + export var glo_im1_private_v3_public = glo_im1_private.f1; + export var glo_im1_private_v4_public = glo_im1_private.f1(); + var glo_im1_private_v1_private = glo_im1_private.c1; + var glo_im1_private_v2_private = new glo_im1_private.c1(); + var glo_im1_private_v3_private = glo_im1_private.f1; + var glo_im1_private_v4_private = glo_im1_private.f1(); + + + //import glo_im2_private = require("glo_M2_public"); + //export var glo_im2_private_v1_public = glo_im2_private.c1; + //export var glo_im2_private_v2_public = new glo_im2_private.c1(); + //export var glo_im2_private_v3_public = glo_im2_private.f1; + //export var glo_im2_private_v4_public = glo_im2_private.f1(); + //var glo_im2_private_v1_private = glo_im2_private.c1; + //var glo_im2_private_v2_private = new glo_im2_private.c1(); + //var glo_im2_private_v3_private = glo_im2_private.f1; + //var glo_im2_private_v4_private = glo_im2_private.f1(); + + import glo_im3_private = glo_M3_private; + export var glo_im3_private_v1_public = glo_im3_private.c1; + export var glo_im3_private_v2_public = new glo_im3_private.c1(); + export var glo_im3_private_v3_public = glo_im3_private.f1; + export var glo_im3_private_v4_public = glo_im3_private.f1(); + var glo_im3_private_v1_private = glo_im3_private.c1; + var glo_im3_private_v2_private = new glo_im3_private.c1(); + var glo_im3_private_v3_private = glo_im3_private.f1; + var glo_im3_private_v4_private = glo_im3_private.f1(); + + //import glo_im4_private = require("glo_M4_private"); + //export var glo_im4_private_v1_public = glo_im4_private.c1; + //export var glo_im4_private_v2_public = new glo_im4_private.c1(); + //export var glo_im4_private_v3_public = glo_im4_private.f1; + //export var glo_im4_private_v4_public = glo_im4_private.f1(); + //var glo_im4_private_v1_private = glo_im4_private.c1; + //var glo_im4_private_v2_private = new glo_im4_private.c1(); + //var glo_im4_private_v3_private = glo_im4_private.f1; + //var glo_im4_private_v4_private = glo_im4_private.f1(); + + // Parse error to export module + export import glo_im1_public = glo_M1_public; + export import glo_im2_public = glo_M3_private; + //export import glo_im3_public = require("glo_M2_public"); + //export import glo_im4_public = require("glo_M4_private"); + + + //export declare module "use_glo_M1_public" { + // import use_glo_M1_public = glo_M1_public; + // export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; + // export var use_glo_M1_public_v2_public: use_glo_M1_public; + // export var use_glo_M1_public_v3_public: () => use_glo_M1_public.c1; + // var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; }; + // var use_glo_M1_public_v2_private: use_glo_M1_public; + // var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1; + + // import use_glo_M2_public = require("glo_M2_public"); + // export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; }; + // export var use_glo_M2_public_v2_public: use_glo_M2_public; + // export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1; + // var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; }; + // var use_glo_M2_public_v2_private: use_glo_M2_public; + // var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; + + // module m2 { + // import errorImport = require("glo_M2_public"); + // import nonerrorImport = glo_M1_public; + + // module m5 { + // import m5_errorImport = require("glo_M2_public"); + // import m5_nonerrorImport = glo_M1_public; + // } + // } + //} + + + //declare module "use_glo_M3_private" { + // import use_glo_M3_private = glo_M3_private; + // export var use_glo_M3_private_v1_public: { new (): use_glo_M3_private.c1; }; + // export var use_glo_M3_private_v2_public: use_glo_M3_private; + // export var use_glo_M3_private_v3_public: () => use_glo_M3_private.c1; + // var use_glo_M3_private_v1_private: { new (): use_glo_M3_private.c1; }; + // var use_glo_M3_private_v2_private: use_glo_M3_private; + // var use_glo_M3_private_v3_private: () => use_glo_M3_private.c1; + + // import use_glo_M4_private = require("glo_M4_private"); + // export var use_glo_M4_private_v1_public: { new (): use_glo_M4_private.c1; }; + // export var use_glo_M4_private_v2_public: use_glo_M4_private; + // export var use_glo_M4_private_v3_public: () => use_glo_M4_private.c1; + // var use_glo_M4_private_v1_private: { new (): use_glo_M4_private.c1; }; + // var use_glo_M4_private_v2_private: use_glo_M4_private; + // var use_glo_M4_private_v3_private: () => use_glo_M4_private.c1; + + // module m2 { + // import errorImport = require("glo_M4_private"); + // import nonerrorImport = glo_M3_private; + + // module m5 { + // import m5_errorImport = require("glo_M4_private"); + // import m5_nonerrorImport = glo_M3_private; + // } + // } + //} + + //declare module "anotherParseError" { + // module m2 { + // declare module "abc" { + // } + // } + + // module m2 { + // module "abc2" { + // } + // } + // module "abc3" { + // } + //} + + //declare export module "anotherParseError2" { + // module m2 { + // declare module "abc" { + // } + // } + + // module m2 { + // module "abc2" { + // } + // } + // module "abc3" { + // } + //} + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import m3 = require("use_glo_M1_public"); + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a = 10; + //import m2 = require("use_glo_M1_public"); + } + + } + + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + //import m3 = require("use_glo_M1_public"); + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a = 10; + //import m2 = require("use_glo_M1_public"); + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 83b3fd5b490e9..1d068ef9996fe 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,3 +1,6 @@ +privacyImportParseErrors.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImportParseErrors.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImportParseErrors.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(22,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -7,6 +10,9 @@ privacyImportParseErrors.ts(69,37): error TS1147: Import declarations in a names privacyImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private' or its corresponding type declarations. privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(85,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImportParseErrors.ts(86,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyImportParseErrors.ts(96,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(106,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyImportParseErrors.ts(106,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -16,8 +22,10 @@ privacyImportParseErrors.ts(153,37): error TS1147: Import declarations in a name privacyImportParseErrors.ts(153,37): error TS2307: Cannot find module 'm2_M4_private' or its corresponding type declarations. privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in a namespace cannot reference a module. privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(170,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(180,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyImportParseErrors.ts(180,23): error TS2664: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. +privacyImportParseErrors.ts(188,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(198,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyImportParseErrors.ts(198,23): error TS2664: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. privacyImportParseErrors.ts(218,34): error TS2307: Cannot find module 'glo_M2_public' or its corresponding type declarations. @@ -29,35 +37,51 @@ privacyImportParseErrors.ts(255,23): error TS2664: Invalid module name in augmen privacyImportParseErrors.ts(258,45): error TS2709: Cannot use namespace 'use_glo_M1_public' as a type. privacyImportParseErrors.ts(261,39): error TS2709: Cannot use namespace 'use_glo_M1_public' as a type. privacyImportParseErrors.ts(264,40): error TS2307: Cannot find module 'glo_M2_public' or its corresponding type declarations. +privacyImportParseErrors.ts(272,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(276,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(277,45): error TS1147: Import declarations in a namespace cannot reference a module. privacyImportParseErrors.ts(284,16): error TS2664: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. privacyImportParseErrors.ts(287,46): error TS2709: Cannot use namespace 'use_glo_M3_private' as a type. privacyImportParseErrors.ts(290,40): error TS2709: Cannot use namespace 'use_glo_M3_private' as a type. privacyImportParseErrors.ts(293,41): error TS2307: Cannot find module 'glo_M4_private' or its corresponding type declarations. +privacyImportParseErrors.ts(301,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(305,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(306,45): error TS1147: Import declarations in a namespace cannot reference a module. privacyImportParseErrors.ts(312,16): error TS2664: Invalid module name in augmentation, module 'anotherParseError' cannot be found. +privacyImportParseErrors.ts(313,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +privacyImportParseErrors.ts(318,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyImportParseErrors.ts(326,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. privacyImportParseErrors.ts(326,23): error TS2664: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. +privacyImportParseErrors.ts(327,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(328,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +privacyImportParseErrors.ts(332,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. privacyImportParseErrors.ts(336,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +privacyImportParseErrors.ts(340,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(341,25): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(342,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(344,29): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(349,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(350,25): error TS1147: Import declarations in a namespace cannot reference a module. +privacyImportParseErrors.ts(351,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a namespace cannot reference a module. -==== privacyImportParseErrors.ts (55 errors) ==== +==== privacyImportParseErrors.ts (75 errors) ==== export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m1_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -68,6 +92,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m1_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -159,7 +185,11 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module m2_M1_public { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -170,6 +200,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m2_M2_private { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -262,6 +294,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } export module glo_M1_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -284,6 +318,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } export module glo_M3_private { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class c1 { } export function f1() { @@ -390,12 +426,16 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1; module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M1_public; module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m5_errorImport = require("glo_M2_public"); ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. @@ -431,12 +471,16 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name var use_glo_M4_private_v3_private: () => use_glo_M4_private.c1; module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import errorImport = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. import nonerrorImport = glo_M3_private; module m5 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m5_errorImport = require("glo_M4_private"); ~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. @@ -449,6 +493,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name ~~~~~~~~~~~~~~~~~~~ !!! error TS2664: Invalid module name in augmentation, module 'anotherParseError' cannot be found. module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -458,6 +504,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module "abc2" { ~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -477,6 +525,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name ~~~~~~~~~~~~~~~~~~~~ !!! error TS2664: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare module "abc" { ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -486,6 +536,8 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module "abc2" { ~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -498,10 +550,14 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ @@ -511,10 +567,14 @@ privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a name } export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import m3 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a = 10; import m2 = require("use_glo_M1_public"); ~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/privacyInterface.errors.txt b/tests/baselines/reference/privacyInterface.errors.txt new file mode 100644 index 0000000000000..1e3f99ea8afb4 --- /dev/null +++ b/tests/baselines/reference/privacyInterface.errors.txt @@ -0,0 +1,279 @@ +privacyInterface.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyInterface.ts(67,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyInterface.ts(195,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyInterface.ts(220,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyInterface.ts (4 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + } + + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + + class C2_private { + } + + export interface C3_public { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + + interface C4_private { + (c1: C1_public); + (c1: C2_private); + (): C1_public; + (c2: number): C2_private; + + new (c1: C1_public); + new (c1: C2_private); + new (): C1_public; + new (c2: number): C2_private; + + [c: number]: C1_public; + [c: string]: C2_private; + + x: C1_public; + y: C2_private; + + a?: C1_public; + b?: C2_private; + + f1(a1: C1_public); + f2(a1: C2_private); + f3(): C1_public; + f4(): C2_private; + + } + } + + export class C5_public { + private f1() { + } + } + + + class C6_private { + } + + export interface C7_public { + (c1: C5_public); + (c1: C6_private); + (): C5_public; + (c2: number): C6_private; + + new (c1: C5_public); + new (c1: C6_private); + new (): C5_public; + new (c2: number): C6_private; + + [c: number]: C5_public; + [c: string]: C6_private; + + x: C5_public; + y: C6_private; + + a?: C5_public; + b?: C6_private; + + f1(a1: C5_public); + f2(a1: C6_private); + f3(): C5_public; + f4(): C6_private; + + } + + interface C8_private { + (c1: C5_public); + (c1: C6_private); + (): C5_public; + (c2: number): C6_private; + + new (c1: C5_public); + new (c1: C6_private); + new (): C5_public; + new (c2: number): C6_private; + + [c: number]: C5_public; + [c: string]: C6_private; + + x: C5_public; + y: C6_private; + + a?: C5_public; + b?: C6_private; + + f1(a1: C5_public); + f2(a1: C6_private); + f3(): C5_public; + f4(): C6_private; + + } + + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m3_i_public { + f1(): number; + } + + interface m3_i_private { + f2(): string; + } + + interface m3_C1_private extends m3_i_public { + } + interface m3_C2_private extends m3_i_private { + } + export interface m3_C3_public extends m3_i_public { + } + export interface m3_C4_public extends m3_i_private { + } + + interface m3_C5_private extends m3_i_private, m3_i_public { + } + export interface m3_C6_public extends m3_i_private, m3_i_public { + } + } + + + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface m4_i_public { + f1(): number; + } + + interface m4_i_private { + f2(): string; + } + + interface m4_C1_private extends m4_i_public { + } + interface m4_C2_private extends m4_i_private { + } + export interface m4_C3_public extends m4_i_public { + } + export interface m4_C4_public extends m4_i_private { + } + + interface m4_C5_private extends m4_i_private, m4_i_public { + } + export interface m4_C6_public extends m4_i_private, m4_i_public { + } + } + + export interface glo_i_public { + f1(): number; + } + + interface glo_i_private { + f2(): string; + } + + interface glo_C1_private extends glo_i_public { + } + interface glo_C2_private extends glo_i_private { + } + export interface glo_C3_public extends glo_i_public { + } + export interface glo_C4_public extends glo_i_private { + } + + interface glo_C5_private extends glo_i_private, glo_i_public { + } + export interface glo_C6_public extends glo_i_private, glo_i_public { + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt new file mode 100644 index 0000000000000..6553b6340de2e --- /dev/null +++ b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt @@ -0,0 +1,103 @@ +privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyInterfaceExtendsClauseDeclFile_externalModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyInterfaceExtendsClauseDeclFile_externalModule.ts(26,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyInterfaceExtendsClauseDeclFile_externalModule.ts (2 errors) ==== + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPublicModule { + } + + interface privateInterfaceInPublicModule { + } + + interface privateInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPublicModule { + } + interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPublicModule { + } + export interface publicInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPublicModule { + } + export interface publicInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPublicModule { // Should error + } + + interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { + } + export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error + } + + export interface publicInterfaceImplementingPrivateAndPublicInterface extends privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error + } + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPrivateModule { + + } + + interface privateInterfaceInPrivateModule { + } + + interface privateInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPrivateModule { + } + interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPrivateModule { + } + export interface publicInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPrivateModule { + } + export interface publicInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPrivateModule { + } + + interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { + } + export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { + } + } + + export interface publicInterface { + + } + + interface privateInterface { + } + + interface privateInterfaceImplementingPublicInterface extends publicInterface { + } + interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterface { + } + export interface publicInterfaceImplementingPublicInterface extends publicInterface { + } + export interface publicInterfaceImplementingPrivateInterface extends privateInterface { // Should error + } + + interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { + } + export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error + } + +==== privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface publicInterfaceInPublicModule { + } + + interface privateInterfaceInPublicModule { + } + + interface privateInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPublicModule { + } + interface privateInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPublicModule { + } + export interface publicInterfaceImplementingPublicInterfaceInModule extends publicInterfaceInPublicModule { + } + export interface publicInterfaceImplementingPrivateInterfaceInModule extends privateInterfaceInPublicModule { // Should error + } + } + interface publicInterfaceInGlobal { + } + interface publicInterfaceImplementingPublicInterfaceInGlobal extends publicInterfaceInGlobal { + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt new file mode 100644 index 0000000000000..2dbb1803aff43 --- /dev/null +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt @@ -0,0 +1,179 @@ +privacyLocalInternalReferenceImportWithExport.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(15,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(39,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(43,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(49,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithExport.ts(102,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyLocalInternalReferenceImportWithExport.ts (8 errors) ==== + // private elements + module m_private { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // Public elements + export module m_public { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + export module import_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // Privacy errors - importing private elements + export import im_public_c_private = m_private.c_private; + export import im_public_e_private = m_private.e_private; + export import im_public_f_private = m_private.f_private; + export import im_public_v_private = m_private.v_private; + export import im_public_i_private = m_private.i_private; + export import im_public_mi_private = m_private.mi_private; + export import im_public_mu_private = m_private.mu_private; + + // Usage of privacy error imports + var privateUse_im_public_c_private = new im_public_c_private(); + export var publicUse_im_public_c_private = new im_public_c_private(); + var privateUse_im_public_e_private = im_public_e_private.Happy; + export var publicUse_im_public_e_private = im_public_e_private.Grumpy; + var privateUse_im_public_f_private = im_public_f_private(); + export var publicUse_im_public_f_private = im_public_f_private(); + var privateUse_im_public_v_private = im_public_v_private; + export var publicUse_im_public_v_private = im_public_v_private; + var privateUse_im_public_i_private: im_public_i_private; + export var publicUse_im_public_i_private: im_public_i_private; + var privateUse_im_public_mi_private = new im_public_mi_private.c(); + export var publicUse_im_public_mi_private = new im_public_mi_private.c(); + var privateUse_im_public_mu_private: im_public_mu_private.i; + export var publicUse_im_public_mu_private: im_public_mu_private.i; + + + // No Privacy errors - importing public elements + export import im_public_c_public = m_public.c_public; + export import im_public_e_public = m_public.e_public; + export import im_public_f_public = m_public.f_public; + export import im_public_v_public = m_public.v_public; + export import im_public_i_public = m_public.i_public; + export import im_public_mi_public = m_public.mi_public; + export import im_public_mu_public = m_public.mu_public; + + // Usage of above + var privateUse_im_public_c_public = new im_public_c_public(); + export var publicUse_im_public_c_public = new im_public_c_public(); + var privateUse_im_public_e_public = im_public_e_public.Happy; + export var publicUse_im_public_e_public = im_public_e_public.Grumpy; + var privateUse_im_public_f_public = im_public_f_public(); + export var publicUse_im_public_f_public = im_public_f_public(); + var privateUse_im_public_v_public = im_public_v_public; + export var publicUse_im_public_v_public = im_public_v_public; + var privateUse_im_public_i_public: im_public_i_public; + export var publicUse_im_public_i_public: im_public_i_public; + var privateUse_im_public_mi_public = new im_public_mi_public.c(); + export var publicUse_im_public_mi_public = new im_public_mi_public.c(); + var privateUse_im_public_mu_public: im_public_mu_public.i; + export var publicUse_im_public_mu_public: im_public_mu_public.i; + } + + module import_private { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // No Privacy errors - importing private elements + export import im_private_c_private = m_private.c_private; + export import im_private_e_private = m_private.e_private; + export import im_private_f_private = m_private.f_private; + export import im_private_v_private = m_private.v_private; + export import im_private_i_private = m_private.i_private; + export import im_private_mi_private = m_private.mi_private; + export import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + // No privacy Error - importing public elements + export import im_private_c_public = m_public.c_public; + export import im_private_e_public = m_public.e_public; + export import im_private_f_public = m_public.f_public; + export import im_private_v_public = m_public.v_public; + export import im_private_i_public = m_public.i_public; + export import im_private_mi_public = m_public.mi_public; + export import im_private_mu_public = m_public.mu_public; + + // Usage of no privacy error imports + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt new file mode 100644 index 0000000000000..c72d6869f0b3c --- /dev/null +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt @@ -0,0 +1,179 @@ +privacyLocalInternalReferenceImportWithoutExport.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(15,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(39,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(43,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(49,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyLocalInternalReferenceImportWithoutExport.ts(102,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyLocalInternalReferenceImportWithoutExport.ts (8 errors) ==== + // private elements + module m_private { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // Public elements + export module m_public { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + export module import_public { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // No Privacy errors - importing private elements + import im_private_c_private = m_private.c_private; + import im_private_e_private = m_private.e_private; + import im_private_f_private = m_private.f_private; + import im_private_v_private = m_private.v_private; + import im_private_i_private = m_private.i_private; + import im_private_mi_private = m_private.mi_private; + import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + + // No Privacy errors - importing public elements + import im_private_c_public = m_public.c_public; + import im_private_e_public = m_public.e_public; + import im_private_f_public = m_public.f_public; + import im_private_v_public = m_public.v_public; + import im_private_i_public = m_public.i_public; + import im_private_mi_public = m_public.mi_public; + import im_private_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; + } + + module import_private { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // No Privacy errors - importing private elements + import im_private_c_private = m_private.c_private; + import im_private_e_private = m_private.e_private; + import im_private_f_private = m_private.f_private; + import im_private_v_private = m_private.v_private; + import im_private_i_private = m_private.i_private; + import im_private_mi_private = m_private.mi_private; + import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + // No privacy Error - importing public elements + import im_private_c_public = m_public.c_public; + import im_private_e_public = m_public.e_public; + import im_private_f_public = m_public.f_public; + import im_private_v_public = m_public.v_public; + import im_private_i_public = m_public.i_public; + import im_private_mi_public = m_public.mi_public; + import im_private_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt new file mode 100644 index 0000000000000..dc8ac032a65bc --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt @@ -0,0 +1,120 @@ +privacyTopLevelInternalReferenceImportWithExport.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithExport.ts(15,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithExport.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithExport.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithExport.ts(39,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithExport.ts(43,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyTopLevelInternalReferenceImportWithExport.ts (6 errors) ==== + // private elements + module m_private { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // Public elements + export module m_public { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // Privacy errors - importing private elements + export import im_public_c_private = m_private.c_private; + export import im_public_e_private = m_private.e_private; + export import im_public_f_private = m_private.f_private; + export import im_public_v_private = m_private.v_private; + export import im_public_i_private = m_private.i_private; + export import im_public_mi_private = m_private.mi_private; + export import im_public_mu_private = m_private.mu_private; + + // Usage of privacy error imports + var privateUse_im_public_c_private = new im_public_c_private(); + export var publicUse_im_public_c_private = new im_public_c_private(); + var privateUse_im_public_e_private = im_public_e_private.Happy; + export var publicUse_im_public_e_private = im_public_e_private.Grumpy; + var privateUse_im_public_f_private = im_public_f_private(); + export var publicUse_im_public_f_private = im_public_f_private(); + var privateUse_im_public_v_private = im_public_v_private; + export var publicUse_im_public_v_private = im_public_v_private; + var privateUse_im_public_i_private: im_public_i_private; + export var publicUse_im_public_i_private: im_public_i_private; + var privateUse_im_public_mi_private = new im_public_mi_private.c(); + export var publicUse_im_public_mi_private = new im_public_mi_private.c(); + var privateUse_im_public_mu_private: im_public_mu_private.i; + export var publicUse_im_public_mu_private: im_public_mu_private.i; + + + // No Privacy errors - importing public elements + export import im_public_c_public = m_public.c_public; + export import im_public_e_public = m_public.e_public; + export import im_public_f_public = m_public.f_public; + export import im_public_v_public = m_public.v_public; + export import im_public_i_public = m_public.i_public; + export import im_public_mi_public = m_public.mi_public; + export import im_public_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_public_c_public = new im_public_c_public(); + export var publicUse_im_public_c_public = new im_public_c_public(); + var privateUse_im_public_e_public = im_public_e_public.Happy; + export var publicUse_im_public_e_public = im_public_e_public.Grumpy; + var privateUse_im_public_f_public = im_public_f_public(); + export var publicUse_im_public_f_public = im_public_f_public(); + var privateUse_im_public_v_public = im_public_v_public; + export var publicUse_im_public_v_public = im_public_v_public; + var privateUse_im_public_i_public: im_public_i_public; + export var publicUse_im_public_i_public: im_public_i_public; + var privateUse_im_public_mi_public = new im_public_mi_public.c(); + export var publicUse_im_public_mi_public = new im_public_mi_public.c(); + var privateUse_im_public_mu_public: im_public_mu_public.i; + export var publicUse_im_public_mu_public: im_public_mu_public.i; + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt new file mode 100644 index 0000000000000..c29b4a7563e95 --- /dev/null +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt @@ -0,0 +1,120 @@ +privacyTopLevelInternalReferenceImportWithoutExport.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithoutExport.ts(15,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithoutExport.ts(19,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithoutExport.ts(26,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithoutExport.ts(39,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTopLevelInternalReferenceImportWithoutExport.ts(43,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyTopLevelInternalReferenceImportWithoutExport.ts (6 errors) ==== + // private elements + module m_private { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_private { + } + export enum e_private { + Happy, + Grumpy + } + export function f_private() { + return new c_private(); + } + export var v_private = new c_private(); + export interface i_private { + } + export module mi_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_private { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // Public elements + export module m_public { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c_public { + } + export enum e_public { + Happy, + Grumpy + } + export function f_public() { + return new c_public(); + } + export var v_public = 10; + export interface i_public { + } + export module mi_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + export module mu_public { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface i { + } + } + } + + // No Privacy errors - importing private elements + import im_private_c_private = m_private.c_private; + import im_private_e_private = m_private.e_private; + import im_private_f_private = m_private.f_private; + import im_private_v_private = m_private.v_private; + import im_private_i_private = m_private.i_private; + import im_private_mi_private = m_private.mi_private; + import im_private_mu_private = m_private.mu_private; + + // Usage of above decls + var privateUse_im_private_c_private = new im_private_c_private(); + export var publicUse_im_private_c_private = new im_private_c_private(); + var privateUse_im_private_e_private = im_private_e_private.Happy; + export var publicUse_im_private_e_private = im_private_e_private.Grumpy; + var privateUse_im_private_f_private = im_private_f_private(); + export var publicUse_im_private_f_private = im_private_f_private(); + var privateUse_im_private_v_private = im_private_v_private; + export var publicUse_im_private_v_private = im_private_v_private; + var privateUse_im_private_i_private: im_private_i_private; + export var publicUse_im_private_i_private: im_private_i_private; + var privateUse_im_private_mi_private = new im_private_mi_private.c(); + export var publicUse_im_private_mi_private = new im_private_mi_private.c(); + var privateUse_im_private_mu_private: im_private_mu_private.i; + export var publicUse_im_private_mu_private: im_private_mu_private.i; + + + // No Privacy errors - importing public elements + import im_private_c_public = m_public.c_public; + import im_private_e_public = m_public.e_public; + import im_private_f_public = m_public.f_public; + import im_private_v_public = m_public.v_public; + import im_private_i_public = m_public.i_public; + import im_private_mi_public = m_public.mi_public; + import im_private_mu_public = m_public.mu_public; + + // Usage of above decls + var privateUse_im_private_c_public = new im_private_c_public(); + export var publicUse_im_private_c_public = new im_private_c_public(); + var privateUse_im_private_e_public = im_private_e_public.Happy; + export var publicUse_im_private_e_public = im_private_e_public.Grumpy; + var privateUse_im_private_f_public = im_private_f_public(); + export var publicUse_im_private_f_public = im_private_f_public(); + var privateUse_im_private_v_public = im_private_v_public; + export var publicUse_im_private_v_public = im_private_v_public; + var privateUse_im_private_i_public: im_private_i_public; + export var publicUse_im_private_i_public: im_private_i_public; + var privateUse_im_private_mi_public = new im_private_mi_public.c(); + export var publicUse_im_private_mi_public = new im_private_mi_public.c(); + var privateUse_im_private_mu_public: im_private_mu_public.i; + export var publicUse_im_private_mu_public: im_private_mu_public.i; + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt new file mode 100644 index 0000000000000..258bdd9c422a1 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt @@ -0,0 +1,447 @@ +privacyTypeParameterOfFunctionDeclFile.ts(156,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTypeParameterOfFunctionDeclFile.ts(313,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyTypeParameterOfFunctionDeclFile.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateTypeParameters { + new (): privateClass; // Error + (): privateClass; // Error + myMethod(): privateClass; // Error + } + + export interface publicInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { // Error + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { // Error + } + private myPrivateMethod() { + } + } + + export class publicClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPrivateTypeParameters() { // Error + } + + export function publicFunctionWithPublicTypeParameters() { + } + + function privateFunctionWithPrivateTypeParameters() { + } + + function privateFunctionWithPublicTypeParameters() { + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + class privateClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPublicTypeParametersWithoutExtends() { + } + + function privateFunctionWithPublicTypeParametersWithoutExtends() { + } + + export interface publicInterfaceWithPrivatModuleTypeParameters { + new (): privateModule.publicClass; // Error + (): privateModule.publicClass; // Error + myMethod(): privateModule.publicClass; // Error + } + export class publicClassWithWithPrivateModuleTypeParameters { + static myPublicStaticMethod() { // Error + } + myPublicMethod() { // Error + } + } + export function publicFunctionWithPrivateMopduleTypeParameters() { // Error + } + + + interface privateInterfaceWithPrivatModuleTypeParameters { + new (): privateModule.publicClass; + (): privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithWithPrivateModuleTypeParameters { + static myPublicStaticMethod() { + } + myPublicMethod() { + } + } + function privateFunctionWithPrivateMopduleTypeParameters() { + } + + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateTypeParameters { + new (): privateClass; // Error + (): privateClass; // Error + myMethod(): privateClass; // Error + } + + export interface publicInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { // Error + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { // Error + } + private myPrivateMethod() { + } + } + + export class publicClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPrivateTypeParameters() { // Error + } + + export function publicFunctionWithPublicTypeParameters() { + } + + function privateFunctionWithPrivateTypeParameters() { + } + + function privateFunctionWithPublicTypeParameters() { + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + class privateClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPublicTypeParametersWithoutExtends() { + } + + function privateFunctionWithPublicTypeParametersWithoutExtends() { + } + + export interface publicInterfaceWithPrivatModuleTypeParameters { + new (): privateModule.publicClass; // Error + (): privateModule.publicClass; // Error + myMethod(): privateModule.publicClass; // Error + } + export class publicClassWithWithPrivateModuleTypeParameters { + static myPublicStaticMethod() { // Error + } + myPublicMethod() { // Error + } + } + export function publicFunctionWithPrivateMopduleTypeParameters() { // Error + } + + + interface privateInterfaceWithPrivatModuleTypeParameters { + new (): privateModule.publicClass; + (): privateModule.publicClass; + myMethod(): privateModule.publicClass; + } + class privateClassWithWithPrivateModuleTypeParameters { + static myPublicStaticMethod() { + } + myPublicMethod() { + } + } + function privateFunctionWithPrivateMopduleTypeParameters() { + } + + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; + } + + export interface publicInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPrivateTypeParameters { + new (): privateClass; + (): privateClass; + myMethod(): privateClass; + } + + interface privateInterfaceWithPublicTypeParameters { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export class publicClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPrivateTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + class privateClassWithWithPublicTypeParameters { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPrivateTypeParameters() { + } + + export function publicFunctionWithPublicTypeParameters() { + } + + function privateFunctionWithPrivateTypeParameters() { + } + + function privateFunctionWithPublicTypeParameters() { + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + new (): publicClass; + (): publicClass; + myMethod(): publicClass; + } + + export class publicClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + class privateClassWithWithPublicTypeParametersWithoutExtends { + static myPublicStaticMethod() { + } + private static myPrivateStaticMethod() { + } + myPublicMethod() { + } + private myPrivateMethod() { + } + } + + export function publicFunctionWithPublicTypeParametersWithoutExtends() { + } + + function privateFunctionWithPublicTypeParametersWithoutExtends() { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt new file mode 100644 index 0000000000000..a18ec55a5718a --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt @@ -0,0 +1,163 @@ +privacyTypeParametersOfClassDeclFile.ts(55,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTypeParametersOfClassDeclFile.ts(111,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyTypeParametersOfClassDeclFile.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export class publicClassWithPrivateTypeParameters { // Error + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPrivateTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithTypeParametersFromPrivateModule { // Error + myMethod(val: T): T { + return val; + } + } + + class privateClassWithTypeParametersFromPrivateModule { + myMethod(val: T): T { + return val; + } + } + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClassInPublicModule { + } + + export class publicClassInPublicModule { + } + + export class publicClassWithPrivateTypeParameters { // Error + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPrivateTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithTypeParametersFromPrivateModule { // Error + myMethod(val: T): T { + return val; + } + } + + class privateClassWithTypeParametersFromPrivateModule { + myMethod(val: T): T { + return val; + } + } + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClassInPrivateModule { + } + + export class publicClassInPrivateModule { + } + + export class publicClassWithPrivateTypeParameters { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPrivateTypeParameters { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParameters { + myMethod(val: T): T { + return val; + } + } + + export class publicClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + + class privateClassWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T { + return val; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt new file mode 100644 index 0000000000000..5cc9736f824f9 --- /dev/null +++ b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt @@ -0,0 +1,199 @@ +privacyTypeParametersOfInterfaceDeclFile.ts(66,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyTypeParametersOfInterfaceDeclFile.ts(132,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyTypeParametersOfInterfaceDeclFile.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + class privateClassT { + } + + export class publicClassT { + } + + export interface publicInterfaceWithPrivateTypeParameters { // Error + myMethod(val: T): T; + myMethod0(): publicClassT; + myMethod1(): privateClassT; + myMethod2(): privateClassT; + myMethod3(): publicClassT; + myMethod4(): publicClassT; + } + + export interface publicInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassT + myMethod1(): privateClassT; + myMethod2(): privateClassT; + myMethod3(): publicClassT; + myMethod4(): publicClassT; + } + + interface privateInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassT; + myMethod1(): privateClassT; + myMethod2(): privateClassT; + myMethod3(): publicClassT; + myMethod4(): publicClassT; + } + + interface privateInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassT; + myMethod1(): privateClassT; + myMethod2(): privateClassT; + myMethod3(): publicClassT; + myMethod4(): publicClassT; + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassT; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassT; + } + + + export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error + } + + interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error + } + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClassInPublicModule { + } + + export class publicClassInPublicModule { + } + + class privateClassInPublicModuleT { + } + + export class publicClassInPublicModuleT { + } + + export interface publicInterfaceWithPrivateTypeParameters { // Error + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT; + myMethod1(): privateClassInPublicModuleT; + myMethod2(): privateClassInPublicModuleT; + myMethod3(): publicClassInPublicModuleT; + myMethod4(): publicClassInPublicModuleT; + } + + export interface publicInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT + myMethod1(): privateClassInPublicModuleT; + myMethod2(): privateClassInPublicModuleT; + myMethod3(): publicClassInPublicModuleT; + myMethod4(): publicClassInPublicModuleT; + } + + interface privateInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT; + myMethod1(): privateClassInPublicModuleT; + myMethod2(): privateClassInPublicModuleT; + myMethod3(): publicClassInPublicModuleT; + myMethod4(): publicClassInPublicModuleT; + } + + interface privateInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT; + myMethod1(): privateClassInPublicModuleT; + myMethod2(): privateClassInPublicModuleT; + myMethod3(): publicClassInPublicModuleT; + myMethod4(): publicClassInPublicModuleT; + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassInPublicModuleT; + } + + export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error + } + + interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error + } + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClassInPrivateModule { + } + + export class publicClassInPrivateModule { + } + + class privateClassInPrivateModuleT { + } + + export class publicClassInPrivateModuleT { + } + + export interface publicInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT; + myMethod1(): privateClassInPrivateModuleT; + myMethod2(): privateClassInPrivateModuleT; + myMethod3(): publicClassInPrivateModuleT; + myMethod4(): publicClassInPrivateModuleT; + } + + export interface publicInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT + myMethod1(): privateClassInPrivateModuleT; + myMethod2(): privateClassInPrivateModuleT; + myMethod3(): publicClassInPrivateModuleT; + myMethod4(): publicClassInPrivateModuleT; + } + + interface privateInterfaceWithPrivateTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT; + myMethod1(): privateClassInPrivateModuleT; + myMethod2(): privateClassInPrivateModuleT; + myMethod3(): publicClassInPrivateModuleT; + myMethod4(): publicClassInPrivateModuleT; + } + + interface privateInterfaceWithPublicTypeParameters { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT; + myMethod1(): privateClassInPrivateModuleT; + myMethod2(): privateClassInPrivateModuleT; + myMethod3(): publicClassInPrivateModuleT; + myMethod4(): publicClassInPrivateModuleT; + } + + export interface publicInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT; + } + + interface privateInterfaceWithPublicTypeParametersWithoutExtends { + myMethod(val: T): T; + myMethod0(): publicClassInPrivateModuleT; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/privacyVar.errors.txt b/tests/baselines/reference/privacyVar.errors.txt new file mode 100644 index 0000000000000..c3f80ea9cd4b2 --- /dev/null +++ b/tests/baselines/reference/privacyVar.errors.txt @@ -0,0 +1,183 @@ +privacyVar.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyVar.ts(60,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyVar.ts (2 errors) ==== + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C1_public { + private f1() { + } + } + + class C2_private { + } + + export class C3_public { + private C3_v1_private: C1_public; + public C3_v2_public: C1_public; + private C3_v3_private: C2_private; + public C3_v4_public: C2_private; // error + + private C3_v11_private = new C1_public(); + public C3_v12_public = new C1_public(); + private C3_v13_private = new C2_private(); + public C3_v14_public = new C2_private(); // error + + private C3_v21_private: C1_public = new C1_public(); + public C3_v22_public: C1_public = new C1_public(); + private C3_v23_private: C2_private = new C2_private(); + public C3_v24_public: C2_private = new C2_private(); // error + } + + class C4_public { + private C4_v1_private: C1_public; + public C4_v2_public: C1_public; + private C4_v3_private: C2_private; + public C4_v4_public: C2_private; + + private C4_v11_private = new C1_public(); + public C4_v12_public = new C1_public(); + private C4_v13_private = new C2_private(); + public C4_v14_public = new C2_private(); + + private C4_v21_private: C1_public = new C1_public(); + public C4_v22_public: C1_public = new C1_public(); + private C4_v23_private: C2_private = new C2_private(); + public C4_v24_public: C2_private = new C2_private(); + } + + var m1_v1_private: C1_public; + export var m1_v2_public: C1_public; + var m1_v3_private: C2_private; + export var m1_v4_public: C2_private; // error + + var m1_v11_private = new C1_public(); + export var m1_v12_public = new C1_public(); + var m1_v13_private = new C2_private(); + export var m1_v14_public = new C2_private(); //error + + var m1_v21_private: C1_public = new C1_public(); + export var m1_v22_public: C1_public = new C1_public(); + var m1_v23_private: C2_private = new C2_private(); + export var m1_v24_public: C2_private = new C2_private(); // error + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class m2_C1_public { + private f1() { + } + } + + class m2_C2_private { + } + + export class m2_C3_public { + private m2_C3_v1_private: m2_C1_public; + public m2_C3_v2_public: m2_C1_public; + private m2_C3_v3_private: m2_C2_private; + public m2_C3_v4_public: m2_C2_private; + + private m2_C3_v11_private = new m2_C1_public(); + public m2_C3_v12_public = new m2_C1_public(); + private m2_C3_v13_private = new m2_C2_private(); + public m2_C3_v14_public = new m2_C2_private(); + + private m2_C3_v21_private: m2_C1_public = new m2_C1_public(); + public m2_C3_v22_public: m2_C1_public = new m2_C1_public(); + private m2_C3_v23_private: m2_C2_private = new m2_C2_private(); + public m2_C3_v24_public: m2_C2_private = new m2_C2_private(); + } + + class m2_C4_public { + private m2_C4_v1_private: m2_C1_public; + public m2_C4_v2_public: m2_C1_public; + private m2_C4_v3_private: m2_C2_private; + public m2_C4_v4_public: m2_C2_private; + + private m2_C4_v11_private = new m2_C1_public(); + public m2_C4_v12_public = new m2_C1_public(); + private m2_C4_v13_private = new m2_C2_private(); + public m2_C4_v14_public = new m2_C2_private(); + + private m2_C4_v21_private: m2_C1_public = new m2_C1_public(); + public m2_C4_v22_public: m2_C1_public = new m2_C1_public(); + private m2_C4_v23_private: m2_C2_private = new m2_C2_private(); + public m2_C4_v24_public: m2_C2_private = new m2_C2_private(); + } + + var m2_v1_private: m2_C1_public; + export var m2_v2_public: m2_C1_public; + var m2_v3_private: m2_C2_private; + export var m2_v4_public: m2_C2_private; + + var m2_v11_private = new m2_C1_public(); + export var m2_v12_public = new m2_C1_public(); + var m2_v13_private = new m2_C2_private(); + export var m2_v14_public = new m2_C2_private(); + + var m2_v21_private: m2_C1_public = new m2_C1_public(); + export var m2_v22_public: m2_C1_public = new m2_C1_public(); + var m2_v23_private: m2_C2_private = new m2_C2_private(); + export var m2_v24_public: m2_C2_private = new m2_C2_private(); + } + + export class glo_C1_public { + private f1() { + } + } + + class glo_C2_private { + } + + export class glo_C3_public { + private glo_C3_v1_private: glo_C1_public; + public glo_C3_v2_public: glo_C1_public; + private glo_C3_v3_private: glo_C2_private; + public glo_C3_v4_public: glo_C2_private; //error + + private glo_C3_v11_private = new glo_C1_public(); + public glo_C3_v12_public = new glo_C1_public(); + private glo_C3_v13_private = new glo_C2_private(); + public glo_C3_v14_public = new glo_C2_private(); // error + + private glo_C3_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C3_v22_public: glo_C1_public = new glo_C1_public(); + private glo_C3_v23_private: glo_C2_private = new glo_C2_private(); + public glo_C3_v24_public: glo_C2_private = new glo_C2_private(); //error + } + + class glo_C4_public { + private glo_C4_v1_private: glo_C1_public; + public glo_C4_v2_public: glo_C1_public; + private glo_C4_v3_private: glo_C2_private; + public glo_C4_v4_public: glo_C2_private; + + private glo_C4_v11_private = new glo_C1_public(); + public glo_C4_v12_public = new glo_C1_public(); + private glo_C4_v13_private = new glo_C2_private(); + public glo_C4_v14_public = new glo_C2_private(); + + private glo_C4_v21_private: glo_C1_public = new glo_C1_public(); + public glo_C4_v22_public: glo_C1_public = new glo_C1_public(); + private glo_C4_v23_private: glo_C2_private = new glo_C2_private(); + public glo_C4_v24_public: glo_C2_private = new glo_C2_private(); + } + + var glo_v1_private: glo_C1_public; + export var glo_v2_public: glo_C1_public; + var glo_v3_private: glo_C2_private; + export var glo_v4_public: glo_C2_private; // error + + var glo_v11_private = new glo_C1_public(); + export var glo_v12_public = new glo_C1_public(); + var glo_v13_private = new glo_C2_private(); + export var glo_v14_public = new glo_C2_private(); // error + + var glo_v21_private: glo_C1_public = new glo_C1_public(); + export var glo_v22_public: glo_C1_public = new glo_C1_public(); + var glo_v23_private: glo_C2_private = new glo_C2_private(); + export var glo_v24_public: glo_C2_private = new glo_C2_private(); // error \ No newline at end of file diff --git a/tests/baselines/reference/privacyVarDeclFile.errors.txt b/tests/baselines/reference/privacyVarDeclFile.errors.txt new file mode 100644 index 0000000000000..d9d08186459ac --- /dev/null +++ b/tests/baselines/reference/privacyVarDeclFile.errors.txt @@ -0,0 +1,437 @@ +privacyVarDeclFile_GlobalFile.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyVarDeclFile_GlobalFile.ts(22,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyVarDeclFile_externalModule.ts(81,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +privacyVarDeclFile_externalModule.ts(163,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privacyVarDeclFile_externalModule.ts (2 errors) ==== + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; // Error + } + + export interface publicInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + interface privateInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + interface privateInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; // Error + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; // Error + private myPrivateProperty: privateClass; + } + + export class publicClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + class privateClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + export var publicVarWithPrivatePropertyTypes: privateClass; // Error + export var publicVarWithPublicPropertyTypes: publicClass; + var privateVarWithPrivatePropertyTypes: privateClass; + var privateVarWithPublicPropertyTypes: publicClass; + + export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error + export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; + declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; + declare var privateAmbientVarWithPublicPropertyTypes: publicClass; + + export interface publicInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; // Error + } + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; // Error + myPublicProperty: privateModule.publicClass; // Error + } + export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + var privateVarWithPrivateModulePropertyTypes: privateModule.publicClass; + declare var privateAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + + export module publicModule { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; // Error + } + + export interface publicInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + interface privateInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + interface privateInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; // Error + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; // Error + private myPrivateProperty: privateClass; + } + + export class publicClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + class privateClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + export var publicVarWithPrivatePropertyTypes: privateClass; // Error + export var publicVarWithPublicPropertyTypes: publicClass; + var privateVarWithPrivatePropertyTypes: privateClass; + var privateVarWithPublicPropertyTypes: publicClass; + + export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error + export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; + declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; + declare var privateAmbientVarWithPublicPropertyTypes: publicClass; + + export interface publicInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; // Error + } + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; // Error + myPublicProperty: privateModule.publicClass; // Error + } + export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + var privateVarWithPrivateModulePropertyTypes: privateModule.publicClass; + declare var privateAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + export interface publicInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + interface privateInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + interface privateInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + export class publicClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + class privateClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + export var publicVarWithPrivatePropertyTypes: privateClass; + export var publicVarWithPublicPropertyTypes: publicClass; + var privateVarWithPrivatePropertyTypes: privateClass; + var privateVarWithPublicPropertyTypes: publicClass; + + export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; + export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; + declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; + declare var privateAmbientVarWithPublicPropertyTypes: publicClass; + + export interface publicInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; + export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + + interface privateInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + var privateVarWithPrivateModulePropertyTypes: privateModule.publicClass; + declare var privateAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + } + +==== privacyVarDeclFile_GlobalFile.ts (2 errors) ==== + class publicClassInGlobal { + } + interface publicInterfaceWithPublicPropertyTypesInGlobal { + myProperty: publicClassInGlobal; + } + class publicClassWithWithPublicPropertyTypesInGlobal { + static myPublicStaticProperty: publicClassInGlobal; + private static myPrivateStaticProperty: publicClassInGlobal; + myPublicProperty: publicClassInGlobal; + private myPrivateProperty: publicClassInGlobal; + } + var publicVarWithPublicPropertyTypesInGlobal: publicClassInGlobal; + declare var publicAmbientVarWithPublicPropertyTypesInGlobal: publicClassInGlobal; + + module publicModuleInGlobal { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + module privateModule { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class privateClass { + } + + export class publicClass { + } + + export interface publicInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + export interface publicInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + interface privateInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + interface privateInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + export class publicClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + class privateClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + export var publicVarWithPrivatePropertyTypes: privateClass; + export var publicVarWithPublicPropertyTypes: publicClass; + var privateVarWithPrivatePropertyTypes: privateClass; + var privateVarWithPublicPropertyTypes: publicClass; + + export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; + export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; + declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; + declare var privateAmbientVarWithPublicPropertyTypes: publicClass; + + export interface publicInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; + export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + + interface privateInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + var privateVarWithPrivateModulePropertyTypes: privateModule.publicClass; + declare var privateAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + } + + export interface publicInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; // Error + } + + export interface publicInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + interface privateInterfaceWithPrivatePropertyTypes { + myProperty: privateClass; + } + + interface privateInterfaceWithPublicPropertyTypes { + myProperty: publicClass; + } + + export class publicClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; // Error + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; // Error + private myPrivateProperty: privateClass; + } + + export class publicClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + class privateClassWithWithPrivatePropertyTypes { + static myPublicStaticProperty: privateClass; + private static myPrivateStaticProperty: privateClass; + myPublicProperty: privateClass; + private myPrivateProperty: privateClass; + } + + class privateClassWithWithPublicPropertyTypes { + static myPublicStaticProperty: publicClass; + private static myPrivateStaticProperty: publicClass; + myPublicProperty: publicClass; + private myPrivateProperty: publicClass; + } + + export var publicVarWithPrivatePropertyTypes: privateClass; // Error + export var publicVarWithPublicPropertyTypes: publicClass; + var privateVarWithPrivatePropertyTypes: privateClass; + var privateVarWithPublicPropertyTypes: publicClass; + + export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error + export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; + declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; + declare var privateAmbientVarWithPublicPropertyTypes: publicClass; + + export interface publicInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; // Error + } + export class publicClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; // Error + myPublicProperty: privateModule.publicClass; // Error + } + export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error + + interface privateInterfaceWithPrivateModulePropertyTypes { + myProperty: privateModule.publicClass; + } + class privateClassWithPrivateModulePropertyTypes { + static myPublicStaticProperty: privateModule.publicClass; + myPublicProperty: privateModule.publicClass; + } + var privateVarWithPrivateModulePropertyTypes: privateModule.publicClass; + declare var privateAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; + } \ No newline at end of file diff --git a/tests/baselines/reference/privateInstanceVisibility.errors.txt b/tests/baselines/reference/privateInstanceVisibility.errors.txt new file mode 100644 index 0000000000000..c168839671ad0 --- /dev/null +++ b/tests/baselines/reference/privateInstanceVisibility.errors.txt @@ -0,0 +1,44 @@ +privateInstanceVisibility.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== privateInstanceVisibility.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class Example { + + private someNumber: number; + + + + public doSomething() { + + var that = this; + + function innerFunction() { + + var num = that.someNumber; + + } + + } + + } + + } + + + + class C { + + private x: number; + + getX() { return this.x; } + + clone(other: C) { + this.x = other.x; + + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt b/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt index 0ed8e38749e82..63912c37badee 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.errors.txt @@ -1,7 +1,8 @@ +privateStaticNotAccessibleInClodule.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privateStaticNotAccessibleInClodule.ts(9,22): error TS2341: Property 'bar' is private and only accessible within class 'C'. -==== privateStaticNotAccessibleInClodule.ts (1 errors) ==== +==== privateStaticNotAccessibleInClodule.ts (2 errors) ==== // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. class C { @@ -10,6 +11,8 @@ privateStaticNotAccessibleInClodule.ts(9,22): error TS2341: Property 'bar' is pr } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = C.bar; // error ~~~ !!! error TS2341: Property 'bar' is private and only accessible within class 'C'. diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt index ee6e9339f479c..040b87ce843d8 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.errors.txt @@ -1,7 +1,8 @@ +privateStaticNotAccessibleInClodule2.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privateStaticNotAccessibleInClodule2.ts(13,22): error TS2341: Property 'bar' is private and only accessible within class 'C'. -==== privateStaticNotAccessibleInClodule2.ts (1 errors) ==== +==== privateStaticNotAccessibleInClodule2.ts (2 errors) ==== // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. class C { @@ -14,6 +15,8 @@ privateStaticNotAccessibleInClodule2.ts(13,22): error TS2341: Property 'bar' is } module D { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = D.bar; // error ~~~ !!! error TS2341: Property 'bar' is private and only accessible within class 'C'. diff --git a/tests/baselines/reference/privateVisibility.errors.txt b/tests/baselines/reference/privateVisibility.errors.txt index 8166a1df9b3d3..654f7bcd76805 100644 --- a/tests/baselines/reference/privateVisibility.errors.txt +++ b/tests/baselines/reference/privateVisibility.errors.txt @@ -1,9 +1,10 @@ privateVisibility.ts(9,3): error TS2341: Property 'privMeth' is private and only accessible within class 'Foo'. privateVisibility.ts(10,3): error TS2341: Property 'privProp' is private and only accessible within class 'Foo'. +privateVisibility.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. privateVisibility.ts(24,3): error TS2341: Property 'priv' is private and only accessible within class 'C'. -==== privateVisibility.ts (3 errors) ==== +==== privateVisibility.ts (4 errors) ==== class Foo { public pubMeth() {this.privMeth();} private privMeth() {} @@ -23,6 +24,8 @@ privateVisibility.ts(24,3): error TS2341: Property 'priv' is private and only ac f.pubProp; // should work module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { public pub = 0; private priv = 1; } export var V = 0; } diff --git a/tests/baselines/reference/project/baseline3/amd/baseline3.errors.txt b/tests/baselines/reference/project/baseline3/amd/baseline3.errors.txt new file mode 100644 index 0000000000000..02035c9c4c997 --- /dev/null +++ b/tests/baselines/reference/project/baseline3/amd/baseline3.errors.txt @@ -0,0 +1,15 @@ +nestedModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModule.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nestedModule.ts (2 errors) ==== + export module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var local = 1; + export var a = local; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/project/baseline3/node/baseline3.errors.txt b/tests/baselines/reference/project/baseline3/node/baseline3.errors.txt new file mode 100644 index 0000000000000..02035c9c4c997 --- /dev/null +++ b/tests/baselines/reference/project/baseline3/node/baseline3.errors.txt @@ -0,0 +1,15 @@ +nestedModule.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +nestedModule.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== nestedModule.ts (2 errors) ==== + export module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module inner { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var local = 1; + export var a = local; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.errors.txt b/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.errors.txt new file mode 100644 index 0000000000000..17343c670dd8d --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/amd/declarationsCascadingImports.errors.txt @@ -0,0 +1,32 @@ +useModule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +useModule.ts(8,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (2 errors) ==== + declare module "quotedm1" { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m4 = require("m4"); + export class v { + public c: m4.d; + } + } + + declare module "quotedm2" { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("quotedm1"); + export var c: m1.v; + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.errors.txt b/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.errors.txt new file mode 100644 index 0000000000000..17343c670dd8d --- /dev/null +++ b/tests/baselines/reference/project/declarationsCascadingImports/node/declarationsCascadingImports.errors.txt @@ -0,0 +1,32 @@ +useModule.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +useModule.ts(8,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (2 errors) ==== + declare module "quotedm1" { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m4 = require("m4"); + export class v { + public c: m4.d; + } + } + + declare module "quotedm2" { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("quotedm1"); + export var c: m1.v; + } + + + + \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsExportNamespace/amd/declarationsExportNamespace.errors.txt b/tests/baselines/reference/project/declarationsExportNamespace/amd/declarationsExportNamespace.errors.txt new file mode 100644 index 0000000000000..4ee994c0defa7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsExportNamespace/amd/declarationsExportNamespace.errors.txt @@ -0,0 +1,16 @@ +useModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (0 errors) ==== + export interface A { + b: number; + } + export as namespace moduleA; +==== useModule.ts (1 errors) ==== + module moduleB { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IUseModuleA { + a: moduleA.A; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsExportNamespace/node/declarationsExportNamespace.errors.txt b/tests/baselines/reference/project/declarationsExportNamespace/node/declarationsExportNamespace.errors.txt new file mode 100644 index 0000000000000..4ee994c0defa7 --- /dev/null +++ b/tests/baselines/reference/project/declarationsExportNamespace/node/declarationsExportNamespace.errors.txt @@ -0,0 +1,16 @@ +useModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (0 errors) ==== + export interface A { + b: number; + } + export as namespace moduleA; +==== useModule.ts (1 errors) ==== + module moduleB { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface IUseModuleA { + a: moduleA.A; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.errors.txt b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.errors.txt new file mode 100644 index 0000000000000..8b327b39c769b --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/amd/declarationsImportedInPrivate.errors.txt @@ -0,0 +1,25 @@ +useModule.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== private_m4.ts (0 errors) ==== + + export class d { + }; + export var x: d; + export function foo(): d { + return new d(); + } + + +==== useModule.ts (1 errors) ==== + // only used privately no need to emit + import private_m4 = require("private_m4"); + export module usePrivate_m4_m1 { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + + export var numberVar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.errors.txt b/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.errors.txt new file mode 100644 index 0000000000000..8b327b39c769b --- /dev/null +++ b/tests/baselines/reference/project/declarationsImportedInPrivate/node/declarationsImportedInPrivate.errors.txt @@ -0,0 +1,25 @@ +useModule.ts(3,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== private_m4.ts (0 errors) ==== + + export class d { + }; + export var x: d; + export function foo(): d { + return new d(); + } + + +==== useModule.ts (1 errors) ==== + // only used privately no need to emit + import private_m4 = require("private_m4"); + export module usePrivate_m4_m1 { + ~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + + export var numberVar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.errors.txt b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.errors.txt new file mode 100644 index 0000000000000..9f8ee7b35098e --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/amd/declarationsMultipleTimesImport.errors.txt @@ -0,0 +1,34 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + // Do not emit multiple used import statements + import multiImport_m4 = require("m4"); // Emit used + export var useMultiImport_m4_x4 = multiImport_m4.x; + export var useMultiImport_m4_d4 = multiImport_m4.d; + export var useMultiImport_m4_f4 = multiImport_m4.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.errors.txt b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.errors.txt new file mode 100644 index 0000000000000..9f8ee7b35098e --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/declarationsMultipleTimesImport.errors.txt @@ -0,0 +1,34 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + // Do not emit multiple used import statements + import multiImport_m4 = require("m4"); // Emit used + export var useMultiImport_m4_x4 = multiImport_m4.x; + export var useMultiImport_m4_d4 = multiImport_m4.d; + export var useMultiImport_m4_f4 = multiImport_m4.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.errors.txt b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.errors.txt new file mode 100644 index 0000000000000..85662c10ae1cc --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/amd/declarationsMultipleTimesMultipleImport.errors.txt @@ -0,0 +1,37 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== m5.ts (0 errors) ==== + import m4 = require("m4"); // Emit used + export function foo2() { + return new m4.d(); + } +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + // Do not emit unused import + import m5 = require("m5"); + export var d = m5.foo2(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.errors.txt b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.errors.txt new file mode 100644 index 0000000000000..85662c10ae1cc --- /dev/null +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/declarationsMultipleTimesMultipleImport.errors.txt @@ -0,0 +1,37 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== m5.ts (0 errors) ==== + import m4 = require("m4"); // Emit used + export function foo2() { + return new m4.d(); + } +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + // Do not emit unused import + import m5 = require("m5"); + export var d = m5.foo2(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.errors.txt b/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.errors.txt new file mode 100644 index 0000000000000..83c8306296bae --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/amd/declarationsSimpleImport.errors.txt @@ -0,0 +1,28 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.errors.txt b/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.errors.txt new file mode 100644 index 0000000000000..83c8306296bae --- /dev/null +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/declarationsSimpleImport.errors.txt @@ -0,0 +1,28 @@ +useModule.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== m4.ts (0 errors) ==== + export class d { + }; + export var x: d; + export function foo() { + return new d(); + } + +==== useModule.ts (1 errors) ==== + import m4 = require("m4"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt new file mode 100644 index 0000000000000..f33bb1534c711 --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/amd/declareExportAdded.errors.txt @@ -0,0 +1,15 @@ +ref.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ref.d.ts (1 errors) ==== + declare module M1 + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function f1(): void; + } +==== consumer.ts (0 errors) ==== + /// + + // in the generated code a 'this' is added before this call + M1.f1(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt new file mode 100644 index 0000000000000..f33bb1534c711 --- /dev/null +++ b/tests/baselines/reference/project/declareExportAdded/node/declareExportAdded.errors.txt @@ -0,0 +1,15 @@ +ref.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== ref.d.ts (1 errors) ==== + declare module M1 + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function f1(): void; + } +==== consumer.ts (0 errors) ==== + /// + + // in the generated code a 'this' is added before this call + M1.f1(); \ No newline at end of file diff --git a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt index 73d3a86d014bc..7e48e7a264743 100644 --- a/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt +++ b/tests/baselines/reference/project/declareVariableCollision/amd/declareVariableCollision.errors.txt @@ -1,16 +1,22 @@ +decl.d.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +decl.d.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. in1.d.ts(1,8): error TS2300: Duplicate identifier 'a'. in2.d.ts(1,8): error TS2300: Duplicate identifier 'a'. -==== decl.d.ts (0 errors) ==== +==== decl.d.ts (2 errors) ==== // bug 535531: duplicate identifier error reported for "import" declarations in separate files declare module A + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { class MyRoot { } export module B + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { class MyClass{ } } diff --git a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt index 73d3a86d014bc..7e48e7a264743 100644 --- a/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt +++ b/tests/baselines/reference/project/declareVariableCollision/node/declareVariableCollision.errors.txt @@ -1,16 +1,22 @@ +decl.d.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +decl.d.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. in1.d.ts(1,8): error TS2300: Duplicate identifier 'a'. in2.d.ts(1,8): error TS2300: Duplicate identifier 'a'. -==== decl.d.ts (0 errors) ==== +==== decl.d.ts (2 errors) ==== // bug 535531: duplicate identifier error reported for "import" declarations in separate files declare module A + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { class MyRoot { } export module B + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { class MyClass{ } } diff --git a/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.errors.txt new file mode 100644 index 0000000000000..7e6664decf2a3 --- /dev/null +++ b/tests/baselines/reference/project/extReferencingExtAndInt/amd/extReferencingExtAndInt.errors.txt @@ -0,0 +1,19 @@ +internal.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internal.ts (1 errors) ==== + module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var b = "foo"; + } +==== external2.ts (0 errors) ==== + export function square(x: number) { + return (x * x); + } +==== external.ts (0 errors) ==== + /// + import a = require("external2"); + + outer.b = "bar"; + var c = a.square(5); \ No newline at end of file diff --git a/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.errors.txt new file mode 100644 index 0000000000000..7e6664decf2a3 --- /dev/null +++ b/tests/baselines/reference/project/extReferencingExtAndInt/node/extReferencingExtAndInt.errors.txt @@ -0,0 +1,19 @@ +internal.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== internal.ts (1 errors) ==== + module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var b = "foo"; + } +==== external2.ts (0 errors) ==== + export function square(x: number) { + return (x * x); + } +==== external.ts (0 errors) ==== + /// + import a = require("external2"); + + outer.b = "bar"; + var c = a.square(5); \ No newline at end of file diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt index 5bdeea3038458..5b501b8106d7e 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt @@ -1,9 +1,12 @@ +internal2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internal2.ts(2,21): error TS1147: Import declarations in a namespace cannot reference a module. internal2.ts(2,21): error TS2792: Cannot find module 'external2'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== internal2.ts (2 errors) ==== +==== internal2.ts (3 errors) ==== module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import g = require("external2") ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt index 5bdeea3038458..5b501b8106d7e 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt @@ -1,9 +1,12 @@ +internal2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. internal2.ts(2,21): error TS1147: Import declarations in a namespace cannot reference a module. internal2.ts(2,21): error TS2792: Cannot find module 'external2'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== internal2.ts (2 errors) ==== +==== internal2.ts (3 errors) ==== module outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import g = require("external2") ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.errors.txt b/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.errors.txt new file mode 100644 index 0000000000000..7b619abdb0fc0 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering1/amd/moduleMergingOrdering1.errors.txt @@ -0,0 +1,31 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + one: string; + two: boolean; + constructor (t: string) { + this.one = t; + this.two = false; + } + } + export class B { + private member: A[]; + + constructor () { + this.member = []; + } + } + } + +==== b.ts (1 errors) ==== + module Test {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.errors.txt b/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.errors.txt new file mode 100644 index 0000000000000..7b619abdb0fc0 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering1/node/moduleMergingOrdering1.errors.txt @@ -0,0 +1,31 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + one: string; + two: boolean; + constructor (t: string) { + this.one = t; + this.two = false; + } + } + export class B { + private member: A[]; + + constructor () { + this.member = []; + } + } + } + +==== b.ts (1 errors) ==== + module Test {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.errors.txt b/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.errors.txt new file mode 100644 index 0000000000000..ec5d48f9b5233 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering2/amd/moduleMergingOrdering2.errors.txt @@ -0,0 +1,31 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== b.ts (1 errors) ==== + module Test {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + one: string; + two: boolean; + constructor (t: string) { + this.one = t; + this.two = false; + } + } + export class B { + private member: A[]; + + constructor () { + this.member = []; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.errors.txt b/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.errors.txt new file mode 100644 index 0000000000000..ec5d48f9b5233 --- /dev/null +++ b/tests/baselines/reference/project/moduleMergingOrdering2/node/moduleMergingOrdering2.errors.txt @@ -0,0 +1,31 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== b.ts (1 errors) ==== + module Test {} + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.ts (1 errors) ==== + module Test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A { + one: string; + two: boolean; + constructor (t: string) { + this.one = t; + this.two = false; + } + } + export class B { + private member: A[]; + + constructor () { + this.member = []; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.errors.txt b/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.errors.txt new file mode 100644 index 0000000000000..ba73cae1e8aa6 --- /dev/null +++ b/tests/baselines/reference/project/nestedDeclare/amd/nestedDeclare.errors.txt @@ -0,0 +1,19 @@ +consume.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +consume.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consume.ts (2 errors) ==== + declare module "math" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + import blah = require("blah"); + export function baz(); + } + + declare module "blah" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.errors.txt b/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.errors.txt new file mode 100644 index 0000000000000..ba73cae1e8aa6 --- /dev/null +++ b/tests/baselines/reference/project/nestedDeclare/node/nestedDeclare.errors.txt @@ -0,0 +1,19 @@ +consume.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +consume.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consume.ts (2 errors) ==== + declare module "math" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + import blah = require("blah"); + export function baz(); + } + + declare module "blah" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt index 2b17a05139aff..bd18d1a9b653c 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt @@ -1,8 +1,11 @@ +test1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test1.ts(2,23): error TS1147: Import declarations in a namespace cannot reference a module. -==== test1.ts (1 errors) ==== +==== test1.ts (2 errors) ==== export module myModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import foo = require("test2"); ~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt index 2b17a05139aff..bd18d1a9b653c 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt @@ -1,8 +1,11 @@ +test1.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test1.ts(2,23): error TS1147: Import declarations in a namespace cannot reference a module. -==== test1.ts (1 errors) ==== +==== test1.ts (2 errors) ==== export module myModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import foo = require("test2"); ~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt index f42b5a7fc941a..825dda72b6d8f 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,9 +1,12 @@ +test1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test1.ts(3,23): error TS1147: Import declarations in a namespace cannot reference a module. test1.ts(3,23): error TS2792: Cannot find module 'test2'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== test1.ts (2 errors) ==== +==== test1.ts (3 errors) ==== module myModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import foo = require("test2"); ~~~~~~~ diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt index f42b5a7fc941a..825dda72b6d8f 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,9 +1,12 @@ +test1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test1.ts(3,23): error TS1147: Import declarations in a namespace cannot reference a module. test1.ts(3,23): error TS2792: Cannot find module 'test2'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== test1.ts (2 errors) ==== +==== test1.ts (3 errors) ==== module myModule { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import foo = require("test2"); ~~~~~~~ diff --git a/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.errors.txt b/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.errors.txt new file mode 100644 index 0000000000000..4df454d3a55bc --- /dev/null +++ b/tests/baselines/reference/project/nestedReferenceTags/amd/nestedReferenceTags.errors.txt @@ -0,0 +1,29 @@ +lib/classA.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +lib/classB.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== lib/classA.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA + { + public method() { } + } + } +==== lib/classB.ts (1 errors) ==== + /// + + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassB extends ClassA + { + } + } +==== main.ts (0 errors) ==== + /// + /// + + class ClassC extends test.ClassA { + } \ No newline at end of file diff --git a/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.errors.txt b/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.errors.txt new file mode 100644 index 0000000000000..4df454d3a55bc --- /dev/null +++ b/tests/baselines/reference/project/nestedReferenceTags/node/nestedReferenceTags.errors.txt @@ -0,0 +1,29 @@ +lib/classA.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +lib/classB.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== lib/classA.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA + { + public method() { } + } + } +==== lib/classB.ts (1 errors) ==== + /// + + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassB extends ClassA + { + } + } +==== main.ts (0 errors) ==== + /// + /// + + class ClassC extends test.ClassA { + } \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFile/amd/outMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/outMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/outMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/outModuleMultifolderSpecifyOutputFile/amd/outModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/outModuleSimpleSpecifyOutputFile/amd/outModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/outModuleSubfolderSpecifyOutputFile/amd/outModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index f644b2a3a90d3..de8a496571a7a 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,11 +1,14 @@ +testGlo.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. testGlo.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. testGlo.ts(2,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? testGlo.ts(21,35): error TS1147: Import declarations in a namespace cannot reference a module. testGlo.ts(21,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== testGlo.ts (4 errors) ==== +==== testGlo.ts (5 errors) ==== module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index f644b2a3a90d3..de8a496571a7a 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,11 +1,14 @@ +testGlo.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. testGlo.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. testGlo.ts(2,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? testGlo.ts(21,35): error TS1147: Import declarations in a namespace cannot reference a module. testGlo.ts(21,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== testGlo.ts (4 errors) ==== +==== testGlo.ts (5 errors) ==== module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 61ae9d8331704..7950dcd7afb1e 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,14 +1,20 @@ +test.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(5,39): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(5,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? test.ts(24,35): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(24,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== test.ts (4 errors) ==== +==== test.ts (6 errors) ==== export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index 61ae9d8331704..7950dcd7afb1e 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,14 +1,20 @@ +test.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(5,39): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(5,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? test.ts(24,35): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(24,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? -==== test.ts (4 errors) ==== +==== test.ts (6 errors) ==== export module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index a454af4a3fed9..388c42041750c 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,11 +1,18 @@ +test.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(2,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +test.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(23,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(42,35): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +test.ts(43,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(63,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== test.ts (4 errors) ==== +==== test.ts (9 errors) ==== export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. @@ -13,6 +20,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to !!! error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? module Internal_M1 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -32,6 +41,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to } export module Internal_M2 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -56,6 +67,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? module Internal_M3 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); @@ -76,6 +89,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to } export module Internal_M4 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index a454af4a3fed9..388c42041750c 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,11 +1,18 @@ +test.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(2,39): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(2,39): error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +test.ts(4,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(23,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. test.ts(42,35): error TS1147: Import declarations in a namespace cannot reference a module. test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +test.ts(43,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.ts(63,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== test.ts (4 errors) ==== +==== test.ts (9 errors) ==== export module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import mExported = require("mExported"); ~~~~~~~~~~~ !!! error TS1147: Import declarations in a namespace cannot reference a module. @@ -13,6 +20,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to !!! error TS2792: Cannot find module 'mExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? module Internal_M1 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -32,6 +41,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to } export module Internal_M2 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c1 = new mExported.me.class1; export function f1() { return new mExported.me.class1(); @@ -56,6 +67,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'mNonExported'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? module Internal_M3 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); @@ -76,6 +89,8 @@ test.ts(42,35): error TS2792: Cannot find module 'mNonExported'. Did you mean to } export module Internal_M4 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt new file mode 100644 index 0000000000000..342b9f17db19b --- /dev/null +++ b/tests/baselines/reference/project/prologueEmit/amd/prologueEmit.errors.txt @@ -0,0 +1,15 @@ +__extends.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== globalThisCapture.ts (0 errors) ==== + // Add a lambda to ensure global 'this' capture is triggered + (()=>this.window); + +==== __extends.ts (1 errors) ==== + // class inheritance to ensure __extends is emitted + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class base {} + export class child extends base {} + } \ No newline at end of file diff --git a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt index ef77af7372ee7..a8cc7ef2a986a 100644 --- a/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt +++ b/tests/baselines/reference/project/prologueEmit/node/prologueEmit.errors.txt @@ -1,4 +1,5 @@ error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. +__extends.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. !!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. @@ -6,9 +7,11 @@ error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. // Add a lambda to ensure global 'this' capture is triggered (()=>this.window); -==== __extends.ts (0 errors) ==== +==== __extends.ts (1 errors) ==== // class inheritance to ensure __extends is emitted module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class base {} export class child extends base {} } \ No newline at end of file diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.errors.txt b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.errors.txt new file mode 100644 index 0000000000000..3a66064f9a71e --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/quotesInFileAndDirectoryNames.errors.txt @@ -0,0 +1,17 @@ +li'b/class'A.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== li'b/class'A.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA + { + public method() { } + } + } +==== m'ain.ts (0 errors) ==== + /// + + class ClassC extends test.ClassA { + } \ No newline at end of file diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.errors.txt b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.errors.txt new file mode 100644 index 0000000000000..3a66064f9a71e --- /dev/null +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/quotesInFileAndDirectoryNames.errors.txt @@ -0,0 +1,17 @@ +li'b/class'A.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== li'b/class'A.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA + { + public method() { } + } + } +==== m'ain.ts (0 errors) ==== + /// + + class ClassC extends test.ClassA { + } \ No newline at end of file diff --git a/tests/baselines/reference/project/referencePathStatic/amd/referencePathStatic.errors.txt b/tests/baselines/reference/project/referencePathStatic/amd/referencePathStatic.errors.txt new file mode 100644 index 0000000000000..5f65923e7926f --- /dev/null +++ b/tests/baselines/reference/project/referencePathStatic/amd/referencePathStatic.errors.txt @@ -0,0 +1,14 @@ +lib.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== lib.ts (1 errors) ==== + module Lib { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class LibType {} + } + +==== test.ts (0 errors) ==== + /// + + var libType: Lib.LibType; \ No newline at end of file diff --git a/tests/baselines/reference/project/referencePathStatic/node/referencePathStatic.errors.txt b/tests/baselines/reference/project/referencePathStatic/node/referencePathStatic.errors.txt new file mode 100644 index 0000000000000..5f65923e7926f --- /dev/null +++ b/tests/baselines/reference/project/referencePathStatic/node/referencePathStatic.errors.txt @@ -0,0 +1,14 @@ +lib.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== lib.ts (1 errors) ==== + module Lib { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class LibType {} + } + +==== test.ts (0 errors) ==== + /// + + var libType: Lib.LibType; \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.errors.txt b/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.errors.txt new file mode 100644 index 0000000000000..99f965b56b6a7 --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobalRef/amd/relativeGlobalRef.errors.txt @@ -0,0 +1,20 @@ +decl.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (1 errors) ==== + declare module "decl" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function call(); + } +==== consume.ts (0 errors) ==== + /// + import decl = require("decl"); + var str = decl.call(); + + declare function fail(); + + if(str !== "success") { + fail(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.errors.txt b/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.errors.txt new file mode 100644 index 0000000000000..99f965b56b6a7 --- /dev/null +++ b/tests/baselines/reference/project/relativeGlobalRef/node/relativeGlobalRef.errors.txt @@ -0,0 +1,20 @@ +decl.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (1 errors) ==== + declare module "decl" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function call(); + } +==== consume.ts (0 errors) ==== + /// + import decl = require("decl"); + var str = decl.call(); + + declare function fail(); + + if(str !== "success") { + fail(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.errors.txt b/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.errors.txt new file mode 100644 index 0000000000000..905e221b3ecf8 --- /dev/null +++ b/tests/baselines/reference/project/relativeNestedRef/amd/relativeNestedRef.errors.txt @@ -0,0 +1,20 @@ +decl.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (1 errors) ==== + declare module "decl" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function call(); + } +==== main/consume.ts (0 errors) ==== + /// + import decl = require("decl"); + var str = decl.call(); + + declare function fail(); + + if(str !== "success") { + fail(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.errors.txt b/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.errors.txt new file mode 100644 index 0000000000000..905e221b3ecf8 --- /dev/null +++ b/tests/baselines/reference/project/relativeNestedRef/node/relativeNestedRef.errors.txt @@ -0,0 +1,20 @@ +decl.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== decl.d.ts (1 errors) ==== + declare module "decl" + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export function call(); + } +==== main/consume.ts (0 errors) ==== + /// + import decl = require("decl"); + var str = decl.call(); + + declare function fail(); + + if(str !== "success") { + fail(); + } \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..221b3ba88b16e --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,27 @@ +bin/test.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt new file mode 100644 index 0000000000000..e5c74a8f6e315 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.dts.errors.txt @@ -0,0 +1,27 @@ +bin/outAndOutDirFile.d.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/outAndOutDirFile.d.ts (1 errors) ==== + declare var m1_a1: number; + declare class m1_c1 { + m1_c1_p1: number; + } + declare var m1_instance1: m1_c1; + declare function m1_f1(): m1_c1; + declare module "ref/m2" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare var a1: number; + declare class c1 { + p1: number; + } + declare var instance1: c1; + declare function f1(): c1; + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..72bfc64eeb902 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,41 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (3 errors) ==== + declare module "outputdir_module_multifolder/ref/m1" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "outputdir_module_multifolder_ref/m2" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m2_a1: number; + export class m2_c1 { + m2_c1_p1: number; + } + export var m2_instance1: m2_c1; + export function m2_f1(): m2_c1; + } + declare module "outputdir_module_multifolder/test" { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("outputdir_module_multifolder/ref/m1"); + import m2 = require("outputdir_module_multifolder_ref/m2"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + export var a3: typeof m2.m2_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..c5973c767749f --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "m1" { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt new file mode 100644 index 0000000000000..abfeb32dbcb63 --- /dev/null +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.dts.errors.txt @@ -0,0 +1,28 @@ +bin/test.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +bin/test.d.ts(9,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== bin/test.d.ts (2 errors) ==== + declare module "ref/m1" { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var m1_a1: number; + export class m1_c1 { + m1_c1_p1: number; + } + export var m1_instance1: m1_c1; + export function m1_f1(): m1_c1; + } + declare module "test" { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import m1 = require("ref/m1"); + export var a1: number; + export class c1 { + p1: number; + } + export var instance1: c1; + export function f1(): c1; + export var a2: typeof m1.m1_c1; + } + \ No newline at end of file diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.errors.txt b/tests/baselines/reference/propertyNamesWithStringLiteral.errors.txt new file mode 100644 index 0000000000000..df4c934156386 --- /dev/null +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.errors.txt @@ -0,0 +1,22 @@ +propertyNamesWithStringLiteral.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== propertyNamesWithStringLiteral.ts (1 errors) ==== + class _Color { + a: number; r: number; g: number; b: number; + } + + interface NamedColors { + azure: _Color; + "blue": _Color; + "pale blue": _Color; + } + module Color { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var namedColors: NamedColors; + } + var a = Color.namedColors["azure"]; + var a = Color.namedColors.blue; // Should not error + var a = Color.namedColors["pale blue"]; // should not error + \ No newline at end of file diff --git a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.errors.txt b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.errors.txt index 9e23438a337e4..197a225193547 100644 --- a/tests/baselines/reference/protectedStaticNotAccessibleInClodule.errors.txt +++ b/tests/baselines/reference/protectedStaticNotAccessibleInClodule.errors.txt @@ -1,7 +1,8 @@ +protectedStaticNotAccessibleInClodule.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. protectedStaticNotAccessibleInClodule.ts(10,22): error TS2445: Property 'bar' is protected and only accessible within class 'C' and its subclasses. -==== protectedStaticNotAccessibleInClodule.ts (1 errors) ==== +==== protectedStaticNotAccessibleInClodule.ts (2 errors) ==== // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. class C { @@ -10,6 +11,8 @@ protectedStaticNotAccessibleInClodule.ts(10,22): error TS2445: Property 'bar' is } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var f = C.foo; // OK export var b = C.bar; // error ~~~ diff --git a/tests/baselines/reference/qualifiedModuleLocals.errors.txt b/tests/baselines/reference/qualifiedModuleLocals.errors.txt index cb58cd72e18a4..fcc32dd360094 100644 --- a/tests/baselines/reference/qualifiedModuleLocals.errors.txt +++ b/tests/baselines/reference/qualifiedModuleLocals.errors.txt @@ -1,8 +1,11 @@ +qualifiedModuleLocals.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. qualifiedModuleLocals.ts(5,27): error TS2339: Property 'b' does not exist on type 'typeof A'. -==== qualifiedModuleLocals.ts (1 errors) ==== +==== qualifiedModuleLocals.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. function b() {} diff --git a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.errors.txt b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.errors.txt new file mode 100644 index 0000000000000..f2b5d83af2169 --- /dev/null +++ b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.errors.txt @@ -0,0 +1,19 @@ +qualifiedName_ImportDeclarations-entity-names-referencing-a-var.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualifiedName_ImportDeclarations-entity-names-referencing-a-var.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== qualifiedName_ImportDeclarations-entity-names-referencing-a-var.ts (2 errors) ==== + module Alpha { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 100; + } + + module Beta { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import p = Alpha.x; + } + + + var x = Alpha.x \ No newline at end of file diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt index c00b1baace4b4..bcb69ad22c6d9 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.errors.txt @@ -1,8 +1,11 @@ +qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts(5,20): error TS2507: Type 'number' is not a constructor function type. -==== qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts (1 errors) ==== +==== qualifiedName_entity-name-resolution-does-not-affect-class-heritage.ts (2 errors) ==== module Alpha { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 100; } diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index e1e3b3218758f..a47021220490d 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,5 +1,16 @@ +qualify.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(3,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(9,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(20,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. +qualify.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(29,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. +qualify.ts(34,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(35,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +qualify.ts(40,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. qualify.ts(45,13): error TS2741: Property 'zeep' is missing in type 'I4' but required in type 'I3'. qualify.ts(46,13): error TS2740: Type 'I4' is missing the following properties from type 'I3[]': length, pop, push, concat, and 16 more. qualify.ts(47,13): error TS2322: Type 'I4' is not assignable to type '() => I3'. @@ -10,16 +21,24 @@ qualify.ts(49,13): error TS2741: Property 'k' is missing in type 'I4' but requir qualify.ts(58,5): error TS2741: Property 'p' is missing in type 'I' but required in type 'T.I'. -==== qualify.ts (8 errors) ==== +==== qualify.ts (19 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var m=0; export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n=1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var y=m; var x=n+y; } @@ -27,10 +46,14 @@ qualify.ts(58,5): error TS2741: Property 'p' is missing in type 'I' but required module T { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { p; } export module U { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var z:I=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I'. @@ -41,7 +64,11 @@ qualify.ts(58,5): error TS2741: Property 'p' is missing in type 'I' but required } module Peer { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module U2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var z:T.U.I2=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I2'. @@ -49,12 +76,18 @@ qualify.ts(58,5): error TS2741: Property 'p' is missing in type 'I' but required } module Everest { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module K1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I3 { zeep; } } export module K2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I4 { z; } diff --git a/tests/baselines/reference/reExportAliasMakesInstantiated.errors.txt b/tests/baselines/reference/reExportAliasMakesInstantiated.errors.txt new file mode 100644 index 0000000000000..f7c702f97efbc --- /dev/null +++ b/tests/baselines/reference/reExportAliasMakesInstantiated.errors.txt @@ -0,0 +1,35 @@ +reExportAliasMakesInstantiated.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reExportAliasMakesInstantiated.ts(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reExportAliasMakesInstantiated.ts(11,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reExportAliasMakesInstantiated.ts(15,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== reExportAliasMakesInstantiated.ts (4 errors) ==== + declare module pack1 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + const test1: string; + export { test1 }; + } + declare module pack2 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import test1 = pack1.test1; + export { test1 }; + } + export import test1 = pack2.test1; + + declare module mod1 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + type test1 = string; + export { test1 }; + } + declare module mod2 { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import test1 = mod1.test1; + export { test1 }; + } + const test2 = mod2; // Possible false positive instantiation, but ok + \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks1.errors.txt b/tests/baselines/reference/reachabilityChecks1.errors.txt index d25977a05b774..e1e7fc16e6cf2 100644 --- a/tests/baselines/reference/reachabilityChecks1.errors.txt +++ b/tests/baselines/reference/reachabilityChecks1.errors.txt @@ -1,19 +1,31 @@ reachabilityChecks1.ts(2,1): error TS7027: Unreachable code detected. +reachabilityChecks1.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reachabilityChecks1.ts(6,5): error TS7027: Unreachable code detected. +reachabilityChecks1.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks1.ts(11,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks1.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reachabilityChecks1.ts(18,5): error TS7027: Unreachable code detected. +reachabilityChecks1.ts(18,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks1.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks1.ts(28,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reachabilityChecks1.ts(30,5): error TS7027: Unreachable code detected. +reachabilityChecks1.ts(30,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reachabilityChecks1.ts(47,5): error TS7027: Unreachable code detected. +reachabilityChecks1.ts(51,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks1.ts(53,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reachabilityChecks1.ts(60,5): error TS7027: Unreachable code detected. reachabilityChecks1.ts(69,5): error TS7027: Unreachable code detected. -==== reachabilityChecks1.ts (7 errors) ==== +==== reachabilityChecks1.ts (17 errors) ==== while (true); var x = 1; ~~~~~~~~~~ !!! error TS7027: Unreachable code detected. module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while (true); let x; ~~~~~~ @@ -21,16 +33,24 @@ reachabilityChecks1.ts(69,5): error TS7027: Unreachable code detected. } module A1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. do {} while(true); module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface F {} } } module A2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while (true); module A { ~~~~~~~~~~ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x = 1; ~~~~~~~~~~~~~~~~~~ } @@ -39,14 +59,20 @@ reachabilityChecks1.ts(69,5): error TS7027: Unreachable code detected. } module A3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while (true); type T = string; } module A4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while (true); module A { ~~~~~~~~~~ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const enum E { X } ~~~~~~~~~~~~~~~~~~~~~~~~~~ } @@ -74,8 +100,12 @@ reachabilityChecks1.ts(69,5): error TS7027: Unreachable code detected. } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. for (; ;); module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } } diff --git a/tests/baselines/reference/reachabilityChecks2.errors.txt b/tests/baselines/reference/reachabilityChecks2.errors.txt index 28d29d72eed30..682649ece3d69 100644 --- a/tests/baselines/reference/reachabilityChecks2.errors.txt +++ b/tests/baselines/reference/reachabilityChecks2.errors.txt @@ -1,16 +1,22 @@ reachabilityChecks2.ts(4,1): error TS7027: Unreachable code detected. +reachabilityChecks2.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reachabilityChecks2.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== reachabilityChecks2.ts (1 errors) ==== +==== reachabilityChecks2.ts (3 errors) ==== while (true) { } const enum E { X } module A4 { ~~~~~~~~~~~ + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. while (true); ~~~~~~~~~~~~~~~~~ module A { ~~~~~~~~~~~~~~ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. const enum E { X } ~~~~~~~~~~~~~~~~~~~~~~~~~~ } diff --git a/tests/baselines/reference/reboundBaseClassSymbol.errors.txt b/tests/baselines/reference/reboundBaseClassSymbol.errors.txt new file mode 100644 index 0000000000000..3caa053ae4b97 --- /dev/null +++ b/tests/baselines/reference/reboundBaseClassSymbol.errors.txt @@ -0,0 +1,11 @@ +reboundBaseClassSymbol.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== reboundBaseClassSymbol.ts (1 errors) ==== + interface A { a: number; } + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var A = 1; + interface B extends A { b: string; } + } \ No newline at end of file diff --git a/tests/baselines/reference/reboundIdentifierOnImportAlias.errors.txt b/tests/baselines/reference/reboundIdentifierOnImportAlias.errors.txt index 302f7d27e9be4..5fa4b627e9820 100644 --- a/tests/baselines/reference/reboundIdentifierOnImportAlias.errors.txt +++ b/tests/baselines/reference/reboundIdentifierOnImportAlias.errors.txt @@ -1,11 +1,17 @@ +reboundIdentifierOnImportAlias.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reboundIdentifierOnImportAlias.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reboundIdentifierOnImportAlias.ts(6,16): error TS2437: Module 'Foo' is hidden by a local declaration with the same name. -==== reboundIdentifierOnImportAlias.ts (1 errors) ==== +==== reboundIdentifierOnImportAlias.ts (3 errors) ==== module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = "hello"; } module Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var Foo = 1; import F = Foo; ~~~ diff --git a/tests/baselines/reference/rectype.errors.txt b/tests/baselines/reference/rectype.errors.txt new file mode 100644 index 0000000000000..10245e58bdd61 --- /dev/null +++ b/tests/baselines/reference/rectype.errors.txt @@ -0,0 +1,19 @@ +rectype.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== rectype.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface I { (i:I):I; } + + export function f(p: I) { return f }; + + var i:I; + + f(i); + f(f(i)); + f((f(f(i)))); + } + + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveBaseCheck.errors.txt b/tests/baselines/reference/recursiveBaseCheck.errors.txt index 25e999d547bd7..d4e363850232b 100644 --- a/tests/baselines/reference/recursiveBaseCheck.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck.errors.txt @@ -1,3 +1,4 @@ +recursiveBaseCheck.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveBaseCheck.ts(2,11): error TS2506: 'C' is referenced directly or indirectly in its own base expression. recursiveBaseCheck.ts(4,18): error TS2506: 'B' is referenced directly or indirectly in its own base expression. recursiveBaseCheck.ts(6,18): error TS2506: 'A' is referenced directly or indirectly in its own base expression. @@ -5,8 +6,10 @@ recursiveBaseCheck.ts(8,18): error TS2506: 'AmChart' is referenced directly or i recursiveBaseCheck.ts(10,18): error TS2506: 'D' is referenced directly or indirectly in its own base expression. -==== recursiveBaseCheck.ts (5 errors) ==== +==== recursiveBaseCheck.ts (6 errors) ==== declare module Module { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C extends D { ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. diff --git a/tests/baselines/reference/recursiveBaseCheck2.errors.txt b/tests/baselines/reference/recursiveBaseCheck2.errors.txt index 043d805a779b4..728f4b7a70064 100644 --- a/tests/baselines/reference/recursiveBaseCheck2.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck2.errors.txt @@ -1,9 +1,20 @@ +recursiveBaseCheck2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveBaseCheck2.ts(1,22): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveBaseCheck2.ts(1,32): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveBaseCheck2.ts(2,18): error TS2506: 'b2CircleShape' is referenced directly or indirectly in its own base expression. recursiveBaseCheck2.ts(4,18): error TS2506: 'b2Shape' is referenced directly or indirectly in its own base expression. +recursiveBaseCheck2.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveBaseCheck2.ts(7,22): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== recursiveBaseCheck2.ts (2 errors) ==== +==== recursiveBaseCheck2.ts (7 errors) ==== declare module Box2D.Collision.Shapes { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class b2CircleShape extends b2Shape { ~~~~~~~~~~~~~ !!! error TS2506: 'b2CircleShape' is referenced directly or indirectly in its own base expression. @@ -14,6 +25,10 @@ recursiveBaseCheck2.ts(4,18): error TS2506: 'b2Shape' is referenced directly or } } declare module Box2D.Dynamics { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class b2ContactListener extends Box2D.Collision.Shapes.b2Shape { } export class b2FixtureDef extends Box2D.Dynamics.b2ContactListener { diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.errors.txt b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.errors.txt new file mode 100644 index 0000000000000..2da4b914f98a7 --- /dev/null +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.errors.txt @@ -0,0 +1,15 @@ +recursiveClassInstantiationsWithDefaultConstructors.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveClassInstantiationsWithDefaultConstructors.ts (1 errors) ==== + module TypeScript2 { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class MemberName { + public prefix: string = ""; + } + export class MemberNameArray extends MemberName { + } + } + + var a = new TypeScript2.MemberNameArray() \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt index 06fffd62af382..9492b6e8fa52f 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt @@ -1,17 +1,34 @@ +recursiveClassReferenceTest.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(6,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveClassReferenceTest.ts(16,19): error TS2304: Cannot find name 'Element'. +recursiveClassReferenceTest.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(32,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(32,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(32,29): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(44,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(44,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveClassReferenceTest.ts(56,11): error TS2663: Cannot find name 'domNode'. Did you mean the instance member 'this.domNode'? +recursiveClassReferenceTest.ts(76,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(76,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(76,21): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveClassReferenceTest.ts(76,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveClassReferenceTest.ts(88,36): error TS2663: Cannot find name 'mode'. Did you mean the instance member 'this.mode'? recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' is not assignable to parameter of type 'IMode'. Property 'getInitialState' is missing in type 'Window' but required in type 'IMode'. -==== recursiveClassReferenceTest.ts (4 errors) ==== +==== recursiveClassReferenceTest.ts (17 errors) ==== // Scenario 1: Test reqursive function call with "this" parameter // Scenario 2: Test recursive function call with cast and "this" parameter declare module Sample.Thing { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IWidget { getDomNode(): any; @@ -40,6 +57,14 @@ recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' i } module Sample.Actions.Thing.Find { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class StartFindAction implements Sample.Thing.IAction { public getId() { return "yo"; } @@ -52,6 +77,12 @@ recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' i } module Sample.Thing.Widgets { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class FindWidget implements Sample.Thing.IWidget { public gar(runner:(widget:Sample.Thing.IWidget)=>any) { if (true) {return runner(this);}} @@ -86,6 +117,14 @@ recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' i declare var self: Window; module Sample.Thing.Languages.PlainText { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class State implements IState { constructor(private mode: IMode) { } diff --git a/tests/baselines/reference/recursiveCloduleReference.errors.txt b/tests/baselines/reference/recursiveCloduleReference.errors.txt new file mode 100644 index 0000000000000..65069a723ca41 --- /dev/null +++ b/tests/baselines/reference/recursiveCloduleReference.errors.txt @@ -0,0 +1,19 @@ +recursiveCloduleReference.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveCloduleReference.ts(5,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveCloduleReference.ts (2 errors) ==== + module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + { + export class C { + } + export module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var C = M.C + }; + }; + + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveGenericUnionType1.errors.txt b/tests/baselines/reference/recursiveGenericUnionType1.errors.txt new file mode 100644 index 0000000000000..25f1459682951 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericUnionType1.errors.txt @@ -0,0 +1,30 @@ +recursiveGenericUnionType1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveGenericUnionType1.ts(8,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveGenericUnionType1.ts (2 errors) ==== + declare module Test1 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type Container = T | { + [i: string]: Container; + }; + export type IStringContainer = Container; + } + + declare module Test2 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type Container = T | { + [i: string]: Container; + }; + export type IStringContainer = Container; + } + + var x: Test1.Container; + + var s1: Test1.IStringContainer; + var s2: Test2.IStringContainer; + s1 = s2; + s2 = s1; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveGenericUnionType2.errors.txt b/tests/baselines/reference/recursiveGenericUnionType2.errors.txt new file mode 100644 index 0000000000000..b01797764cba0 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericUnionType2.errors.txt @@ -0,0 +1,30 @@ +recursiveGenericUnionType2.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveGenericUnionType2.ts(8,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveGenericUnionType2.ts (2 errors) ==== + declare module Test1 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type Container = T | { + [i: string]: Container[]; + }; + export type IStringContainer = Container; + } + + declare module Test2 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export type Container = T | { + [i: string]: Container[]; + }; + export type IStringContainer = Container; + } + + var x: Test1.Container; + + var s1: Test1.IStringContainer; + var s2: Test2.IStringContainer; + s1 = s2; + s2 = s1; + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveIdenticalOverloadResolution.errors.txt b/tests/baselines/reference/recursiveIdenticalOverloadResolution.errors.txt new file mode 100644 index 0000000000000..e43451acec4ef --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalOverloadResolution.errors.txt @@ -0,0 +1,22 @@ +recursiveIdenticalOverloadResolution.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveIdenticalOverloadResolution.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface I { (i: I): I; } + + function f(p: I) { return f }; + + var i: I; + + f(i); + + f(f(i)); + + f((f(f(i)))); + + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveMods.errors.txt b/tests/baselines/reference/recursiveMods.errors.txt new file mode 100644 index 0000000000000..374a08f55d432 --- /dev/null +++ b/tests/baselines/reference/recursiveMods.errors.txt @@ -0,0 +1,32 @@ +recursiveMods.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursiveMods.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursiveMods.ts (2 errors) ==== + export module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C {} + } + + export module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + function Bar() : C { + if (true) { return Bar();} + return new C(); + } + + function Baz() : C { + var c = Baz(); + return Bar(); + } + + function Gar() { + var c : C = Baz(); + return; + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeComparison2.errors.txt b/tests/baselines/reference/recursiveTypeComparison2.errors.txt index 799776a7f34fc..6d25ff23f377d 100644 --- a/tests/baselines/reference/recursiveTypeComparison2.errors.txt +++ b/tests/baselines/reference/recursiveTypeComparison2.errors.txt @@ -1,10 +1,13 @@ +recursiveTypeComparison2.ts(3,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. recursiveTypeComparison2.ts(13,80): error TS2304: Cannot find name 'StateValue'. -==== recursiveTypeComparison2.ts (1 errors) ==== +==== recursiveTypeComparison2.ts (2 errors) ==== // Before fix this would cause compiler to hang (#1170) declare module Bacon { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Event { } interface Error extends Event { diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.errors.txt b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.errors.txt new file mode 100644 index 0000000000000..79700fd98119a --- /dev/null +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.errors.txt @@ -0,0 +1,44 @@ +recursivelySpecializedConstructorDeclaration.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursivelySpecializedConstructorDeclaration.ts(1,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursivelySpecializedConstructorDeclaration.ts(1,26): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +recursivelySpecializedConstructorDeclaration.ts(1,31): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== recursivelySpecializedConstructorDeclaration.ts (4 errors) ==== + module MsPortal.Controls.Base.ItemList { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export interface Interface { + // Removing this line fixes the constructor of ItemValue + options: ViewModel; + } + + export class ItemValue { + constructor(value: T) { + } + } + + export class ViewModel extends ItemValue { + } + } + + // Generates: + /* + declare module MsPortal.Controls.Base.ItemList { + interface Interface { + options: ViewModel; + } + class ItemValue { + constructor(value: T); + } + class ViewModel extends ItemValue { + } + } + */ \ No newline at end of file diff --git a/tests/baselines/reference/relativePathToDeclarationFile.errors.txt b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt new file mode 100644 index 0000000000000..475c742a9018d --- /dev/null +++ b/tests/baselines/reference/relativePathToDeclarationFile.errors.txt @@ -0,0 +1,33 @@ +test/foo.d.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test/other.d.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== test/file1.ts (0 errors) ==== + import foo = require('foo'); + import other = require('./other'); + import relMod = require('./sub/relMod'); + + if(foo.M2.x){ + var x = new relMod(other.M2.x.charCodeAt(0)); + } + +==== test/foo.d.ts (1 errors) ==== + export declare module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: boolean; + } + +==== test/other.d.ts (1 errors) ==== + export declare module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x: string; + } + +==== test/sub/relMod.d.ts (0 errors) ==== + declare class Test { + constructor(x: number); + } + export = Test; + \ No newline at end of file diff --git a/tests/baselines/reference/requireEmitSemicolon.errors.txt b/tests/baselines/reference/requireEmitSemicolon.errors.txt new file mode 100644 index 0000000000000..9c2b44ca84b94 --- /dev/null +++ b/tests/baselines/reference/requireEmitSemicolon.errors.txt @@ -0,0 +1,26 @@ +requireEmitSemicolon_0.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +requireEmitSemicolon_1.ts(4,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== requireEmitSemicolon_1.ts (1 errors) ==== + /// + import P = require("requireEmitSemicolon_0"); // bug was we were not emitting a ; here and causing runtime failures in node + + export module Database { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class DB { + public findPerson(id: number): P.Models.Person { + return new P.Models.Person("Rock"); + } + } + } +==== requireEmitSemicolon_0.ts (1 errors) ==== + export module Models { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Person { + constructor(name: string) { } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/reservedNameOnInterfaceImport.errors.txt b/tests/baselines/reference/reservedNameOnInterfaceImport.errors.txt index 2f044a77a9201..1e6e71679d76e 100644 --- a/tests/baselines/reference/reservedNameOnInterfaceImport.errors.txt +++ b/tests/baselines/reference/reservedNameOnInterfaceImport.errors.txt @@ -1,8 +1,11 @@ +reservedNameOnInterfaceImport.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reservedNameOnInterfaceImport.ts(5,12): error TS2438: Import name cannot be 'string'. -==== reservedNameOnInterfaceImport.ts (1 errors) ==== +==== reservedNameOnInterfaceImport.ts (2 errors) ==== declare module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface istring { } // Should error; 'test.istring' is a type, so this import conflicts with the 'string' type. diff --git a/tests/baselines/reference/reservedNameOnModuleImport.errors.txt b/tests/baselines/reference/reservedNameOnModuleImport.errors.txt new file mode 100644 index 0000000000000..5a5c674e8a7d6 --- /dev/null +++ b/tests/baselines/reference/reservedNameOnModuleImport.errors.txt @@ -0,0 +1,16 @@ +reservedNameOnModuleImport.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reservedNameOnModuleImport.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== reservedNameOnModuleImport.ts (2 errors) ==== + declare module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module mstring { } + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Should be fine; this does not clobber any declared values. + export import string = mstring; + } + \ No newline at end of file diff --git a/tests/baselines/reference/reservedNameOnModuleImport.types b/tests/baselines/reference/reservedNameOnModuleImport.types index c98bb89a099dd..706c5070b73c5 100644 --- a/tests/baselines/reference/reservedNameOnModuleImport.types +++ b/tests/baselines/reference/reservedNameOnModuleImport.types @@ -11,6 +11,7 @@ declare module test { export import string = mstring; >string : any > : ^^^ ->mstring : error +>mstring : any +> : ^^^ } diff --git a/tests/baselines/reference/reservedNameOnModuleImportWithInterface.errors.txt b/tests/baselines/reference/reservedNameOnModuleImportWithInterface.errors.txt index 8840f387c6b5d..66bca56307fad 100644 --- a/tests/baselines/reference/reservedNameOnModuleImportWithInterface.errors.txt +++ b/tests/baselines/reference/reservedNameOnModuleImportWithInterface.errors.txt @@ -1,10 +1,16 @@ +reservedNameOnModuleImportWithInterface.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reservedNameOnModuleImportWithInterface.ts(3,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. reservedNameOnModuleImportWithInterface.ts(6,12): error TS2438: Import name cannot be 'string'. -==== reservedNameOnModuleImportWithInterface.ts (1 errors) ==== +==== reservedNameOnModuleImportWithInterface.ts (3 errors) ==== declare module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface mi_string { } module mi_string { } + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Should error; imports both a type and a module, which means it conflicts with the 'string' type. import string = mi_string; diff --git a/tests/baselines/reference/resolveModuleNameWithSameLetDeclarationName1.errors.txt b/tests/baselines/reference/resolveModuleNameWithSameLetDeclarationName1.errors.txt new file mode 100644 index 0000000000000..3260d7343fa71 --- /dev/null +++ b/tests/baselines/reference/resolveModuleNameWithSameLetDeclarationName1.errors.txt @@ -0,0 +1,14 @@ +resolveModuleNameWithSameLetDeclarationName1.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== resolveModuleNameWithSameLetDeclarationName1.ts (1 errors) ==== + declare module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + interface Bar { + + } + } + + let foo: foo.Bar; \ No newline at end of file diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt index 299438f52428c..5db4aca2923ba 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt @@ -1,31 +1,99 @@ +resolvingClassDeclarationWhenInBaseTypeResolution.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(2,45): error TS2449: Class 'nitidus' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(9,56): error TS2449: Class 'mixtus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(17,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(45,48): error TS2449: Class 'psilurus' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(60,44): error TS2449: Class 'jugularis' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(96,44): error TS2449: Class 'aurata' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(102,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(108,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(114,48): error TS2449: Class 'gilbertii' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(126,43): error TS2449: Class 'johorensis' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(153,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(182,54): error TS2449: Class 'falconeri' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(188,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(199,47): error TS2449: Class 'pygmaea' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(238,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(246,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(247,46): error TS2449: Class 'ciliolabrum' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(254,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(272,35): error TS2449: Class 'coludo' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(301,41): error TS2449: Class 'oreas' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(316,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(357,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(375,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(390,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(402,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(403,53): error TS2449: Class 'johorensis' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(424,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(435,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(436,55): error TS2449: Class 'punicus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(451,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(463,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(468,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(469,52): error TS2449: Class 'stolzmanni' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(473,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(477,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(489,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(490,42): error TS2449: Class 'portoricensis' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(494,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(495,50): error TS2449: Class 'pelurus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(499,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(500,49): error TS2449: Class 'lasiurus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(503,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(516,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(533,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(534,50): error TS2449: Class 'stolzmanni' used before its declaration. resolvingClassDeclarationWhenInBaseTypeResolution.ts(549,53): error TS2449: Class 'daphaenodon' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(579,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(580,54): error TS2449: Class 'johorensis' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(588,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(589,52): error TS2449: Class 'stolzmanni' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(593,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(597,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(604,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(605,55): error TS2449: Class 'psilurus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(615,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(626,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(638,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(654,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(671,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(677,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(683,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(701,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(717,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(721,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(738,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(748,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(764,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(768,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Class 'lasiurus' used before its declaration. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(787,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(815,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(823,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(825,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(838,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(850,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(857,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(874,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(888,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(894,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(900,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(915,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(932,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(944,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(961,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(978,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(983,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(988,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(1000,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +resolvingClassDeclarationWhenInBaseTypeResolution.ts(1009,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== resolvingClassDeclarationWhenInBaseTypeResolution.ts (24 errors) ==== +==== resolvingClassDeclarationWhenInBaseTypeResolution.ts (90 errors) ==== module rionegrensis { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class caniventer extends Lanthanum.nitidus { ~~~~~~~ !!! error TS2449: Class 'nitidus' used before its declaration. @@ -48,6 +116,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module julianae { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class steerii { } export class nudicaudus { @@ -142,12 +212,16 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module ruatanica { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class hector { humulis() : julianae.steerii { var x : julianae.steerii; () => { var y = this; }; return x; } eurycerus() : panamensis.linulus, lavali.wilsoni> { var x : panamensis.linulus, lavali.wilsoni>; () => { var y = this; }; return x; } } } module Lanthanum { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class suillus { spilosoma() : quasiater.carolinensis { var x : quasiater.carolinensis; () => { var y = this; }; return x; } tumbalensis() : caurinus.megaphyllus { var x : caurinus.megaphyllus; () => { var y = this; }; return x; } @@ -199,6 +273,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module rendalli { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class zuluensis extends julianae.steerii { telfairi() : argurus.wetmorei { var x : argurus.wetmorei; () => { var y = this; }; return x; } keyensis() : quasiater.wattsi { var x : quasiater.wattsi; () => { var y = this; }; return x; } @@ -237,6 +313,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module trivirgatus { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class tumidifrons { nivalis() : dogramacii.kaiseri { var x : dogramacii.kaiseri; () => { var y = this; }; return x; } vestitus() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } @@ -290,6 +368,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module quasiater { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class bobrinskoi { crassicaudatus() : samarensis.cahirinus { var x : samarensis.cahirinus; () => { var y = this; }; return x; } mulatta() : argurus.oreas { var x : argurus.oreas; () => { var y = this; }; return x; } @@ -298,6 +378,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module ruatanica { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class americanus extends imperfecta.ciliolabrum { ~~~~~~~~~~~ !!! error TS2449: Class 'ciliolabrum' used before its declaration. @@ -309,6 +391,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module lavali { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class wilsoni extends Lanthanum.nitidus { setiger() : nigra.thalia { var x : nigra.thalia; () => { var y = this; }; return x; } lorentzii() : imperfecta.subspinosus { var x : imperfecta.subspinosus; () => { var y = this; }; return x; } @@ -377,6 +461,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module dogramacii { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class robustulus extends lavali.wilsoni { fossor() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } humboldti() : sagitta.cinereus { var x : sagitta.cinereus; () => { var y = this; }; return x; } @@ -418,6 +504,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module lutreolus { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class schlegeli extends lavali.beisa { mittendorfi() : rionegrensis.caniventer { var x : rionegrensis.caniventer; () => { var y = this; }; return x; } blicki() : dogramacii.robustulus { var x : dogramacii.robustulus; () => { var y = this; }; return x; } @@ -436,6 +524,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class dauricus { chinensis() : Lanthanum.jugularis { var x : Lanthanum.jugularis; () => { var y = this; }; return x; } duodecimcostatus() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } @@ -451,6 +541,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module nigra { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class dolichurus { solomonis() : panglima.abidi, argurus.netscheri, julianae.oralis>>> { var x : panglima.abidi, argurus.netscheri, julianae.oralis>>>; () => { var y = this; }; return x; } alfredi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } @@ -463,6 +555,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module panglima { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class amphibius extends caurinus.johorensis, Lanthanum.jugularis> { ~~~~~~~~~~ !!! error TS2449: Class 'johorensis' used before its declaration. @@ -488,6 +582,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module quasiater { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class carolinensis { concinna(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } aeneus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } @@ -499,6 +595,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module minutus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class himalayana extends lutreolus.punicus { ~~~~~~~ !!! error TS2449: Class 'punicus' used before its declaration. @@ -518,6 +616,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module caurinus { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class mahaganus extends panglima.fundatus { martiniquensis(): ruatanica.hector>> { var x: ruatanica.hector>>; () => { var y = this; }; return x; } devius(): samarensis.pelurus, trivirgatus.falconeri>> { var x: samarensis.pelurus, trivirgatus.falconeri>>; () => { var y = this; }; return x; } @@ -530,11 +630,15 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module macrorhinos { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class marmosurus { tansaniana(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } } } module howi { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class angulatus extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. @@ -543,10 +647,14 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module daubentonii { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class nesiotes { } } module nigra { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class thalia { dichotomus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } arnuxii(): panamensis.linulus, lavali.beisa> { var x: panamensis.linulus, lavali.beisa>; () => { var y = this; }; return x; } @@ -559,6 +667,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module sagitta { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class walkeri extends minutus.portoricensis { ~~~~~~~~~~~~~ !!! error TS2449: Class 'portoricensis' used before its declaration. @@ -567,6 +677,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module minutus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class inez extends samarensis.pelurus { ~~~~~~~ !!! error TS2449: Class 'pelurus' used before its declaration. @@ -575,6 +687,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module macrorhinos { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class konganensis extends imperfecta.lasiurus { ~~~~~~~~ !!! error TS2449: Class 'lasiurus' used before its declaration. @@ -582,6 +696,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module panamensis { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class linulus extends ruatanica.hector> { goslingi(): daubentonii.arboreus { var x: daubentonii.arboreus; () => { var y = this; }; return x; } taki(): patas.uralensis { var x: patas.uralensis; () => { var y = this; }; return x; } @@ -595,6 +711,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module nigra { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class gracilis { weddellii(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } echinothrix(): Lanthanum.nitidus, argurus.oreas> { var x: Lanthanum.nitidus, argurus.oreas>; () => { var y = this; }; return x; } @@ -612,6 +730,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module samarensis { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class pelurus extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. @@ -664,6 +784,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module sagitta { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class leptoceros extends caurinus.johorensis> { ~~~~~~~~~~ !!! error TS2449: Class 'johorensis' used before its declaration. @@ -676,6 +798,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module daubentonii { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class nigricans extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. @@ -684,10 +808,14 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module dammermani { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class siberu { } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class pygmaea extends rendalli.moojeni { pajeros(): gabriellae.echinatus { var x: gabriellae.echinatus; () => { var y = this; }; return x; } capucinus(): rendalli.zuluensis { var x: rendalli.zuluensis; () => { var y = this; }; return x; } @@ -695,6 +823,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module chrysaeolus { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class sarasinorum extends caurinus.psilurus { ~~~~~~~~ !!! error TS2449: Class 'psilurus' used before its declaration. @@ -709,6 +839,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class wetmorei { leucoptera(): petrophilus.rosalia { var x: petrophilus.rosalia; () => { var y = this; }; return x; } ochraventer(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } @@ -720,6 +852,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class oreas extends lavali.wilsoni { salamonis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } paniscus(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } @@ -732,6 +866,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module daubentonii { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class arboreus { capreolus(): rendalli.crenulata, lavali.wilsoni> { var x: rendalli.crenulata, lavali.wilsoni>; () => { var y = this; }; return x; } moreni(): panglima.abidi { var x: panglima.abidi; () => { var y = this; }; return x; } @@ -748,6 +884,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module patas { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class uralensis { cartilagonodus(): Lanthanum.nitidus { var x: Lanthanum.nitidus; () => { var y = this; }; return x; } pyrrhinus(): lavali.beisa { var x: lavali.beisa; () => { var y = this; }; return x; } @@ -765,18 +903,24 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module provocax { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class melanoleuca extends lavali.wilsoni { Neodymium(): macrorhinos.marmosurus, lutreolus.foina> { var x: macrorhinos.marmosurus, lutreolus.foina>; () => { var y = this; }; return x; } baeri(): imperfecta.lasiurus { var x: imperfecta.lasiurus; () => { var y = this; }; return x; } } } module sagitta { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class sicarius { Chlorine(): samarensis.cahirinus, dogramacii.robustulus> { var x: samarensis.cahirinus, dogramacii.robustulus>; () => { var y = this; }; return x; } simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>> { var x: macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>>; () => { var y = this; }; return x; } } } module howi { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class marcanoi extends Lanthanum.megalonyx { formosae(): Lanthanum.megalonyx { var x: Lanthanum.megalonyx; () => { var y = this; }; return x; } dudui(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } @@ -795,6 +939,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class gilbertii { nasutus(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } poecilops(): julianae.steerii { var x: julianae.steerii; () => { var y = this; }; return x; } @@ -811,10 +957,14 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module petrophilus { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class minutilla { } } module lutreolus { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class punicus { strandi(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } lar(): caurinus.mahaganus { var x: caurinus.mahaganus; () => { var y = this; }; return x; } @@ -832,6 +982,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module macrorhinos { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class daphaenodon { bredanensis(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } othus(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } @@ -842,6 +994,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module sagitta { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class cinereus { zunigae(): rendalli.crenulata> { var x: rendalli.crenulata>; () => { var y = this; }; return x; } microps(): daubentonii.nigricans> { var x: daubentonii.nigricans>; () => { var y = this; }; return x; } @@ -858,10 +1012,14 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module nigra { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class caucasica { } } module gabriellae { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class klossii extends imperfecta.lasiurus { ~~~~~~~~ !!! error TS2449: Class 'lasiurus' used before its declaration. @@ -884,6 +1042,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module imperfecta { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class lasiurus { marisae(): lavali.thaeleri { var x: lavali.thaeleri; () => { var y = this; }; return x; } fulvus(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } @@ -912,6 +1072,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module quasiater { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class wattsi { lagotis(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } hussoni(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } @@ -920,8 +1082,12 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module butleri { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } module petrophilus { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class sodyi extends quasiater.bobrinskoi { saundersiae(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } imberbis(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } @@ -935,6 +1101,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module caurinus { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class megaphyllus extends imperfecta.lasiurus> { montana(): argurus.oreas { var x: argurus.oreas; () => { var y = this; }; return x; } amatus(): lutreolus.schlegeli { var x: lutreolus.schlegeli; () => { var y = this; }; return x; } @@ -947,6 +1115,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module minutus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class portoricensis { relictus(): quasiater.carolinensis { var x: quasiater.carolinensis; () => { var y = this; }; return x; } aequatorianus(): gabriellae.klossii { var x: gabriellae.klossii; () => { var y = this; }; return x; } @@ -954,6 +1124,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module lutreolus { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class foina { tarfayensis(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } Promethium(): samarensis.pelurus { var x: samarensis.pelurus; () => { var y = this; }; return x; } @@ -971,6 +1143,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module lutreolus { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class cor extends panglima.fundatus, lavali.beisa>, dammermani.melanops> { antinorii(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } voi(): caurinus.johorensis { var x: caurinus.johorensis; () => { var y = this; }; return x; } @@ -985,18 +1159,24 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module howi { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class coludo { bernhardi(): lutreolus.punicus { var x: lutreolus.punicus; () => { var y = this; }; return x; } isseli(): argurus.germaini { var x: argurus.germaini; () => { var y = this; }; return x; } } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class germaini extends gabriellae.amicus { sharpei(): lavali.wilsoni { var x: lavali.wilsoni; () => { var y = this; }; return x; } palmarum(): macrorhinos.marmosurus { var x: macrorhinos.marmosurus; () => { var y = this; }; return x; } } } module sagitta { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class stolzmanni { riparius(): nigra.dolichurus { var x: nigra.dolichurus; () => { var y = this; }; return x; } dhofarensis(): lutreolus.foina { var x: lutreolus.foina; () => { var y = this; }; return x; } @@ -1012,6 +1192,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module dammermani { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class melanops extends minutus.inez { blarina(): dammermani.melanops { var x: dammermani.melanops; () => { var y = this; }; return x; } harwoodi(): rionegrensis.veraecrucis, lavali.wilsoni> { var x: rionegrensis.veraecrucis, lavali.wilsoni>; () => { var y = this; }; return x; } @@ -1029,6 +1211,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class peninsulae extends patas.uralensis { aitkeni(): trivirgatus.mixtus, panglima.amphibius> { var x: trivirgatus.mixtus, panglima.amphibius>; () => { var y = this; }; return x; } novaeangliae(): lavali.xanthognathus { var x: lavali.xanthognathus; () => { var y = this; }; return x; } @@ -1041,6 +1225,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class netscheri { gravis(): nigra.caucasica, dogramacii.kaiseri> { var x: nigra.caucasica, dogramacii.kaiseri>; () => { var y = this; }; return x; } ruschii(): imperfecta.lasiurus> { var x: imperfecta.lasiurus>; () => { var y = this; }; return x; } @@ -1058,6 +1244,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module ruatanica { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Praseodymium extends ruatanica.hector { clara(): panglima.amphibius, argurus.dauricus> { var x: panglima.amphibius, argurus.dauricus>; () => { var y = this; }; return x; } spectabilis(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } @@ -1075,16 +1263,22 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module caurinus { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class johorensis extends lutreolus.punicus { maini(): ruatanica.Praseodymium { var x: ruatanica.Praseodymium; () => { var y = this; }; return x; } } } module argurus { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class luctuosa { loriae(): rendalli.moojeni, gabriellae.echinatus>, sagitta.stolzmanni>, lutreolus.punicus> { var x: rendalli.moojeni, gabriellae.echinatus>, sagitta.stolzmanni>, lutreolus.punicus>; () => { var y = this; }; return x; } } } module panamensis { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class setulosus { duthieae(): caurinus.mahaganus, dogramacii.aurata> { var x: caurinus.mahaganus, dogramacii.aurata>; () => { var y = this; }; return x; } guereza(): howi.coludo { var x: howi.coludo; () => { var y = this; }; return x; } @@ -1097,6 +1291,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module petrophilus { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class rosalia { palmeri(): panglima.amphibius>, trivirgatus.mixtus, panglima.amphibius>> { var x: panglima.amphibius>, trivirgatus.mixtus, panglima.amphibius>>; () => { var y = this; }; return x; } baeops(): Lanthanum.nitidus { var x: Lanthanum.nitidus; () => { var y = this; }; return x; } @@ -1106,6 +1302,8 @@ resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53): error TS2449: Clas } } module caurinus { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class psilurus extends lutreolus.punicus { socialis(): panglima.amphibius { var x: panglima.amphibius; () => { var y = this; }; return x; } lundi(): petrophilus.sodyi { var x: petrophilus.sodyi; () => { var y = this; }; return x; } diff --git a/tests/baselines/reference/returnTypeParameterWithModules.errors.txt b/tests/baselines/reference/returnTypeParameterWithModules.errors.txt new file mode 100644 index 0000000000000..5508d048418f6 --- /dev/null +++ b/tests/baselines/reference/returnTypeParameterWithModules.errors.txt @@ -0,0 +1,23 @@ +returnTypeParameterWithModules.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +returnTypeParameterWithModules.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== returnTypeParameterWithModules.ts (2 errors) ==== + module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function reduce(ar, f, e?): Array { + return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); + }; + }; + module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + import A = M1 + export function compose() { + A.reduce(arguments, compose2); + }; + export function compose2(g: (x: B) => C, f: (x: D) => B): (x: D) => C { + return function (x) { return g(f(x)); } + }; + }; \ No newline at end of file diff --git a/tests/baselines/reference/returnTypeParameterWithModules.types b/tests/baselines/reference/returnTypeParameterWithModules.types index a97badc7dc14b..4f7ca1587797b 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.types +++ b/tests/baselines/reference/returnTypeParameterWithModules.types @@ -9,11 +9,15 @@ module M1 { >reduce : (ar: any, f: any, e?: any) => Array > : ^ ^^ ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^ >ar : any +> : ^^^ >f : any +> : ^^^ >e : any +> : ^^^ return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); >Array.prototype.reduce.apply(ar, e ? [f, e] : [f]) : any +> : ^^^ >Array.prototype.reduce.apply : (this: Function, thisArg: any, argArray?: any) => any > : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ >Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } @@ -29,16 +33,21 @@ module M1 { >apply : (this: Function, thisArg: any, argArray?: any) => any > : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ >ar : any +> : ^^^ >e ? [f, e] : [f] : any[] > : ^^^^^ >e : any +> : ^^^ >[f, e] : any[] > : ^^^^^ >f : any +> : ^^^ >e : any +> : ^^^ >[f] : any[] > : ^^^^^ >f : any +> : ^^^ }; }; diff --git a/tests/baselines/reference/reuseInnerModuleMember.errors.txt b/tests/baselines/reference/reuseInnerModuleMember.errors.txt new file mode 100644 index 0000000000000..f2bb2da08b05f --- /dev/null +++ b/tests/baselines/reference/reuseInnerModuleMember.errors.txt @@ -0,0 +1,25 @@ +reuseInnerModuleMember_0.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reuseInnerModuleMember_1.ts(2,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +reuseInnerModuleMember_1.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== reuseInnerModuleMember_1.ts (2 errors) ==== + /// + declare module bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface alpha { } + } + + import f = require('./reuseInnerModuleMember_0'); + module bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x: alpha; + } + +==== reuseInnerModuleMember_0.ts (1 errors) ==== + export module M { } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + \ No newline at end of file diff --git a/tests/baselines/reference/scopeResolutionIdentifiers.errors.txt b/tests/baselines/reference/scopeResolutionIdentifiers.errors.txt index 1500c50c79c53..76cae36c15ba7 100644 --- a/tests/baselines/reference/scopeResolutionIdentifiers.errors.txt +++ b/tests/baselines/reference/scopeResolutionIdentifiers.errors.txt @@ -1,17 +1,25 @@ +scopeResolutionIdentifiers.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +scopeResolutionIdentifiers.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. scopeResolutionIdentifiers.ts(24,14): error TS2729: Property 's' is used before its initialization. +scopeResolutionIdentifiers.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +scopeResolutionIdentifiers.ts(33,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== scopeResolutionIdentifiers.ts (1 errors) ==== +==== scopeResolutionIdentifiers.ts (5 errors) ==== // EveryType used in a nested scope of a different EveryType with the same name, type of the identifier is the one defined in the inner scope var s: string; module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var s: number; var n = s; var n: number; } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var s: number; var n = s; var n: number; @@ -36,8 +44,12 @@ scopeResolutionIdentifiers.ts(24,14): error TS2729: Property 's' is used before } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var s: any; module M4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var n = s; var n: any; } diff --git a/tests/baselines/reference/selfRef.errors.txt b/tests/baselines/reference/selfRef.errors.txt index 37bdaf9700b52..fc688c03014ce 100644 --- a/tests/baselines/reference/selfRef.errors.txt +++ b/tests/baselines/reference/selfRef.errors.txt @@ -1,9 +1,12 @@ +selfRef.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. selfRef.ts(8,8): error TS2304: Cannot find name 'name'. selfRef.ts(12,18): error TS2304: Cannot find name 'name'. -==== selfRef.ts (2 errors) ==== +==== selfRef.ts (3 errors) ==== module M + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. { export class Test { diff --git a/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt b/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt index e3836bb61ecd1..5c4d24b289d5d 100644 --- a/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt +++ b/tests/baselines/reference/semicolonsInModuleDeclarations.errors.txt @@ -1,8 +1,11 @@ +semicolonsInModuleDeclarations.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. semicolonsInModuleDeclarations.ts(2,27): error TS1036: Statements are not allowed in ambient contexts. -==== semicolonsInModuleDeclarations.ts (1 errors) ==== +==== semicolonsInModuleDeclarations.ts (2 errors) ==== declare module ambiModule { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface i1 { }; ~ !!! error TS1036: Statements are not allowed in ambient contexts. diff --git a/tests/baselines/reference/separate1-2.errors.txt b/tests/baselines/reference/separate1-2.errors.txt new file mode 100644 index 0000000000000..db6fa4a85a0ca --- /dev/null +++ b/tests/baselines/reference/separate1-2.errors.txt @@ -0,0 +1,9 @@ +separate1-2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== separate1-2.ts (1 errors) ==== + module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function f() { } + } \ No newline at end of file diff --git a/tests/baselines/reference/shadowedInternalModule.errors.txt b/tests/baselines/reference/shadowedInternalModule.errors.txt index 12d5e7ddb8d1b..c1be7587ab4f7 100644 --- a/tests/baselines/reference/shadowedInternalModule.errors.txt +++ b/tests/baselines/reference/shadowedInternalModule.errors.txt @@ -1,13 +1,27 @@ +shadowedInternalModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. shadowedInternalModule.ts(13,20): error TS2437: Module 'A' is hidden by a local declaration with the same name. +shadowedInternalModule.ts(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(17,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. shadowedInternalModule.ts(30,5): error TS2440: Import declaration conflicts with local declaration of 'Y'. +shadowedInternalModule.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(41,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(43,17): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(46,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. shadowedInternalModule.ts(47,10): error TS2438: Import name cannot be 'any'. +shadowedInternalModule.ts(52,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(56,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +shadowedInternalModule.ts(61,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with local declaration of 'Q'. -==== shadowedInternalModule.ts (4 errors) ==== +==== shadowedInternalModule.ts (16 errors) ==== // all errors imported modules conflict with local variables module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var Point = { x: 0, y: 0 } export interface Point { x: number; @@ -16,6 +30,8 @@ shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var A = { x: 0, y: 0 }; import Point = A; ~ @@ -23,7 +39,11 @@ shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with } module X { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module Y { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface Point{ x: number; y: number @@ -36,6 +56,8 @@ shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with } module Z { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import Y = X.Y; ~~~~~~~~~~~~~~~ !!! error TS2440: Import declaration conflicts with local declaration of 'Y'. @@ -46,15 +68,23 @@ shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with // module a { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export type A = number; } module b { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import A = a.A; export module A {} + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import any = b.A; ~~~ !!! error TS2438: Import name cannot be 'any'. @@ -63,15 +93,21 @@ shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with // module q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export const Q = {}; } module r { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import Q = q.Q; export type Q = number; } module s { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import Q = r.Q; ~~~~~~~~~~~~~~~ !!! error TS2440: Import declaration conflicts with local declaration of 'Q'. diff --git a/tests/baselines/reference/sourceMap-Comments.errors.txt b/tests/baselines/reference/sourceMap-Comments.errors.txt new file mode 100644 index 0000000000000..f9a264b79c794 --- /dev/null +++ b/tests/baselines/reference/sourceMap-Comments.errors.txt @@ -0,0 +1,29 @@ +sourceMap-Comments.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourceMap-Comments.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMap-Comments.ts (2 errors) ==== + module sas.tools { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Test { + public doX(): void { + let f: number = 2; + switch (f) { + case 1: + break; + case 2: + //line comment 1 + //line comment 2 + break; + case 3: + //a comment + break; + } + } + } + + } + \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.errors.txt b/tests/baselines/reference/sourceMap-FileWithComments.errors.txt new file mode 100644 index 0000000000000..fee431168e760 --- /dev/null +++ b/tests/baselines/reference/sourceMap-FileWithComments.errors.txt @@ -0,0 +1,41 @@ +sourceMap-FileWithComments.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMap-FileWithComments.ts (1 errors) ==== + // Interface + interface IPoint { + getDist(): number; + } + + // Module + module Shapes { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + // Class + export class Point implements IPoint { + // Constructor + constructor(public x: number, public y: number) { } + + // Instance member + getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } + + // Static member + static origin = new Point(0, 0); + } + + // Variable comment after class + var a = 10; + + export function foo() { + } + + /** comment after function + * this is another comment + */ + var b = 10; + } + + /** Local Variable */ + var p: IPoint = new Shapes.Point(3, 4); + var dist = p.getDist(); \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt new file mode 100644 index 0000000000000..a1175075d1476 --- /dev/null +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.errors.txt @@ -0,0 +1,19 @@ +sourceMap-StringLiteralWithNewLine.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMap-StringLiteralWithNewLine.ts (1 errors) ==== + interface Document { + } + interface Window { + document: Document; + } + declare var window: Window; + + module Foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = "test1"; + var y = "test 2\ + isn't this a lot of fun"; + var z = window.document; + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.errors.txt b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.errors.txt new file mode 100644 index 0000000000000..a44b5b97ab258 --- /dev/null +++ b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.errors.txt @@ -0,0 +1,12 @@ +sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.ts (1 errors) ==== + module Q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function P() { + // Test this + var a = 1; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.errors.txt b/tests/baselines/reference/sourceMapSample.errors.txt index c82d38a07e4d6..7eeca97cea61c 100644 --- a/tests/baselines/reference/sourceMapSample.errors.txt +++ b/tests/baselines/reference/sourceMapSample.errors.txt @@ -1,8 +1,14 @@ +sourceMapSample.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourceMapSample.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. sourceMapSample.ts(14,45): error TS2694: Namespace 'Foo.Bar' has no exported member 'Greeter'. -==== sourceMapSample.ts (1 errors) ==== +==== sourceMapSample.ts (3 errors) ==== module Foo.Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. "use strict"; class Greeter { diff --git a/tests/baselines/reference/sourceMapValidationClasses.errors.txt b/tests/baselines/reference/sourceMapValidationClasses.errors.txt new file mode 100644 index 0000000000000..c52d978d10762 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationClasses.errors.txt @@ -0,0 +1,45 @@ +sourceMapValidationClasses.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourceMapValidationClasses.ts(1,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMapValidationClasses.ts (2 errors) ==== + module Foo.Bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + "use strict"; + + class Greeter { + constructor(public greeting: string) { + } + + greet() { + return "

" + this.greeting + "

"; + } + } + + + function foo(greeting: string): Greeter { + return new Greeter(greeting); + } + + var greeter = new Greeter("Hello, world!"); + var str = greeter.greet(); + + function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { + var greeters: Greeter[] = []; /* inline block comment */ + greeters[0] = new Greeter(greeting); + for (var i = 0; i < restGreetings.length; i++) { + greeters.push(new Greeter(restGreetings[i])); + } + + return greeters; + } + + var b = foo2("Hello", "World", "!"); + // This is simple signle line comment + for (var j = 0; j < b.length; j++) { + b[j].greet(); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationImport.errors.txt b/tests/baselines/reference/sourceMapValidationImport.errors.txt new file mode 100644 index 0000000000000..02efe89963eaa --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationImport.errors.txt @@ -0,0 +1,14 @@ +sourceMapValidationImport.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMapValidationImport.ts (1 errors) ==== + export module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c { + } + } + import a = m.c; + export import b = m.c; + var x = new a(); + var y = new b(); \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.errors.txt b/tests/baselines/reference/sourceMapValidationModule.errors.txt new file mode 100644 index 0000000000000..63a6dbfe94193 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationModule.errors.txt @@ -0,0 +1,25 @@ +sourceMapValidationModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourceMapValidationModule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourceMapValidationModule.ts(6,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourceMapValidationModule.ts (3 errors) ==== + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var a = 10; + a++; + } + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 30; + } + + export function foo() { + return m4.x; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt new file mode 100644 index 0000000000000..7c1a2a36369df --- /dev/null +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.errors.txt @@ -0,0 +1,25 @@ +a.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +b.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== a.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var X = 1; + } + interface Navigator { + getGamepads(func?: any): any; + webkitGetGamepads(func?: any): any + msGetGamepads(func?: any): any; + webkitGamepads(func?: any): any; + } + +==== b.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class c1 { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types index 2911f8b23b94d..94b9908c83e1d 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types @@ -16,21 +16,25 @@ interface Navigator { >getGamepads : { (): (Gamepad | null)[]; (func?: any): any; } > : ^^^^^^ ^^^ ^^^ ^^^ ^^^ >func : any +> : ^^^ webkitGetGamepads(func?: any): any >webkitGetGamepads : (func?: any) => any > : ^ ^^^ ^^^^^ >func : any +> : ^^^ msGetGamepads(func?: any): any; >msGetGamepads : (func?: any) => any > : ^ ^^^ ^^^^^ >func : any +> : ^^^ webkitGamepads(func?: any): any; >webkitGamepads : (func?: any) => any > : ^ ^^^ ^^^^^ >func : any +> : ^^^ } === b.ts === diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.errors.txt b/tests/baselines/reference/sourcemapValidationDuplicateNames.errors.txt new file mode 100644 index 0000000000000..c00255436d13d --- /dev/null +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.errors.txt @@ -0,0 +1,17 @@ +sourcemapValidationDuplicateNames.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +sourcemapValidationDuplicateNames.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== sourcemapValidationDuplicateNames.ts (2 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 10; + export class c { + } + } + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var b = new m1.c(); + } \ No newline at end of file diff --git a/tests/baselines/reference/specializationOfExportedClass.errors.txt b/tests/baselines/reference/specializationOfExportedClass.errors.txt new file mode 100644 index 0000000000000..71cf174796e53 --- /dev/null +++ b/tests/baselines/reference/specializationOfExportedClass.errors.txt @@ -0,0 +1,14 @@ +specializationOfExportedClass.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== specializationOfExportedClass.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class C { } + + } + + var x = new M.C(); + \ No newline at end of file diff --git a/tests/baselines/reference/spellingSuggestionModule.errors.txt b/tests/baselines/reference/spellingSuggestionModule.errors.txt index 47fb42baec688..df19494a2a8c4 100644 --- a/tests/baselines/reference/spellingSuggestionModule.errors.txt +++ b/tests/baselines/reference/spellingSuggestionModule.errors.txt @@ -1,9 +1,10 @@ spellingSuggestionModule.ts(2,1): error TS2304: Cannot find name 'foobar'. spellingSuggestionModule.ts(5,1): error TS2304: Cannot find name 'barfoo'. +spellingSuggestionModule.ts(7,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. spellingSuggestionModule.ts(8,1): error TS2552: Cannot find name 'faroo'. Did you mean 'farboo'? -==== spellingSuggestionModule.ts (3 errors) ==== +==== spellingSuggestionModule.ts (4 errors) ==== declare module "foobar" { export const x: number; } foobar; ~~~~~~ @@ -15,6 +16,8 @@ spellingSuggestionModule.ts(8,1): error TS2552: Cannot find name 'faroo'. Did yo !!! error TS2304: Cannot find name 'barfoo'. declare module farboo { export const x: number; } + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. faroo; ~~~~~ !!! error TS2552: Cannot find name 'faroo'. Did you mean 'farboo'? diff --git a/tests/baselines/reference/staticMemberExportAccess.errors.txt b/tests/baselines/reference/staticMemberExportAccess.errors.txt index b9dfba1801cb5..0fed5b372744e 100644 --- a/tests/baselines/reference/staticMemberExportAccess.errors.txt +++ b/tests/baselines/reference/staticMemberExportAccess.errors.txt @@ -1,10 +1,11 @@ +staticMemberExportAccess.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticMemberExportAccess.ts(14,39): error TS2351: This expression is not constructable. Type 'Sammy' has no construct signatures. staticMemberExportAccess.ts(17,18): error TS2576: Property 'bar' does not exist on type 'Sammy'. Did you mean to access the static member 'Sammy.bar' instead? staticMemberExportAccess.ts(18,18): error TS2339: Property 'x' does not exist on type 'Sammy'. -==== staticMemberExportAccess.ts (3 errors) ==== +==== staticMemberExportAccess.ts (4 errors) ==== class Sammy { foo() { return "hi"; } static bar() { @@ -12,6 +13,8 @@ staticMemberExportAccess.ts(18,18): error TS2339: Property 'x' does not exist on } } module Sammy { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = 1; } interface JQueryStatic { diff --git a/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt b/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt index 6e0f4a1d15a3e..0d3b4ea804f3d 100644 --- a/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt +++ b/tests/baselines/reference/staticMethodReferencingTypeArgument1.errors.txt @@ -1,10 +1,13 @@ +staticMethodReferencingTypeArgument1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticMethodReferencingTypeArgument1.ts(9,33): error TS2302: Static members cannot reference class type parameters. staticMethodReferencingTypeArgument1.ts(10,29): error TS2302: Static members cannot reference class type parameters. staticMethodReferencingTypeArgument1.ts(10,43): error TS2302: Static members cannot reference class type parameters. -==== staticMethodReferencingTypeArgument1.ts (3 errors) ==== +==== staticMethodReferencingTypeArgument1.ts (4 errors) ==== module Editor { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class List { next: List; prev: List; diff --git a/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=false).errors.txt b/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=false).errors.txt index 2416c0a2ae63a..f0014f36e1839 100644 --- a/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=false).errors.txt +++ b/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=false).errors.txt @@ -42,39 +42,49 @@ staticPropertyNameConflicts.ts(203,12): error TS2699: Static property 'arguments staticPropertyNameConflicts.ts(208,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments_Anonymous2'. staticPropertyNameConflicts.ts(213,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn_Anonymous'. staticPropertyNameConflicts.ts(218,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn_Anonymous2'. +staticPropertyNameConflicts.ts(226,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(228,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'. staticPropertyNameConflicts.ts(234,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'ExportedStaticName'. +staticPropertyNameConflicts.ts(238,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(240,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'. staticPropertyNameConflicts.ts(246,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'ExportedStaticNameFn'. +staticPropertyNameConflicts.ts(251,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(252,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(253,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'. staticPropertyNameConflicts.ts(259,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'ExportedStaticLength'. +staticPropertyNameConflicts.ts(263,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(264,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(265,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'. staticPropertyNameConflicts.ts(271,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'ExportedStaticLengthFn'. +staticPropertyNameConflicts.ts(276,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(277,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(278,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. staticPropertyNameConflicts.ts(284,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'ExportedStaticPrototype'. +staticPropertyNameConflicts.ts(288,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(289,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(290,16): error TS2300: Duplicate identifier 'prototype'. staticPropertyNameConflicts.ts(290,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. staticPropertyNameConflicts.ts(296,12): error TS2300: Duplicate identifier '[FunctionPropertyNames.prototype]'. staticPropertyNameConflicts.ts(296,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'ExportedStaticPrototypeFn'. +staticPropertyNameConflicts.ts(301,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(302,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(303,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'. staticPropertyNameConflicts.ts(309,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'ExportedStaticCaller'. +staticPropertyNameConflicts.ts(313,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(314,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(315,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'. staticPropertyNameConflicts.ts(321,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'ExportedStaticCallerFn'. +staticPropertyNameConflicts.ts(326,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(327,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(328,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'. staticPropertyNameConflicts.ts(334,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'ExportedStaticArguments'. +staticPropertyNameConflicts.ts(338,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(340,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'. staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'ExportedStaticArgumentsFn'. -==== staticPropertyNameConflicts.ts (74 errors) ==== +==== staticPropertyNameConflicts.ts (84 errors) ==== const FunctionPropertyNames = { name: 'name', length: 'length', @@ -389,6 +399,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments // name module TestOnDefaultExportedClass_1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class StaticName { static name: number; // error without useDefineForClassFields ~~~~ @@ -405,6 +417,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments } module TestOnDefaultExportedClass_2 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class StaticNameFn { static name() {} // error without useDefineForClassFields ~~~~ @@ -422,6 +436,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments // length module TestOnDefaultExportedClass_3 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticLength { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -440,6 +456,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments } module TestOnDefaultExportedClass_4 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticLengthFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -459,6 +477,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments // prototype module TestOnDefaultExportedClass_5 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticPrototype { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -477,6 +497,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments } module TestOnDefaultExportedClass_6 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticPrototypeFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -500,6 +522,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments // caller module TestOnDefaultExportedClass_7 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticCaller { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -518,6 +542,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments } module TestOnDefaultExportedClass_8 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticCallerFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -537,6 +563,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments // arguments module TestOnDefaultExportedClass_9 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticArguments { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -555,6 +583,8 @@ staticPropertyNameConflicts.ts(346,12): error TS2699: Static property 'arguments } module TestOnDefaultExportedClass_10 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticArgumentsFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. diff --git a/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=true).errors.txt b/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=true).errors.txt index 4d30b87e5dd4e..584743cac4d27 100644 --- a/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=true).errors.txt +++ b/tests/baselines/reference/staticPropertyNameConflicts(usedefineforclassfields=true).errors.txt @@ -10,23 +10,33 @@ staticPropertyNameConflicts.ts(171,12): error TS2300: Duplicate identifier 'prot staticPropertyNameConflicts.ts(171,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn_Anonymous'. staticPropertyNameConflicts.ts(176,12): error TS2300: Duplicate identifier '[FunctionPropertyNames.prototype]'. staticPropertyNameConflicts.ts(176,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn_Anonymous2'. +staticPropertyNameConflicts.ts(226,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +staticPropertyNameConflicts.ts(238,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +staticPropertyNameConflicts.ts(251,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(252,12): error TS1319: A default export can only be used in an ECMAScript-style module. +staticPropertyNameConflicts.ts(263,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(264,12): error TS1319: A default export can only be used in an ECMAScript-style module. +staticPropertyNameConflicts.ts(276,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(277,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(278,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'. staticPropertyNameConflicts.ts(284,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'ExportedStaticPrototype'. +staticPropertyNameConflicts.ts(288,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(289,12): error TS1319: A default export can only be used in an ECMAScript-style module. staticPropertyNameConflicts.ts(290,16): error TS2300: Duplicate identifier 'prototype'. staticPropertyNameConflicts.ts(290,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'. staticPropertyNameConflicts.ts(296,12): error TS2300: Duplicate identifier '[FunctionPropertyNames.prototype]'. staticPropertyNameConflicts.ts(296,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'ExportedStaticPrototypeFn'. +staticPropertyNameConflicts.ts(301,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(302,12): error TS1319: A default export can only be used in an ECMAScript-style module. +staticPropertyNameConflicts.ts(313,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(314,12): error TS1319: A default export can only be used in an ECMAScript-style module. +staticPropertyNameConflicts.ts(326,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(327,12): error TS1319: A default export can only be used in an ECMAScript-style module. +staticPropertyNameConflicts.ts(338,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only be used in an ECMAScript-style module. -==== staticPropertyNameConflicts.ts (26 errors) ==== +==== staticPropertyNameConflicts.ts (36 errors) ==== const FunctionPropertyNames = { name: 'name', length: 'length', @@ -277,6 +287,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only // name module TestOnDefaultExportedClass_1 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class StaticName { static name: number; // error without useDefineForClassFields name: string; // ok @@ -289,6 +301,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only } module TestOnDefaultExportedClass_2 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class StaticNameFn { static name() {} // error without useDefineForClassFields name() {} // ok @@ -302,6 +316,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only // length module TestOnDefaultExportedClass_3 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticLength { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -316,6 +332,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only } module TestOnDefaultExportedClass_4 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticLengthFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -331,6 +349,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only // prototype module TestOnDefaultExportedClass_5 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticPrototype { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -349,6 +369,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only } module TestOnDefaultExportedClass_6 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticPrototypeFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -372,6 +394,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only // caller module TestOnDefaultExportedClass_7 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticCaller { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -386,6 +410,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only } module TestOnDefaultExportedClass_8 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticCallerFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -401,6 +427,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only // arguments module TestOnDefaultExportedClass_9 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticArguments { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. @@ -415,6 +443,8 @@ staticPropertyNameConflicts.ts(339,12): error TS1319: A default export can only } module TestOnDefaultExportedClass_10 { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export default class StaticArgumentsFn { ~~~~~~~ !!! error TS1319: A default export can only be used in an ECMAScript-style module. diff --git a/tests/baselines/reference/staticPropertyNotInClassType.errors.txt b/tests/baselines/reference/staticPropertyNotInClassType.errors.txt index 9c0ab00358759..a211c8d2f709a 100644 --- a/tests/baselines/reference/staticPropertyNotInClassType.errors.txt +++ b/tests/baselines/reference/staticPropertyNotInClassType.errors.txt @@ -1,14 +1,20 @@ +staticPropertyNotInClassType.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +staticPropertyNotInClassType.ts(10,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNotInClassType.ts(16,16): error TS2576: Property 'foo' does not exist on type 'C'. Did you mean to access the static member 'C.foo' instead? staticPropertyNotInClassType.ts(17,16): error TS2339: Property 'bar' does not exist on type 'C'. staticPropertyNotInClassType.ts(18,16): error TS2576: Property 'x' does not exist on type 'C'. Did you mean to access the static member 'C.x' instead? +staticPropertyNotInClassType.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNotInClassType.ts(27,21): error TS2302: Static members cannot reference class type parameters. +staticPropertyNotInClassType.ts(30,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticPropertyNotInClassType.ts(36,16): error TS2576: Property 'foo' does not exist on type 'C'. Did you mean to access the static member 'C.foo' instead? staticPropertyNotInClassType.ts(37,16): error TS2339: Property 'bar' does not exist on type 'C'. staticPropertyNotInClassType.ts(38,16): error TS2576: Property 'x' does not exist on type 'C'. Did you mean to access the static member 'C.x' instead? -==== staticPropertyNotInClassType.ts (7 errors) ==== +==== staticPropertyNotInClassType.ts (11 errors) ==== module NonGeneric { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { fn() { return this; } static get x() { return 1; } @@ -18,6 +24,8 @@ staticPropertyNotInClassType.ts(38,16): error TS2576: Property 'x' does not exis } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = ''; // not reflected in class type } @@ -35,6 +43,8 @@ staticPropertyNotInClassType.ts(38,16): error TS2576: Property 'x' does not exis } module Generic { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class C { fn() { return this; } static get x() { return 1; } @@ -46,6 +56,8 @@ staticPropertyNotInClassType.ts(38,16): error TS2576: Property 'x' does not exis } module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = ''; // not reflected in class type } diff --git a/tests/baselines/reference/statics.errors.txt b/tests/baselines/reference/statics.errors.txt index e4b8e903494f9..c1d49ab2a2d88 100644 --- a/tests/baselines/reference/statics.errors.txt +++ b/tests/baselines/reference/statics.errors.txt @@ -1,9 +1,12 @@ +statics.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. statics.ts(6,18): error TS2339: Property 'g' does not exist on type 'C'. statics.ts(23,33): error TS2339: Property 'g' does not exist on type 'C'. -==== statics.ts (2 errors) ==== +==== statics.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { x: number; constructor(public c1: number, public c2: number, c3: number) { diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt b/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt index b01e274fbc667..608897bc7b6e4 100644 --- a/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt +++ b/tests/baselines/reference/staticsNotInScopeInClodule.errors.txt @@ -1,12 +1,15 @@ +staticsNotInScopeInClodule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. staticsNotInScopeInClodule.ts(6,13): error TS2304: Cannot find name 'x'. -==== staticsNotInScopeInClodule.ts (1 errors) ==== +==== staticsNotInScopeInClodule.ts (2 errors) ==== class Clod { static x = 10; } module Clod { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var p = x; // x isn't in scope here ~ !!! error TS2304: Cannot find name 'x'. diff --git a/tests/baselines/reference/strictModeReservedWordInModuleDeclaration.errors.txt b/tests/baselines/reference/strictModeReservedWordInModuleDeclaration.errors.txt index d895a7bb80247..eb69b34e5709a 100644 --- a/tests/baselines/reference/strictModeReservedWordInModuleDeclaration.errors.txt +++ b/tests/baselines/reference/strictModeReservedWordInModuleDeclaration.errors.txt @@ -1,24 +1,45 @@ strictModeReservedWordInModuleDeclaration.ts(2,8): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +strictModeReservedWordInModuleDeclaration.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. strictModeReservedWordInModuleDeclaration.ts(3,8): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +strictModeReservedWordInModuleDeclaration.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. strictModeReservedWordInModuleDeclaration.ts(4,8): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +strictModeReservedWordInModuleDeclaration.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +strictModeReservedWordInModuleDeclaration.ts(4,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. strictModeReservedWordInModuleDeclaration.ts(6,8): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +strictModeReservedWordInModuleDeclaration.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. strictModeReservedWordInModuleDeclaration.ts(6,16): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +strictModeReservedWordInModuleDeclaration.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +strictModeReservedWordInModuleDeclaration.ts(6,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== strictModeReservedWordInModuleDeclaration.ts (5 errors) ==== +==== strictModeReservedWordInModuleDeclaration.ts (12 errors) ==== "use strict" module public { } ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module private { } ~~~~~~~ !!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module public.whatever { ~~~~~~ !!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } module private.public.foo { } ~~~~~~~ !!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~~~~ +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. ~~~~~~ -!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. \ No newline at end of file +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.errors.txt b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.errors.txt new file mode 100644 index 0000000000000..d3cf7e5c6b55b --- /dev/null +++ b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.errors.txt @@ -0,0 +1,10 @@ +stringLiteralObjectLiteralDeclaration1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== stringLiteralObjectLiteralDeclaration1.ts (1 errors) ==== + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n = { 'foo bar': 4 }; + } + \ No newline at end of file diff --git a/tests/baselines/reference/structural1.errors.txt b/tests/baselines/reference/structural1.errors.txt new file mode 100644 index 0000000000000..ad0a3b8743dfa --- /dev/null +++ b/tests/baselines/reference/structural1.errors.txt @@ -0,0 +1,18 @@ +structural1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== structural1.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface I { + salt:number; + pepper:number; + } + + export function f(i:I) { + } + + f({salt:2,pepper:0}); + } + \ No newline at end of file diff --git a/tests/baselines/reference/structuralTypeInDeclareFileForModule.errors.txt b/tests/baselines/reference/structuralTypeInDeclareFileForModule.errors.txt new file mode 100644 index 0000000000000..f1fdd648c3629 --- /dev/null +++ b/tests/baselines/reference/structuralTypeInDeclareFileForModule.errors.txt @@ -0,0 +1,8 @@ +structuralTypeInDeclareFileForModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== structuralTypeInDeclareFileForModule.ts (1 errors) ==== + module M { export var x; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var m = M; \ No newline at end of file diff --git a/tests/baselines/reference/structuralTypeInDeclareFileForModule.types b/tests/baselines/reference/structuralTypeInDeclareFileForModule.types index 6f47c616ccc0d..6e110b835ec22 100644 --- a/tests/baselines/reference/structuralTypeInDeclareFileForModule.types +++ b/tests/baselines/reference/structuralTypeInDeclareFileForModule.types @@ -5,6 +5,7 @@ module M { export var x; } >M : typeof M > : ^^^^^^^^ >x : any +> : ^^^ var m = M; >m : typeof M diff --git a/tests/baselines/reference/subtypesOfAny.errors.txt b/tests/baselines/reference/subtypesOfAny.errors.txt new file mode 100644 index 0000000000000..17126ccbd4f6e --- /dev/null +++ b/tests/baselines/reference/subtypesOfAny.errors.txt @@ -0,0 +1,142 @@ +subtypesOfAny.ts(89,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypesOfAny.ts(99,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypesOfAny.ts (2 errors) ==== + // every type is a subtype of any, no errors expected + + interface I { + [x: string]: any; + foo: any; + } + + + interface I2 { + [x: string]: any; + foo: number; + } + + + interface I3 { + [x: string]: any; + foo: string; + } + + + interface I4 { + [x: string]: any; + foo: boolean; + } + + + interface I5 { + [x: string]: any; + foo: Date; + } + + + interface I6 { + [x: string]: any; + foo: RegExp; + } + + + interface I7 { + [x: string]: any; + foo: { bar: number }; + } + + + interface I8 { + [x: string]: any; + foo: number[]; + } + + + interface I9 { + [x: string]: any; + foo: I8; + } + + class A { foo: number; } + interface I10 { + [x: string]: any; + foo: A; + } + + class A2 { foo: T; } + interface I11 { + [x: string]: any; + foo: A2; + } + + + interface I12 { + [x: string]: any; + foo: (x) => number; + } + + + interface I13 { + [x: string]: any; + foo: (x:T) => T; + } + + + enum E { A } + interface I14 { + [x: string]: any; + foo: E; + } + + + function f() { } + module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + interface I15 { + [x: string]: any; + foo: typeof f; + } + + + class c { baz: string } + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + interface I16 { + [x: string]: any; + foo: typeof c; + } + + + interface I17 { + [x: string]: any; + foo: T; + } + + + interface I18 { + [x: string]: any; + foo: U; + } + //interface I18 { + // [x: string]: any; + // foo: U; + //} + + + interface I19 { + [x: string]: any; + foo: Object; + } + + + interface I20 { + [x: string]: any; + foo: {}; + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfAny.types b/tests/baselines/reference/subtypesOfAny.types index f52f5e649abca..dd4adcb479274 100644 --- a/tests/baselines/reference/subtypesOfAny.types +++ b/tests/baselines/reference/subtypesOfAny.types @@ -10,6 +10,7 @@ interface I { foo: any; >foo : any +> : ^^^ } @@ -144,6 +145,7 @@ interface I12 { >foo : (x: any) => number > : ^ ^^^^^^^^^^ >x : any +> : ^^^ } diff --git a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt index 0e448bce51069..d7396bcb07dca 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt @@ -1,9 +1,11 @@ subtypesOfTypeParameter.ts(8,5): error TS2416: Property 'foo' in type 'D1' is not assignable to the same property in base type 'C3'. Type 'U' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'. +subtypesOfTypeParameter.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypesOfTypeParameter.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== subtypesOfTypeParameter.ts (1 errors) ==== +==== subtypesOfTypeParameter.ts (3 errors) ==== // checking whether other types are subtypes of type parameters class C3 { @@ -30,10 +32,14 @@ subtypesOfTypeParameter.ts(8,5): error TS2416: Property 'foo' in type 'D1' enum E { A } function f() { } module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } class c { baz: string } module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt new file mode 100644 index 0000000000000..0f0311fe4d85d --- /dev/null +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt @@ -0,0 +1,166 @@ +subtypesOfTypeParameterWithConstraints2.ts(42,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypesOfTypeParameterWithConstraints2.ts(46,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypesOfTypeParameterWithConstraints2.ts (2 errors) ==== + // checking whether other types are subtypes of type parameters with constraints + + function f1(x: T, y: U) { + var r = true ? x : y; + var r = true ? y : x; + } + + // V > U > T + function f2(x: T, y: U, z: V) { + var r = true ? x : y; + var r = true ? y : x; + + // ok + var r2 = true ? z : y; + var r2 = true ? y : z; + + // ok + var r2a = true ? z : x; + var r2b = true ? x : z; + } + + // Date > U > T + function f3(x: T, y: U) { + var r = true ? x : y; + var r = true ? y : x; + + // ok + var r2 = true ? x : new Date(); + var r2 = true ? new Date() : x; + + // ok + var r3 = true ? y : new Date(); + var r3 = true ? new Date() : y; + } + + + interface I1 { foo: number; } + class C1 { foo: number; } + class C2 { foo: T; } + enum E { A } + function f() { } + module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + class c { baz: string } + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + + function f4(x: T) { + var r0 = true ? x : null; // ok + var r0 = true ? null : x; // ok + + var u: typeof undefined; + var r0b = true ? u : x; // ok + var r0b = true ? x : u; // ok + } + + function f5(x: T) { + var r1 = true ? 1 : x; // ok + var r1 = true ? x : 1; // ok + } + + function f6(x: T) { + var r2 = true ? '' : x; // ok + var r2 = true ? x : ''; // ok + } + + function f7(x: T) { + var r3 = true ? true : x; // ok + var r3 = true ? x : true; // ok + } + + function f8(x: T) { + var r4 = true ? new Date() : x; // ok + var r4 = true ? x : new Date(); // ok + } + + function f9(x: T) { + var r5 = true ? /1/ : x; // ok + var r5 = true ? x : /1/; // ok + } + + function f10(x: T) { + var r6 = true ? { foo: 1 } : x; // ok + var r6 = true ? x : { foo: 1 }; // ok + } + + function f11 void>(x: T) { + var r7 = true ? () => { } : x; // ok + var r7 = true ? x : () => { }; // ok + } + + function f12(x: U) => U>(x: T) { + var r8 = true ? (x: T) => { return x } : x; // ok + var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations + } + + function f13(x: T) { + var i1: I1; + var r9 = true ? i1 : x; // ok + var r9 = true ? x : i1; // ok + } + + function f14(x: T) { + var c1: C1; + var r10 = true ? c1 : x; // ok + var r10 = true ? x : c1; // ok + } + + function f15>(x: T) { + var c2: C2; + var r12 = true ? c2 : x; // ok + var r12 = true ? x : c2; // ok + } + + function f16(x: T) { + var r13 = true ? E : x; // ok + var r13 = true ? x : E; // ok + + var r14 = true ? E.A : x; // ok + var r14 = true ? x : E.A; // ok + } + + function f17(x: T) { + var af: typeof f; + var r15 = true ? af : x; // ok + var r15 = true ? x : af; // ok + } + + function f18(x: T) { + var ac: typeof c; + var r16 = true ? ac : x; // ok + var r16 = true ? x : ac; // ok + } + + function f19(x: T) { + function f17(a: U) { + var r17 = true ? x : a; // ok + var r17 = true ? a : x; // ok + } + + function f18(a: V) { + var r18 = true ? x : a; // ok + var r18 = true ? a : x; // ok + } + } + + function f20(x: T) { + var r19 = true ? new Object() : x; // ok + var r19 = true ? x : new Object(); // ok + } + + function f21(x: T) { + var r20 = true ? {} : x; // ok + var r20 = true ? x : {}; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types index c181f9980b718..e4adad1bd99eb 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types @@ -296,26 +296,33 @@ function f4(x: T) { var u: typeof undefined; >u : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ var r0b = true ? u : x; // ok >r0b : any +> : ^^^ >true ? u : x : any +> : ^^^ >true : true > : ^^^^ >u : any +> : ^^^ >x : T > : ^ var r0b = true ? x : u; // ok >r0b : any +> : ^^^ >true ? x : u : any +> : ^^^ >true : true > : ^^^^ >x : T > : ^ >u : any +> : ^^^ } function f5(x: T) { diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt index c889d468425d4..c1c5821453bc4 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt @@ -1,3 +1,4 @@ +subtypesOfTypeParameterWithRecursiveConstraints.ts(56,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2411: Property 'foo' of type 'U' is not assignable to 'string' index type 'T'. subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2416: Property 'foo' in type 'D2' is not assignable to the same property in base type 'Base'. Type 'U' is not assignable to type 'T'. @@ -22,6 +23,7 @@ subtypesOfTypeParameterWithRecursiveConstraints.ts(98,9): error TS2411: Property subtypesOfTypeParameterWithRecursiveConstraints.ts(98,9): error TS2416: Property 'foo' in type 'D8' is not assignable to the same property in base type 'Base'. Type 'U' is not assignable to type 'V'. 'V' could be instantiated with an arbitrary type which could be unrelated to 'U'. +subtypesOfTypeParameterWithRecursiveConstraints.ts(108,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypesOfTypeParameterWithRecursiveConstraints.ts(115,9): error TS2416: Property 'foo' in type 'D1' is not assignable to the same property in base type 'Base2'. Type 'T' is not assignable to type 'Foo'. Type 'Foo' is not assignable to type 'Foo'. @@ -60,7 +62,7 @@ subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2416: Propert 'V' could be instantiated with an arbitrary type which could be unrelated to 'T'. -==== subtypesOfTypeParameterWithRecursiveConstraints.ts (24 errors) ==== +==== subtypesOfTypeParameterWithRecursiveConstraints.ts (26 errors) ==== // checking whether other types are subtypes of type parameters with constraints class Foo { foo: T; } @@ -117,6 +119,8 @@ subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2416: Propert } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Base { foo: T; } @@ -205,6 +209,8 @@ subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2416: Propert module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Base2 { foo: Foo; } diff --git a/tests/baselines/reference/subtypesOfUnion.errors.txt b/tests/baselines/reference/subtypesOfUnion.errors.txt index 49f667cc429b6..0ad9eb417b8a3 100644 --- a/tests/baselines/reference/subtypesOfUnion.errors.txt +++ b/tests/baselines/reference/subtypesOfUnion.errors.txt @@ -1,3 +1,5 @@ +subtypesOfUnion.ts(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypesOfUnion.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypesOfUnion.ts(16,5): error TS2411: Property 'foo4' of type 'boolean' is not assignable to 'string' index type 'string | number'. subtypesOfUnion.ts(18,5): error TS2411: Property 'foo6' of type 'Date' is not assignable to 'string' index type 'string | number'. subtypesOfUnion.ts(19,5): error TS2411: Property 'foo7' of type 'RegExp' is not assignable to 'string' index type 'string | number'. @@ -29,15 +31,19 @@ subtypesOfUnion.ts(50,5): error TS2411: Property 'foo17' of type 'Object' is not subtypesOfUnion.ts(51,5): error TS2411: Property 'foo18' of type '{}' is not assignable to 'string' index type 'number'. -==== subtypesOfUnion.ts (29 errors) ==== +==== subtypesOfUnion.ts (31 errors) ==== enum E { e1, e2 } interface I8 { [x: string]: number[]; } class A { foo: number; } class A2 { foo: T; } function f() { } module f { export var bar = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class c { baz: string } module c { export var bar = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // A type T is a subtype of a union type U if T is a subtype of any type in U. interface I1 { diff --git a/tests/baselines/reference/subtypingWithCallSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignatures.errors.txt new file mode 100644 index 0000000000000..ecdf5bd80074d --- /dev/null +++ b/tests/baselines/reference/subtypingWithCallSignatures.errors.txt @@ -0,0 +1,17 @@ +subtypingWithCallSignatures.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypingWithCallSignatures.ts (1 errors) ==== + module CallSignature { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare function foo1(cb: (x: number) => void): typeof cb; + declare function foo1(cb: any): any; + var r = foo1((x: number) => 1); // ok because base returns void + var r2 = foo1((x: T) => ''); // ok because base returns void + + declare function foo2(cb: (x: number, y: number) => void): typeof cb; + declare function foo2(cb: any): any; + var r3 = foo2((x: number, y: number) => 1); // ok because base returns void + var r4 = foo2((x: T) => ''); // ok because base returns void + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignatures.types b/tests/baselines/reference/subtypingWithCallSignatures.types index 938d1445c988b..1c347c5891d01 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.types +++ b/tests/baselines/reference/subtypingWithCallSignatures.types @@ -19,6 +19,7 @@ module CallSignature { >foo1 : { (cb: (x: number) => void): typeof cb; (cb: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >cb : any +> : ^^^ var r = foo1((x: number) => 1); // ok because base returns void >r : (x: number) => void @@ -64,6 +65,7 @@ module CallSignature { >foo2 : { (cb: (x: number, y: number) => void): typeof cb; (cb: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >cb : any +> : ^^^ var r3 = foo2((x: number, y: number) => 1); // ok because base returns void >r3 : (x: number, y: number) => void diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.errors.txt b/tests/baselines/reference/subtypingWithCallSignatures3.errors.txt new file mode 100644 index 0000000000000..37d15af0d5378 --- /dev/null +++ b/tests/baselines/reference/subtypingWithCallSignatures3.errors.txt @@ -0,0 +1,127 @@ +subtypingWithCallSignatures3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypingWithCallSignatures3.ts(108,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypingWithCallSignatures3.ts (2 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + // error cases, so function calls will all result in 'any' + + module Errors { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + declare function foo2(a2: (x: number) => string[]): typeof a2; + declare function foo2(a2: any): any; + + declare function foo7(a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; + declare function foo7(a2: any): any; + + declare function foo8(a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; + declare function foo8(a2: any): any; + + declare function foo10(a2: (...x: Base[]) => Base): typeof a2; + declare function foo10(a2: any): any; + + declare function foo11(a2: (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2; + declare function foo11(a2: any): any; + + declare function foo12(a2: (x: Array, y: Array) => Array): typeof a2; + declare function foo12(a2: any): any; + + declare function foo15(a2: (x: { a: string; b: number }) => number): typeof a2; + declare function foo15(a2: any): any; + + declare function foo16(a2: { + // type of parameter is overload set which means we can't do inference based on this type + (x: { + (a: number): number; + (a?: number): number; + }): number[]; + (x: { + (a: boolean): boolean; + (a?: boolean): boolean; + }): boolean[]; + }): typeof a2; + declare function foo16(a2: any): any; + + declare function foo17(a2: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }): typeof a2; + declare function foo17(a2: any): any; + + var r1 = foo2((x: T) => null); // any + var r1a = [(x: number) => [''], (x: T) => null]; + var r1b = [(x: T) => null, (x: number) => ['']]; + + var r2arg = (x: (arg: T) => U) => (r: T) => null; + var r2arg2 = (x: (arg: Base) => Derived) => (r: Base) => null; + var r2 = foo7(r2arg); // any + var r2a = [r2arg2, r2arg]; + var r2b = [r2arg, r2arg2]; + + var r3arg = (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => null; + var r3arg2 = (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null; + var r3 = foo8(r3arg); // any + var r3a = [r3arg2, r3arg]; + var r3b = [r3arg, r3arg2]; + + var r4arg = (...x: T[]) => null; + var r4arg2 = (...x: Base[]) => null; + var r4 = foo10(r4arg); // any + var r4a = [r4arg2, r4arg]; + var r4b = [r4arg, r4arg2]; + + var r5arg = (x: T, y: T) => null; + var r5arg2 = (x: { foo: string }, y: { foo: string; bar: string }) => null; + var r5 = foo11(r5arg); // any + var r5a = [r5arg2, r5arg]; + var r5b = [r5arg, r5arg2]; + + var r6arg = (x: Array, y: Array) => >null; + var r6arg2 = >(x: Array, y: Array) => null; + var r6 = foo12(r6arg); // (x: Array, y: Array) => Array + var r6a = [r6arg2, r6arg]; + var r6b = [r6arg, r6arg2]; + + var r7arg = (x: { a: T; b: T }) => null; + var r7arg2 = (x: { a: string; b: number }) => 1; + var r7 = foo15(r7arg); // any + var r7a = [r7arg2, r7arg]; + var r7b = [r7arg, r7arg2]; + + var r7arg3 = (x: { a: T; b: T }) => 1; + var r7c = foo15(r7arg3); // (x: { a: string; b: number }) => number): number; + var r7d = [r7arg2, r7arg3]; + var r7e = [r7arg3, r7arg2]; + + var r8arg = (x: (a: T) => T) => null; + var r8 = foo16(r8arg); // any + + var r9arg = (x: (a: T) => T) => null; + var r9 = foo17(r9arg); // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; + } + + module WithGenericSignaturesInBaseType { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare function foo2(a2: (x: T) => T[]): typeof a2; + declare function foo2(a2: any): any; + var r2arg2 = (x: T) => ['']; + var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now + + declare function foo3(a2: (x: T) => string[]): typeof a2; + declare function foo3(a2: any): any; + var r3arg2 = (x: T) => null; + var r3 = foo3(r3arg2); // any + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.types b/tests/baselines/reference/subtypingWithCallSignatures3.types index 5618553cd89b6..5697b48d4b57f 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.types +++ b/tests/baselines/reference/subtypingWithCallSignatures3.types @@ -52,6 +52,7 @@ module Errors { >foo2 : { (a2: (x: number) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo7(a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; >foo7 : { (a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; (a2: any): any; } @@ -71,6 +72,7 @@ module Errors { >foo7 : { (a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo8(a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; >foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; (a2: any): any; } @@ -94,6 +96,7 @@ module Errors { >foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo10(a2: (...x: Base[]) => Base): typeof a2; >foo10 : { (a2: (...x: Base[]) => Base): typeof a2; (a2: any): any; } @@ -109,6 +112,7 @@ module Errors { >foo10 : { (a2: (...x: Base[]) => Base): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo11(a2: (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2; >foo11 : { (a2: (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; } @@ -132,6 +136,7 @@ module Errors { >foo11 : { (a2: (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo12(a2: (x: Array, y: Array) => Array): typeof a2; >foo12 : { (a2: (x: Array, y: Array) => Array): typeof a2; (a2: any): any; } @@ -149,6 +154,7 @@ module Errors { >foo12 : { (a2: (x: Array, y: Array) => Array): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo15(a2: (x: { a: string; b: number }) => number): typeof a2; >foo15 : { (a2: (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } @@ -168,6 +174,7 @@ module Errors { >foo15 : { (a2: (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo16(a2: { >foo16 : { (a2: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } @@ -210,6 +217,7 @@ module Errors { >foo16 : { (a2: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo17(a2: { >foo17 : { (a2: { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }): typeof a2; (a2: any): any; } @@ -251,6 +259,7 @@ module Errors { >foo17 : { (a2: { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r1 = foo2((x: T) => null); // any >r1 : (x: number) => string[] @@ -412,7 +421,9 @@ module Errors { var r3 = foo8(r3arg); // any >r3 : any +> : ^^^ >foo8(r3arg) : any +> : ^^^ >foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r3arg : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U @@ -632,7 +643,9 @@ module Errors { var r7 = foo15(r7arg); // any >r7 : any +> : ^^^ >foo15(r7arg) : any +> : ^^^ >foo15 : { (a2: (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r7arg : (x: { a: T; b: T; }) => T @@ -674,7 +687,9 @@ module Errors { var r7c = foo15(r7arg3); // (x: { a: string; b: number }) => number): number; >r7c : any +> : ^^^ >foo15(r7arg3) : any +> : ^^^ >foo15 : { (a2: (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r7arg3 : (x: { a: T; b: T; }) => number @@ -714,7 +729,9 @@ module Errors { var r8 = foo16(r8arg); // any >r8 : any +> : ^^^ >foo16(r8arg) : any +> : ^^^ >foo16 : { (a2: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r8arg : (x: (a: T) => T) => T[] @@ -761,6 +778,7 @@ module WithGenericSignaturesInBaseType { >foo2 : { (a2: (x: T) => T[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r2arg2 = (x: T) => ['']; >r2arg2 : (x: T) => string[] @@ -776,7 +794,9 @@ module WithGenericSignaturesInBaseType { var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now >r2 : any +> : ^^^ >foo2(r2arg2) : any +> : ^^^ >foo2 : { (a2: (x: T) => T[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r2arg2 : (x: T) => string[] @@ -796,6 +816,7 @@ module WithGenericSignaturesInBaseType { >foo3 : { (a2: (x: T) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r3arg2 = (x: T) => null; >r3arg2 : (x: T) => T[] @@ -809,7 +830,9 @@ module WithGenericSignaturesInBaseType { var r3 = foo3(r3arg2); // any >r3 : any +> : ^^^ >foo3(r3arg2) : any +> : ^^^ >foo3 : { (a2: (x: T) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r3arg2 : (x: T) => T[] diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt index b94eb09873208..3485c81cfdef2 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,3 +1,5 @@ +subtypingWithCallSignaturesWithSpecializedSignatures.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypingWithCallSignaturesWithSpecializedSignatures.ts(38,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. The types returned by 'a(...)' are incompatible between these types. Type 'string' is not assignable to type 'number'. @@ -7,10 +9,12 @@ subtypingWithCallSignaturesWithSpecializedSignatures.ts(76,15): error TS2430: In 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== subtypingWithCallSignaturesWithSpecializedSignatures.ts (2 errors) ==== +==== subtypingWithCallSignaturesWithSpecializedSignatures.ts (4 errors) ==== // same as subtypingWithCallSignatures but with additional specialized signatures that should not affect the results module CallSignature { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's (x: 'a'): void; @@ -46,6 +50,8 @@ subtypingWithCallSignaturesWithSpecializedSignatures.ts(76,15): error TS2430: In } module MemberWithCallSignature { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's a: { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignatures.errors.txt new file mode 100644 index 0000000000000..a80efe56340f6 --- /dev/null +++ b/tests/baselines/reference/subtypingWithConstructSignatures.errors.txt @@ -0,0 +1,21 @@ +subtypingWithConstructSignatures.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypingWithConstructSignatures.ts (1 errors) ==== + module ConstructSignature { + ~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare function foo1(cb: new (x: number) => void): typeof cb; + declare function foo1(cb: any): any; + var rarg1: new (x: number) => number; + var r = foo1(rarg1); // ok because base returns void + var rarg2: new (x: T) => string; + var r2 = foo1(rarg2); // ok because base returns void + + declare function foo2(cb: new (x: number, y: number) => void): typeof cb; + declare function foo2(cb: any): any; + var r3arg1: new (x: number, y: number) => number; + var r3 = foo2(r3arg1); // ok because base returns void + var r4arg1: new (x: T) => string; + var r4 = foo2(r4arg1); // ok because base returns void + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithConstructSignatures.types b/tests/baselines/reference/subtypingWithConstructSignatures.types index a73396e328bf2..2d8a7786efeb3 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures.types +++ b/tests/baselines/reference/subtypingWithConstructSignatures.types @@ -19,6 +19,7 @@ module ConstructSignature { >foo1 : { (cb: new (x: number) => void): typeof cb; (cb: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >cb : any +> : ^^^ var rarg1: new (x: number) => number; >rarg1 : new (x: number) => number @@ -68,6 +69,7 @@ module ConstructSignature { >foo2 : { (cb: new (x: number, y: number) => void): typeof cb; (cb: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >cb : any +> : ^^^ var r3arg1: new (x: number, y: number) => number; >r3arg1 : new (x: number, y: number) => number diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.errors.txt b/tests/baselines/reference/subtypingWithConstructSignatures3.errors.txt new file mode 100644 index 0000000000000..512d7c2eda9c6 --- /dev/null +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.errors.txt @@ -0,0 +1,129 @@ +subtypingWithConstructSignatures3.ts(4,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypingWithConstructSignatures3.ts(110,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypingWithConstructSignatures3.ts (2 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + // error cases, so function calls will all result in 'any' + + module Errors { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class Base { foo: string; } + class Derived extends Base { bar: string; } + class Derived2 extends Derived { baz: string; } + class OtherDerived extends Base { bing: string; } + + declare function foo2(a2: new (x: number) => string[]): typeof a2; + declare function foo2(a2: any): any; + + declare function foo7(a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2; + declare function foo7(a2: any): any; + + declare function foo8(a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; + declare function foo8(a2: any): any; + + declare function foo10(a2: new (...x: Base[]) => Base): typeof a2; + declare function foo10(a2: any): any; + + declare function foo11(a2: new (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2; + declare function foo11(a2: any): any; + + declare function foo12(a2: new (x: Array, y: Array) => Array): typeof a2; + declare function foo12(a2: any): any; + + declare function foo15(a2: new (x: { a: string; b: number }) => number): typeof a2; + declare function foo15(a2: any): any; + + declare function foo16(a2: { + // type of parameter is overload set which means we can't do inference based on this type + new (x: { + new (a: number): number; + new (a?: number): number; + }): number[]; + new (x: { + new (a: boolean): boolean; + new (a?: boolean): boolean; + }): boolean[]; + }): typeof a2; + declare function foo16(a2: any): any; + + declare function foo17(a2: { + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + new (x: { + new (a: T): T; + new (a: T): T; + }): any[]; + }): typeof a2; + declare function foo17(a2: any): any; + + var r1arg1: new (x: T) => U[]; + var r1arg2: new (x: number) => string[]; + var r1 = foo2(r1arg1); // any + var r1a = [r1arg2, r1arg1]; + var r1b = [r1arg1, r1arg2]; + + var r2arg1: new (x: new (arg: T) => U) => new (r: T) => V; + var r2arg2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2; + var r2 = foo7(r2arg1); // any + var r2a = [r2arg2, r2arg1]; + var r2b = [r2arg1, r2arg2]; + + var r3arg1: new (x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U; + var r3arg2: new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived; + var r3 = foo8(r3arg1); // any + var r3a = [r3arg2, r3arg1]; + var r3b = [r3arg1, r3arg2]; + + var r4arg1: new (...x: T[]) => T; + var r4arg2: new (...x: Base[]) => Base; + var r4 = foo10(r4arg1); // any + var r4a = [r4arg2, r4arg1]; + var r4b = [r4arg1, r4arg2]; + + var r5arg1: new (x: T, y: T) => T; + var r5arg2: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + var r5 = foo11(r5arg1); // any + var r5a = [r5arg2, r5arg1]; + var r5b = [r5arg1, r5arg2]; + + var r6arg1: new (x: Array, y: Array) => Array; + var r6arg2: new >(x: Array, y: Array) => T; + var r6 = foo12(r6arg1); // new (x: Array, y: Array) => Array + var r6a = [r6arg2, r6arg1]; + var r6b = [r6arg1, r6arg2]; + + var r7arg1: new (x: { a: T; b: T }) => T; + var r7arg2: new (x: { a: string; b: number }) => number; + var r7 = foo15(r7arg1); // (x: { a: string; b: number }) => number): number; + var r7a = [r7arg2, r7arg1]; + var r7b = [r7arg1, r7arg2]; + + var r7arg3: new (x: { a: T; b: T }) => number; + var r7c = foo15(r7arg3); // any + var r7d = [r7arg2, r7arg3]; + var r7e = [r7arg3, r7arg2]; + + var r8arg: new (x: new (a: T) => T) => T[]; + var r8 = foo16(r8arg); // any + + var r9arg: new (x: new (a: T) => T) => any[]; + var r9 = foo17(r9arg); // // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; + } + + module WithGenericSignaturesInBaseType { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare function foo2(a2: new (x: T) => T[]): typeof a2; + declare function foo2(a2: any): any; + var r2arg2: new (x: T) => string[]; + var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now + + declare function foo3(a2: new (x: T) => string[]): typeof a2; + declare function foo3(a2: any): any; + var r3arg2: new (x: T) => T[]; + var r3 = foo3(r3arg2); // any + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.types b/tests/baselines/reference/subtypingWithConstructSignatures3.types index d6cd126a6f618..a489bb191591d 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.types +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.types @@ -52,6 +52,7 @@ module Errors { >foo2 : { (a2: new (x: number) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo7(a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2; >foo7 : { (a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2; (a2: any): any; } @@ -71,6 +72,7 @@ module Errors { >foo7 : { (a2: new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo8(a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; >foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; (a2: any): any; } @@ -94,6 +96,7 @@ module Errors { >foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo10(a2: new (...x: Base[]) => Base): typeof a2; >foo10 : { (a2: new (...x: Base[]) => Base): typeof a2; (a2: any): any; } @@ -109,6 +112,7 @@ module Errors { >foo10 : { (a2: new (...x: Base[]) => Base): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo11(a2: new (x: { foo: string }, y: { foo: string; bar: string }) => Base): typeof a2; >foo11 : { (a2: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; } @@ -132,6 +136,7 @@ module Errors { >foo11 : { (a2: new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo12(a2: new (x: Array, y: Array) => Array): typeof a2; >foo12 : { (a2: new (x: Array, y: Array) => Array): typeof a2; (a2: any): any; } @@ -149,6 +154,7 @@ module Errors { >foo12 : { (a2: new (x: Array, y: Array) => Array): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo15(a2: new (x: { a: string; b: number }) => number): typeof a2; >foo15 : { (a2: new (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } @@ -168,6 +174,7 @@ module Errors { >foo15 : { (a2: new (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo16(a2: { >foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } @@ -210,6 +217,7 @@ module Errors { >foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ declare function foo17(a2: { >foo17 : { (a2: { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }): typeof a2; (a2: any): any; } @@ -251,6 +259,7 @@ module Errors { >foo17 : { (a2: { new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r1arg1: new (x: T) => U[]; >r1arg1 : new (x: T) => U[] @@ -376,7 +385,9 @@ module Errors { var r3 = foo8(r3arg1); // any >r3 : any +> : ^^^ >foo8(r3arg1) : any +> : ^^^ >foo8 : { (a2: new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r3arg1 : new (x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U @@ -564,7 +575,9 @@ module Errors { var r7 = foo15(r7arg1); // (x: { a: string; b: number }) => number): number; >r7 : any +> : ^^^ >foo15(r7arg1) : any +> : ^^^ >foo15 : { (a2: new (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r7arg1 : new (x: { a: T; b: T; }) => T @@ -602,7 +615,9 @@ module Errors { var r7c = foo15(r7arg3); // any >r7c : any +> : ^^^ >foo15(r7arg3) : any +> : ^^^ >foo15 : { (a2: new (x: { a: string; b: number; }) => number): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r7arg3 : new (x: { a: T; b: T; }) => number @@ -638,7 +653,9 @@ module Errors { var r8 = foo16(r8arg); // any >r8 : any +> : ^^^ >foo16(r8arg) : any +> : ^^^ >foo16 : { (a2: { new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r8arg : new (x: new (a: T) => T) => T[] @@ -681,6 +698,7 @@ module WithGenericSignaturesInBaseType { >foo2 : { (a2: new (x: T) => T[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r2arg2: new (x: T) => string[]; >r2arg2 : new (x: T) => string[] @@ -690,7 +708,9 @@ module WithGenericSignaturesInBaseType { var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now >r2 : any +> : ^^^ >foo2(r2arg2) : any +> : ^^^ >foo2 : { (a2: new (x: T) => T[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r2arg2 : new (x: T) => string[] @@ -710,6 +730,7 @@ module WithGenericSignaturesInBaseType { >foo3 : { (a2: new (x: T) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >a2 : any +> : ^^^ var r3arg2: new (x: T) => T[]; >r3arg2 : new (x: T) => T[] @@ -719,7 +740,9 @@ module WithGenericSignaturesInBaseType { var r3 = foo3(r3arg2); // any >r3 : any +> : ^^^ >foo3(r3arg2) : any +> : ^^^ >foo3 : { (a2: new (x: T) => string[]): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r3arg2 : new (x: T) => T[] diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt index 5ecff96f90d6c..789a799cdbf11 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,3 +1,5 @@ +subtypingWithConstructSignaturesWithSpecializedSignatures.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +subtypingWithConstructSignaturesWithSpecializedSignatures.ts(38,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. The types returned by 'new a(...)' are incompatible between these types. Type 'string' is not assignable to type 'number'. @@ -7,10 +9,12 @@ subtypingWithConstructSignaturesWithSpecializedSignatures.ts(76,15): error TS243 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== subtypingWithConstructSignaturesWithSpecializedSignatures.ts (2 errors) ==== +==== subtypingWithConstructSignaturesWithSpecializedSignatures.ts (4 errors) ==== // same as subtypingWithCallSignatures but with additional specialized signatures that should not affect the results module CallSignature { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's new (x: 'a'): void; @@ -46,6 +50,8 @@ subtypingWithConstructSignaturesWithSpecializedSignatures.ts(76,15): error TS243 } module MemberWithCallSignature { + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { // T // M's a: { diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index a69d2499601a8..29b83729e2d17 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,3 +1,4 @@ +subtypingWithGenericCallSignaturesWithOptionalParameters.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. @@ -6,6 +7,7 @@ subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430 Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. Target signature provides too few arguments. Expected 2 or more, but got 1. +subtypingWithGenericCallSignaturesWithOptionalParameters.ts(89,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericCallSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -98,6 +100,7 @@ subtypingWithGenericCallSignaturesWithOptionalParameters.ts(172,15): error TS243 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'. +subtypingWithGenericCallSignaturesWithOptionalParameters.ts(177,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. @@ -108,10 +111,12 @@ subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS243 Target signature provides too few arguments. Expected 2 or more, but got 1. -==== subtypingWithGenericCallSignaturesWithOptionalParameters.ts (22 errors) ==== +==== subtypingWithGenericCallSignaturesWithOptionalParameters.ts (25 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type module ClassTypeParam { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { a: () => T; a2: (x?: T) => T; @@ -208,6 +213,8 @@ subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS243 } module GenericSignaturesInvalid { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // all of these are errors interface Base2 { @@ -422,6 +429,8 @@ subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS243 } module GenericSignaturesValid { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base2 { a: () => T; diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index 962bd6f02a2d9..a82631a1df59e 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,3 +1,4 @@ +subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. @@ -6,6 +7,7 @@ subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error T Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. Target signature provides too few arguments. Expected 2 or more, but got 1. +subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(89,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(100,15): error TS2430: Interface 'I1' incorrectly extends interface 'Base2'. The types returned by 'new a()' are incompatible between these types. Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated. @@ -98,6 +100,7 @@ subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(172,15): 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'. +subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(177,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. @@ -108,10 +111,12 @@ subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error Target signature provides too few arguments. Expected 2 or more, but got 1. -==== subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (22 errors) ==== +==== subtypingWithGenericConstructSignaturesWithOptionalParameters.ts (25 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type module ClassTypeParam { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base { a: new () => T; a2: new (x?: T) => T; @@ -208,6 +213,8 @@ subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error } module GenericSignaturesInvalid { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // all of these are errors interface Base2 { @@ -422,6 +429,8 @@ subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error } module GenericSignaturesValid { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Base2 { a: new () => T; diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt index ebe38a9ecc663..5ef68f07198a9 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt @@ -1,3 +1,4 @@ +subtypingWithNumericIndexer.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithNumericIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. 'number' index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -8,7 +9,7 @@ subtypingWithNumericIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly e 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. -==== subtypingWithNumericIndexer.ts (2 errors) ==== +==== subtypingWithNumericIndexer.ts (3 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -28,6 +29,8 @@ subtypingWithNumericIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly e } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: number]: T; } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt index 4ffb55f7afd11..6cb9fcdeb7179 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt @@ -1,6 +1,7 @@ subtypingWithNumericIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. 'number' index signatures are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithNumericIndexer2.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithNumericIndexer2.ts(24,27): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base' but required in type 'Derived'. subtypingWithNumericIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. @@ -17,7 +18,7 @@ subtypingWithNumericIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrec 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived2'. -==== subtypingWithNumericIndexer2.ts (5 errors) ==== +==== subtypingWithNumericIndexer2.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -42,6 +43,8 @@ subtypingWithNumericIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrec } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { [x: number]: T; } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt index f08112dbb97cd..85053dc1832d1 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt @@ -1,6 +1,7 @@ subtypingWithNumericIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. 'number' index signatures are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithNumericIndexer3.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithNumericIndexer3.ts(24,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base' but required in type 'Derived'. subtypingWithNumericIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -17,7 +18,7 @@ subtypingWithNumericIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived2'. -==== subtypingWithNumericIndexer3.ts (5 errors) ==== +==== subtypingWithNumericIndexer3.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -42,6 +43,8 @@ subtypingWithNumericIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: number]: T; } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt index 7a19e44207f5f..6c183ac62844e 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt @@ -1,6 +1,7 @@ subtypingWithNumericIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. 'number' index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. +subtypingWithNumericIndexer4.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithNumericIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. 'number' index signatures are incompatible. Type 'string' is not assignable to type 'Base'. @@ -12,7 +13,7 @@ subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== subtypingWithNumericIndexer4.ts (4 errors) ==== +==== subtypingWithNumericIndexer4.ts (5 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -32,6 +33,8 @@ subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: number]: T; } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt index b8e96c0d40243..91713a7a7c681 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt @@ -2,6 +2,7 @@ subtypingWithNumericIndexer5.ts(11,7): error TS2420: Class 'B' incorrectly imple 'string' and 'number' index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithNumericIndexer5.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithNumericIndexer5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A'. 'string' and 'number' index signatures are incompatible. Type 'Base' is not assignable to type 'T'. @@ -16,7 +17,7 @@ subtypingWithNumericIndexer5.ts(40,11): error TS2420: Class 'B5' incorrectly 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived2'. -==== subtypingWithNumericIndexer5.ts (4 errors) ==== +==== subtypingWithNumericIndexer5.ts (5 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -42,6 +43,8 @@ subtypingWithNumericIndexer5.ts(40,11): error TS2420: Class 'B5' incorrectly } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { [x: number]: T; } diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index 3a4205341f95c..6faf3ea8080f6 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -4,6 +4,7 @@ subtypingWithObjectMembers.ts(24,5): error TS2416: Property '2' in type 'B2' is Type 'string' is not assignable to type 'Base'. subtypingWithObjectMembers.ts(34,5): error TS2416: Property ''2.0'' in type 'B3' is not assignable to the same property in base type 'A3'. Type 'string' is not assignable to type 'Base'. +subtypingWithObjectMembers.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers.ts(45,9): error TS2416: Property 'bar' in type 'B' is not assignable to the same property in base type 'A'. Type 'string' is not assignable to type 'Base'. subtypingWithObjectMembers.ts(55,9): error TS2416: Property '2' in type 'B2' is not assignable to the same property in base type 'A2'. @@ -12,7 +13,7 @@ subtypingWithObjectMembers.ts(65,9): error TS2416: Property ''2.0'' in type 'B3' Type 'string' is not assignable to type 'Base'. -==== subtypingWithObjectMembers.ts (6 errors) ==== +==== subtypingWithObjectMembers.ts (7 errors) ==== class Base { foo: string; } class Derived extends Base { bar: string; } class Derived2 extends Derived { baz: string; } @@ -59,6 +60,8 @@ subtypingWithObjectMembers.ts(65,9): error TS2416: Property ''2.0'' in type 'B3' } module TwoLevels { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { foo: Base; bar: Base; diff --git a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt index 391292aadbd24..af4024386b28a 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt @@ -1,3 +1,4 @@ +subtypingWithObjectMembers2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers2.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -7,6 +8,7 @@ subtypingWithObjectMembers2.ts(27,15): error TS2430: Interface 'B2' incorrectly subtypingWithObjectMembers2.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. Types of property ''2.0'' are incompatible. Type 'string' is not assignable to type 'Base'. +subtypingWithObjectMembers2.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers2.ts(50,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -18,7 +20,7 @@ subtypingWithObjectMembers2.ts(70,15): error TS2430: Interface 'B3' incorrectly Type 'string' is not assignable to type 'Base'. -==== subtypingWithObjectMembers2.ts (6 errors) ==== +==== subtypingWithObjectMembers2.ts (8 errors) ==== interface Base { foo: string; } @@ -30,6 +32,8 @@ subtypingWithObjectMembers2.ts(70,15): error TS2430: Interface 'B3' incorrectly // N and M have the same name, same accessibility, same optionality, and N is a subtype of M // foo properties are valid, bar properties cause errors in the derived class declarations module NotOptional { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo: Base; bar: Base; @@ -75,6 +79,8 @@ subtypingWithObjectMembers2.ts(70,15): error TS2430: Interface 'B3' incorrectly // same cases as above but with optional module Optional { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo?: Base; bar?: Base; diff --git a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt index c69465b1ee1cf..39ec267c4a59e 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt @@ -1,3 +1,4 @@ +subtypingWithObjectMembers3.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers3.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. @@ -7,6 +8,7 @@ subtypingWithObjectMembers3.ts(27,15): error TS2430: Interface 'B2' incorrectly subtypingWithObjectMembers3.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. Types of property ''2.0'' are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithObjectMembers3.ts(43,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers3.ts(49,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. @@ -18,7 +20,7 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly Property 'bar' is missing in type 'Base' but required in type 'Derived'. -==== subtypingWithObjectMembers3.ts (6 errors) ==== +==== subtypingWithObjectMembers3.ts (8 errors) ==== interface Base { foo: string; } @@ -30,6 +32,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly // N and M have the same name, same accessibility, same optionality, and N is a subtype of M // foo properties are valid, bar properties cause errors in the derived class declarations module NotOptional { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo: Base; bar: Derived; @@ -77,6 +81,8 @@ subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly } module Optional { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo?: Base; bar?: Derived; diff --git a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt index d5251e2ce7a70..932aa5d2569ee 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt @@ -1,15 +1,17 @@ +subtypingWithObjectMembers5.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers5.ts(16,11): error TS2420: Class 'B' incorrectly implements interface 'A'. Property 'foo' is missing in type 'B' but required in type 'A'. subtypingWithObjectMembers5.ts(24,11): error TS2420: Class 'B2' incorrectly implements interface 'A2'. Property '1' is missing in type 'B2' but required in type 'A2'. subtypingWithObjectMembers5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A3'. Property ''1'' is missing in type 'B3' but required in type 'A3'. +subtypingWithObjectMembers5.ts(38,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembers5.ts(43,11): error TS2559: Type 'B' has no properties in common with type 'A'. subtypingWithObjectMembers5.ts(51,11): error TS2559: Type 'B2' has no properties in common with type 'A2'. subtypingWithObjectMembers5.ts(59,11): error TS2559: Type 'B3' has no properties in common with type 'A3'. -==== subtypingWithObjectMembers5.ts (6 errors) ==== +==== subtypingWithObjectMembers5.ts (8 errors) ==== interface Base { foo: string; } @@ -21,6 +23,8 @@ subtypingWithObjectMembers5.ts(59,11): error TS2559: Type 'B3' has no properties // N and M have the same name, same accessibility, same optionality, and N is a subtype of M // foo properties are valid, bar properties cause errors in the derived class declarations module NotOptional { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo: Base; } @@ -60,6 +64,8 @@ subtypingWithObjectMembers5.ts(59,11): error TS2559: Type 'B3' has no properties // same cases as above but with optional module Optional { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { foo?: Base; } diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt index bb4fec3208f26..4463d3870c8eb 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt @@ -1,9 +1,11 @@ +subtypingWithObjectMembersAccessibility2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'A2' but not in type 'B2'. subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'A3' but not in type 'B3'. +subtypingWithObjectMembersAccessibility2.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. @@ -12,7 +14,7 @@ subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' inc Property ''1'' is private in type 'A3' but not in type 'B3'. -==== subtypingWithObjectMembersAccessibility2.ts (6 errors) ==== +==== subtypingWithObjectMembersAccessibility2.ts (8 errors) ==== // Derived member is private, base member is not causes errors class Base { @@ -24,6 +26,8 @@ subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' inc } module ExplicitPublic { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { private foo: Base; } @@ -59,6 +63,8 @@ subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' inc } module ImplicitPublic { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { private foo: Base; } diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersOptionality.errors.txt new file mode 100644 index 0000000000000..060619bad7b46 --- /dev/null +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality.errors.txt @@ -0,0 +1,79 @@ +subtypingWithObjectMembersOptionality.ts(44,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== subtypingWithObjectMembersOptionality.ts (1 errors) ==== + // Derived member is not optional but base member is, should be ok + + interface Base { foo: string; } + interface Derived extends Base { bar: string; } + interface Derived2 extends Derived { baz: string; } + + // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: + // - S' and T are object types and, for each member M in T, one of the following is true: + // - M is a property and S' contains a property N where + // M and N have the same name, + // the type of N is a subtype of that of M, + // M and N are both public or both private, and + // if M is a required property, N is also a required property. + // - M is an optional property and S' contains no property of the same name as M. + interface T { + Foo?: Base; + } + + interface S extends T { + Foo: Derived + } + + interface T2 { + 1?: Base; + } + + interface S2 extends T2 { + 1: Derived; + } + + interface T3 { + '1'?: Base; + } + + interface S3 extends T3 { + '1.': Derived; + } + + // object literal case + var a: { Foo?: Base; }; + var b = { Foo: null }; + var r = true ? a : b; + + module TwoLevels { + ~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface T { + Foo?: Base; + } + + interface S extends T { + Foo: Derived2 + } + + interface T2 { + 1?: Base; + } + + interface S2 extends T2 { + 1: Derived2; + } + + interface T3 { + '1'?: Base; + } + + interface S3 extends T3 { + '1.': Derived2; + } + + // object literal case + var a: { Foo?: Base; }; + var b = { Foo: null }; + var r = true ? a : b; + } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt index a2cedb556bcee..da66d2cbe74ea 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt @@ -1,3 +1,4 @@ +subtypingWithStringIndexer.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithStringIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. 'string' index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -8,7 +9,7 @@ subtypingWithStringIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly ex 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. -==== subtypingWithStringIndexer.ts (2 errors) ==== +==== subtypingWithStringIndexer.ts (3 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -28,6 +29,8 @@ subtypingWithStringIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly ex } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: string]: T; } diff --git a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt index 8a43b708b1946..7c254cdf34da5 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt @@ -1,6 +1,7 @@ subtypingWithStringIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. 'string' index signatures are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithStringIndexer2.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithStringIndexer2.ts(24,27): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base' but required in type 'Derived'. subtypingWithStringIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. @@ -17,7 +18,7 @@ subtypingWithStringIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrect 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived2'. -==== subtypingWithStringIndexer2.ts (5 errors) ==== +==== subtypingWithStringIndexer2.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -42,6 +43,8 @@ subtypingWithStringIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrect } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { [x: string]: T; } diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt index 2097ececc0589..08ece57b94c5b 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt @@ -1,6 +1,7 @@ subtypingWithStringIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. 'string' index signatures are incompatible. Property 'bar' is missing in type 'Base' but required in type 'Derived'. +subtypingWithStringIndexer3.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithStringIndexer3.ts(24,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base' but required in type 'Derived'. subtypingWithStringIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -17,7 +18,7 @@ subtypingWithStringIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly e 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived2'. -==== subtypingWithStringIndexer3.ts (5 errors) ==== +==== subtypingWithStringIndexer3.ts (6 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -42,6 +43,8 @@ subtypingWithStringIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly e } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: string]: T; } diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt index c339de71ce60a..f9d0357f9424b 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt @@ -1,6 +1,7 @@ subtypingWithStringIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. 'string' index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. +subtypingWithStringIndexer4.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. subtypingWithStringIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. 'string' index signatures are incompatible. Type 'string' is not assignable to type 'Base'. @@ -12,7 +13,7 @@ subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly e 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== subtypingWithStringIndexer4.ts (4 errors) ==== +==== subtypingWithStringIndexer4.ts (5 errors) ==== // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } @@ -32,6 +33,8 @@ subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly e } module Generics { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class A { [x: string]: T; } diff --git a/tests/baselines/reference/super1.errors.txt b/tests/baselines/reference/super1.errors.txt index 02dea57041526..7e9f1d42571e6 100644 --- a/tests/baselines/reference/super1.errors.txt +++ b/tests/baselines/reference/super1.errors.txt @@ -1,10 +1,11 @@ super1.ts(16,22): error TS2339: Property 'super' does not exist on type 'Sub1'. super1.ts(29,22): error TS2339: Property 'prototype' does not exist on type 'Base2'. super1.ts(42,22): error TS2339: Property 'bar' does not exist on type 'Base3'. +super1.ts(47,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. super1.ts(62,20): error TS2335: 'super' can only be referenced in a derived class. -==== super1.ts (4 errors) ==== +==== super1.ts (5 errors) ==== // Case 1 class Base1 { public foo() { @@ -58,6 +59,8 @@ super1.ts(62,20): error TS2335: 'super' can only be referenced in a derived clas // Case 4 module Base4 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Sub4 { public x(){ return "hello"; diff --git a/tests/baselines/reference/superAccessInFatArrow1.errors.txt b/tests/baselines/reference/superAccessInFatArrow1.errors.txt new file mode 100644 index 0000000000000..b80169a4a7ae2 --- /dev/null +++ b/tests/baselines/reference/superAccessInFatArrow1.errors.txt @@ -0,0 +1,21 @@ +superAccessInFatArrow1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== superAccessInFatArrow1.ts (1 errors) ==== + module test { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { + foo() { + } + } + export class B extends A { + bar(callback: () => void ) { + } + runme() { + this.bar(() => { + super.foo(); + }); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.errors.txt b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.errors.txt index d6c019a7ee097..ebb0882f252e5 100644 --- a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.errors.txt +++ b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.errors.txt @@ -1,11 +1,14 @@ +super_inside-object-literal-getters-and-setters.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. super_inside-object-literal-getters-and-setters.ts(5,20): error TS2659: 'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher. super_inside-object-literal-getters-and-setters.ts(8,13): error TS2659: 'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher. super_inside-object-literal-getters-and-setters.ts(11,20): error TS2660: 'super' can only be referenced in members of derived classes or object literal expressions. super_inside-object-literal-getters-and-setters.ts(21,24): error TS2659: 'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher. -==== super_inside-object-literal-getters-and-setters.ts (4 errors) ==== +==== super_inside-object-literal-getters-and-setters.ts (5 errors) ==== module ObjectLiteral { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var ThisInObjectLiteral = { _foo: '1', get foo(): string { diff --git a/tests/baselines/reference/switchStatements.errors.txt b/tests/baselines/reference/switchStatements.errors.txt index 5ffcf502b7baf..ea69e1726f2bb 100644 --- a/tests/baselines/reference/switchStatements.errors.txt +++ b/tests/baselines/reference/switchStatements.errors.txt @@ -1,8 +1,11 @@ +switchStatements.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. switchStatements.ts(35,20): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'C'. -==== switchStatements.ts (1 errors) ==== +==== switchStatements.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export function fn(x: number) { return ''; } diff --git a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt index d9c0e5a618b23..cab66e110ee91 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.errors.txt +++ b/tests/baselines/reference/symbolDeclarationEmit12.errors.txt @@ -1,9 +1,12 @@ +symbolDeclarationEmit12.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. symbolDeclarationEmit12.ts(9,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. symbolDeclarationEmit12.ts(10,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'. -==== symbolDeclarationEmit12.ts (2 errors) ==== +==== symbolDeclarationEmit12.ts (3 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface I { } export class C { [Symbol.iterator]: I; diff --git a/tests/baselines/reference/symbolProperty48.errors.txt b/tests/baselines/reference/symbolProperty48.errors.txt new file mode 100644 index 0000000000000..b2125e4c8d851 --- /dev/null +++ b/tests/baselines/reference/symbolProperty48.errors.txt @@ -0,0 +1,13 @@ +symbolProperty48.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty48.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Symbol; + + class C { + [Symbol.iterator]() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty48.types b/tests/baselines/reference/symbolProperty48.types index f13741a2c4b95..333bcda7784b2 100644 --- a/tests/baselines/reference/symbolProperty48.types +++ b/tests/baselines/reference/symbolProperty48.types @@ -7,6 +7,7 @@ module M { var Symbol; >Symbol : any +> : ^^^ class C { >C : C @@ -16,6 +17,7 @@ module M { >[Symbol.iterator] : () => void > : ^^^^^^^^^^ >Symbol.iterator : any +> : ^^^ >Symbol : any > : ^^^ >iterator : any diff --git a/tests/baselines/reference/symbolProperty49.errors.txt b/tests/baselines/reference/symbolProperty49.errors.txt new file mode 100644 index 0000000000000..6f54b6209ee44 --- /dev/null +++ b/tests/baselines/reference/symbolProperty49.errors.txt @@ -0,0 +1,13 @@ +symbolProperty49.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty49.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var Symbol; + + class C { + [Symbol.iterator]() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty49.types b/tests/baselines/reference/symbolProperty49.types index 24f6b96bfaacc..29ad72a0d61ce 100644 --- a/tests/baselines/reference/symbolProperty49.types +++ b/tests/baselines/reference/symbolProperty49.types @@ -7,6 +7,7 @@ module M { export var Symbol; >Symbol : any +> : ^^^ class C { >C : C @@ -16,6 +17,7 @@ module M { >[Symbol.iterator] : () => void > : ^^^^^^^^^^ >Symbol.iterator : any +> : ^^^ >Symbol : any > : ^^^ >iterator : any diff --git a/tests/baselines/reference/symbolProperty50.errors.txt b/tests/baselines/reference/symbolProperty50.errors.txt new file mode 100644 index 0000000000000..8bbded7cad3d4 --- /dev/null +++ b/tests/baselines/reference/symbolProperty50.errors.txt @@ -0,0 +1,13 @@ +symbolProperty50.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty50.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Symbol { } + + class C { + [Symbol.iterator]() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty51.errors.txt b/tests/baselines/reference/symbolProperty51.errors.txt new file mode 100644 index 0000000000000..f99de4f151ea8 --- /dev/null +++ b/tests/baselines/reference/symbolProperty51.errors.txt @@ -0,0 +1,16 @@ +symbolProperty51.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +symbolProperty51.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty51.ts (2 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + module Symbol { } + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + class C { + [Symbol.iterator]() { } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty55.errors.txt b/tests/baselines/reference/symbolProperty55.errors.txt new file mode 100644 index 0000000000000..17740ff7709cd --- /dev/null +++ b/tests/baselines/reference/symbolProperty55.errors.txt @@ -0,0 +1,16 @@ +symbolProperty55.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty55.ts (1 errors) ==== + var obj = { + [Symbol.iterator]: 0 + }; + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Symbol: SymbolConstructor; + // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, + // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. + obj[Symbol.iterator]; + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty56.errors.txt b/tests/baselines/reference/symbolProperty56.errors.txt new file mode 100644 index 0000000000000..570a4dd216e59 --- /dev/null +++ b/tests/baselines/reference/symbolProperty56.errors.txt @@ -0,0 +1,16 @@ +symbolProperty56.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== symbolProperty56.ts (1 errors) ==== + var obj = { + [Symbol.iterator]: 0 + }; + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Symbol: {}; + // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, + // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. + obj[Symbol["iterator"]]; + } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty56.types b/tests/baselines/reference/symbolProperty56.types index 45b764021ad4f..ffb708bf82151 100644 --- a/tests/baselines/reference/symbolProperty56.types +++ b/tests/baselines/reference/symbolProperty56.types @@ -32,10 +32,12 @@ module M { // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol["iterator"]]; ->obj[Symbol["iterator"]] : error +>obj[Symbol["iterator"]] : any +> : ^^^ >obj : { [Symbol.iterator]: number; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Symbol["iterator"] : error +>Symbol["iterator"] : any +> : ^^^ >Symbol : {} > : ^^ >"iterator" : "iterator" diff --git a/tests/baselines/reference/systemDefaultImportCallable.errors.txt b/tests/baselines/reference/systemDefaultImportCallable.errors.txt new file mode 100644 index 0000000000000..1fe092d226873 --- /dev/null +++ b/tests/baselines/reference/systemDefaultImportCallable.errors.txt @@ -0,0 +1,19 @@ +core-js.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== core-js.d.ts (1 errors) ==== + declare module core { + ~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var String: { + repeat(text: string, count: number): string; + }; + } + declare module "core-js/fn/string/repeat" { + var repeat: typeof core.String.repeat; + export default repeat; + } +==== greeter.ts (0 errors) ==== + import repeat from "core-js/fn/string/repeat"; + + const _: string = repeat(new Date().toUTCString() + " ", 2); \ No newline at end of file diff --git a/tests/baselines/reference/systemModule7.errors.txt b/tests/baselines/reference/systemModule7.errors.txt new file mode 100644 index 0000000000000..fe6653a1d16fa --- /dev/null +++ b/tests/baselines/reference/systemModule7.errors.txt @@ -0,0 +1,18 @@ +systemModule7.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +systemModule7.ts(7,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== systemModule7.ts (2 errors) ==== + // filename: instantiatedModule.ts + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 1; + } + + // filename: nonInstantiatedModule.ts + export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface I {} + } \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleAmbientDeclarations.errors.txt b/tests/baselines/reference/systemModuleAmbientDeclarations.errors.txt new file mode 100644 index 0000000000000..31b804e6cb2b3 --- /dev/null +++ b/tests/baselines/reference/systemModuleAmbientDeclarations.errors.txt @@ -0,0 +1,31 @@ +file6.ts(1,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file1.ts (0 errors) ==== + declare class Promise { } + declare function Foo(): void; + declare class C {} + declare enum E {X = 1}; + + export var promise = Promise; + export var foo = Foo; + export var c = C; + export var e = E; + +==== file2.ts (0 errors) ==== + export declare function foo(); + +==== file3.ts (0 errors) ==== + export declare class C {} + +==== file4.ts (0 errors) ==== + export declare var v: number; + +==== file5.ts (0 errors) ==== + export declare enum E {X = 1} + +==== file6.ts (1 errors) ==== + export declare module M { var v: number; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleConstEnums.errors.txt b/tests/baselines/reference/systemModuleConstEnums.errors.txt new file mode 100644 index 0000000000000..0405575fa3c56 --- /dev/null +++ b/tests/baselines/reference/systemModuleConstEnums.errors.txt @@ -0,0 +1,17 @@ +systemModuleConstEnums.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== systemModuleConstEnums.ts (1 errors) ==== + declare function use(a: any); + const enum TopLevelConstEnum { X } + + export function foo() { + use(TopLevelConstEnum.X); + use(M.NonTopLevelConstEnum.X); + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum NonTopLevelConstEnum { X } + } \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleConstEnums.types b/tests/baselines/reference/systemModuleConstEnums.types index 56d1f19b1e2de..5c81a34b24f23 100644 --- a/tests/baselines/reference/systemModuleConstEnums.types +++ b/tests/baselines/reference/systemModuleConstEnums.types @@ -5,6 +5,7 @@ declare function use(a: any); >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >a : any +> : ^^^ const enum TopLevelConstEnum { X } >TopLevelConstEnum : TopLevelConstEnum @@ -18,6 +19,7 @@ export function foo() { use(TopLevelConstEnum.X); >use(TopLevelConstEnum.X) : any +> : ^^^ >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >TopLevelConstEnum.X : TopLevelConstEnum @@ -29,6 +31,7 @@ export function foo() { use(M.NonTopLevelConstEnum.X); >use(M.NonTopLevelConstEnum.X) : any +> : ^^^ >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >M.NonTopLevelConstEnum.X : M.NonTopLevelConstEnum diff --git a/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.errors.txt b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.errors.txt new file mode 100644 index 0000000000000..bd1aaa15051da --- /dev/null +++ b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.errors.txt @@ -0,0 +1,17 @@ +systemModuleConstEnumsSeparateCompilation.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== systemModuleConstEnumsSeparateCompilation.ts (1 errors) ==== + declare function use(a: any); + const enum TopLevelConstEnum { X } + + export function foo() { + use(TopLevelConstEnum.X); + use(M.NonTopLevelConstEnum.X); + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export const enum NonTopLevelConstEnum { X } + } \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.types b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.types index 89c2edb8e0e8b..4c915efbf94a9 100644 --- a/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.types +++ b/tests/baselines/reference/systemModuleConstEnumsSeparateCompilation.types @@ -5,6 +5,7 @@ declare function use(a: any); >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >a : any +> : ^^^ const enum TopLevelConstEnum { X } >TopLevelConstEnum : TopLevelConstEnum @@ -18,6 +19,7 @@ export function foo() { use(TopLevelConstEnum.X); >use(TopLevelConstEnum.X) : any +> : ^^^ >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >TopLevelConstEnum.X : TopLevelConstEnum @@ -29,6 +31,7 @@ export function foo() { use(M.NonTopLevelConstEnum.X); >use(M.NonTopLevelConstEnum.X) : any +> : ^^^ >use : (a: any) => any > : ^ ^^ ^^^^^^^^ >M.NonTopLevelConstEnum.X : M.NonTopLevelConstEnum diff --git a/tests/baselines/reference/systemModuleDeclarationMerging.errors.txt b/tests/baselines/reference/systemModuleDeclarationMerging.errors.txt new file mode 100644 index 0000000000000..aecf7354f76a6 --- /dev/null +++ b/tests/baselines/reference/systemModuleDeclarationMerging.errors.txt @@ -0,0 +1,20 @@ +systemModuleDeclarationMerging.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +systemModuleDeclarationMerging.ts(5,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +systemModuleDeclarationMerging.ts(8,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== systemModuleDeclarationMerging.ts (3 errors) ==== + export function F() {} + export module F { var x; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export class C {} + export module C { var x; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export enum E {} + export module E { var x; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleDeclarationMerging.types b/tests/baselines/reference/systemModuleDeclarationMerging.types index 607f30b28f75a..7e450adda6611 100644 --- a/tests/baselines/reference/systemModuleDeclarationMerging.types +++ b/tests/baselines/reference/systemModuleDeclarationMerging.types @@ -9,6 +9,7 @@ export module F { var x; } >F : typeof F > : ^^^^^^^^ >x : any +> : ^^^ export class C {} >C : C @@ -18,6 +19,7 @@ export module C { var x; } >C : typeof C > : ^^^^^^^^ >x : any +> : ^^^ export enum E {} >E : E @@ -27,4 +29,5 @@ export module E { var x; } >E : typeof E > : ^^^^^^^^ >x : any +> : ^^^ diff --git a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.errors.txt b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.errors.txt new file mode 100644 index 0000000000000..4dfdf6244df8b --- /dev/null +++ b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.errors.txt @@ -0,0 +1,23 @@ +systemModuleNonTopLevelModuleMembers.ts(2,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +systemModuleNonTopLevelModuleMembers.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +systemModuleNonTopLevelModuleMembers.ts(8,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== systemModuleNonTopLevelModuleMembers.ts (3 errors) ==== + export class TopLevelClass {} + export module TopLevelModule {var v;} + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function TopLevelFunction(): void {} + export enum TopLevelEnum {E} + + export module TopLevelModule2 { + ~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class NonTopLevelClass {} + export module NonTopLevelModule {var v;} + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function NonTopLevelFunction(): void {} + export enum NonTopLevelEnum {E} + } \ No newline at end of file diff --git a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.types b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.types index 4e87b84df2ec9..4247d85b9e1d1 100644 --- a/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.types +++ b/tests/baselines/reference/systemModuleNonTopLevelModuleMembers.types @@ -9,6 +9,7 @@ export module TopLevelModule {var v;} >TopLevelModule : typeof TopLevelModule > : ^^^^^^^^^^^^^^^^^^^^^ >v : any +> : ^^^ export function TopLevelFunction(): void {} >TopLevelFunction : () => void @@ -32,6 +33,7 @@ export module TopLevelModule2 { >NonTopLevelModule : typeof NonTopLevelModule > : ^^^^^^^^^^^^^^^^^^^^^^^^ >v : any +> : ^^^ export function NonTopLevelFunction(): void {} >NonTopLevelFunction : () => void diff --git a/tests/baselines/reference/testContainerList.errors.txt b/tests/baselines/reference/testContainerList.errors.txt new file mode 100644 index 0000000000000..1db3c47408f77 --- /dev/null +++ b/tests/baselines/reference/testContainerList.errors.txt @@ -0,0 +1,13 @@ +testContainerList.ts(2,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== testContainerList.ts (1 errors) ==== + // Regression test for #325 + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class C { + constructor(public d: {}) { } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/thisAssignmentInNamespaceDeclaration1.errors.txt b/tests/baselines/reference/thisAssignmentInNamespaceDeclaration1.errors.txt index 3824bc8325a48..78fcc8ef570eb 100644 --- a/tests/baselines/reference/thisAssignmentInNamespaceDeclaration1.errors.txt +++ b/tests/baselines/reference/thisAssignmentInNamespaceDeclaration1.errors.txt @@ -1,12 +1,15 @@ +a.js(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. a.js(1,8): error TS8006: 'module' declarations can only be used in TypeScript files. a.js(2,5): error TS2331: 'this' cannot be referenced in a module or namespace body. b.js(1,11): error TS8006: 'namespace' declarations can only be used in TypeScript files. b.js(2,5): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== a.js (2 errors) ==== +==== a.js (3 errors) ==== module foo { ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~~ !!! error TS8006: 'module' declarations can only be used in TypeScript files. this.bar = 4; ~~~~ diff --git a/tests/baselines/reference/thisBinding.errors.txt b/tests/baselines/reference/thisBinding.errors.txt index 44b2c84be079b..2538ace34ebd4 100644 --- a/tests/baselines/reference/thisBinding.errors.txt +++ b/tests/baselines/reference/thisBinding.errors.txt @@ -1,8 +1,11 @@ +thisBinding.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. thisBinding.ts(9,8): error TS2339: Property 'e' does not exist on type 'I'. -==== thisBinding.ts (1 errors) ==== +==== thisBinding.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I { z; } diff --git a/tests/baselines/reference/thisInInvalidContexts.errors.txt b/tests/baselines/reference/thisInInvalidContexts.errors.txt index 8847058104db5..b014ed92dda89 100644 --- a/tests/baselines/reference/thisInInvalidContexts.errors.txt +++ b/tests/baselines/reference/thisInInvalidContexts.errors.txt @@ -1,5 +1,6 @@ thisInInvalidContexts.ts(9,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. thisInInvalidContexts.ts(17,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +thisInInvalidContexts.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. thisInInvalidContexts.ts(23,13): error TS2331: 'this' cannot be referenced in a module or namespace body. thisInInvalidContexts.ts(31,13): error TS2526: A 'this' type is available only in a non-static member of a class or interface. thisInInvalidContexts.ts(33,25): error TS2507: Type 'typeof globalThis' is not a constructor function type. @@ -7,7 +8,7 @@ thisInInvalidContexts.ts(39,9): error TS2332: 'this' cannot be referenced in cur thisInInvalidContexts.ts(40,9): error TS2332: 'this' cannot be referenced in current location. -==== thisInInvalidContexts.ts (7 errors) ==== +==== thisInInvalidContexts.ts (8 errors) ==== class BaseErrClass { constructor(t: any) { } } @@ -33,6 +34,8 @@ thisInInvalidContexts.ts(40,9): error TS2332: 'this' cannot be referenced in cur } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. //'this' in module variable var x = this; // Error ~~~~ diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt index c123b758ac6f4..7495ac97e15ee 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.errors.txt @@ -1,5 +1,6 @@ thisInInvalidContextsExternalModule.ts(9,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. thisInInvalidContextsExternalModule.ts(17,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. +thisInInvalidContextsExternalModule.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. thisInInvalidContextsExternalModule.ts(23,13): error TS2331: 'this' cannot be referenced in a module or namespace body. thisInInvalidContextsExternalModule.ts(31,13): error TS2526: A 'this' type is available only in a non-static member of a class or interface. thisInInvalidContextsExternalModule.ts(33,25): error TS2507: Type 'undefined' is not a constructor function type. @@ -7,7 +8,7 @@ thisInInvalidContextsExternalModule.ts(39,9): error TS2332: 'this' cannot be ref thisInInvalidContextsExternalModule.ts(40,9): error TS2332: 'this' cannot be referenced in current location. -==== thisInInvalidContextsExternalModule.ts (7 errors) ==== +==== thisInInvalidContextsExternalModule.ts (8 errors) ==== class BaseErrClass { constructor(t: any) { } } @@ -33,6 +34,8 @@ thisInInvalidContextsExternalModule.ts(40,9): error TS2332: 'this' cannot be ref } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. //'this' in module variable var x = this; // Error ~~~~ diff --git a/tests/baselines/reference/thisInModule.errors.txt b/tests/baselines/reference/thisInModule.errors.txt index 3ca1ea57f21e1..17b6f5ae69957 100644 --- a/tests/baselines/reference/thisInModule.errors.txt +++ b/tests/baselines/reference/thisInModule.errors.txt @@ -1,8 +1,11 @@ +thisInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. thisInModule.ts(3,5): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== thisInModule.ts (1 errors) ==== +==== thisInModule.ts (2 errors) ==== module myMod { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x; this.x = 5; ~~~~ diff --git a/tests/baselines/reference/thisInModuleFunction1.errors.txt b/tests/baselines/reference/thisInModuleFunction1.errors.txt new file mode 100644 index 0000000000000..41db08c27f785 --- /dev/null +++ b/tests/baselines/reference/thisInModuleFunction1.errors.txt @@ -0,0 +1,12 @@ +thisInModuleFunction1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== thisInModuleFunction1.ts (1 errors) ==== + module bar { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function bar() { + return this; + } + } + var z = bar.bar(); \ No newline at end of file diff --git a/tests/baselines/reference/thisInModuleFunction1.types b/tests/baselines/reference/thisInModuleFunction1.types index a51ac6530657e..865153549fb1a 100644 --- a/tests/baselines/reference/thisInModuleFunction1.types +++ b/tests/baselines/reference/thisInModuleFunction1.types @@ -11,11 +11,14 @@ module bar { return this; >this : any +> : ^^^ } } var z = bar.bar(); >z : any +> : ^^^ >bar.bar() : any +> : ^^^ >bar.bar : () => any > : ^^^^^^^^^ >bar : typeof bar diff --git a/tests/baselines/reference/thisKeyword.errors.txt b/tests/baselines/reference/thisKeyword.errors.txt index 1cde44eb6b49b..25472b0da3385 100644 --- a/tests/baselines/reference/thisKeyword.errors.txt +++ b/tests/baselines/reference/thisKeyword.errors.txt @@ -1,8 +1,11 @@ +thisKeyword.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. thisKeyword.ts(2,5): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== thisKeyword.ts (1 errors) ==== +==== thisKeyword.ts (2 errors) ==== module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. this.bar = 4; ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. diff --git a/tests/baselines/reference/this_inside-enum-should-not-be-allowed.errors.txt b/tests/baselines/reference/this_inside-enum-should-not-be-allowed.errors.txt index c7b2986b99b6d..256631471a7df 100644 --- a/tests/baselines/reference/this_inside-enum-should-not-be-allowed.errors.txt +++ b/tests/baselines/reference/this_inside-enum-should-not-be-allowed.errors.txt @@ -1,8 +1,9 @@ this_inside-enum-should-not-be-allowed.ts(2,36): error TS2332: 'this' cannot be referenced in current location. +this_inside-enum-should-not-be-allowed.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. this_inside-enum-should-not-be-allowed.ts(7,30): error TS2332: 'this' cannot be referenced in current location. -==== this_inside-enum-should-not-be-allowed.ts (2 errors) ==== +==== this_inside-enum-should-not-be-allowed.ts (3 errors) ==== enum TopLevelEnum { ThisWasAllowedButShouldNotBe = this // Should not be allowed ~~~~ @@ -10,6 +11,8 @@ this_inside-enum-should-not-be-allowed.ts(7,30): error TS2332: 'this' cannot be } module ModuleEnum { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. enum EnumInModule { WasADifferentError = this // this was handled as if this was in a module ~~~~ diff --git a/tests/baselines/reference/this_inside-object-literal-getters-and-setters.errors.txt b/tests/baselines/reference/this_inside-object-literal-getters-and-setters.errors.txt new file mode 100644 index 0000000000000..7a3614089eb6e --- /dev/null +++ b/tests/baselines/reference/this_inside-object-literal-getters-and-setters.errors.txt @@ -0,0 +1,22 @@ +this_inside-object-literal-getters-and-setters.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== this_inside-object-literal-getters-and-setters.ts (1 errors) ==== + module ObjectLiteral { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var ThisInObjectLiteral = { + _foo: '1', + get foo(): string { + return this._foo; + }, + set foo(value: string) { + this._foo = value; + }, + test: function () { + return this._foo; + } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/this_inside-object-literal-getters-and-setters.types b/tests/baselines/reference/this_inside-object-literal-getters-and-setters.types index fb1143f861b47..ddc5581dd4cab 100644 --- a/tests/baselines/reference/this_inside-object-literal-getters-and-setters.types +++ b/tests/baselines/reference/this_inside-object-literal-getters-and-setters.types @@ -23,6 +23,7 @@ module ObjectLiteral { return this._foo; >this._foo : any +> : ^^^ >this : any > : ^^^ >_foo : any @@ -39,6 +40,7 @@ module ObjectLiteral { >this._foo = value : string > : ^^^^^^ >this._foo : any +> : ^^^ >this : any > : ^^^ >_foo : any @@ -55,6 +57,7 @@ module ObjectLiteral { return this._foo; >this._foo : any +> : ^^^ >this : any > : ^^^ >_foo : any diff --git a/tests/baselines/reference/throwStatements.errors.txt b/tests/baselines/reference/throwStatements.errors.txt new file mode 100644 index 0000000000000..d87c24603f017 --- /dev/null +++ b/tests/baselines/reference/throwStatements.errors.txt @@ -0,0 +1,91 @@ +throwStatements.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== throwStatements.ts (1 errors) ==== + // all legal + + interface I { + id: number; + } + + class C implements I { + id: number; + } + + class D{ + source: T; + recurse: D; + wrapped: D> + } + + function F(x: string): number { return 42; } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class A { + name: string; + } + + export function F2(x: number): string { return x.toString(); } + } + + var aNumber = 9.9; + throw aNumber; + var aString = 'this is a string'; + throw aString; + var aDate = new Date(12); + throw aDate; + var anObject = new Object(); + throw anObject; + + var anAny = null; + throw anAny; + var anOtherAny = new C(); + throw anOtherAny; + var anUndefined = undefined; + throw anUndefined; + + var aClass = new C(); + throw aClass; + var aGenericClass = new D(); + throw aGenericClass; + var anObjectLiteral = { id: 12 }; + throw anObjectLiteral; + + var aFunction = F; + throw aFunction; + throw aFunction(''); + var aLambda = (x) => 2; + throw aLambda; + throw aLambda(1); + + var aModule = M; + throw aModule; + throw typeof M; + var aClassInModule = new M.A(); + throw aClassInModule; + var aFunctionInModule = M.F2; + throw aFunctionInModule; + + // no initializer or annotation, so this is an 'any' + var x; + throw x; + + // literals + throw 0.0; + throw false; + throw null; + throw undefined; + throw 'a string'; + throw function () { return 'a string' }; + throw (x:T) => 42; + throw { x: 12, y: 13 }; + throw []; + throw ['a', ['b']]; + throw /[a-z]/; + throw new Date(); + throw new C(); + throw new Object(); + throw new D(); + \ No newline at end of file diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types index 697b9d5d871ed..9dadb89c2a917 100644 --- a/tests/baselines/reference/throwStatements.types +++ b/tests/baselines/reference/throwStatements.types @@ -119,13 +119,17 @@ throw anObject; var anAny = null; >anAny : any +> : ^^^ throw anAny; >anAny : any +> : ^^^ var anOtherAny = new C(); >anOtherAny : any +> : ^^^ > new C() : any +> : ^^^ >new C() : C > : ^ >C : typeof C @@ -133,14 +137,17 @@ var anOtherAny = new C(); throw anOtherAny; >anOtherAny : any +> : ^^^ var anUndefined = undefined; >anUndefined : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ throw anUndefined; >anUndefined : any +> : ^^^ var aClass = new C(); >aClass : C @@ -204,6 +211,7 @@ var aLambda = (x) => 2; >(x) => 2 : (x: any) => number > : ^ ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >2 : 2 > : ^ @@ -268,9 +276,11 @@ throw aFunctionInModule; // no initializer or annotation, so this is an 'any' var x; >x : any +> : ^^^ throw x; >x : any +> : ^^^ // literals throw 0.0; diff --git a/tests/baselines/reference/topLevel.errors.txt b/tests/baselines/reference/topLevel.errors.txt new file mode 100644 index 0000000000000..ef5fabcdd431f --- /dev/null +++ b/tests/baselines/reference/topLevel.errors.txt @@ -0,0 +1,33 @@ +topLevel.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== topLevel.ts (1 errors) ==== + interface IPoint { + x:number; + y:number; + } + + class Point implements IPoint { + constructor(public x,public y){} + public move(xo:number,yo:number) { + this.x+=xo; + this.y+=yo; + return this; + } + public toString() { + return ("("+this.x+","+this.y+")"); + } + } + + var result=""; + result+=(new Point(3,4).move(2,2)); + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var origin=new Point(0,0); + } + + result+=(M.origin.move(1,1)); + + \ No newline at end of file diff --git a/tests/baselines/reference/topLevel.types b/tests/baselines/reference/topLevel.types index 779e5f6174e2c..38099d751ed73 100644 --- a/tests/baselines/reference/topLevel.types +++ b/tests/baselines/reference/topLevel.types @@ -17,7 +17,9 @@ class Point implements IPoint { constructor(public x,public y){} >x : any +> : ^^^ >y : any +> : ^^^ public move(xo:number,yo:number) { >move : (xo: number, yo: number) => this @@ -29,7 +31,9 @@ class Point implements IPoint { this.x+=xo; >this.x+=xo : any +> : ^^^ >this.x : any +> : ^^^ >this : this > : ^^^^ >x : any @@ -39,7 +43,9 @@ class Point implements IPoint { this.y+=yo; >this.y+=yo : any +> : ^^^ >this.y : any +> : ^^^ >this : this > : ^^^^ >y : any @@ -69,6 +75,7 @@ class Point implements IPoint { >"(" : "(" > : ^^^ >this.x : any +> : ^^^ >this : this > : ^^^^ >x : any @@ -76,6 +83,7 @@ class Point implements IPoint { >"," : "," > : ^^^ >this.y : any +> : ^^^ >this : this > : ^^^^ >y : any diff --git a/tests/baselines/reference/topLevelLambda.errors.txt b/tests/baselines/reference/topLevelLambda.errors.txt index 963983fe8c457..ab1ed86428465 100644 --- a/tests/baselines/reference/topLevelLambda.errors.txt +++ b/tests/baselines/reference/topLevelLambda.errors.txt @@ -1,8 +1,11 @@ +topLevelLambda.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. topLevelLambda.ts(2,17): error TS2331: 'this' cannot be referenced in a module or namespace body. -==== topLevelLambda.ts (1 errors) ==== +==== topLevelLambda.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var f = () => {this.window;} ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. diff --git a/tests/baselines/reference/tsserver/projectReferenceCompileOnSave/compile-on-save-emits-same-output-as-project-build-with-external-project.js b/tests/baselines/reference/tsserver/projectReferenceCompileOnSave/compile-on-save-emits-same-output-as-project-build-with-external-project.js index 3130ae106a02e..07d645ca550cb 100644 --- a/tests/baselines/reference/tsserver/projectReferenceCompileOnSave/compile-on-save-emits-same-output-as-project-build-with-external-project.js +++ b/tests/baselines/reference/tsserver/projectReferenceCompileOnSave/compile-on-save-emits-same-output-as-project-build-with-external-project.js @@ -93,7 +93,7 @@ declare namespace Hmi { //// [/user/username/projects/myproject/buttonClass/Source.tsbuildinfo] -{"fileNames":["../../../../../home/src/tslibs/TS/Lib/lib.d.ts","./Source.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-1678937917-module Hmi {\n export class Button {\n public static myStaticFunction() {\n }\n }\n}"],"root":[2],"options":{"composite":true,"module":0,"outFile":"./Source.js"},"outSignature":"6176297704-declare namespace Hmi {\n class Button {\n static myStaticFunction(): void;\n }\n}\n","latestChangedDtsFile":"./Source.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../../home/src/tslibs/TS/Lib/lib.d.ts","./Source.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-1678937917-module Hmi {\n export class Button {\n public static myStaticFunction() {\n }\n }\n}"],"root":[2],"options":{"composite":true,"module":0,"outFile":"./Source.js"},"semanticDiagnosticsPerFile":[[2,[{"start":7,"length":3,"messageText":"This syntax is not allowed when 'erasableSyntaxOnly' is enabled.","category":1,"code":1294}]]],"outSignature":"6176297704-declare namespace Hmi {\n class Button {\n static myStaticFunction(): void;\n }\n}\n","latestChangedDtsFile":"./Source.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/buttonClass/Source.tsbuildinfo.readable.baseline.txt] { @@ -116,10 +116,24 @@ declare namespace Hmi { "module": 0, "outFile": "./Source.js" }, + "semanticDiagnosticsPerFile": [ + [ + "./Source.ts", + [ + { + "start": 7, + "length": 3, + "messageText": "This syntax is not allowed when 'erasableSyntaxOnly' is enabled.", + "category": 1, + "code": 1294 + } + ] + ] + ], "outSignature": "6176297704-declare namespace Hmi {\n class Button {\n static myStaticFunction(): void;\n }\n}\n", "latestChangedDtsFile": "./Source.d.ts", "version": "FakeTSVersion", - "size": 918 + "size": 1084 } //// [/user/username/projects/myproject/SiblingClass/Source.js] @@ -145,7 +159,7 @@ declare namespace Hmi { //// [/user/username/projects/myproject/SiblingClass/Source.tsbuildinfo] -{"fileNames":["../../../../../home/src/tslibs/TS/Lib/lib.d.ts","../buttonClass/Source.d.ts","./Source.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","6176297704-declare namespace Hmi {\n class Button {\n static myStaticFunction(): void;\n }\n}\n","-3370344921-module Hmi {\n export class Sibling {\n public mySiblingFunction() {\n }\n }\n}"],"root":[3],"options":{"composite":true,"module":0,"outFile":"./Source.js"},"outSignature":"-2810380820-declare namespace Hmi {\n class Sibling {\n mySiblingFunction(): void;\n }\n}\n","latestChangedDtsFile":"./Source.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../../home/src/tslibs/TS/Lib/lib.d.ts","../buttonClass/Source.d.ts","./Source.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","6176297704-declare namespace Hmi {\n class Button {\n static myStaticFunction(): void;\n }\n}\n","-3370344921-module Hmi {\n export class Sibling {\n public mySiblingFunction() {\n }\n }\n}"],"root":[3],"options":{"composite":true,"module":0,"outFile":"./Source.js"},"semanticDiagnosticsPerFile":[[3,[{"start":7,"length":3,"messageText":"This syntax is not allowed when 'erasableSyntaxOnly' is enabled.","category":1,"code":1294}]]],"outSignature":"-2810380820-declare namespace Hmi {\n class Sibling {\n mySiblingFunction(): void;\n }\n}\n","latestChangedDtsFile":"./Source.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/SiblingClass/Source.tsbuildinfo.readable.baseline.txt] { @@ -170,10 +184,24 @@ declare namespace Hmi { "module": 0, "outFile": "./Source.js" }, + "semanticDiagnosticsPerFile": [ + [ + "./Source.ts", + [ + { + "start": 7, + "length": 3, + "messageText": "This syntax is not allowed when 'erasableSyntaxOnly' is enabled.", + "category": 1, + "code": 1294 + } + ] + ] + ], "outSignature": "-2810380820-declare namespace Hmi {\n class Sibling {\n mySiblingFunction(): void;\n }\n}\n", "latestChangedDtsFile": "./Source.d.ts", "version": "FakeTSVersion", - "size": 1049 + "size": 1215 } diff --git a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt index 339091ece5b38..f83ab054efaa4 100644 --- a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt +++ b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(10,8): error TS1003: Identifier expected. file.tsx(10,10): error TS1005: ';' expected. file.tsx(10,10): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. @@ -13,8 +14,10 @@ file.tsx(11,13): error TS1005: ';' expected. file.tsx(11,19): error TS1161: Unterminated regular expression literal. -==== file.tsx (13 errors) ==== +==== file.tsx (14 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: { "data-foo"?: string }; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 97c5b5a5d5e98..ca5da9d58c4c5 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. file.tsx(24,8): error TS2322: Type '{ y: number; }' is not assignable to type 'Attribs1'. Property 'y' does not exist on type 'Attribs1'. @@ -10,8 +11,10 @@ file.tsx(29,2): error TS2741: Property 'reqd' is missing in type '{}' but requir file.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. -==== file.tsx (7 errors) ==== +==== file.tsx (8 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: Attribs1; diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt index 5a2d2cd061bed..da4753fa8b620 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt @@ -1,8 +1,11 @@ file.tsx(11,14): error TS2322: Type 'string' is not assignable to type 'boolean'. +react.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== react.d.ts (0 errors) ==== +==== react.d.ts (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxAttributeResolution11.errors.txt b/tests/baselines/reference/tsxAttributeResolution11.errors.txt index bad7b2842ebf0..ec9d74dc39080 100644 --- a/tests/baselines/reference/tsxAttributeResolution11.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution11.errors.txt @@ -1,9 +1,12 @@ file.tsx(11,22): error TS2322: Type '{ bar: string; }' is not assignable to type 'IntrinsicAttributes & { ref?: string; }'. Property 'bar' does not exist on type 'IntrinsicAttributes & { ref?: string; }'. +react.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== react.d.ts (0 errors) ==== +==== react.d.ts (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxAttributeResolution12.errors.txt b/tests/baselines/reference/tsxAttributeResolution12.errors.txt index d777757422f32..3760b20086db7 100644 --- a/tests/baselines/reference/tsxAttributeResolution12.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution12.errors.txt @@ -1,11 +1,15 @@ +file.tsx(17,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(25,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'. Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'. file.tsx(28,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'. Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'. +react.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== react.d.ts (0 errors) ==== +==== react.d.ts (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } @@ -17,7 +21,7 @@ file.tsx(28,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAtt } } -==== file.tsx (2 errors) ==== +==== file.tsx (3 errors) ==== declare class Component { constructor(props?: P, context?: any); setState(f: (prevState: S, props: P) => S, callback?: () => any): void; @@ -35,6 +39,8 @@ file.tsx(28,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAtt } declare module TestMod { + ~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface TestClass extends ComponentClass<{reqd: any}> { } var Test: TestClass; diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt index b20cb15130805..f59a5a4f1a7ac 100644 --- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt @@ -1,9 +1,12 @@ file.tsx(13,28): error TS2322: Type 'number' is not assignable to type 'string'. file.tsx(15,28): error TS2322: Type 'boolean' is not assignable to type 'string | number'. +react.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== react.d.ts (0 errors) ==== +==== react.d.ts (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { div: any; diff --git a/tests/baselines/reference/tsxAttributeResolution2.errors.txt b/tests/baselines/reference/tsxAttributeResolution2.errors.txt index a883324c5ade6..e6910e4e7d4d8 100644 --- a/tests/baselines/reference/tsxAttributeResolution2.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution2.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(17,21): error TS2339: Property 'leng' does not exist on type 'string'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: Attribs1; diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt index fe4a24f30f7bb..cd9c406e6f80b 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(19,2): error TS2322: Type '{ x: number; }' is not assignable to type 'Attribs1'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -5,8 +6,10 @@ file.tsx(23,2): error TS2741: Property 'x' is missing in type '{ y: number; }' b file.tsx(31,8): error TS2322: Type 'number' is not assignable to type 'string'. -==== file.tsx (3 errors) ==== +==== file.tsx (4 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: Attribs1; diff --git a/tests/baselines/reference/tsxAttributeResolution4.errors.txt b/tests/baselines/reference/tsxAttributeResolution4.errors.txt index 2f74bf4ab3dc7..a0fc3394c20c8 100644 --- a/tests/baselines/reference/tsxAttributeResolution4.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution4.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(15,26): error TS2339: Property 'len' does not exist on type 'string'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: Attribs1; diff --git a/tests/baselines/reference/tsxAttributeResolution5.errors.txt b/tests/baselines/reference/tsxAttributeResolution5.errors.txt index a26f11d72f866..3e2b6a566892d 100644 --- a/tests/baselines/reference/tsxAttributeResolution5.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution5.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(21,10): error TS2322: Type 'T' is not assignable to type 'Attribs1'. Type '{ x: number; }' is not assignable to type 'Attribs1'. Types of property 'x' are incompatible. @@ -7,8 +8,10 @@ file.tsx(25,10): error TS2322: Type 'T' is not assignable to type 'Attribs1'. file.tsx(29,2): error TS2741: Property 'x' is missing in type '{}' but required in type 'Attribs1'. -==== file.tsx (3 errors) ==== +==== file.tsx (4 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: Attribs1; diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index 343c4a2709836..3d416ab5e3d0c 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,10 +1,13 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'. file.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. file.tsx(12,2): error TS2741: Property 'n' is missing in type '{}' but required in type '{ n: boolean; }'. -==== file.tsx (3 errors) ==== +==== file.tsx (4 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: { n?: boolean; s?: string}; diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index 66020bf89164c..cbc4d26d47ec1 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,10 +1,13 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(9,2): error TS2322: Type '{ "data-foo": number; }' is not assignable to type '{ "data-foo"?: string; }'. Types of property '"data-foo"' are incompatible. Type 'number' is not assignable to type 'string'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { test1: { "data-foo"?: string }; diff --git a/tests/baselines/reference/tsxAttributeResolution8.errors.txt b/tests/baselines/reference/tsxAttributeResolution8.errors.txt new file mode 100644 index 0000000000000..c66a59871c710 --- /dev/null +++ b/tests/baselines/reference/tsxAttributeResolution8.errors.txt @@ -0,0 +1,16 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + test1: {x: string}; + } + } + + var x: any; + // Should be OK + \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution8.types b/tests/baselines/reference/tsxAttributeResolution8.types index 2c1d895fde545..cfd445dc27f67 100644 --- a/tests/baselines/reference/tsxAttributeResolution8.types +++ b/tests/baselines/reference/tsxAttributeResolution8.types @@ -14,6 +14,7 @@ declare module JSX { var x: any; >x : any +> : ^^^ // Should be OK @@ -22,4 +23,5 @@ var x: any; >test1 : any > : ^^^ >x : any +> : ^^^ diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt index 2339359950e14..dd486a4820dc0 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt @@ -1,8 +1,11 @@ file.tsx(9,14): error TS2322: Type 'number' is not assignable to type 'string'. +react.d.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== react.d.ts (0 errors) ==== +==== react.d.ts (1 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.errors.txt b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.errors.txt new file mode 100644 index 0000000000000..1bf6caedfca39 --- /dev/null +++ b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.errors.txt @@ -0,0 +1,25 @@ +tsxCorrectlyParseLessThanComparison1.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== tsxCorrectlyParseLessThanComparison1.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { + div: string; + } + } + declare namespace React { + class Component { + constructor(props?: P, context?: any); + props: P; + } + } + + export class ShortDetails extends React.Component<{ id: number }, {}> { + public render(): JSX.Element { + if (this.props.id < 1) { + return (
); + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.types b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.types index c2f4e13069a3a..2a460d9df0fce 100644 --- a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.types +++ b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.types @@ -20,6 +20,7 @@ declare namespace React { >props : P > : ^ >context : any +> : ^^^ props: P; >props : P @@ -62,8 +63,10 @@ export class ShortDetails extends React.Component<{ id: number }, {}> { > : ^ return (
); ->(
) : error ->
: error +>(
) : any +> : ^^^ +>
: any +> : ^^^ >div : any > : ^^^ >div : any diff --git a/tests/baselines/reference/tsxDynamicTagName2.errors.txt b/tests/baselines/reference/tsxDynamicTagName2.errors.txt index 2d65c21ad0e91..33c76d970ebb7 100644 --- a/tests/baselines/reference/tsxDynamicTagName2.errors.txt +++ b/tests/baselines/reference/tsxDynamicTagName2.errors.txt @@ -1,9 +1,12 @@ +tsxDynamicTagName2.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxDynamicTagName2.tsx(9,1): error TS2339: Property 'customTag' does not exist on type 'JSX.IntrinsicElements'. tsxDynamicTagName2.tsx(9,25): error TS2339: Property 'customTag' does not exist on type 'JSX.IntrinsicElements'. -==== tsxDynamicTagName2.tsx (2 errors) ==== +==== tsxDynamicTagName2.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { div: any diff --git a/tests/baselines/reference/tsxDynamicTagName3.errors.txt b/tests/baselines/reference/tsxDynamicTagName3.errors.txt index 0e35fd3af4543..4b2dd064fd5ba 100644 --- a/tests/baselines/reference/tsxDynamicTagName3.errors.txt +++ b/tests/baselines/reference/tsxDynamicTagName3.errors.txt @@ -1,9 +1,12 @@ +tsxDynamicTagName3.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxDynamicTagName3.tsx(9,1): error TS2339: Property 'h1' does not exist on type 'JSX.IntrinsicElements'. tsxDynamicTagName3.tsx(9,2): error TS2604: JSX element type 'CustomTag' does not have any construct or call signatures. -==== tsxDynamicTagName3.tsx (2 errors) ==== +==== tsxDynamicTagName3.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { div: any diff --git a/tests/baselines/reference/tsxDynamicTagName4.errors.txt b/tests/baselines/reference/tsxDynamicTagName4.errors.txt new file mode 100644 index 0000000000000..99df65b401912 --- /dev/null +++ b/tests/baselines/reference/tsxDynamicTagName4.errors.txt @@ -0,0 +1,16 @@ +tsxDynamicTagName4.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== tsxDynamicTagName4.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + div: any + h1: any + } + } + + var CustomTag: "h1" = "h1"; + Hello World \ No newline at end of file diff --git a/tests/baselines/reference/tsxDynamicTagName4.types b/tests/baselines/reference/tsxDynamicTagName4.types index d9252c1baae9f..cf907c1c8b6e7 100644 --- a/tests/baselines/reference/tsxDynamicTagName4.types +++ b/tests/baselines/reference/tsxDynamicTagName4.types @@ -6,9 +6,11 @@ declare module JSX { interface IntrinsicElements { div: any >div : any +> : ^^^ h1: any >h1 : any +> : ^^^ } } diff --git a/tests/baselines/reference/tsxDynamicTagName6.errors.txt b/tests/baselines/reference/tsxDynamicTagName6.errors.txt new file mode 100644 index 0000000000000..035e98bb6fcbb --- /dev/null +++ b/tests/baselines/reference/tsxDynamicTagName6.errors.txt @@ -0,0 +1,15 @@ +tsxDynamicTagName6.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== tsxDynamicTagName6.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + div: any + } + } + + const t = {tag:'h1'} + const foo = // No error \ No newline at end of file diff --git a/tests/baselines/reference/tsxDynamicTagName6.types b/tests/baselines/reference/tsxDynamicTagName6.types index 74559ac6dcffb..81e8dc22e2c9c 100644 --- a/tests/baselines/reference/tsxDynamicTagName6.types +++ b/tests/baselines/reference/tsxDynamicTagName6.types @@ -6,6 +6,7 @@ declare module JSX { interface IntrinsicElements { div: any >div : any +> : ^^^ } } diff --git a/tests/baselines/reference/tsxElementResolution.errors.txt b/tests/baselines/reference/tsxElementResolution.errors.txt new file mode 100644 index 0000000000000..a96fb5d6f018d --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution.errors.txt @@ -0,0 +1,30 @@ +tsxElementResolution.tsx(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== tsxElementResolution.tsx (1 errors) ==== + declare namespace JSX { + interface IntrinsicElements { + foundFirst: { x: string }; + 'string_named'; + 'var'; + } + } + + class foundFirst { } + class Other {} + + module Dotted { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class Name { } + } + + // Should find the intrinsic element, not the class element + var a = ; + var b = ; + // TODO: This should not be a parse error (should + // parse a property name here, not identifier) + // var c = ; + var d = ; + var e = ; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution.types b/tests/baselines/reference/tsxElementResolution.types index 798cd8774cc46..6ad1eb6ea8b6e 100644 --- a/tests/baselines/reference/tsxElementResolution.types +++ b/tests/baselines/reference/tsxElementResolution.types @@ -11,9 +11,11 @@ declare namespace JSX { 'string_named'; >'string_named' : any +> : ^^^ 'var'; >'var' : any +> : ^^^ } } @@ -36,16 +38,20 @@ module Dotted { // Should find the intrinsic element, not the class element var a = ; ->a : error -> : error +>a : any +> : ^^^ +> : any +> : ^^^ >foundFirst : typeof foundFirst > : ^^^^^^^^^^^^^^^^^ >x : string > : ^^^^^^ var b = ; ->b : error -> : error +>b : any +> : ^^^ +> : any +> : ^^^ >string_named : any > : ^^^ @@ -53,14 +59,18 @@ var b = ; // parse a property name here, not identifier) // var c = ; var d = ; ->d : error -> : error +>d : any +> : ^^^ +> : any +> : ^^^ >Other : typeof Other > : ^^^^^^^^^^^^ var e = ; ->e : error -> : error +>e : any +> : ^^^ +> : any +> : ^^^ >Dotted.Name : typeof Dotted.Name > : ^^^^^^^^^^^^^^^^^^ >Dotted : typeof Dotted diff --git a/tests/baselines/reference/tsxElementResolution1.errors.txt b/tests/baselines/reference/tsxElementResolution1.errors.txt index 14b4701adb5d8..7616cb1982c5e 100644 --- a/tests/baselines/reference/tsxElementResolution1.errors.txt +++ b/tests/baselines/reference/tsxElementResolution1.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(12,1): error TS2339: Property 'span' does not exist on type 'JSX.IntrinsicElements'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { div: any diff --git a/tests/baselines/reference/tsxElementResolution10.errors.txt b/tests/baselines/reference/tsxElementResolution10.errors.txt index cc2fb31328d47..3aa76883b1620 100644 --- a/tests/baselines/reference/tsxElementResolution10.errors.txt +++ b/tests/baselines/reference/tsxElementResolution10.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(13,2): error TS2322: Type '{ x: number; }' is not assignable to type 'string'. file.tsx(13,2): error TS2786: 'Obj1' cannot be used as a JSX component. Its instance type '{ x: number; }' is not a valid JSX element. @@ -5,8 +6,10 @@ file.tsx(13,2): error TS2786: 'Obj1' cannot be used as a JSX component. file.tsx(19,2): error TS2322: Type '{ x: number; render: number; }' is not assignable to type 'string'. -==== file.tsx (3 errors) ==== +==== file.tsx (4 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface ElementClass { render: any; diff --git a/tests/baselines/reference/tsxElementResolution11.errors.txt b/tests/baselines/reference/tsxElementResolution11.errors.txt index 6296e5b226654..a87f0cc9379a8 100644 --- a/tests/baselines/reference/tsxElementResolution11.errors.txt +++ b/tests/baselines/reference/tsxElementResolution11.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(17,7): error TS2322: Type '{ x: number; }' is not assignable to type '{ q?: number; }'. Property 'x' does not exist on type '{ q?: number; }'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface ElementAttributesProperty { } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 4ae68f689219d..8e236eca53871 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -1,11 +1,14 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. file.tsx(25,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. file.tsx(26,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property. file.tsx(33,7): error TS2322: Type 'string' is not assignable to type 'number'. -==== file.tsx (4 errors) ==== +==== file.tsx (5 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface ElementAttributesProperty { pr: any; } interface IntrinsicElements { } diff --git a/tests/baselines/reference/tsxElementResolution13.errors.txt b/tests/baselines/reference/tsxElementResolution13.errors.txt new file mode 100644 index 0000000000000..038bb76ce18c4 --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution13.errors.txt @@ -0,0 +1,17 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface ElementAttributesProperty { pr1: any; pr2: any; } + } + + interface Obj1 { + new(n: string): any; + } + var obj1: Obj1; + ; // Error + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution13.types b/tests/baselines/reference/tsxElementResolution13.types index 3f0b05cbc0524..e153ff2d87e8d 100644 --- a/tests/baselines/reference/tsxElementResolution13.types +++ b/tests/baselines/reference/tsxElementResolution13.types @@ -5,7 +5,9 @@ declare module JSX { interface Element { } interface ElementAttributesProperty { pr1: any; pr2: any; } >pr1 : any +> : ^^^ >pr2 : any +> : ^^^ } interface Obj1 { diff --git a/tests/baselines/reference/tsxElementResolution14.errors.txt b/tests/baselines/reference/tsxElementResolution14.errors.txt new file mode 100644 index 0000000000000..d55141d160209 --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution14.errors.txt @@ -0,0 +1,16 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + } + + interface Obj1 { + new(n: string): {}; + } + var obj1: Obj1; + ; // OK + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution15.errors.txt b/tests/baselines/reference/tsxElementResolution15.errors.txt index c445681d5ecec..9a25751a0017e 100644 --- a/tests/baselines/reference/tsxElementResolution15.errors.txt +++ b/tests/baselines/reference/tsxElementResolution15.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(3,12): error TS2608: The global type 'JSX.ElementAttributesProperty' may not have more than one property. file.tsx(11,2): error TS2322: Type '{ x: number; }' is not assignable to type 'string'. -==== file.tsx (2 errors) ==== +==== file.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface ElementAttributesProperty { pr1: any; pr2: any; } ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxElementResolution16.errors.txt b/tests/baselines/reference/tsxElementResolution16.errors.txt index 8faeb1d54b5cb..39332c3f45f69 100644 --- a/tests/baselines/reference/tsxElementResolution16.errors.txt +++ b/tests/baselines/reference/tsxElementResolution16.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(8,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. } interface Obj1 { diff --git a/tests/baselines/reference/tsxElementResolution17.errors.txt b/tests/baselines/reference/tsxElementResolution17.errors.txt new file mode 100644 index 0000000000000..e5e8bfb49d530 --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution17.errors.txt @@ -0,0 +1,30 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== consumer.tsx (0 errors) ==== + /// + // Should keep s1 and elide s2 + import s1 = require('elements1'); + import s2 = require('elements2'); + ; + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { } + } + + declare module 'elements1' { + class MyElement { + + } + } + + declare module 'elements2' { + class MyElement { + + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution18.errors.txt b/tests/baselines/reference/tsxElementResolution18.errors.txt index ac5441e50dae5..5853bbcd64c17 100644 --- a/tests/baselines/reference/tsxElementResolution18.errors.txt +++ b/tests/baselines/reference/tsxElementResolution18.errors.txt @@ -1,8 +1,11 @@ +file1.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file1.tsx(6,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== file1.tsx (1 errors) ==== +==== file1.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } } diff --git a/tests/baselines/reference/tsxElementResolution19.errors.txt b/tests/baselines/reference/tsxElementResolution19.errors.txt new file mode 100644 index 0000000000000..f34df326ff3ce --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution19.errors.txt @@ -0,0 +1,23 @@ +file1.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== react.d.ts (0 errors) ==== + declare module "react" { + + } + +==== file1.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + } + export class MyClass { } + +==== file2.tsx (0 errors) ==== + // Should not elide React import + import * as React from 'react'; + import {MyClass} from './file1'; + + ; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution19.types b/tests/baselines/reference/tsxElementResolution19.types index 84abd9ed7fe86..aa1492af6e47d 100644 --- a/tests/baselines/reference/tsxElementResolution19.types +++ b/tests/baselines/reference/tsxElementResolution19.types @@ -26,7 +26,8 @@ import {MyClass} from './file1'; > : ^^^^^^^^^^^^^^ ; -> : error +> : any +> : ^^^ >MyClass : typeof MyClass > : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/tsxElementResolution2.errors.txt b/tests/baselines/reference/tsxElementResolution2.errors.txt new file mode 100644 index 0000000000000..e2bf31fd4e6f8 --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution2.errors.txt @@ -0,0 +1,18 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [x: string]: any; + } + } + + // OK +
; + + // OK + ; \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution3.errors.txt b/tests/baselines/reference/tsxElementResolution3.errors.txt index 9e136eb96e1f5..a18017dc4e836 100644 --- a/tests/baselines/reference/tsxElementResolution3.errors.txt +++ b/tests/baselines/reference/tsxElementResolution3.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(12,7): error TS2322: Type '{ w: string; }' is not assignable to type '{ n: string; }'. Property 'w' does not exist on type '{ n: string; }'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [x: string]: { n: string; }; diff --git a/tests/baselines/reference/tsxElementResolution4.errors.txt b/tests/baselines/reference/tsxElementResolution4.errors.txt index a47a97b2e6852..7b20a0ac5c197 100644 --- a/tests/baselines/reference/tsxElementResolution4.errors.txt +++ b/tests/baselines/reference/tsxElementResolution4.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(16,7): error TS2322: Type '{ q: string; }' is not assignable to type '{ m: string; }'. Property 'q' does not exist on type '{ m: string; }'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { div: { n: string; }; diff --git a/tests/baselines/reference/tsxElementResolution5.errors.txt b/tests/baselines/reference/tsxElementResolution5.errors.txt new file mode 100644 index 0000000000000..c3c04f4f95c30 --- /dev/null +++ b/tests/baselines/reference/tsxElementResolution5.errors.txt @@ -0,0 +1,13 @@ +file1.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file1.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + } + + // OK, but implicit any +
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution6.errors.txt b/tests/baselines/reference/tsxElementResolution6.errors.txt index 640f49336e22b..b1d53f975a937 100644 --- a/tests/baselines/reference/tsxElementResolution6.errors.txt +++ b/tests/baselines/reference/tsxElementResolution6.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(8,1): error TS2339: Property 'div' does not exist on type 'JSX.IntrinsicElements'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } } diff --git a/tests/baselines/reference/tsxElementResolution7.errors.txt b/tests/baselines/reference/tsxElementResolution7.errors.txt index fbed105e3f69c..098a2da51e9dd 100644 --- a/tests/baselines/reference/tsxElementResolution7.errors.txt +++ b/tests/baselines/reference/tsxElementResolution7.errors.txt @@ -1,14 +1,21 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(12,5): error TS2339: Property 'other' does not exist on type 'typeof my'. +file.tsx(14,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(19,11): error TS2339: Property 'non' does not exist on type 'typeof my'. -==== file.tsx (2 errors) ==== +==== file.tsx (5 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } } module my { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var div: any; } // OK @@ -19,6 +26,8 @@ file.tsx(19,11): error TS2339: Property 'non' does not exist on type 'typeof my' !!! error TS2339: Property 'other' does not exist on type 'typeof my'. module q { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import mine = my; // OK ; diff --git a/tests/baselines/reference/tsxElementResolution8.errors.txt b/tests/baselines/reference/tsxElementResolution8.errors.txt index 2ac2fb2d0ad6e..2597c5a0c2883 100644 --- a/tests/baselines/reference/tsxElementResolution8.errors.txt +++ b/tests/baselines/reference/tsxElementResolution8.errors.txt @@ -1,9 +1,12 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(8,2): error TS2604: JSX element type 'Div' does not have any construct or call signatures. file.tsx(34,2): error TS2604: JSX element type 'Obj3' does not have any construct or call signatures. -==== file.tsx (2 errors) ==== +==== file.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } } diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index d7d34730a348b..5f7ec2eeca080 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(11,2): error TS2769: No overload matches this call. Overload 1 of 2, '(n: string): { x: number; }', gave the following error. Type '{}' is not assignable to type 'string'. @@ -21,8 +22,10 @@ file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. Property 'something' is missing in type '{ x: number; } & { x: number; y: string; }' but required in type 'Element'. -==== file.tsx (5 errors) ==== +==== file.tsx (6 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { something; } interface IntrinsicElements { } } diff --git a/tests/baselines/reference/tsxEmit1.errors.txt b/tests/baselines/reference/tsxEmit1.errors.txt new file mode 100644 index 0000000000000..b85e12a53ccca --- /dev/null +++ b/tests/baselines/reference/tsxEmit1.errors.txt @@ -0,0 +1,46 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + + var p; + var selfClosed1 =
; + var selfClosed2 =
; + var selfClosed3 =
; + var selfClosed4 =
; + var selfClosed5 =
; + var selfClosed6 =
; + var selfClosed7 =
; + + var openClosed1 =
; + var openClosed2 =
foo
; + var openClosed3 =
{p}
; + var openClosed4 =
{p < p}
; + var openClosed5 =
{p > p}
; + + class SomeClass { + f() { + var rewrites1 =
{() => this}
; + var rewrites2 =
{[p, ...p, p]}
; + var rewrites3 =
{{p}}
; + + var rewrites4 =
this}>
; + var rewrites5 =
; + var rewrites6 =
; + } + } + + var whitespace1 =
; + var whitespace2 =
{p}
; + var whitespace3 =
+ {p} +
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit1.types b/tests/baselines/reference/tsxEmit1.types index 3d54a51b0ce31..3eb4f3b55ee2e 100644 --- a/tests/baselines/reference/tsxEmit1.types +++ b/tests/baselines/reference/tsxEmit1.types @@ -12,6 +12,7 @@ declare module JSX { var p; >p : any +> : ^^^ var selfClosed1 =
; >selfClosed1 : JSX.Element @@ -89,7 +90,9 @@ var selfClosed7 =
; >div : any > : ^^^ >x : any +> : ^^^ >p : any +> : ^^^ >y : string > : ^^^^^^ @@ -125,6 +128,7 @@ var openClosed3 =
{p}
; >n : string > : ^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -140,7 +144,9 @@ var openClosed4 =
{p < p}
; >p < p : boolean > : ^^^^^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -156,7 +162,9 @@ var openClosed5 =
{p > p}
; >p > p : boolean > : ^^^^^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -192,9 +200,13 @@ class SomeClass { >[p, ...p, p] : any[] > : ^^^^^ >p : any +> : ^^^ >...p : any +> : ^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -208,6 +220,7 @@ class SomeClass { >{p} : { p: any; } > : ^^^^^^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -239,9 +252,13 @@ class SomeClass { >[p, ...p, p] : any[] > : ^^^^^ >p : any +> : ^^^ >...p : any +> : ^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -257,6 +274,7 @@ class SomeClass { >{p} : { p: any; } > : ^^^^^^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ } @@ -280,6 +298,7 @@ var whitespace2 =
{p}
; >div : any > : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -293,6 +312,7 @@ var whitespace3 =
{p} >p : any +> : ^^^
; >div : any diff --git a/tests/baselines/reference/tsxEmit2.errors.txt b/tests/baselines/reference/tsxEmit2.errors.txt new file mode 100644 index 0000000000000..092a773d6d0c4 --- /dev/null +++ b/tests/baselines/reference/tsxEmit2.errors.txt @@ -0,0 +1,20 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + + var p1: any, p2: any, p3: any; + var spreads1 =
{p2}
; + var spreads2 =
{p2}
; + var spreads3 =
{p2}
; + var spreads4 =
{p2}
; + var spreads5 =
{p2}
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit2.types b/tests/baselines/reference/tsxEmit2.types index 68c88e26d1a74..c3b468198a895 100644 --- a/tests/baselines/reference/tsxEmit2.types +++ b/tests/baselines/reference/tsxEmit2.types @@ -12,8 +12,11 @@ declare module JSX { var p1: any, p2: any, p3: any; >p1 : any +> : ^^^ >p2 : any +> : ^^^ >p3 : any +> : ^^^ var spreads1 =
{p2}
; >spreads1 : JSX.Element @@ -23,7 +26,9 @@ var spreads1 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -35,7 +40,9 @@ var spreads2 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -47,9 +54,13 @@ var spreads3 =
{p2}
; >div : any > : ^^^ >x : any +> : ^^^ >p3 : any +> : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -61,9 +72,13 @@ var spreads4 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >x : any +> : ^^^ >p3 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -75,11 +90,17 @@ var spreads5 =
{p2}
; >div : any > : ^^^ >x : any +> : ^^^ >p2 : any +> : ^^^ >p1 : any +> : ^^^ >y : any +> : ^^^ >p3 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ diff --git a/tests/baselines/reference/tsxEmit3.errors.txt b/tests/baselines/reference/tsxEmit3.errors.txt index 6cd649f866a58..96d1218bb69d6 100644 --- a/tests/baselines/reference/tsxEmit3.errors.txt +++ b/tests/baselines/reference/tsxEmit3.errors.txt @@ -1,18 +1,31 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(6,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(8,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(16,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(18,2): error TS2695: Left side of comma operator is unused and has no side effects. +file.tsx(20,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(22,3): error TS2695: Left side of comma operator is unused and has no side effects. file.tsx(25,3): error TS2695: Left side of comma operator is unused and has no side effects. +file.tsx(30,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(35,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(38,2): error TS2695: Left side of comma operator is unused and has no side effects. -==== file.tsx (4 errors) ==== +==== file.tsx (11 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Foo { constructor() { } } export module S { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Bar { } // Emit Foo @@ -21,12 +34,16 @@ file.tsx(38,2): error TS2695: Left side of comma operator is unused and has no s } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Emit M.Foo Foo, ; ~~~ !!! error TS2695: Left side of comma operator is unused and has no side effects. export module S { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Emit M.Foo Foo, ; ~~~ @@ -41,11 +58,15 @@ file.tsx(38,2): error TS2695: Left side of comma operator is unused and has no s } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Emit M.S.Bar S.Bar, ; } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var M = 100; // Emit M_1.Foo Foo, ; diff --git a/tests/baselines/reference/tsxFragmentErrors.errors.txt b/tests/baselines/reference/tsxFragmentErrors.errors.txt index 1f64c9fba44f4..abf1ace5aad0a 100644 --- a/tests/baselines/reference/tsxFragmentErrors.errors.txt +++ b/tests/baselines/reference/tsxFragmentErrors.errors.txt @@ -1,11 +1,14 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(9,7): error TS2304: Cannot find name 'div'. file.tsx(9,7): error TS17015: Expected corresponding closing tag for JSX fragment. file.tsx(9,11): error TS17014: JSX fragment has no corresponding closing tag. file.tsx(11,17): error TS1005: '; // no whitespace + < >; // lots of whitespace + < /*starting wrap*/ >; // comments in the tags + <>hi; // text inside + <>hi
bye
; // children + <>1<>2.12.23; // nested fragments + <>#; // # would cause scanning error if not in jsxtext \ No newline at end of file diff --git a/tests/baselines/reference/tsxFragmentPreserveEmit.types b/tests/baselines/reference/tsxFragmentPreserveEmit.types index 6623a6581c5fe..c408a78e30af5 100644 --- a/tests/baselines/reference/tsxFragmentPreserveEmit.types +++ b/tests/baselines/reference/tsxFragmentPreserveEmit.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ <>; // no whitespace ><> : JSX.Element diff --git a/tests/baselines/reference/tsxFragmentReactEmit.errors.txt b/tests/baselines/reference/tsxFragmentReactEmit.errors.txt new file mode 100644 index 0000000000000..b9d67d0ca7812 --- /dev/null +++ b/tests/baselines/reference/tsxFragmentReactEmit.errors.txt @@ -0,0 +1,21 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + <>; // no whitespace + < >; // lots of whitespace + < /*starting wrap*/ >; // comments in the tags + <>hi; // text inside + <>hi
bye
; // children + <>1<>2.12.23; // nested fragments + <>#; // # would cause scanning error if not in jsxtext \ No newline at end of file diff --git a/tests/baselines/reference/tsxFragmentReactEmit.types b/tests/baselines/reference/tsxFragmentReactEmit.types index 925d67e86f1f5..79d114572f0fe 100644 --- a/tests/baselines/reference/tsxFragmentReactEmit.types +++ b/tests/baselines/reference/tsxFragmentReactEmit.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ <>; // no whitespace ><> : JSX.Element diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.errors.txt b/tests/baselines/reference/tsxGenericArrowFunctionParsing.errors.txt index 1886cbe92af77..7f60dfba31f49 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.errors.txt +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.errors.txt @@ -1,10 +1,13 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(8,17): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`? file.tsx(20,32): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`? file.tsx(24,25): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`? -==== file.tsx (3 errors) ==== +==== file.tsx (4 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { isElement; } } diff --git a/tests/baselines/reference/tsxOpeningClosingNames.errors.txt b/tests/baselines/reference/tsxOpeningClosingNames.errors.txt new file mode 100644 index 0000000000000..86f56f1c708d4 --- /dev/null +++ b/tests/baselines/reference/tsxOpeningClosingNames.errors.txt @@ -0,0 +1,25 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(5,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(5,18): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +file.tsx(5,20): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (4 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + } + + declare module A.B.C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var D: any; + } + + foo + \ No newline at end of file diff --git a/tests/baselines/reference/tsxOpeningClosingNames.types b/tests/baselines/reference/tsxOpeningClosingNames.types index 73ef8a42136f7..82688cc6cc47a 100644 --- a/tests/baselines/reference/tsxOpeningClosingNames.types +++ b/tests/baselines/reference/tsxOpeningClosingNames.types @@ -15,12 +15,14 @@ declare module A.B.C { var D: any; >D : any +> : ^^^ } foo
>foo : JSX.Element > : ^^^^^^^^^^^ >A.B.C.D : any +> : ^^^ >A.B.C : typeof A.B.C > : ^^^^^^^^^^^^ >A.B : typeof A.B @@ -34,6 +36,7 @@ declare module A.B.C { >D : any > : ^^^ >A . B . C.D : any +> : ^^^ >A . B . C : typeof A.B.C > : ^^^^^^^^^^^^ >A . B : typeof A.B diff --git a/tests/baselines/reference/tsxParseTests1.errors.txt b/tests/baselines/reference/tsxParseTests1.errors.txt new file mode 100644 index 0000000000000..44be2985bccc9 --- /dev/null +++ b/tests/baselines/reference/tsxParseTests1.errors.txt @@ -0,0 +1,13 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { div; span; } + } + + var x =
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxParseTests1.types b/tests/baselines/reference/tsxParseTests1.types index 68c0cb92d1c2a..2378f85713c6e 100644 --- a/tests/baselines/reference/tsxParseTests1.types +++ b/tests/baselines/reference/tsxParseTests1.types @@ -5,7 +5,9 @@ declare module JSX { interface Element { } interface IntrinsicElements { div; span; } >div : any +> : ^^^ >span : any +> : ^^^ } var x =
; diff --git a/tests/baselines/reference/tsxParseTests2.errors.txt b/tests/baselines/reference/tsxParseTests2.errors.txt new file mode 100644 index 0000000000000..71b36561b58aa --- /dev/null +++ b/tests/baselines/reference/tsxParseTests2.errors.txt @@ -0,0 +1,13 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { div; span; } + } + + var x =
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxParseTests2.types b/tests/baselines/reference/tsxParseTests2.types index b76f472260804..f8cf845fc8876 100644 --- a/tests/baselines/reference/tsxParseTests2.types +++ b/tests/baselines/reference/tsxParseTests2.types @@ -5,7 +5,9 @@ declare module JSX { interface Element { } interface IntrinsicElements { div; span; } >div : any +> : ^^^ >span : any +> : ^^^ } var x =
; diff --git a/tests/baselines/reference/tsxPreserveEmit1.errors.txt b/tests/baselines/reference/tsxPreserveEmit1.errors.txt new file mode 100644 index 0000000000000..f17b899aadfbf --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit1.errors.txt @@ -0,0 +1,42 @@ +react.d.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.tsx(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +test.tsx(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== test.tsx (2 errors) ==== + // Should emit 'react-router' in the AMD dependency list + import React = require('react'); + import ReactRouter = require('react-router'); + + import Route = ReactRouter.Route; + + var routes1 = ; + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var X: any; + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // Should emit 'M.X' in both opening and closing tags + var y = ; + } + +==== react.d.ts (1 errors) ==== + declare module 'react' { + var x: any; + export = x; + } + + declare module ReactRouter { + ~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var Route: any; + interface Thing { } + } + declare module 'react-router' { + export = ReactRouter; + } + \ No newline at end of file diff --git a/tests/baselines/reference/tsxPreserveEmit1.types b/tests/baselines/reference/tsxPreserveEmit1.types index 3b1d03d9fb37e..ed5230cf866b3 100644 --- a/tests/baselines/reference/tsxPreserveEmit1.types +++ b/tests/baselines/reference/tsxPreserveEmit1.types @@ -19,9 +19,12 @@ import Route = ReactRouter.Route; > : ^^^ var routes1 = ; ->routes1 : error -> : error +>routes1 : any +> : ^^^ +> : any +> : ^^^ >Route : any +> : ^^^ module M { >M : typeof M @@ -29,6 +32,7 @@ module M { export var X: any; >X : any +> : ^^^ } module M { >M : typeof M @@ -36,10 +40,14 @@ module M { // Should emit 'M.X' in both opening and closing tags var y = ; ->y : error -> : error +>y : any +> : ^^^ +> : any +> : ^^^ >X : any +> : ^^^ >X : any +> : ^^^ } === react.d.ts === @@ -49,6 +57,7 @@ declare module 'react' { var x: any; >x : any +> : ^^^ export = x; >x : any @@ -61,6 +70,7 @@ declare module ReactRouter { var Route: any; >Route : any +> : ^^^ interface Thing { } } diff --git a/tests/baselines/reference/tsxPreserveEmit3.errors.txt b/tests/baselines/reference/tsxPreserveEmit3.errors.txt new file mode 100644 index 0000000000000..afef5605001c3 --- /dev/null +++ b/tests/baselines/reference/tsxPreserveEmit3.errors.txt @@ -0,0 +1,20 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + +==== test.d.ts (0 errors) ==== + export var React; + +==== react-consumer.tsx (0 errors) ==== + // This import should be elided + import {React} from "./test"; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxPreserveEmit3.types b/tests/baselines/reference/tsxPreserveEmit3.types index 2419af27a3ec4..f708932c21602 100644 --- a/tests/baselines/reference/tsxPreserveEmit3.types +++ b/tests/baselines/reference/tsxPreserveEmit3.types @@ -13,6 +13,7 @@ declare module JSX { === test.d.ts === export var React; >React : any +> : ^^^ === react-consumer.tsx === // This import should be elided diff --git a/tests/baselines/reference/tsxReactEmit1.errors.txt b/tests/baselines/reference/tsxReactEmit1.errors.txt new file mode 100644 index 0000000000000..dd9a9fa1d7476 --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit1.errors.txt @@ -0,0 +1,47 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + var p; + var selfClosed1 =
; + var selfClosed2 =
; + var selfClosed3 =
; + var selfClosed4 =
; + var selfClosed5 =
; + var selfClosed6 =
; + var selfClosed7 =
; + + var openClosed1 =
; + var openClosed2 =
foo
; + var openClosed3 =
{p}
; + var openClosed4 =
{p < p}
; + var openClosed5 =
{p > p}
; + + class SomeClass { + f() { + var rewrites1 =
{() => this}
; + var rewrites2 =
{[p, ...p, p]}
; + var rewrites3 =
{{p}}
; + + var rewrites4 =
this}>
; + var rewrites5 =
; + var rewrites6 =
; + } + } + + var whitespace1 =
; + var whitespace2 =
{p}
; + var whitespace3 =
+ {p} +
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit1.types b/tests/baselines/reference/tsxReactEmit1.types index dce76f2538cdd..2f567886e1f75 100644 --- a/tests/baselines/reference/tsxReactEmit1.types +++ b/tests/baselines/reference/tsxReactEmit1.types @@ -11,9 +11,11 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ var p; >p : any +> : ^^^ var selfClosed1 =
; >selfClosed1 : JSX.Element @@ -91,7 +93,9 @@ var selfClosed7 =
; >div : any > : ^^^ >x : any +> : ^^^ >p : any +> : ^^^ >y : string > : ^^^^^^ >b : true @@ -129,6 +133,7 @@ var openClosed3 =
{p}
; >n : string > : ^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -144,7 +149,9 @@ var openClosed4 =
{p < p}
; >p < p : boolean > : ^^^^^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -162,7 +169,9 @@ var openClosed5 =
{p > p}
; >p > p : boolean > : ^^^^^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -198,9 +207,13 @@ class SomeClass { >[p, ...p, p] : any[] > : ^^^^^ >p : any +> : ^^^ >...p : any +> : ^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -214,6 +227,7 @@ class SomeClass { >{p} : { p: any; } > : ^^^^^^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -245,9 +259,13 @@ class SomeClass { >[p, ...p, p] : any[] > : ^^^^^ >p : any +> : ^^^ >...p : any +> : ^^^ >p : any +> : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -263,6 +281,7 @@ class SomeClass { >{p} : { p: any; } > : ^^^^^^^^^^^ >p : any +> : ^^^ >div : any > : ^^^ } @@ -286,6 +305,7 @@ var whitespace2 =
{p}
; >div : any > : ^^^ >p : any +> : ^^^ >div : any > : ^^^ @@ -299,6 +319,7 @@ var whitespace3 =
{p} >p : any +> : ^^^
; >div : any diff --git a/tests/baselines/reference/tsxReactEmit2.errors.txt b/tests/baselines/reference/tsxReactEmit2.errors.txt new file mode 100644 index 0000000000000..99e82de2cfe23 --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit2.errors.txt @@ -0,0 +1,21 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + var p1: any, p2: any, p3: any; + var spreads1 =
{p2}
; + var spreads2 =
{p2}
; + var spreads3 =
{p2}
; + var spreads4 =
{p2}
; + var spreads5 =
{p2}
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit2.types b/tests/baselines/reference/tsxReactEmit2.types index 7dff2c8ef6019..c8842b94c9722 100644 --- a/tests/baselines/reference/tsxReactEmit2.types +++ b/tests/baselines/reference/tsxReactEmit2.types @@ -11,11 +11,15 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ var p1: any, p2: any, p3: any; >p1 : any +> : ^^^ >p2 : any +> : ^^^ >p3 : any +> : ^^^ var spreads1 =
{p2}
; >spreads1 : JSX.Element @@ -25,7 +29,9 @@ var spreads1 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -37,7 +43,9 @@ var spreads2 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -49,9 +57,13 @@ var spreads3 =
{p2}
; >div : any > : ^^^ >x : any +> : ^^^ >p3 : any +> : ^^^ >p1 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -63,9 +75,13 @@ var spreads4 =
{p2}
; >div : any > : ^^^ >p1 : any +> : ^^^ >x : any +> : ^^^ >p3 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ @@ -77,11 +93,17 @@ var spreads5 =
{p2}
; >div : any > : ^^^ >x : any +> : ^^^ >p2 : any +> : ^^^ >p1 : any +> : ^^^ >y : any +> : ^^^ >p3 : any +> : ^^^ >p2 : any +> : ^^^ >div : any > : ^^^ diff --git a/tests/baselines/reference/tsxReactEmit3.errors.txt b/tests/baselines/reference/tsxReactEmit3.errors.txt new file mode 100644 index 0000000000000..0646ce3f05bbd --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit3.errors.txt @@ -0,0 +1,12 @@ +test.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== test.tsx (1 errors) ==== + declare module JSX { interface Element { } } + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + declare var React: any; + + declare var Foo, Bar, baz; + + q s ; \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit3.types b/tests/baselines/reference/tsxReactEmit3.types index ef3786fbf2f23..dbdf153f45ae6 100644 --- a/tests/baselines/reference/tsxReactEmit3.types +++ b/tests/baselines/reference/tsxReactEmit3.types @@ -4,28 +4,39 @@ declare module JSX { interface Element { } } declare var React: any; >React : any +> : ^^^ declare var Foo, Bar, baz; >Foo : any +> : ^^^ >Bar : any +> : ^^^ >baz : any +> : ^^^ q s ; > q s : JSX.Element > : ^^^^^^^^^^^ >Foo : any +> : ^^^ > q : JSX.Element > : ^^^^^^^^^^^ >Bar : any +> : ^^^ >Bar : any +> : ^^^ > : JSX.Element > : ^^^^^^^^^^^ >Bar : any +> : ^^^ > : JSX.Element > : ^^^^^^^^^^^ >Bar : any +> : ^^^ > : JSX.Element > : ^^^^^^^^^^^ >Bar : any +> : ^^^ >Foo : any +> : ^^^ diff --git a/tests/baselines/reference/tsxReactEmit4.errors.txt b/tests/baselines/reference/tsxReactEmit4.errors.txt index cd634c4a2393a..05dc9b93ba2ce 100644 --- a/tests/baselines/reference/tsxReactEmit4.errors.txt +++ b/tests/baselines/reference/tsxReactEmit4.errors.txt @@ -1,8 +1,11 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(12,5): error TS2304: Cannot find name 'blah'. -==== file.tsx (1 errors) ==== +==== file.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/tsxReactEmit5.errors.txt b/tests/baselines/reference/tsxReactEmit5.errors.txt new file mode 100644 index 0000000000000..8f7cb4edf4fbd --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit5.errors.txt @@ -0,0 +1,23 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + +==== test.d.ts (0 errors) ==== + export var React; + +==== react-consumer.tsx (0 errors) ==== + import {React} from "./test"; + // Should emit test_1.React.createElement + // and React.__spread + var foo: any; + var spread1 =
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit5.types b/tests/baselines/reference/tsxReactEmit5.types index 9d0e211292e66..8b93de05856bf 100644 --- a/tests/baselines/reference/tsxReactEmit5.types +++ b/tests/baselines/reference/tsxReactEmit5.types @@ -13,6 +13,7 @@ declare module JSX { === test.d.ts === export var React; >React : any +> : ^^^ === react-consumer.tsx === import {React} from "./test"; @@ -23,6 +24,7 @@ import {React} from "./test"; // and React.__spread var foo: any; >foo : any +> : ^^^ var spread1 =
; >spread1 : JSX.Element @@ -34,6 +36,7 @@ var spread1 =
; >x : string > : ^^^^^^ >foo : any +> : ^^^ >y : string > : ^^^^^^ diff --git a/tests/baselines/reference/tsxReactEmit6.errors.txt b/tests/baselines/reference/tsxReactEmit6.errors.txt new file mode 100644 index 0000000000000..93fa4872ffcaf --- /dev/null +++ b/tests/baselines/reference/tsxReactEmit6.errors.txt @@ -0,0 +1,29 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + +==== react-consumer.tsx (0 errors) ==== + namespace M { + export var React: any; + } + + namespace M { + // Should emit M.React.createElement + // and M.React.__spread + var foo: any; + var spread1 =
; + + // Quotes + var x =
This "quote" thing
; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmit6.types b/tests/baselines/reference/tsxReactEmit6.types index 71943031d6149..7850e45e966c7 100644 --- a/tests/baselines/reference/tsxReactEmit6.types +++ b/tests/baselines/reference/tsxReactEmit6.types @@ -17,6 +17,7 @@ namespace M { export var React: any; >React : any +> : ^^^ } namespace M { @@ -27,6 +28,7 @@ namespace M { // and M.React.__spread var foo: any; >foo : any +> : ^^^ var spread1 =
; >spread1 : JSX.Element @@ -38,6 +40,7 @@ namespace M { >x : string > : ^^^^^^ >foo : any +> : ^^^ >y : string > : ^^^^^^ diff --git a/tests/baselines/reference/tsxReactEmit7.errors.txt b/tests/baselines/reference/tsxReactEmit7.errors.txt index c640c0107ff89..9d8964ed97b6e 100644 --- a/tests/baselines/reference/tsxReactEmit7.errors.txt +++ b/tests/baselines/reference/tsxReactEmit7.errors.txt @@ -1,3 +1,4 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. file.tsx(8,10): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. file.tsx(9,10): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. file.tsx(10,10): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. @@ -9,8 +10,10 @@ file.tsx(17,10): error TS2874: This JSX tag requires 'React' to be in scope, but file.tsx(18,10): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. -==== file.tsx (9 errors) ==== +==== file.tsx (10 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/tsxReactEmitEntities.errors.txt b/tests/baselines/reference/tsxReactEmitEntities.errors.txt new file mode 100644 index 0000000000000..80f8fe721bf46 --- /dev/null +++ b/tests/baselines/reference/tsxReactEmitEntities.errors.txt @@ -0,0 +1,28 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + +
Dot goes here: · ¬AnEntity;
; +
Be careful of "-ed strings!
; +
{{braces}}
; + // Escapes do nothing +
\n
; + + // Also works in string literal attributes +
; + // Does not happen for a string literal that happens to be inside an attribute (and escapes then work) +
; + // Preserves single quotes +
; + // https://github.com/microsoft/TypeScript/issues/35732 +
🐈🐕🐇🐑
; \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types index 096a0e0976ba0..c62888da0840b 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.types +++ b/tests/baselines/reference/tsxReactEmitEntities.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^
Dot goes here: · ¬AnEntity;
; >
Dot goes here: · ¬AnEntity;
: JSX.Element diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.errors.txt b/tests/baselines/reference/tsxReactEmitWhitespace.errors.txt new file mode 100644 index 0000000000000..bbe6c738801d3 --- /dev/null +++ b/tests/baselines/reference/tsxReactEmitWhitespace.errors.txt @@ -0,0 +1,70 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + // THIS FILE HAS TEST-SIGNIFICANT LEADING/TRAILING + // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT + + var p = 0; + // Emit " " +
; + // Emit " ", p, " " +
{p}
; + // Emit only p +
+ {p} +
; + + // Emit only p +
+ {p} +
; + + // Emit " 3" +
3 +
; + + // Emit " 3 " +
3
; + + // Emit "3" +
+ 3 +
; + + // Emit no args +
+
; + + // Emit "foo bar" +
+ + foo + + bar + +
; + + // Emit "hello\\ world" +
+ + hello\ + + world +
; + + // Emit " a b c d " +
a + b c + d
; + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.types b/tests/baselines/reference/tsxReactEmitWhitespace.types index a14632989603f..7bb8fea6ed14d 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ // THIS FILE HAS TEST-SIGNIFICANT LEADING/TRAILING // WHITESPACE, DO NOT RUN 'FORMAT DOCUMENT' ON IT diff --git a/tests/baselines/reference/tsxReactEmitWhitespace2.errors.txt b/tests/baselines/reference/tsxReactEmitWhitespace2.errors.txt new file mode 100644 index 0000000000000..19cdaa0ac5ce4 --- /dev/null +++ b/tests/baselines/reference/tsxReactEmitWhitespace2.errors.txt @@ -0,0 +1,22 @@ +file.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== file.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + // Emit ' word' in the last string +
word code word
; + // Same here +
code word
; + // And here +
word
; + + \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmitWhitespace2.types b/tests/baselines/reference/tsxReactEmitWhitespace2.types index 9462fc05066ad..100cedd7dcdec 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace2.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace2.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ // Emit ' word' in the last string
word code word
; diff --git a/tests/baselines/reference/tsxSpreadChildren.errors.txt b/tests/baselines/reference/tsxSpreadChildren.errors.txt new file mode 100644 index 0000000000000..2188b2a9e2c43 --- /dev/null +++ b/tests/baselines/reference/tsxSpreadChildren.errors.txt @@ -0,0 +1,32 @@ +tsxSpreadChildren.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== tsxSpreadChildren.tsx (1 errors) ==== + declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Element { } + interface IntrinsicElements { + [s: string]: any; + } + } + declare var React: any; + + interface TodoProp { + id: number; + todo: string; + } + interface TodoListProps { + todos: TodoProp[]; + } + function Todo(prop: { key: number, todo: string }) { + return
{prop.key.toString() + prop.todo}
; + } + function TodoList({ todos }: TodoListProps) { + return
+ {...todos.map(todo => )} +
; + } + let x: TodoListProps; + + \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadChildren.types b/tests/baselines/reference/tsxSpreadChildren.types index c60b95ace1470..423d13a5ba9cc 100644 --- a/tests/baselines/reference/tsxSpreadChildren.types +++ b/tests/baselines/reference/tsxSpreadChildren.types @@ -11,6 +11,7 @@ declare module JSX { } declare var React: any; >React : any +> : ^^^ interface TodoProp { id: number; diff --git a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).errors.txt b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).errors.txt index 2451cbd0d775c..225deb2d8fe5b 100644 --- a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).errors.txt +++ b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es2015).errors.txt @@ -1,8 +1,11 @@ +tsxSpreadChildrenInvalidType.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es5).errors.txt b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es5).errors.txt index 2451cbd0d775c..225deb2d8fe5b 100644 --- a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es5).errors.txt +++ b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react,target=es5).errors.txt @@ -1,8 +1,11 @@ +tsxSpreadChildrenInvalidType.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (1 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt index 508f839052887..78bc8423ed4eb 100644 --- a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt +++ b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es2015).errors.txt @@ -1,9 +1,12 @@ +tsxSpreadChildrenInvalidType.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxSpreadChildrenInvalidType.tsx(17,12): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt index 5d9568a1b87f0..9524fac2ed519 100644 --- a/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt +++ b/tests/baselines/reference/tsxSpreadChildrenInvalidType(jsx=react-jsx,target=es5).errors.txt @@ -1,9 +1,12 @@ +tsxSpreadChildrenInvalidType.tsx(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. tsxSpreadChildrenInvalidType.tsx(17,12): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. tsxSpreadChildrenInvalidType.tsx(21,9): error TS2609: JSX spread child must be an array type. -==== tsxSpreadChildrenInvalidType.tsx (2 errors) ==== +==== tsxSpreadChildrenInvalidType.tsx (3 errors) ==== declare module JSX { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Element { } interface IntrinsicElements { [s: string]: any; diff --git a/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName.errors.txt b/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName.errors.txt index c6ff07cf337ce..ffdbbf951ad72 100644 --- a/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName.errors.txt +++ b/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName.errors.txt @@ -2,15 +2,20 @@ twoGenericInterfacesDifferingByTypeParameterName.ts(3,11): error TS2428: All dec twoGenericInterfacesDifferingByTypeParameterName.ts(7,11): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName.ts(11,11): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName.ts(15,11): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesDifferingByTypeParameterName.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName.ts(20,15): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName.ts(24,15): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName.ts(28,15): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName.ts(32,15): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesDifferingByTypeParameterName.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesDifferingByTypeParameterName.ts(43,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesDifferingByTypeParameterName.ts(49,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName.ts(50,22): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesDifferingByTypeParameterName.ts(55,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName.ts(56,22): error TS2428: All declarations of 'B' must have identical type parameters. -==== twoGenericInterfacesDifferingByTypeParameterName.ts (10 errors) ==== +==== twoGenericInterfacesDifferingByTypeParameterName.ts (15 errors) ==== // type parameter names are relevant when choosing whether to merge interface declarations interface A { @@ -38,6 +43,8 @@ twoGenericInterfacesDifferingByTypeParameterName.ts(56,22): error TS2428: All de } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -64,18 +71,24 @@ twoGenericInterfacesDifferingByTypeParameterName.ts(56,22): error TS2428: All de } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B { x: U; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B { // ok, different declaration space than other M2 y: V; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface B { ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. @@ -84,6 +97,8 @@ twoGenericInterfacesDifferingByTypeParameterName.ts(56,22): error TS2428: All de } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface B { // error ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. diff --git a/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName2.errors.txt b/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName2.errors.txt index c5ad989c5540f..974459e36d902 100644 --- a/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName2.errors.txt +++ b/tests/baselines/reference/twoGenericInterfacesDifferingByTypeParameterName2.errors.txt @@ -1,13 +1,18 @@ twoGenericInterfacesDifferingByTypeParameterName2.ts(3,11): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName2.ts(7,11): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName2.ts(8,8): error TS2304: Cannot find name 'V'. +twoGenericInterfacesDifferingByTypeParameterName2.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName2.ts(12,15): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesDifferingByTypeParameterName2.ts(16,15): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesDifferingByTypeParameterName2.ts(21,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesDifferingByTypeParameterName2.ts(27,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesDifferingByTypeParameterName2.ts(33,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName2.ts(34,22): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesDifferingByTypeParameterName2.ts(39,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesDifferingByTypeParameterName2.ts(40,22): error TS2428: All declarations of 'B' must have identical type parameters. -==== twoGenericInterfacesDifferingByTypeParameterName2.ts (7 errors) ==== +==== twoGenericInterfacesDifferingByTypeParameterName2.ts (12 errors) ==== // type parameter names are relevant when choosing whether to merge interface declarations interface B { @@ -25,6 +30,8 @@ twoGenericInterfacesDifferingByTypeParameterName2.ts(40,22): error TS2428: All d } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B { ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. @@ -39,18 +46,24 @@ twoGenericInterfacesDifferingByTypeParameterName2.ts(40,22): error TS2428: All d } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B { x: U; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B { // ok, different declaration space than other M2 y: T; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface B { ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. @@ -59,6 +72,8 @@ twoGenericInterfacesDifferingByTypeParameterName2.ts(40,22): error TS2428: All d } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface B { // error ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. diff --git a/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.errors.txt b/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.errors.txt index a64ab9200f0e5..0a0fa68a8df0d 100644 --- a/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.errors.txt +++ b/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.errors.txt @@ -1,12 +1,17 @@ twoGenericInterfacesWithDifferentConstraints.ts(1,11): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesWithDifferentConstraints.ts(5,11): error TS2428: All declarations of 'A' must have identical type parameters. +twoGenericInterfacesWithDifferentConstraints.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithDifferentConstraints.ts(10,15): error TS2428: All declarations of 'B' must have identical type parameters. twoGenericInterfacesWithDifferentConstraints.ts(14,15): error TS2428: All declarations of 'B' must have identical type parameters. +twoGenericInterfacesWithDifferentConstraints.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesWithDifferentConstraints.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesWithDifferentConstraints.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithDifferentConstraints.ts(32,22): error TS2428: All declarations of 'A' must have identical type parameters. +twoGenericInterfacesWithDifferentConstraints.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithDifferentConstraints.ts(38,22): error TS2428: All declarations of 'A' must have identical type parameters. -==== twoGenericInterfacesWithDifferentConstraints.ts (6 errors) ==== +==== twoGenericInterfacesWithDifferentConstraints.ts (11 errors) ==== interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -20,6 +25,8 @@ twoGenericInterfacesWithDifferentConstraints.ts(38,22): error TS2428: All declar } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface B> { ~ !!! error TS2428: All declarations of 'B' must have identical type parameters. @@ -34,18 +41,24 @@ twoGenericInterfacesWithDifferentConstraints.ts(38,22): error TS2428: All declar } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { x: T; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { // ok, different declaration space from other M2.A y: T; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -54,6 +67,8 @@ twoGenericInterfacesWithDifferentConstraints.ts(38,22): error TS2428: All declar } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { // error ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. diff --git a/tests/baselines/reference/twoGenericInterfacesWithTheSameNameButDifferentArity.errors.txt b/tests/baselines/reference/twoGenericInterfacesWithTheSameNameButDifferentArity.errors.txt index 55daa94d0079d..3b29ade6912ed 100644 --- a/tests/baselines/reference/twoGenericInterfacesWithTheSameNameButDifferentArity.errors.txt +++ b/tests/baselines/reference/twoGenericInterfacesWithTheSameNameButDifferentArity.errors.txt @@ -1,12 +1,17 @@ twoGenericInterfacesWithTheSameNameButDifferentArity.ts(1,11): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesWithTheSameNameButDifferentArity.ts(5,11): error TS2428: All declarations of 'A' must have identical type parameters. +twoGenericInterfacesWithTheSameNameButDifferentArity.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithTheSameNameButDifferentArity.ts(10,15): error TS2428: All declarations of 'A' must have identical type parameters. twoGenericInterfacesWithTheSameNameButDifferentArity.ts(14,15): error TS2428: All declarations of 'A' must have identical type parameters. +twoGenericInterfacesWithTheSameNameButDifferentArity.ts(19,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesWithTheSameNameButDifferentArity.ts(25,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoGenericInterfacesWithTheSameNameButDifferentArity.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithTheSameNameButDifferentArity.ts(32,22): error TS2428: All declarations of 'A' must have identical type parameters. +twoGenericInterfacesWithTheSameNameButDifferentArity.ts(37,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoGenericInterfacesWithTheSameNameButDifferentArity.ts(38,22): error TS2428: All declarations of 'A' must have identical type parameters. -==== twoGenericInterfacesWithTheSameNameButDifferentArity.ts (6 errors) ==== +==== twoGenericInterfacesWithTheSameNameButDifferentArity.ts (11 errors) ==== interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -20,6 +25,8 @@ twoGenericInterfacesWithTheSameNameButDifferentArity.ts(38,22): error TS2428: Al } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -34,18 +41,24 @@ twoGenericInterfacesWithTheSameNameButDifferentArity.ts(38,22): error TS2428: Al } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { x: T; } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface A { // ok, different declaration space than other M2 y: T; } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. @@ -54,6 +67,8 @@ twoGenericInterfacesWithTheSameNameButDifferentArity.ts(38,22): error TS2428: Al } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { // error ~ !!! error TS2428: All declarations of 'A' must have identical type parameters. diff --git a/tests/baselines/reference/twoInterfacesDifferentRootModule.errors.txt b/tests/baselines/reference/twoInterfacesDifferentRootModule.errors.txt index 7f5fdb77d2e97..fd20581048221 100644 --- a/tests/baselines/reference/twoInterfacesDifferentRootModule.errors.txt +++ b/tests/baselines/reference/twoInterfacesDifferentRootModule.errors.txt @@ -1,11 +1,15 @@ +twoInterfacesDifferentRootModule.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoInterfacesDifferentRootModule.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoInterfacesDifferentRootModule.ts(19,16): error TS2339: Property 'foo' does not exist on type 'A'. twoInterfacesDifferentRootModule.ts(27,16): error TS2339: Property 'foo' does not exist on type 'B'. -==== twoInterfacesDifferentRootModule.ts (2 errors) ==== +==== twoInterfacesDifferentRootModule.ts (4 errors) ==== // two interfaces with different root modules should not merge module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { foo: string; } @@ -16,6 +20,8 @@ twoInterfacesDifferentRootModule.ts(27,16): error TS2339: Property 'foo' does no } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { bar: number; } diff --git a/tests/baselines/reference/twoInterfacesDifferentRootModule2.errors.txt b/tests/baselines/reference/twoInterfacesDifferentRootModule2.errors.txt index 89bc2c51f3af6..795b8202b759f 100644 --- a/tests/baselines/reference/twoInterfacesDifferentRootModule2.errors.txt +++ b/tests/baselines/reference/twoInterfacesDifferentRootModule2.errors.txt @@ -1,13 +1,17 @@ +twoInterfacesDifferentRootModule2.ts(3,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +twoInterfacesDifferentRootModule2.ts(12,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. twoInterfacesDifferentRootModule2.ts(18,20): error TS2339: Property 'foo' does not exist on type 'A'. twoInterfacesDifferentRootModule2.ts(26,20): error TS2339: Property 'foo' does not exist on type 'B'. twoInterfacesDifferentRootModule2.ts(32,16): error TS2339: Property 'bar' does not exist on type 'A'. twoInterfacesDifferentRootModule2.ts(36,16): error TS2339: Property 'bar' does not exist on type 'B'. -==== twoInterfacesDifferentRootModule2.ts (4 errors) ==== +==== twoInterfacesDifferentRootModule2.ts (6 errors) ==== // two interfaces with different root modules should not merge module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { foo: string; } @@ -17,6 +21,8 @@ twoInterfacesDifferentRootModule2.ts(36,16): error TS2339: Property 'bar' does n } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface A { bar: number; } diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.errors.txt b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.errors.txt new file mode 100644 index 0000000000000..3eb9370df9457 --- /dev/null +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.errors.txt @@ -0,0 +1,37 @@ +twoMergedInterfacesWithDifferingOverloads2.ts(15,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== twoMergedInterfacesWithDifferingOverloads2.ts (1 errors) ==== + interface A { + (): string; + (x: number): number; + } + + interface A { + (x: number, y: number): boolean; + } + + var a: A; + var r = a(); + var r2 = a(1); + var r3 = a(1, 2); + + module G { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface A { + (): string; + (x: T): T; + } + + interface A { + (x: T, y: number): T; + (x: U, y: T): U; + } + + var a: A; + var r = a(); + var r2 = a(true); + var r3 = a(true, 2); + var r4 = a(1, true); + } \ No newline at end of file diff --git a/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.errors.txt b/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.errors.txt new file mode 100644 index 0000000000000..5965ae9b10d24 --- /dev/null +++ b/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.errors.txt @@ -0,0 +1,16 @@ +typeAliasDoesntMakeModuleInstantiated.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeAliasDoesntMakeModuleInstantiated.ts (1 errors) ==== + declare module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // type alias declaration here shouldnt make the module declaration instantiated + type Selector = string| string[] |Function; + + export interface IStatic { + (selector: any /* Selector */): IInstance; + } + export interface IInstance { } + } + declare var m: m.IStatic; // Should be ok to have var 'm' as module is non instantiated \ No newline at end of file diff --git a/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.types b/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.types index 58ff347de9069..900ae8480a78e 100644 --- a/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.types +++ b/tests/baselines/reference/typeAliasDoesntMakeModuleInstantiated.types @@ -10,6 +10,7 @@ declare module m { export interface IStatic { (selector: any /* Selector */): IInstance; >selector : any +> : ^^^ } export interface IInstance { } } diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.errors.txt b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.errors.txt new file mode 100644 index 0000000000000..789ef67f36ffb --- /dev/null +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.errors.txt @@ -0,0 +1,97 @@ +typeGuardsInFunctionAndModuleBlock.ts(52,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInFunctionAndModuleBlock.ts(54,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInFunctionAndModuleBlock.ts(66,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInFunctionAndModuleBlock.ts(68,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInFunctionAndModuleBlock.ts(68,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeGuardsInFunctionAndModuleBlock.ts (5 errors) ==== + // typeguards are scoped in function/module block + + function foo(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f() { + var b = x; // number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (); + } + function foo2(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f(a: number | boolean) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (x); // x here is narrowed to number | boolean + } + function foo3(x: number | string | boolean) { + return typeof x === "string" + ? x + : (() => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(); + } + function foo4(x: number | string | boolean) { + return typeof x === "string" + ? x + : ((a: number | boolean) => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(x); // x here is narrowed to number | boolean + } + // Type guards do not affect nested function declarations + function foo5(x: number | string | boolean) { + if (typeof x === "string") { + var y = x; // string; + function foo() { + var z = x; // string + } + } + } + module m { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x: number | string | boolean; + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } + } + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x: number | string | boolean; + module m2.m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardsInModule.errors.txt b/tests/baselines/reference/typeGuardsInModule.errors.txt new file mode 100644 index 0000000000000..53aacefbfac4c --- /dev/null +++ b/tests/baselines/reference/typeGuardsInModule.errors.txt @@ -0,0 +1,105 @@ +typeGuardsInModule.ts(9,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInModule.ts(32,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInModule.ts(35,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInModule.ts(65,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeGuardsInModule.ts(65,11): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeGuardsInModule.ts (5 errors) ==== + // Note that type guards affect types of variables and parameters only and + // have no effect on members of objects such as properties. + + // variables in global + var num: number; + var strOrNum: string | number; + var var1: string | number; + // Inside module + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } + } + // local module + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var var2: string | number; + export var var3: string | number; + module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // local variables from outer module declaration + num = typeof var2 === "string" && var2.length; // string + + // exported variable from outer the module + strOrNum = typeof var3 === "string" && var3; // string | number + + // variables in module declaration + var var4: string | number; + if (typeof var4 === "string") { + num = var4.length; // string + } + else { + num = var4; // number + } + + // exported variable in the module + export var var5: string | number; + if (typeof var5 === "string") { + strOrNum = var5; // string | number + } + else { + strOrNum = var5; // string | number + } + } + } + // Dotted module + module m3.m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/typeOfThisInFunctionExpression.errors.txt b/tests/baselines/reference/typeOfThisInFunctionExpression.errors.txt new file mode 100644 index 0000000000000..f31d66f920a37 --- /dev/null +++ b/tests/baselines/reference/typeOfThisInFunctionExpression.errors.txt @@ -0,0 +1,51 @@ +typeOfThisInFunctionExpression.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeOfThisInFunctionExpression.ts (1 errors) ==== + // type of 'this' in FunctionExpression is Any + + function fn() { + var p = this; + var p: any; + } + + var t = function () { + var p = this; + var p: any; + } + + var t2 = function f() { + var x = this; + var x: any; + } + + class C { + x = function () { + var q: any; + var q = this; + } + y = function ff() { + var q: any; + var q = this; + } + } + + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + function fn() { + var p = this; + var p: any; + } + + var t = function () { + var p = this; + var p: any; + } + + var t2 = function f() { + var x = this; + var x: any; + } + + } \ No newline at end of file diff --git a/tests/baselines/reference/typeOfThisInFunctionExpression.types b/tests/baselines/reference/typeOfThisInFunctionExpression.types index 0c5cc889b9c95..c9d81426e3396 100644 --- a/tests/baselines/reference/typeOfThisInFunctionExpression.types +++ b/tests/baselines/reference/typeOfThisInFunctionExpression.types @@ -9,10 +9,13 @@ function fn() { var p = this; >p : any +> : ^^^ >this : any +> : ^^^ var p: any; >p : any +> : ^^^ } var t = function () { @@ -23,10 +26,13 @@ var t = function () { var p = this; >p : any +> : ^^^ >this : any +> : ^^^ var p: any; >p : any +> : ^^^ } var t2 = function f() { @@ -39,10 +45,13 @@ var t2 = function f() { var x = this; >x : any +> : ^^^ >this : any +> : ^^^ var x: any; >x : any +> : ^^^ } class C { @@ -57,10 +66,13 @@ class C { var q: any; >q : any +> : ^^^ var q = this; >q : any +> : ^^^ >this : any +> : ^^^ } y = function ff() { >y : () => void @@ -72,10 +84,13 @@ class C { var q: any; >q : any +> : ^^^ var q = this; >q : any +> : ^^^ >this : any +> : ^^^ } } @@ -89,10 +104,13 @@ module M { var p = this; >p : any +> : ^^^ >this : any +> : ^^^ var p: any; >p : any +> : ^^^ } var t = function () { @@ -103,10 +121,13 @@ module M { var p = this; >p : any +> : ^^^ >this : any +> : ^^^ var p: any; >p : any +> : ^^^ } var t2 = function f() { @@ -119,10 +140,13 @@ module M { var x = this; >x : any +> : ^^^ >this : any +> : ^^^ var x: any; >x : any +> : ^^^ } } diff --git a/tests/baselines/reference/typeResolution.errors.txt b/tests/baselines/reference/typeResolution.errors.txt new file mode 100644 index 0000000000000..49cd67cfc4154 --- /dev/null +++ b/tests/baselines/reference/typeResolution.errors.txt @@ -0,0 +1,137 @@ +typeResolution.ts(1,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(3,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(76,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(77,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(97,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(102,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeResolution.ts(103,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeResolution.ts (8 errors) ==== + export module TopLevelModule1 { + ~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module SubModule1 { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module SubSubModule1 { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA { + public AisIn1_1_1() { + // Try all qualified names of this type + var a1: ClassA; a1.AisIn1_1_1(); + var a2: SubSubModule1.ClassA; a2.AisIn1_1_1(); + var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1(); + var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1(); + + // Two variants of qualifying a peer type + var b1: ClassB; b1.BisIn1_1_1(); + var b2: TopLevelModule1.SubModule1.SubSubModule1.ClassB; b2.BisIn1_1_1(); + + // Type only accessible from the root + var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2(); + + // Interface reference + var d1: InterfaceX; d1.XisIn1_1_1(); + var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1(); + } + } + export class ClassB { + public BisIn1_1_1() { + /** Exactly the same as above in AisIn1_1_1 **/ + + // Try all qualified names of this type + var a1: ClassA; a1.AisIn1_1_1(); + var a2: SubSubModule1.ClassA; a2.AisIn1_1_1(); + var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1(); + var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1(); + + // Two variants of qualifying a peer type + var b1: ClassB; b1.BisIn1_1_1(); + var b2: TopLevelModule1.SubModule1.SubSubModule1.ClassB; b2.BisIn1_1_1(); + + // Type only accessible from the root + var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2(); + var c2: TopLevelModule2.SubModule3.ClassA; c2.AisIn2_3(); + + // Interface reference + var d1: InterfaceX; d1.XisIn1_1_1(); + var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1(); + } + } + export interface InterfaceX { XisIn1_1_1(); } + class NonExportedClassQ { + constructor() { + function QQ() { + /* Sampling of stuff from AisIn1_1_1 */ + var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1(); + var c1: TopLevelModule1.SubModule2.SubSubModule2.ClassA; c1.AisIn1_2_2(); + var d1: InterfaceX; d1.XisIn1_1_1(); + var c2: TopLevelModule2.SubModule3.ClassA; c2.AisIn2_3(); + } + } + } + } + + // Should have no effect on S1.SS1.ClassA above because it is not exported + class ClassA { + constructor() { + function AA() { + var a2: SubSubModule1.ClassA; a2.AisIn1_1_1(); + var a3: SubModule1.SubSubModule1.ClassA; a3.AisIn1_1_1(); + var a4: TopLevelModule1.SubModule1.SubSubModule1.ClassA; a4.AisIn1_1_1(); + + // Interface reference + var d2: SubSubModule1.InterfaceX; d2.XisIn1_1_1(); + } + } + } + } + + export module SubModule2 { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module SubSubModule2 { + ~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + // No code here since these are the mirror of the above calls + export class ClassA { public AisIn1_2_2() { } } + export class ClassB { public BisIn1_2_2() { } } + export class ClassC { public CisIn1_2_2() { } } + export interface InterfaceY { YisIn1_2_2(); } + interface NonExportedInterfaceQ { } + } + + export interface InterfaceY { YisIn1_2(); } + } + + class ClassA { + public AisIn1() { } + } + + interface InterfaceY { + YisIn1(); + } + + module NotExportedModule { + ~~~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA { } + } + } + + module TopLevelModule2 { + ~~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export module SubModule3 { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class ClassA { + public AisIn2_3() { } + } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/typeResolution.types b/tests/baselines/reference/typeResolution.types index fe3a18ca49aec..a70db36c17046 100644 --- a/tests/baselines/reference/typeResolution.types +++ b/tests/baselines/reference/typeResolution.types @@ -137,6 +137,7 @@ export module TopLevelModule1 { >d1 : InterfaceX > : ^^^^^^^^^^ >d1.XisIn1_1_1() : any +> : ^^^ >d1.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d1 : InterfaceX @@ -150,6 +151,7 @@ export module TopLevelModule1 { >SubSubModule1 : any > : ^^^ >d2.XisIn1_1_1() : any +> : ^^^ >d2.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d2 : InterfaceX @@ -300,6 +302,7 @@ export module TopLevelModule1 { >d1 : InterfaceX > : ^^^^^^^^^^ >d1.XisIn1_1_1() : any +> : ^^^ >d1.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d1 : InterfaceX @@ -313,6 +316,7 @@ export module TopLevelModule1 { >SubSubModule1 : any > : ^^^ >d2.XisIn1_1_1() : any +> : ^^^ >d2.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d2 : InterfaceX @@ -375,6 +379,7 @@ export module TopLevelModule1 { >d1 : InterfaceX > : ^^^^^^^^^^ >d1.XisIn1_1_1() : any +> : ^^^ >d1.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d1 : InterfaceX @@ -467,6 +472,7 @@ export module TopLevelModule1 { >SubSubModule1 : any > : ^^^ >d2.XisIn1_1_1() : any +> : ^^^ >d2.XisIn1_1_1 : () => any > : ^^^^^^^^^ >d2 : SubSubModule1.InterfaceX diff --git a/tests/baselines/reference/typeValueConflict1.errors.txt b/tests/baselines/reference/typeValueConflict1.errors.txt index 71d2f9a4d99bd..2d1fae5c8d939 100644 --- a/tests/baselines/reference/typeValueConflict1.errors.txt +++ b/tests/baselines/reference/typeValueConflict1.errors.txt @@ -1,12 +1,18 @@ +typeValueConflict1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeValueConflict1.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeValueConflict1.ts(8,21): error TS2339: Property 'A' does not exist on type 'number'. -==== typeValueConflict1.ts (1 errors) ==== +==== typeValueConflict1.ts (3 errors) ==== module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var M1 = 0; // Should error. M1 should bind to the variable, not to the module. class B extends M1.A { diff --git a/tests/baselines/reference/typeValueConflict2.errors.txt b/tests/baselines/reference/typeValueConflict2.errors.txt index 49f677e4a8bec..ce115147a7f9c 100644 --- a/tests/baselines/reference/typeValueConflict2.errors.txt +++ b/tests/baselines/reference/typeValueConflict2.errors.txt @@ -1,14 +1,21 @@ +typeValueConflict2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeValueConflict2.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeValueConflict2.ts(10,24): error TS2339: Property 'A' does not exist on type 'number'. +typeValueConflict2.ts(13,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== typeValueConflict2.ts (1 errors) ==== +==== typeValueConflict2.ts (4 errors) ==== module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class A { constructor(a: T) { } } } module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var M1 = 0; // Should error. M1 should bind to the variable, not to the module. class B extends M1.A { @@ -17,6 +24,8 @@ typeValueConflict2.ts(10,24): error TS2339: Property 'A' does not exist on type } } module M3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. // Shouldn't error class B extends M1.A { } diff --git a/tests/baselines/reference/typeofANonExportedType.errors.txt b/tests/baselines/reference/typeofANonExportedType.errors.txt index 54a6e6778175c..7f0a5558ccb07 100644 --- a/tests/baselines/reference/typeofANonExportedType.errors.txt +++ b/tests/baselines/reference/typeofANonExportedType.errors.txt @@ -1,9 +1,11 @@ typeofANonExportedType.ts(20,12): error TS2323: Cannot redeclare exported variable 'r5'. typeofANonExportedType.ts(21,12): error TS2323: Cannot redeclare exported variable 'r5'. +typeofANonExportedType.ts(23,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofANonExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. +typeofANonExportedType.ts(45,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== typeofANonExportedType.ts (3 errors) ==== +==== typeofANonExportedType.ts (5 errors) ==== var x = 1; export var r1: typeof x; var y = { foo: '' }; @@ -31,6 +33,8 @@ typeofANonExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or !!! error TS2323: Cannot redeclare exported variable 'r5'. module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var foo = ''; export class C { foo: string; @@ -55,6 +59,8 @@ typeofANonExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or function foo() { } module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = 1; export class C { foo: string; diff --git a/tests/baselines/reference/typeofAnExportedType.errors.txt b/tests/baselines/reference/typeofAnExportedType.errors.txt index f252ad3c963f6..e04bc20c8e59f 100644 --- a/tests/baselines/reference/typeofAnExportedType.errors.txt +++ b/tests/baselines/reference/typeofAnExportedType.errors.txt @@ -1,9 +1,11 @@ typeofAnExportedType.ts(20,12): error TS2323: Cannot redeclare exported variable 'r5'. typeofAnExportedType.ts(21,12): error TS2323: Cannot redeclare exported variable 'r5'. +typeofAnExportedType.ts(23,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofAnExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or indirectly in its own type annotation. +typeofAnExportedType.ts(45,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. -==== typeofAnExportedType.ts (3 errors) ==== +==== typeofAnExportedType.ts (5 errors) ==== export var x = 1; export var r1: typeof x; export var y = { foo: '' }; @@ -31,6 +33,8 @@ typeofAnExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or in !!! error TS2323: Cannot redeclare exported variable 'r5'. export module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var foo = ''; export class C { foo: string; @@ -55,6 +59,8 @@ typeofAnExportedType.ts(42,12): error TS2502: 'r12' is referenced directly or in export function foo() { } export module foo { + ~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var y = 1; export class C { foo: string; diff --git a/tests/baselines/reference/typeofInternalModules.errors.txt b/tests/baselines/reference/typeofInternalModules.errors.txt index 51b8052fcef8e..eb5857a6f6bdf 100644 --- a/tests/baselines/reference/typeofInternalModules.errors.txt +++ b/tests/baselines/reference/typeofInternalModules.errors.txt @@ -1,3 +1,6 @@ +typeofInternalModules.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeofInternalModules.ts(2,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +typeofInternalModules.ts(5,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofInternalModules.ts(15,16): error TS2708: Cannot use namespace 'importUninst' as a value. typeofInternalModules.ts(17,9): error TS2709: Cannot use namespace 'Outer' as a type. typeofInternalModules.ts(19,1): error TS2741: Property 'C' is missing in type 'typeof Outer' but required in type 'typeof instantiated'. @@ -5,12 +8,18 @@ typeofInternalModules.ts(21,16): error TS2708: Cannot use namespace 'importUnins typeofInternalModules.ts(23,1): error TS2741: Property 'instantiated' is missing in type 'typeof instantiated' but required in type 'typeof Outer'. -==== typeofInternalModules.ts (5 errors) ==== +==== typeofInternalModules.ts (8 errors) ==== module Outer { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export module instantiated { + ~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { } } export module uninstantiated { + ~~~~~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface P { } } } diff --git a/tests/baselines/reference/typeofModuleWithoutExports.errors.txt b/tests/baselines/reference/typeofModuleWithoutExports.errors.txt new file mode 100644 index 0000000000000..375e0ebd6c7c7 --- /dev/null +++ b/tests/baselines/reference/typeofModuleWithoutExports.errors.txt @@ -0,0 +1,14 @@ +typeofModuleWithoutExports.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== typeofModuleWithoutExports.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + var x = 1; + class C { + foo: number; + } + } + + var r: typeof M; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index 25c672a3767b1..5d281f717a46a 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,10 +1,11 @@ +typeofOperatorWithAnyOtherType.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. typeofOperatorWithAnyOtherType.ts(58,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== typeofOperatorWithAnyOtherType.ts (4 errors) ==== +==== typeofOperatorWithAnyOtherType.ts (5 errors) ==== // typeof operator on any type var ANY: any; @@ -25,6 +26,8 @@ typeofOperatorWithAnyOtherType.ts(58,1): error TS2695: Left side of comma operat } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt index 19daef2333410..13238e7040215 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -1,7 +1,8 @@ +typeofOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== typeofOperatorWithBooleanType.ts (1 errors) ==== +==== typeofOperatorWithBooleanType.ts (2 errors) ==== // typeof operator on boolean type var BOOLEAN: boolean; @@ -12,6 +13,8 @@ typeofOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma operato static foo() { return false; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: boolean; } diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt index d42260f0f269d..8483815dbd0a8 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -1,7 +1,8 @@ +typeofOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== typeofOperatorWithNumberType.ts (1 errors) ==== +==== typeofOperatorWithNumberType.ts (2 errors) ==== // typeof operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; @@ -13,6 +14,8 @@ typeofOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator static foo() { return 1; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: number; } diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index 8d60a1282ad7f..f5b42cb4d0269 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,7 +1,8 @@ +typeofOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== typeofOperatorWithStringType.ts (1 errors) ==== +==== typeofOperatorWithStringType.ts (2 errors) ==== // typeof operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -13,6 +14,8 @@ typeofOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator static foo() { return ""; } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: string; } diff --git a/tests/baselines/reference/typeofThis.errors.txt b/tests/baselines/reference/typeofThis.errors.txt index 82ca3ffcf1d09..4ce9ad5bb9c19 100644 --- a/tests/baselines/reference/typeofThis.errors.txt +++ b/tests/baselines/reference/typeofThis.errors.txt @@ -2,13 +2,14 @@ typeofThis.ts(24,19): error TS2683: 'this' implicitly has type 'any' because it typeofThis.ts(32,19): error TS18048: 'this' is possibly 'undefined'. typeofThis.ts(46,23): error TS2331: 'this' cannot be referenced in a module or namespace body. typeofThis.ts(46,23): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +typeofThis.ts(50,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. typeofThis.ts(52,23): error TS2331: 'this' cannot be referenced in a module or namespace body. typeofThis.ts(52,23): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. typeofThis.ts(57,19): error TS7041: The containing arrow function captures the global value of 'this'. typeofThis.ts(57,24): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. -==== typeofThis.ts (8 errors) ==== +==== typeofThis.ts (9 errors) ==== class Test { data = {}; constructor() { @@ -67,6 +68,8 @@ typeofThis.ts(57,24): error TS7017: Element implicitly has an 'any' type because } module Test7 { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export let f = () => { let x: typeof this.no = 1; ~~~~ diff --git a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt index 557bdfb4dad0e..a5c8c705e0aa1 100644 --- a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt +++ b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt @@ -1,3 +1,4 @@ +foo_0.ts(6,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. foo_1.ts(5,5): error TS2741: Property 'M2' is missing in type 'typeof import("foo_0")' but required in type '{ M2: Object; }'. @@ -11,13 +12,15 @@ foo_1.ts(5,5): error TS2741: Property 'M2' is missing in type 'typeof import("fo !!! error TS2741: Property 'M2' is missing in type 'typeof import("foo_0")' but required in type '{ M2: Object; }'. !!! related TS2728 foo_1.ts:5:9: 'M2' is declared here. -==== foo_0.ts (0 errors) ==== +==== foo_0.ts (1 errors) ==== export interface Person { name: string; age: number; } export module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface I2 { x: Person; } diff --git a/tests/baselines/reference/undeclaredBase.errors.txt b/tests/baselines/reference/undeclaredBase.errors.txt index 49001bfc2b1f1..4702334485fad 100644 --- a/tests/baselines/reference/undeclaredBase.errors.txt +++ b/tests/baselines/reference/undeclaredBase.errors.txt @@ -1,8 +1,11 @@ +undeclaredBase.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. undeclaredBase.ts(1,37): error TS2339: Property 'I' does not exist on type 'typeof M'. -==== undeclaredBase.ts (1 errors) ==== +==== undeclaredBase.ts (2 errors) ==== module M { export class C extends M.I { } } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. ~ !!! error TS2339: Property 'I' does not exist on type 'typeof M'. diff --git a/tests/baselines/reference/undeclaredMethod.errors.txt b/tests/baselines/reference/undeclaredMethod.errors.txt index c1522ca0b1f88..9fba7955e68f2 100644 --- a/tests/baselines/reference/undeclaredMethod.errors.txt +++ b/tests/baselines/reference/undeclaredMethod.errors.txt @@ -1,8 +1,11 @@ +undeclaredMethod.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. undeclaredMethod.ts(10,3): error TS2339: Property 'saltbar' does not exist on type 'C'. -==== undeclaredMethod.ts (1 errors) ==== +==== undeclaredMethod.ts (2 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { public salt() {} } diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.errors.txt b/tests/baselines/reference/undefinedIsSubtypeOfEverything.errors.txt new file mode 100644 index 0000000000000..4adf05edd6951 --- /dev/null +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.errors.txt @@ -0,0 +1,130 @@ +undefinedIsSubtypeOfEverything.ts(82,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +undefinedIsSubtypeOfEverything.ts(91,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== undefinedIsSubtypeOfEverything.ts (2 errors) ==== + // undefined is a subtype of every other types, no errors expected below + + class Base { + foo: typeof undefined; + } + + class D0 extends Base { + foo: any; + } + + class DA extends Base { + foo: typeof undefined; + } + + class D1 extends Base { + foo: string; + } + + class D1A extends Base { + foo: String; + } + + + class D2 extends Base { + foo: number; + } + + class D2A extends Base { + foo: Number; + } + + + class D3 extends Base { + foo: boolean; + } + + class D3A extends Base { + foo: Boolean; + } + + + class D4 extends Base { + foo: RegExp; + } + + class D5 extends Base { + foo: Date; + } + + + class D6 extends Base { + foo: number[]; + } + + class D7 extends Base { + foo: { bar: number }; + } + + + class D8 extends Base { + foo: D7; + } + + interface I1 { + bar: string; + } + class D9 extends Base { + foo: I1; + } + + + class D10 extends Base { + foo: () => number; + } + + enum E { A } + class D11 extends Base { + foo: E; + } + + function f() { } + module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + class D12 extends Base { + foo: typeof f; + } + + + class c { baz: string } + module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var bar = 1; + } + class D13 extends Base { + foo: typeof c; + } + + + class D14 extends Base { + foo: T; + } + + + class D15 extends Base { + foo: U; + } + + //class D15 extends Base { + // foo: U; + //} + + + class D16 extends Base { + foo: Object; + } + + + class D17 extends Base { + foo: {}; + } + \ No newline at end of file diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types index 63a9eb50c7bef..c0e593504d3db 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types @@ -9,6 +9,7 @@ class Base { foo: typeof undefined; >foo : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ } @@ -21,6 +22,7 @@ class D0 extends Base { foo: any; >foo : any +> : ^^^ } class DA extends Base { @@ -31,6 +33,7 @@ class DA extends Base { foo: typeof undefined; >foo : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ } diff --git a/tests/baselines/reference/underscoreMapFirst.errors.txt b/tests/baselines/reference/underscoreMapFirst.errors.txt new file mode 100644 index 0000000000000..119dcdfe6f370 --- /dev/null +++ b/tests/baselines/reference/underscoreMapFirst.errors.txt @@ -0,0 +1,54 @@ +underscoreMapFirst.ts(1,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== underscoreMapFirst.ts (1 errors) ==== + declare module _ { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + interface Collection { } + interface List extends Collection { + [index: number]: T; + length: number; + } + + interface ListIterator { + (value: T, index: number, list: T[]): TResult; + } + + interface Dictionary extends Collection { + [index: string]: T; + } + export function pluck( + list: Collection, + propertyName: string): any[]; + + export function map( + list: List, + iterator: ListIterator, + context?: any): TResult[]; + + export function first(array: List): T; + } + + declare class View { + model: any; + } + + interface IData { + series: ISeries[]; + } + + interface ISeries { + items: any[]; + key: string; + } + + class MyView extends View { + public getDataSeries(): ISeries[] { + var data: IData[] = this.model.get("data"); + var allSeries: ISeries[][] = _.pluck(data, "series"); + + return _.map(allSeries, _.first); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/underscoreMapFirst.types b/tests/baselines/reference/underscoreMapFirst.types index ed76e069050a6..551d29678865f 100644 --- a/tests/baselines/reference/underscoreMapFirst.types +++ b/tests/baselines/reference/underscoreMapFirst.types @@ -57,6 +57,7 @@ declare module _ { context?: any): TResult[]; >context : any +> : ^^^ export function first(array: List): T; >first : (array: List) => T @@ -71,6 +72,7 @@ declare class View { model: any; >model : any +> : ^^^ } interface IData { @@ -103,7 +105,9 @@ class MyView extends View { >data : IData[] > : ^^^^^^^ >this.model.get("data") : any +> : ^^^ >this.model.get : any +> : ^^^ >this.model : any > : ^^^ >this : this diff --git a/tests/baselines/reference/underscoreTest1.errors.txt b/tests/baselines/reference/underscoreTest1.errors.txt index f3070567b8d80..124d057be2e3c 100644 --- a/tests/baselines/reference/underscoreTest1.errors.txt +++ b/tests/baselines/reference/underscoreTest1.errors.txt @@ -1,3 +1,4 @@ +underscoreTest1_underscore.ts(31,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this call. Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. @@ -270,7 +271,7 @@ underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this var template2 = _.template("Hello {{ name }}!"); template2({ name: "Mustache" }); _.template("Using 'with': <%= data.answer %>", { answer: 'no' }, { variable: 'data' }); -==== underscoreTest1_underscore.ts (0 errors) ==== +==== underscoreTest1_underscore.ts (1 errors) ==== interface Dictionary { [x: string]: T; } @@ -302,6 +303,8 @@ underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this } module Underscore { + ~~~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface WrappedObject { keys(): string[]; values(): any[]; diff --git a/tests/baselines/reference/unexportedInstanceClassVariables.errors.txt b/tests/baselines/reference/unexportedInstanceClassVariables.errors.txt new file mode 100644 index 0000000000000..cb6a2418a3147 --- /dev/null +++ b/tests/baselines/reference/unexportedInstanceClassVariables.errors.txt @@ -0,0 +1,21 @@ +unexportedInstanceClassVariables.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +unexportedInstanceClassVariables.ts(7,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== unexportedInstanceClassVariables.ts (2 errors) ==== + module M{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A{ + constructor(val:string){} + } + } + + module M{ + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + class A {} + + var a = new A(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.errors.txt b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.errors.txt index 1219bb562c96c..433f77b800365 100644 --- a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.errors.txt +++ b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.errors.txt @@ -22,15 +22,17 @@ unionSubtypeIfEveryConstituentTypeIsSubtype.ts(85,5): error TS2411: Property 'fo unionSubtypeIfEveryConstituentTypeIsSubtype.ts(91,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to 'string' index type '(x: T) => T'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(92,5): error TS2411: Property 'foo2' of type 'number' is not assignable to 'string' index type '(x: T) => T'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(99,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to 'string' index type 'E2'. +unionSubtypeIfEveryConstituentTypeIsSubtype.ts(105,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(110,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to 'string' index type 'typeof f'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(111,5): error TS2411: Property 'foo2' of type 'number' is not assignable to 'string' index type 'typeof f'. +unionSubtypeIfEveryConstituentTypeIsSubtype.ts(116,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(121,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to 'string' index type 'typeof c'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(122,5): error TS2411: Property 'foo2' of type 'number' is not assignable to 'string' index type 'typeof c'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(128,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to 'string' index type 'T'. unionSubtypeIfEveryConstituentTypeIsSubtype.ts(129,5): error TS2411: Property 'foo2' of type 'number' is not assignable to 'string' index type 'T'. -==== unionSubtypeIfEveryConstituentTypeIsSubtype.ts (30 errors) ==== +==== unionSubtypeIfEveryConstituentTypeIsSubtype.ts (32 errors) ==== enum e { e1, e2 @@ -184,6 +186,8 @@ unionSubtypeIfEveryConstituentTypeIsSubtype.ts(129,5): error TS2411: Property 'f function f() { } module f { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } interface I15 { @@ -199,6 +203,8 @@ unionSubtypeIfEveryConstituentTypeIsSubtype.ts(129,5): error TS2411: Property 'f class c { baz: string } module c { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var bar = 1; } interface I16 { diff --git a/tests/baselines/reference/unknownSymbols2.errors.txt b/tests/baselines/reference/unknownSymbols2.errors.txt index 593a6a51bbf8f..9745efe44b090 100644 --- a/tests/baselines/reference/unknownSymbols2.errors.txt +++ b/tests/baselines/reference/unknownSymbols2.errors.txt @@ -1,3 +1,4 @@ +unknownSymbols2.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unknownSymbols2.ts(2,12): error TS2304: Cannot find name 'asdf'. unknownSymbols2.ts(3,17): error TS2304: Cannot find name 'asdf'. unknownSymbols2.ts(4,14): error TS2304: Cannot find name 'asdf'. @@ -7,11 +8,14 @@ unknownSymbols2.ts(15,13): error TS2304: Cannot find name 'asdf'. unknownSymbols2.ts(16,14): error TS2304: Cannot find name 'qwerty'. unknownSymbols2.ts(22,19): error TS2304: Cannot find name 'asdf'. unknownSymbols2.ts(23,32): error TS2304: Cannot find name 'qwerty'. +unknownSymbols2.ts(25,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unknownSymbols2.ts(29,16): error TS2503: Cannot find namespace 'asdf'. -==== unknownSymbols2.ts (10 errors) ==== +==== unknownSymbols2.ts (12 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x: asdf; ~~~~ !!! error TS2304: Cannot find name 'asdf'. @@ -54,6 +58,8 @@ unknownSymbols2.ts(29,16): error TS2503: Cannot find namespace 'asdf'. !!! error TS2304: Cannot find name 'qwerty'. module N { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var x = 1; } import c = N; diff --git a/tests/baselines/reference/unspecializedConstraints.errors.txt b/tests/baselines/reference/unspecializedConstraints.errors.txt index 824b8fa2b45a3..2c02779300024 100644 --- a/tests/baselines/reference/unspecializedConstraints.errors.txt +++ b/tests/baselines/reference/unspecializedConstraints.errors.txt @@ -1,8 +1,11 @@ +unspecializedConstraints.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unspecializedConstraints.ts(84,44): error TS2552: Cannot find name 'TypeParameter'. Did you mean 'Parameter'? -==== unspecializedConstraints.ts (1 errors) ==== +==== unspecializedConstraints.ts (2 errors) ==== module ts { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. interface Map { [index: string]: T; } diff --git a/tests/baselines/reference/unusedClassesinModule1.errors.txt b/tests/baselines/reference/unusedClassesinModule1.errors.txt index c0956cabe423a..9621cc148b561 100644 --- a/tests/baselines/reference/unusedClassesinModule1.errors.txt +++ b/tests/baselines/reference/unusedClassesinModule1.errors.txt @@ -1,8 +1,11 @@ +unusedClassesinModule1.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unusedClassesinModule1.ts(2,11): error TS6196: 'Calculator' is declared but never used. -==== unusedClassesinModule1.ts (1 errors) ==== +==== unusedClassesinModule1.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. class Calculator { ~~~~~~~~~~ !!! error TS6196: 'Calculator' is declared but never used. diff --git a/tests/baselines/reference/unusedImports10.errors.txt b/tests/baselines/reference/unusedImports10.errors.txt index 3720cbbe21c66..ef3bd22cefe66 100644 --- a/tests/baselines/reference/unusedImports10.errors.txt +++ b/tests/baselines/reference/unusedImports10.errors.txt @@ -1,8 +1,12 @@ +unusedImports10.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +unusedImports10.ts(8,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unusedImports10.ts(9,12): error TS6133: 'a' is declared but its value is never read. -==== unusedImports10.ts (1 errors) ==== +==== unusedImports10.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class Calculator { public handelChar() { } @@ -10,6 +14,8 @@ unusedImports10.ts(9,12): error TS6133: 'a' is declared but its value is never r } module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. import a = A; ~ !!! error TS6133: 'a' is declared but its value is never read. diff --git a/tests/baselines/reference/unusedModuleInModule.errors.txt b/tests/baselines/reference/unusedModuleInModule.errors.txt index 675be2bf4b31d..532216a1e2c5b 100644 --- a/tests/baselines/reference/unusedModuleInModule.errors.txt +++ b/tests/baselines/reference/unusedModuleInModule.errors.txt @@ -1,9 +1,15 @@ +unusedModuleInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +unusedModuleInModule.ts(2,12): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unusedModuleInModule.ts(2,12): error TS6133: 'B' is declared but its value is never read. -==== unusedModuleInModule.ts (1 errors) ==== +==== unusedModuleInModule.ts (3 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. module B {} ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + ~ !!! error TS6133: 'B' is declared but its value is never read. } \ No newline at end of file diff --git a/tests/baselines/reference/unusedNamespaceInModule.errors.txt b/tests/baselines/reference/unusedNamespaceInModule.errors.txt index c0bb803d1719e..d4a306e105067 100644 --- a/tests/baselines/reference/unusedNamespaceInModule.errors.txt +++ b/tests/baselines/reference/unusedNamespaceInModule.errors.txt @@ -1,8 +1,11 @@ +unusedNamespaceInModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. unusedNamespaceInModule.ts(2,15): error TS6133: 'B' is declared but its value is never read. -==== unusedNamespaceInModule.ts (1 errors) ==== +==== unusedNamespaceInModule.ts (2 errors) ==== module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. namespace B { } ~ !!! error TS6133: 'B' is declared but its value is never read. diff --git a/tests/baselines/reference/usingModuleWithExportImportInValuePosition.errors.txt b/tests/baselines/reference/usingModuleWithExportImportInValuePosition.errors.txt new file mode 100644 index 0000000000000..5fe4f407b1694 --- /dev/null +++ b/tests/baselines/reference/usingModuleWithExportImportInValuePosition.errors.txt @@ -0,0 +1,31 @@ +usingModuleWithExportImportInValuePosition.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +usingModuleWithExportImportInValuePosition.ts(6,19): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +usingModuleWithExportImportInValuePosition.ts(12,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== usingModuleWithExportImportInValuePosition.ts (3 errors) ==== + module A { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var x = 'hello world' + export class Point { + constructor(public x: number, public y: number) { } + } + export module B { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export interface Id { + name: string; + } + } + } + module C { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export import a = A; + } + + var a: string = C.a.x; + var b: { x: number; y: number; } = new C.a.Point(0, 0); + var c: { name: string }; + var c: C.a.B.Id; \ No newline at end of file diff --git a/tests/baselines/reference/validNullAssignments.errors.txt b/tests/baselines/reference/validNullAssignments.errors.txt index d2ae508b11570..76bfe01cf8c90 100644 --- a/tests/baselines/reference/validNullAssignments.errors.txt +++ b/tests/baselines/reference/validNullAssignments.errors.txt @@ -1,11 +1,12 @@ validNullAssignments.ts(10,3): error TS2540: Cannot assign to 'A' because it is a read-only property. validNullAssignments.ts(15,1): error TS2629: Cannot assign to 'C' because it is a class. validNullAssignments.ts(20,1): error TS2693: 'I' only refers to a type, but is being used as a value here. +validNullAssignments.ts(22,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. validNullAssignments.ts(23,1): error TS2631: Cannot assign to 'M' because it is a namespace. validNullAssignments.ts(30,1): error TS2630: Cannot assign to 'i' because it is a function. -==== validNullAssignments.ts (5 errors) ==== +==== validNullAssignments.ts (6 errors) ==== var a: number = null; var b: boolean = null; var c: string = null; @@ -34,6 +35,8 @@ validNullAssignments.ts(30,1): error TS2630: Cannot assign to 'i' because it is !!! error TS2693: 'I' only refers to a type, but is being used as a value here. module M { export var x = 1; } + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. M = null; // error ~ !!! error TS2631: Cannot assign to 'M' because it is a namespace. diff --git a/tests/baselines/reference/varBlock.errors.txt b/tests/baselines/reference/varBlock.errors.txt index 28bf5f09e9d18..7569ad4d1fe43 100644 --- a/tests/baselines/reference/varBlock.errors.txt +++ b/tests/baselines/reference/varBlock.errors.txt @@ -1,15 +1,19 @@ +varBlock.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +varBlock.ts(6,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. varBlock.ts(8,18): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(11,22): error TS2369: A parameter property is only allowed in a constructor implementation. varBlock.ts(11,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. varBlock.ts(15,17): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(21,18): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(22,22): error TS1039: Initializers are not allowed in ambient contexts. +varBlock.ts(24,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. varBlock.ts(25,21): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(26,26): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(26,35): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(27,29): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(28,35): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(28,45): error TS1039: Initializers are not allowed in ambient contexts. +varBlock.ts(31,16): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. varBlock.ts(32,13): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(33,18): error TS1039: Initializers are not allowed in ambient contexts. varBlock.ts(33,26): error TS1039: Initializers are not allowed in ambient contexts. @@ -20,13 +24,17 @@ varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the varBlock.ts(39,17): error TS1039: Initializers are not allowed in ambient contexts. -==== varBlock.ts (20 errors) ==== +==== varBlock.ts (24 errors) ==== module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var a, b2: number = 10, b; } declare module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var a, b, c; var a1, b1 = 10; ~~ @@ -57,6 +65,8 @@ varBlock.ts(39,17): error TS1039: Initializers are not allowed in ambient contex !!! error TS1039: Initializers are not allowed in ambient contexts. module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. declare var d = 10; ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. @@ -76,6 +86,8 @@ varBlock.ts(39,17): error TS1039: Initializers are not allowed in ambient contex } declare module m4 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. var d = 10; ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. diff --git a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.errors.txt b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.errors.txt index 3627685248c34..79e5acd1bfa85 100644 --- a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.errors.txt +++ b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.errors.txt @@ -1,12 +1,18 @@ +varNameConflictsWithImportInDifferentPartOfModule.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +varNameConflictsWithImportInDifferentPartOfModule.ts(5,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. varNameConflictsWithImportInDifferentPartOfModule.ts(6,5): error TS2440: Import declaration conflicts with local declaration of 'q'. -==== varNameConflictsWithImportInDifferentPartOfModule.ts (1 errors) ==== +==== varNameConflictsWithImportInDifferentPartOfModule.ts (3 errors) ==== module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var q = 5; export var s = ''; } module M1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export import q = M1.s; // Should be an error but isn't ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2440: Import declaration conflicts with local declaration of 'q'. diff --git a/tests/baselines/reference/vararg.errors.txt b/tests/baselines/reference/vararg.errors.txt index 5486ca8df10f3..fd688df66aca4 100644 --- a/tests/baselines/reference/vararg.errors.txt +++ b/tests/baselines/reference/vararg.errors.txt @@ -1,3 +1,4 @@ +vararg.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. vararg.ts(12,31): error TS2370: A rest parameter must be of an array type. vararg.ts(17,13): error TS2304: Cannot find name 'builder'. vararg.ts(19,17): error TS2304: Cannot find name 'builder'. @@ -8,8 +9,10 @@ vararg.ts(32,17): error TS2345: Argument of type 'number' is not assignable to p vararg.ts(33,17): error TS2345: Argument of type 'C' is not assignable to parameter of type 'string'. -==== vararg.ts (8 errors) ==== +==== vararg.ts (9 errors) ==== module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class C { public f(x:string,...rest:number[]) { var sum=0; diff --git a/tests/baselines/reference/vardecl.errors.txt b/tests/baselines/reference/vardecl.errors.txt new file mode 100644 index 0000000000000..680dd6b883ab9 --- /dev/null +++ b/tests/baselines/reference/vardecl.errors.txt @@ -0,0 +1,116 @@ +vardecl.ts(61,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== vardecl.ts (1 errors) ==== + var simpleVar; + + var anotherVar: any; + var varWithSimpleType: number; + var varWithArrayType: number[]; + + var varWithInitialValue = 30; + + var withComplicatedValue = { x: 30, y: 70, desc: "position" }; + + declare var declaredVar; + declare var declareVar2 + + declare var declaredVar3; + declare var deckareVarWithType: number; + + var arrayVar: string[] = ['a', 'b']; + + var complicatedArrayVar: { x: number; y: string; }[] ; + complicatedArrayVar.push({ x: 30, y : 'hello world' }); + + var n1: { [s: string]: number; }; + + var c : { + new? (): any; + } + + var d: { + foo? (): { + x: number; + }; + } + + var d3: { + foo(): { + x: number; + y: number; + }; + } + + var d2: { + foo (): { + x: number; + }; + } + + var n2: { + (): void; + } + var n4: { + (): void; + }[]; + + var d4: { + foo(n: string, x: { x: number; y: number; }): { + x: number; + y: number; + }; + } + + module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export var a, b2: number = 10, b; + var m1; + var a2, b22: number = 10, b222; + var m3; + + class C { + constructor (public b) { + } + } + + export class C2 { + constructor (public b) { + } + } + var m; + declare var d1, d2; + var b23; + declare var v1; + export var mE; + export declare var d1E, d2E; + export var b2E; + export declare var v1E; + } + + var a22, b22 = 10, c22 = 30; + var nn; + + declare var da1, da2; + var normalVar; + declare var dv1; + var xl; + var x; + var z; + + function foo(a2) { + var a = 10; + } + + for (var i = 0, j = 0; i < 10; i++) { + j++; + } + + + for (var k = 0; k < 30; k++) { + k++; + } + var b = 10; + \ No newline at end of file diff --git a/tests/baselines/reference/vardecl.types b/tests/baselines/reference/vardecl.types index e74765d824481..e851313f35a99 100644 --- a/tests/baselines/reference/vardecl.types +++ b/tests/baselines/reference/vardecl.types @@ -3,9 +3,11 @@ === vardecl.ts === var simpleVar; >simpleVar : any +> : ^^^ var anotherVar: any; >anotherVar : any +> : ^^^ var varWithSimpleType: number; >varWithSimpleType : number @@ -41,12 +43,15 @@ var withComplicatedValue = { x: 30, y: 70, desc: "position" }; declare var declaredVar; >declaredVar : any +> : ^^^ declare var declareVar2 >declareVar2 : any +> : ^^^ declare var declaredVar3; >declaredVar3 : any +> : ^^^ declare var deckareVarWithType: number; >deckareVarWithType : number @@ -200,25 +205,31 @@ module m2 { export var a, b2: number = 10, b; >a : any +> : ^^^ >b2 : number > : ^^^^^^ >10 : 10 > : ^^ >b : any +> : ^^^ var m1; >m1 : any +> : ^^^ var a2, b22: number = 10, b222; >a2 : any +> : ^^^ >b22 : number > : ^^^^^^ >10 : 10 > : ^^ >b222 : any +> : ^^^ var m3; >m3 : any +> : ^^^ class C { >C : C @@ -226,6 +237,7 @@ module m2 { constructor (public b) { >b : any +> : ^^^ } } @@ -235,37 +247,49 @@ module m2 { constructor (public b) { >b : any +> : ^^^ } } var m; >m : any +> : ^^^ declare var d1, d2; >d1 : any +> : ^^^ >d2 : any +> : ^^^ var b23; >b23 : any +> : ^^^ declare var v1; >v1 : any +> : ^^^ export var mE; >mE : any +> : ^^^ export declare var d1E, d2E; >d1E : any +> : ^^^ >d2E : any +> : ^^^ export var b2E; >b2E : any +> : ^^^ export declare var v1E; >v1E : any +> : ^^^ } var a22, b22 = 10, c22 = 30; >a22 : any +> : ^^^ >b22 : number > : ^^^^^^ >10 : 10 @@ -277,30 +301,39 @@ var a22, b22 = 10, c22 = 30; var nn; >nn : any +> : ^^^ declare var da1, da2; >da1 : any +> : ^^^ >da2 : any +> : ^^^ var normalVar; >normalVar : any +> : ^^^ declare var dv1; >dv1 : any +> : ^^^ var xl; >xl : any +> : ^^^ var x; >x : any +> : ^^^ var z; >z : any +> : ^^^ function foo(a2) { >foo : (a2: any) => void > : ^ ^^^^^^^^^^^^^^ >a2 : any +> : ^^^ var a = 10; >a : number diff --git a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.errors.txt b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.errors.txt index 2211c228ad368..f3a6882ce78d6 100644 --- a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.errors.txt +++ b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.errors.txt @@ -1,10 +1,16 @@ +variableDeclaratorResolvedDuringContextualTyping.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +variableDeclaratorResolvedDuringContextualTyping.ts(66,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +variableDeclaratorResolvedDuringContextualTyping.ts(84,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +variableDeclaratorResolvedDuringContextualTyping.ts(91,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. variableDeclaratorResolvedDuringContextualTyping.ts(115,29): error TS2304: Cannot find name 'IUploadResult'. variableDeclaratorResolvedDuringContextualTyping.ts(116,32): error TS2339: Property 'jsonToStat' does not exist on type 'FileService'. variableDeclaratorResolvedDuringContextualTyping.ts(116,43): error TS2304: Cannot find name 'newFilePath'. -==== variableDeclaratorResolvedDuringContextualTyping.ts (3 errors) ==== +==== variableDeclaratorResolvedDuringContextualTyping.ts (7 errors) ==== module WinJS { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface ValueCallback { (value: any): any; } @@ -70,6 +76,8 @@ variableDeclaratorResolvedDuringContextualTyping.ts(116,43): error TS2304: Canno } module Services { + ~~~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IRequestService { /** * Returns the URL that can be used to access the provided service. The optional second argument can @@ -88,6 +96,8 @@ variableDeclaratorResolvedDuringContextualTyping.ts(116,43): error TS2304: Canno } module Errors { + ~~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export class ConnectionError /* extends Error */ { constructor(request: XMLHttpRequest) { } @@ -95,6 +105,8 @@ variableDeclaratorResolvedDuringContextualTyping.ts(116,43): error TS2304: Canno } module Files { + ~~~~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export interface IUploadResult { stat: string; isNew: boolean; diff --git a/tests/baselines/reference/visSyntax.errors.txt b/tests/baselines/reference/visSyntax.errors.txt new file mode 100644 index 0000000000000..83b09c12fa112 --- /dev/null +++ b/tests/baselines/reference/visSyntax.errors.txt @@ -0,0 +1,17 @@ +visSyntax.ts(1,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== visSyntax.ts (1 errors) ==== + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export class C { + } + + export interface I { + + } + + export var x=10; + } + \ No newline at end of file diff --git a/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt index 93c05ff427a3d..4f8d4002ff5a6 100644 --- a/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/voidOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ +voidOperatorWithAnyOtherType.ts(20,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. voidOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. voidOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. voidOperatorWithAnyOtherType.ts(48,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -==== voidOperatorWithAnyOtherType.ts (3 errors) ==== +==== voidOperatorWithAnyOtherType.ts (4 errors) ==== // void operator on any type var ANY: any; @@ -24,6 +25,8 @@ voidOperatorWithAnyOtherType.ts(48,27): error TS2365: Operator '+' cannot be app } } module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var n: any; } var objA = new A(); diff --git a/tests/baselines/reference/voidOperatorWithBooleanType.errors.txt b/tests/baselines/reference/voidOperatorWithBooleanType.errors.txt new file mode 100644 index 0000000000000..bbd36451a5145 --- /dev/null +++ b/tests/baselines/reference/voidOperatorWithBooleanType.errors.txt @@ -0,0 +1,44 @@ +voidOperatorWithBooleanType.ts(10,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== voidOperatorWithBooleanType.ts (1 errors) ==== + // void operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsAny1 = void BOOLEAN; + + // boolean type literal + var ResultIsAny2 = void true; + var ResultIsAny3 = void { x: true, y: false }; + + // boolean type expressions + var ResultIsAny4 = void objA.a; + var ResultIsAny5 = void M.n; + var ResultIsAny6 = void foo(); + var ResultIsAny7 = void A.foo(); + + // multiple void operator + var ResultIsAny8 = void void BOOLEAN; + + // miss assignment operators + void true; + void BOOLEAN; + void foo(); + void true, false; + void objA.a; + void M.n; \ No newline at end of file diff --git a/tests/baselines/reference/voidOperatorWithBooleanType.types b/tests/baselines/reference/voidOperatorWithBooleanType.types index 1dd4655d20984..412d0518b4161 100644 --- a/tests/baselines/reference/voidOperatorWithBooleanType.types +++ b/tests/baselines/reference/voidOperatorWithBooleanType.types @@ -46,6 +46,7 @@ var objA = new A(); // boolean type var var ResultIsAny1 = void BOOLEAN; >ResultIsAny1 : any +> : ^^^ >void BOOLEAN : undefined > : ^^^^^^^^^ >BOOLEAN : boolean @@ -54,6 +55,7 @@ var ResultIsAny1 = void BOOLEAN; // boolean type literal var ResultIsAny2 = void true; >ResultIsAny2 : any +> : ^^^ >void true : undefined > : ^^^^^^^^^ >true : true @@ -61,6 +63,7 @@ var ResultIsAny2 = void true; var ResultIsAny3 = void { x: true, y: false }; >ResultIsAny3 : any +> : ^^^ >void { x: true, y: false } : undefined > : ^^^^^^^^^ >{ x: true, y: false } : { x: boolean; y: boolean; } @@ -77,6 +80,7 @@ var ResultIsAny3 = void { x: true, y: false }; // boolean type expressions var ResultIsAny4 = void objA.a; >ResultIsAny4 : any +> : ^^^ >void objA.a : undefined > : ^^^^^^^^^ >objA.a : boolean @@ -88,6 +92,7 @@ var ResultIsAny4 = void objA.a; var ResultIsAny5 = void M.n; >ResultIsAny5 : any +> : ^^^ >void M.n : undefined > : ^^^^^^^^^ >M.n : boolean @@ -99,6 +104,7 @@ var ResultIsAny5 = void M.n; var ResultIsAny6 = void foo(); >ResultIsAny6 : any +> : ^^^ >void foo() : undefined > : ^^^^^^^^^ >foo() : boolean @@ -108,6 +114,7 @@ var ResultIsAny6 = void foo(); var ResultIsAny7 = void A.foo(); >ResultIsAny7 : any +> : ^^^ >void A.foo() : undefined > : ^^^^^^^^^ >A.foo() : boolean @@ -122,6 +129,7 @@ var ResultIsAny7 = void A.foo(); // multiple void operator var ResultIsAny8 = void void BOOLEAN; >ResultIsAny8 : any +> : ^^^ >void void BOOLEAN : undefined > : ^^^^^^^^^ >void BOOLEAN : undefined diff --git a/tests/baselines/reference/voidOperatorWithNumberType.errors.txt b/tests/baselines/reference/voidOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..de10c4d54e31c --- /dev/null +++ b/tests/baselines/reference/voidOperatorWithNumberType.errors.txt @@ -0,0 +1,51 @@ +voidOperatorWithNumberType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== voidOperatorWithNumberType.ts (1 errors) ==== + // void operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsAny1 = void NUMBER; + var ResultIsAny2 = void NUMBER1; + + // number type literal + var ResultIsAny3 = void 1; + var ResultIsAny4 = void { x: 1, y: 2}; + var ResultIsAny5 = void { x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsAny6 = void objA.a; + var ResultIsAny7 = void M.n; + var ResultIsAny8 = void NUMBER1[0]; + var ResultIsAny9 = void foo(); + var ResultIsAny10 = void A.foo(); + var ResultIsAny11 = void (NUMBER + NUMBER); + + // multiple void operators + var ResultIsAny12 = void void NUMBER; + var ResultIsAny13 = void void void (NUMBER + NUMBER); + + // miss assignment operators + void 1; + void NUMBER; + void NUMBER1; + void foo(); + void objA.a; + void M.n; + void objA.a, M.n; \ No newline at end of file diff --git a/tests/baselines/reference/voidOperatorWithNumberType.types b/tests/baselines/reference/voidOperatorWithNumberType.types index 20fde2f006984..72ee81778221e 100644 --- a/tests/baselines/reference/voidOperatorWithNumberType.types +++ b/tests/baselines/reference/voidOperatorWithNumberType.types @@ -56,6 +56,7 @@ var objA = new A(); // number type var var ResultIsAny1 = void NUMBER; >ResultIsAny1 : any +> : ^^^ >void NUMBER : undefined > : ^^^^^^^^^ >NUMBER : number @@ -63,6 +64,7 @@ var ResultIsAny1 = void NUMBER; var ResultIsAny2 = void NUMBER1; >ResultIsAny2 : any +> : ^^^ >void NUMBER1 : undefined > : ^^^^^^^^^ >NUMBER1 : number[] @@ -71,6 +73,7 @@ var ResultIsAny2 = void NUMBER1; // number type literal var ResultIsAny3 = void 1; >ResultIsAny3 : any +> : ^^^ >void 1 : undefined > : ^^^^^^^^^ >1 : 1 @@ -78,6 +81,7 @@ var ResultIsAny3 = void 1; var ResultIsAny4 = void { x: 1, y: 2}; >ResultIsAny4 : any +> : ^^^ >void { x: 1, y: 2} : undefined > : ^^^^^^^^^ >{ x: 1, y: 2} : { x: number; y: number; } @@ -93,6 +97,7 @@ var ResultIsAny4 = void { x: 1, y: 2}; var ResultIsAny5 = void { x: 1, y: (n: number) => { return n; } }; >ResultIsAny5 : any +> : ^^^ >void { x: 1, y: (n: number) => { return n; } } : undefined > : ^^^^^^^^^ >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } @@ -113,6 +118,7 @@ var ResultIsAny5 = void { x: 1, y: (n: number) => { return n; } }; // number type expressions var ResultIsAny6 = void objA.a; >ResultIsAny6 : any +> : ^^^ >void objA.a : undefined > : ^^^^^^^^^ >objA.a : number @@ -124,6 +130,7 @@ var ResultIsAny6 = void objA.a; var ResultIsAny7 = void M.n; >ResultIsAny7 : any +> : ^^^ >void M.n : undefined > : ^^^^^^^^^ >M.n : number @@ -135,6 +142,7 @@ var ResultIsAny7 = void M.n; var ResultIsAny8 = void NUMBER1[0]; >ResultIsAny8 : any +> : ^^^ >void NUMBER1[0] : undefined > : ^^^^^^^^^ >NUMBER1[0] : number @@ -146,6 +154,7 @@ var ResultIsAny8 = void NUMBER1[0]; var ResultIsAny9 = void foo(); >ResultIsAny9 : any +> : ^^^ >void foo() : undefined > : ^^^^^^^^^ >foo() : number @@ -155,6 +164,7 @@ var ResultIsAny9 = void foo(); var ResultIsAny10 = void A.foo(); >ResultIsAny10 : any +> : ^^^ >void A.foo() : undefined > : ^^^^^^^^^ >A.foo() : number @@ -168,6 +178,7 @@ var ResultIsAny10 = void A.foo(); var ResultIsAny11 = void (NUMBER + NUMBER); >ResultIsAny11 : any +> : ^^^ >void (NUMBER + NUMBER) : undefined > : ^^^^^^^^^ >(NUMBER + NUMBER) : number @@ -182,6 +193,7 @@ var ResultIsAny11 = void (NUMBER + NUMBER); // multiple void operators var ResultIsAny12 = void void NUMBER; >ResultIsAny12 : any +> : ^^^ >void void NUMBER : undefined > : ^^^^^^^^^ >void NUMBER : undefined @@ -191,6 +203,7 @@ var ResultIsAny12 = void void NUMBER; var ResultIsAny13 = void void void (NUMBER + NUMBER); >ResultIsAny13 : any +> : ^^^ >void void void (NUMBER + NUMBER) : undefined > : ^^^^^^^^^ >void void (NUMBER + NUMBER) : undefined diff --git a/tests/baselines/reference/voidOperatorWithStringType.errors.txt b/tests/baselines/reference/voidOperatorWithStringType.errors.txt new file mode 100644 index 0000000000000..27d5bb66e6371 --- /dev/null +++ b/tests/baselines/reference/voidOperatorWithStringType.errors.txt @@ -0,0 +1,50 @@ +voidOperatorWithStringType.ts(11,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== voidOperatorWithStringType.ts (1 errors) ==== + // void operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + ~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsAny1 = void STRING; + var ResultIsAny2 = void STRING1; + + // string type literal + var ResultIsAny3 = void ""; + var ResultIsAny4 = void { x: "", y: "" }; + var ResultIsAny5 = void { x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsAny6 = void objA.a; + var ResultIsAny7 = void M.n; + var ResultIsAny8 = void STRING1[0]; + var ResultIsAny9 = void foo(); + var ResultIsAny10 = void A.foo(); + var ResultIsAny11 = void (STRING + STRING); + var ResultIsAny12 = void STRING.charAt(0); + + // multiple void operators + var ResultIsAny13 = void void STRING; + var ResultIsAny14 = void void void (STRING + STRING); + + // miss assignment operators + void ""; + void STRING; + void STRING1; + void foo(); + void objA.a,M.n; \ No newline at end of file diff --git a/tests/baselines/reference/voidOperatorWithStringType.types b/tests/baselines/reference/voidOperatorWithStringType.types index cedab63d9e631..ab6afa26c9d4e 100644 --- a/tests/baselines/reference/voidOperatorWithStringType.types +++ b/tests/baselines/reference/voidOperatorWithStringType.types @@ -56,6 +56,7 @@ var objA = new A(); // string type var var ResultIsAny1 = void STRING; >ResultIsAny1 : any +> : ^^^ >void STRING : undefined > : ^^^^^^^^^ >STRING : string @@ -63,6 +64,7 @@ var ResultIsAny1 = void STRING; var ResultIsAny2 = void STRING1; >ResultIsAny2 : any +> : ^^^ >void STRING1 : undefined > : ^^^^^^^^^ >STRING1 : string[] @@ -71,6 +73,7 @@ var ResultIsAny2 = void STRING1; // string type literal var ResultIsAny3 = void ""; >ResultIsAny3 : any +> : ^^^ >void "" : undefined > : ^^^^^^^^^ >"" : "" @@ -78,6 +81,7 @@ var ResultIsAny3 = void ""; var ResultIsAny4 = void { x: "", y: "" }; >ResultIsAny4 : any +> : ^^^ >void { x: "", y: "" } : undefined > : ^^^^^^^^^ >{ x: "", y: "" } : { x: string; y: string; } @@ -93,6 +97,7 @@ var ResultIsAny4 = void { x: "", y: "" }; var ResultIsAny5 = void { x: "", y: (s: string) => { return s; } }; >ResultIsAny5 : any +> : ^^^ >void { x: "", y: (s: string) => { return s; } } : undefined > : ^^^^^^^^^ >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } @@ -113,6 +118,7 @@ var ResultIsAny5 = void { x: "", y: (s: string) => { return s; } }; // string type expressions var ResultIsAny6 = void objA.a; >ResultIsAny6 : any +> : ^^^ >void objA.a : undefined > : ^^^^^^^^^ >objA.a : string @@ -124,6 +130,7 @@ var ResultIsAny6 = void objA.a; var ResultIsAny7 = void M.n; >ResultIsAny7 : any +> : ^^^ >void M.n : undefined > : ^^^^^^^^^ >M.n : string @@ -135,6 +142,7 @@ var ResultIsAny7 = void M.n; var ResultIsAny8 = void STRING1[0]; >ResultIsAny8 : any +> : ^^^ >void STRING1[0] : undefined > : ^^^^^^^^^ >STRING1[0] : string @@ -146,6 +154,7 @@ var ResultIsAny8 = void STRING1[0]; var ResultIsAny9 = void foo(); >ResultIsAny9 : any +> : ^^^ >void foo() : undefined > : ^^^^^^^^^ >foo() : string @@ -155,6 +164,7 @@ var ResultIsAny9 = void foo(); var ResultIsAny10 = void A.foo(); >ResultIsAny10 : any +> : ^^^ >void A.foo() : undefined > : ^^^^^^^^^ >A.foo() : string @@ -168,6 +178,7 @@ var ResultIsAny10 = void A.foo(); var ResultIsAny11 = void (STRING + STRING); >ResultIsAny11 : any +> : ^^^ >void (STRING + STRING) : undefined > : ^^^^^^^^^ >(STRING + STRING) : string @@ -181,6 +192,7 @@ var ResultIsAny11 = void (STRING + STRING); var ResultIsAny12 = void STRING.charAt(0); >ResultIsAny12 : any +> : ^^^ >void STRING.charAt(0) : undefined > : ^^^^^^^^^ >STRING.charAt(0) : string @@ -197,6 +209,7 @@ var ResultIsAny12 = void STRING.charAt(0); // multiple void operators var ResultIsAny13 = void void STRING; >ResultIsAny13 : any +> : ^^^ >void void STRING : undefined > : ^^^^^^^^^ >void STRING : undefined @@ -206,6 +219,7 @@ var ResultIsAny13 = void void STRING; var ResultIsAny14 = void void void (STRING + STRING); >ResultIsAny14 : any +> : ^^^ >void void void (STRING + STRING) : undefined > : ^^^^^^^^^ >void void (STRING + STRING) : undefined diff --git a/tests/baselines/reference/withExportDecl.errors.txt b/tests/baselines/reference/withExportDecl.errors.txt new file mode 100644 index 0000000000000..6695d29962a6d --- /dev/null +++ b/tests/baselines/reference/withExportDecl.errors.txt @@ -0,0 +1,70 @@ +withExportDecl.ts(38,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +withExportDecl.ts(43,23): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. +withExportDecl.ts(49,15): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== withExportDecl.ts (3 errors) ==== + var simpleVar; + export var exportedSimpleVar; + + var anotherVar: any; + var varWithSimpleType: number; + var varWithArrayType: number[]; + + var varWithInitialValue = 30; + export var exportedVarWithInitialValue = 70; + + var withComplicatedValue = { x: 30, y: 70, desc: "position" }; + export var exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; + + declare var declaredVar; + declare var declareVar2 + + declare var declaredVar; + declare var deckareVarWithType: number; + export declare var exportedDeclaredVar: number; + + var arrayVar: string[] = ['a', 'b']; + + export var exportedArrayVar: { x: number; y: string; }[] ; + exportedArrayVar.push({ x: 30, y : 'hello world' }); + + function simpleFunction() { + return { + x: "Hello", + y: "word", + n: 2 + }; + } + + export function exportedFunction() { + return simpleFunction(); + } + + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { + return "Hello"; + } + } + export declare module m2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export var a: number; + } + + + export module m3 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + export function foo() { + return m1.foo(); + } + } + + export var eVar1, eVar2 = 10; + var eVar22; + export var eVar3 = 10, eVar4, eVar5; \ No newline at end of file diff --git a/tests/baselines/reference/withExportDecl.types b/tests/baselines/reference/withExportDecl.types index 1d45b9b0fc6f7..ea8e810c7e6d7 100644 --- a/tests/baselines/reference/withExportDecl.types +++ b/tests/baselines/reference/withExportDecl.types @@ -3,12 +3,15 @@ === withExportDecl.ts === var simpleVar; >simpleVar : any +> : ^^^ export var exportedSimpleVar; >exportedSimpleVar : any +> : ^^^ var anotherVar: any; >anotherVar : any +> : ^^^ var varWithSimpleType: number; >varWithSimpleType : number @@ -68,12 +71,15 @@ export var exportedWithComplicatedValue = { x: 30, y: 70, desc: "position" }; declare var declaredVar; >declaredVar : any +> : ^^^ declare var declareVar2 >declareVar2 : any +> : ^^^ declare var declaredVar; >declaredVar : any +> : ^^^ declare var deckareVarWithType: number; >deckareVarWithType : number @@ -206,6 +212,7 @@ export module m3 { export var eVar1, eVar2 = 10; >eVar1 : any +> : ^^^ >eVar2 : number > : ^^^^^^ >10 : 10 @@ -213,6 +220,7 @@ export var eVar1, eVar2 = 10; var eVar22; >eVar22 : any +> : ^^^ export var eVar3 = 10, eVar4, eVar5; >eVar3 : number @@ -220,5 +228,7 @@ export var eVar3 = 10, eVar4, eVar5; >10 : 10 > : ^^ >eVar4 : any +> : ^^^ >eVar5 : any +> : ^^^ diff --git a/tests/baselines/reference/withImportDecl.errors.txt b/tests/baselines/reference/withImportDecl.errors.txt new file mode 100644 index 0000000000000..4be9eebe55cd8 --- /dev/null +++ b/tests/baselines/reference/withImportDecl.errors.txt @@ -0,0 +1,47 @@ +withImportDecl_1.ts(29,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + + +==== withImportDecl_1.ts (1 errors) ==== + /// + var simpleVar; + + var anotherVar: any; + var varWithSimpleType: number; + var varWithArrayType: number[]; + + var varWithInitialValue = 30; + + var withComplicatedValue = { x: 30, y: 70, desc: "position" }; + + declare var declaredVar; + declare var declareVar2 + + declare var declaredVar; + declare var deckareVarWithType: number; + + var arrayVar: string[] = ['a', 'b']; + + + function simpleFunction() { + return { + x: "Hello", + y: "word", + n: 2 + }; + } + + module m1 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. + export function foo() { + return "Hello"; + } + } + + import m3 = require("withImportDecl_0"); + + var b = new m3.A(); + b.foo; +==== withImportDecl_0.ts (0 errors) ==== + export class A { foo: string; } + \ No newline at end of file diff --git a/tests/baselines/reference/withImportDecl.types b/tests/baselines/reference/withImportDecl.types index 7fc757fb6324f..74beeb81d468b 100644 --- a/tests/baselines/reference/withImportDecl.types +++ b/tests/baselines/reference/withImportDecl.types @@ -4,9 +4,11 @@ /// var simpleVar; >simpleVar : any +> : ^^^ var anotherVar: any; >anotherVar : any +> : ^^^ var varWithSimpleType: number; >varWithSimpleType : number @@ -42,12 +44,15 @@ var withComplicatedValue = { x: 30, y: 70, desc: "position" }; declare var declaredVar; >declaredVar : any +> : ^^^ declare var declareVar2 >declareVar2 : any +> : ^^^ declare var declaredVar; >declaredVar : any +> : ^^^ declare var deckareVarWithType: number; >deckareVarWithType : number diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index 603db90af980e..04678c0338c4c 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -17,11 +17,12 @@ witness.ts(57,5): error TS2403: Subsequent variable declarations must have the s witness.ts(58,12): error TS2873: This kind of expression is always falsy. witness.ts(68,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fnCallResult' must be of type 'never', but here has type 'any'. witness.ts(110,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'. +witness.ts(113,8): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. witness.ts(121,14): error TS2729: Property 'n' is used before its initialization. witness.ts(128,19): error TS2729: Property 'q' is used before its initialization. -==== witness.ts (21 errors) ==== +==== witness.ts (22 errors) ==== // Initializers var varInit = varInit; // any var pInit: any; @@ -183,6 +184,8 @@ witness.ts(128,19): error TS2729: Property 'q' is used before its initialization // Property access of module member module M2 { + ~~ +!!! error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled. export var x = M2.x; var y = x; var y: any;