Merge branch 'master' into glob2

This commit is contained in:
Ron Buckton committed 2015-12-07 15:15:22 -08:00
commit 5de2fcc100
257 files changed
+3300 -846

No files matched your search

@@ -0,0 +1,23 @@
tests/cases/compiler/ClassDeclaration26.ts(2,22): error TS1005: ';' expected.
tests/cases/compiler/ClassDeclaration26.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/ClassDeclaration26.ts(4,20): error TS1005: '=' expected.
tests/cases/compiler/ClassDeclaration26.ts(4,23): error TS1005: '=>' expected.
tests/cases/compiler/ClassDeclaration26.ts(5,1): error TS1128: Declaration or statement expected.
==== tests/cases/compiler/ClassDeclaration26.ts (5 errors) ====
class C {
public const var export foo = 10;
~~~~~~
!!! error TS1005: ';' expected.
var constructor() { }
~~~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~
!!! error TS1005: '=' expected.
~
!!! error TS1005: '=>' expected.
}
~
!!! error TS1128: Declaration or statement expected.
@@ -0,0 +1,15 @@
//// [ClassDeclaration26.ts]
class C {
public const var export foo = 10;
var constructor() { }
}
//// [ClassDeclaration26.js]
var C = (function () {
function C() {
this.foo = 10;
}
return C;
})();
var constructor = function () { };
@@ -0,0 +1,9 @@
tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts(2,3): error TS1248: A class member cannot have the 'const' keyword.
==== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts (1 errors) ====
class AtomicNumbers {
static const H = 1;
~~~~~~~~~~~~~~~~~~~
!!! error TS1248: A class member cannot have the 'const' keyword.
}
@@ -0,0 +1,12 @@
//// [ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts]
class AtomicNumbers {
static const H = 1;
}
//// [ClassDeclarationWithInvalidConstOnPropertyDeclaration.js]
var AtomicNumbers = (function () {
function AtomicNumbers() {
}
AtomicNumbers.H = 1;
return AtomicNumbers;
})();
@@ -0,0 +1,13 @@
//// [ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts]
class C {
const
x = 10;
}
//// [ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js]
var C = (function () {
function C() {
this.x = 10;
}
return C;
})();
@@ -0,0 +1,10 @@
=== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts ===
class C {
>C : Symbol(C, Decl(ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts, 0, 0))
const
>const : Symbol(const, Decl(ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts, 0, 9))
x = 10;
>x : Symbol(x, Decl(ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts, 1, 9))
}
@@ -0,0 +1,11 @@
=== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.ts ===
class C {
>C : C
const
>const : any
x = 10;
>x : number
>10 : number
}
@@ -11,11 +11,13 @@ define(["require", "exports"], function (require, exports) {
"use strict";
class default_1 {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
//// [b.js]
define(["require", "exports"], function (require, exports) {
"use strict";
function default_1() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
@@ -10,8 +10,10 @@ export default function() {}
"use strict";
class default_1 {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
//// [b.js]
"use strict";
function default_1() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
@@ -18,6 +18,7 @@ export default function() {}
"use strict";
class default_1 {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
//// [b.js]
@@ -31,5 +32,6 @@ export default function() {}
})(function (require, exports) {
"use strict";
function default_1() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
@@ -1,11 +1,19 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Type 'S2' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Type '(x: string) => number' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
Type '(x: string) => string' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'.
Type 'S2' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => number' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => string' provides no match for the signature 'new (x: number): void'
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ====
@@ -39,25 +47,33 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
t = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Type 'S2' provides no match for the signature 'new (x: number): void'
t = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
!!! error TS2322: Type '(x: string) => number' provides no match for the signature 'new (x: number): void'
t = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
!!! error TS2322: Type '(x: string) => string' provides no match for the signature 'new (x: number): void'
a = s2;
~
!!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type 'S2' provides no match for the signature 'new (x: number): void'
a = a3;
~
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => number' provides no match for the signature 'new (x: number): void'
a = function (x: string) { return ''; }
~
!!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => string' provides no match for the signature 'new (x: number): void'
@@ -9,9 +9,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'.
@@ -19,9 +21,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
Types of property 'f' are incompatible.
Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
Property 'f' is missing in type '(x: string) => number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'.
@@ -79,11 +83,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
t = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
t = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'.
@@ -97,11 +103,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
a = a3;
~
!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'.
!!! error TS2322: Types of property 'f' are incompatible.
!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'.
!!! error TS2322: Type '(x: string) => void' provides no match for the signature 'new (x: number): void'
a = (x: string) => 1;
~
!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'.
@@ -11,12 +11,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
Type '(a: any) => any' provides no match for the signature 'new (a: number): number'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
Types of parameters 'x' and 'x' are incompatible.
Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
Type '(a: any) => any' provides no match for the signature 'new <T extends Derived>(a: T): T'
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
Types of parameters 'x' and 'x' are incompatible.
Type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }' is not assignable to type '(a: any) => any'.
@@ -116,6 +118,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'.
!!! error TS2322: Type '(a: any) => any' provides no match for the signature 'new (a: number): number'
b16 = a16; // error
~~~
!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => T[]'.
@@ -128,6 +131,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
!!! error TS2322: Type 'new <T>(x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }'.
!!! error TS2322: Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }'.
!!! error TS2322: Type '(a: any) => any' provides no match for the signature 'new <T extends Derived>(a: T): T'
b17 = a17; // error
~~~
!!! error TS2322: Type '{ new (x: { new <T extends Derived>(a: T): T; new <T extends Base>(a: T): T; }): any[]; new (x: { new <T extends Derived2>(a: T): T; new <T extends Base>(a: T): T; }): any[]; }' is not assignable to type 'new <T>(x: (a: T) => T) => any[]'.
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'
==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'
==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tstring>(a: Tstring) => Tstring'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tstring>(a: Tstring): Tstring'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tnumber>(a: Tnumber): Tnumber'
==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__obj = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '<Tnumber>(a: Tnumber) => Tnumber'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature '<Tnumber>(a: Tnumber): Tnumber'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tnumber>(param: Tnumber): any'
==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tnumber>(param: Tnumber) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tnumber>(param: Tnumber): any'
@@ -1,4 +1,5 @@
tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tstring>(param: Tstring): any'
==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ====
@@ -12,4 +13,5 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'inte
}
__test2__.__val__aa = __test1__.__val__obj4
~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type 'new <Tstring>(param: Tstring) => any'.
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' provides no match for the signature 'new <Tstring>(param: Tstring): any'
@@ -1,5 +1,7 @@
tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'.
Type 'new () => any' provides no match for the signature '(): void'
tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'.
Type '() => void' provides no match for the signature 'new (): any'
==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ====
@@ -12,6 +14,8 @@ tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() =>
foo = bar; // error
~~~
!!! error TS2322: Type 'new () => any' is not assignable to type '() => void'.
!!! error TS2322: Type 'new () => any' provides no match for the signature '(): void'
bar = foo; // error
~~~
!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'.
!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'.
!!! error TS2322: Type '() => void' provides no match for the signature 'new (): any'
@@ -16,17 +16,17 @@ export var pi = Math.PI;
export var y = x * i;
//// [concat.js]
define("tests/cases/compiler/baz", ["require", "exports", "tests/cases/compiler/a/bar", "tests/cases/compiler/a/foo"], function (require, exports, bar_1, foo_1) {
define("baz", ["require", "exports", "a/bar", "a/foo"], function (require, exports, bar_1, foo_1) {
"use strict";
exports.pi = Math.PI;
exports.y = bar_1.x * foo_1.i;
});
define("tests/cases/compiler/a/foo", ["require", "exports", "tests/cases/compiler/baz"], function (require, exports, baz_1) {
define("a/foo", ["require", "exports", "baz"], function (require, exports, baz_1) {
"use strict";
exports.i = Math.sqrt(-1);
exports.z = baz_1.pi * baz_1.pi;
});
define("tests/cases/compiler/a/bar", ["require", "exports", "tests/cases/compiler/a/foo"], function (require, exports, foo_2) {
define("a/bar", ["require", "exports", "a/foo"], function (require, exports, foo_2) {
"use strict";
exports.x = foo_2.z + foo_2.z;
});
@@ -1,10 +1,12 @@
tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'.
Type '() => { name: string; }' provides no match for the signature 'new (): { name: string; }'
==== tests/cases/compiler/constructorAsType.ts (1 errors) ====
var Person:new () => {name: string;} = function () {return {name:"joe"};};
~~~~~~
!!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'.
!!! error TS2322: Type '() => { name: string; }' provides no match for the signature 'new (): { name: string; }'
var Person2:{new() : {name:string;};};
@@ -28,6 +28,7 @@ define(["require", "exports"], function (require, exports) {
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
@@ -45,5 +46,6 @@ define(["require", "exports"], function (require, exports) {
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
@@ -27,6 +27,7 @@ let Foo = class {
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
//// [b.js]
"use strict";
@@ -42,4 +43,5 @@ let default_1 = class {
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
@@ -35,6 +35,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
@@ -59,5 +60,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
@@ -12,11 +12,13 @@ define(["require", "exports"], function (require, exports) {
"use strict";
class Foo {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
define(["require", "exports"], function (require, exports) {
"use strict";
function foo() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = foo;
});
@@ -11,8 +11,10 @@ export default function foo() {}
"use strict";
class Foo {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
//// [b.js]
"use strict";
function foo() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = foo;
@@ -19,6 +19,7 @@ export default function foo() {}
"use strict";
class Foo {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
@@ -32,5 +33,6 @@ export default function foo() {}
})(function (require, exports) {
"use strict";
function foo() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = foo;
});
@@ -0,0 +1,23 @@
//// [enumExportMergingES6.ts]
export enum Animals {
Cat = 1
}
export enum Animals {
Dog = 2
}
export enum Animals {
CatDog = Cat | Dog
}
//// [enumExportMergingES6.js]
export var Animals;
(function (Animals) {
Animals[Animals["Cat"] = 1] = "Cat";
})(Animals || (Animals = {}));
(function (Animals) {
Animals[Animals["Dog"] = 2] = "Dog";
})(Animals || (Animals = {}));
(function (Animals) {
Animals[Animals["CatDog"] = 3] = "CatDog";
})(Animals || (Animals = {}));
@@ -0,0 +1,22 @@
=== tests/cases/conformance/enums/enumExportMergingES6.ts ===
export enum Animals {
>Animals : Symbol(Animals, Decl(enumExportMergingES6.ts, 0, 0), Decl(enumExportMergingES6.ts, 2, 1), Decl(enumExportMergingES6.ts, 5, 1))
Cat = 1
>Cat : Symbol(Animals.Cat, Decl(enumExportMergingES6.ts, 0, 21))
}
export enum Animals {
>Animals : Symbol(Animals, Decl(enumExportMergingES6.ts, 0, 0), Decl(enumExportMergingES6.ts, 2, 1), Decl(enumExportMergingES6.ts, 5, 1))
Dog = 2
>Dog : Symbol(Animals.Dog, Decl(enumExportMergingES6.ts, 3, 21))
}
export enum Animals {
>Animals : Symbol(Animals, Decl(enumExportMergingES6.ts, 0, 0), Decl(enumExportMergingES6.ts, 2, 1), Decl(enumExportMergingES6.ts, 5, 1))
CatDog = Cat | Dog
>CatDog : Symbol(Animals.CatDog, Decl(enumExportMergingES6.ts, 6, 21))
>Cat : Symbol(Animals.Cat, Decl(enumExportMergingES6.ts, 0, 21))
>Dog : Symbol(Animals.Dog, Decl(enumExportMergingES6.ts, 3, 21))
}
@@ -0,0 +1,25 @@
=== tests/cases/conformance/enums/enumExportMergingES6.ts ===
export enum Animals {
>Animals : Animals
Cat = 1
>Cat : Animals
>1 : number
}
export enum Animals {
>Animals : Animals
Dog = 2
>Dog : Animals
>2 : number
}
export enum Animals {
>Animals : Animals
CatDog = Cat | Dog
>CatDog : Animals
>Cat | Dog : number
>Cat : Animals
>Dog : Animals
}
@@ -27,6 +27,7 @@ var x1: number = m;
exports.a = 10;
exports.x = exports.a;
exports.m = exports.a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {};
//// [es6ImportDefaultBindingFollowedWithNamedImport_1.js]
"use strict";
@@ -1,15 +1,21 @@
tests/cases/compiler/client.ts(1,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(2,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(3,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(3,34): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
tests/cases/compiler/client.ts(4,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(5,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(5,34): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
tests/cases/compiler/client.ts(6,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(7,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(7,34): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'x'.
tests/cases/compiler/client.ts(7,37): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
tests/cases/compiler/client.ts(8,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(9,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(9,34): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'x'.
tests/cases/compiler/client.ts(10,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(11,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(11,34): error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'm'.
tests/cases/compiler/client.ts(12,12): error TS2323: Cannot redeclare exported variable 'x1'.
==== tests/cases/compiler/server.ts (0 errors) ====
@@ -17,23 +23,29 @@ tests/cases/compiler/client.ts(11,34): error TS2305: Module '"tests/cases/compil
var a = 10;
export default a;
==== tests/cases/compiler/client.ts (12 errors) ====
==== tests/cases/compiler/client.ts (18 errors) ====
export import defaultBinding1, { } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = defaultBinding1;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding2, { a } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
~
!!! error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
export var x1: number = defaultBinding2;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding3, { a as b } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
~
!!! error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
export var x1: number = defaultBinding3;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding4, { x, a as y } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
@@ -42,16 +54,22 @@ tests/cases/compiler/client.ts(11,34): error TS2305: Module '"tests/cases/compil
~
!!! error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'a'.
export var x1: number = defaultBinding4;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding5, { x as z, } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
~
!!! error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'x'.
export var x1: number = defaultBinding5;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding6, { m, } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
~
!!! error TS2305: Module '"tests/cases/compiler/server"' has no exported member 'm'.
export var x1: number = defaultBinding6;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
@@ -1,9 +1,15 @@
tests/cases/compiler/client.ts(1,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(2,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(3,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(4,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(5,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(6,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(7,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(8,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(9,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(10,12): error TS2323: Cannot redeclare exported variable 'x1'.
tests/cases/compiler/client.ts(11,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(12,12): error TS2323: Cannot redeclare exported variable 'x1'.
==== tests/cases/compiler/server.ts (0 errors) ====
@@ -13,7 +19,7 @@ tests/cases/compiler/client.ts(11,1): error TS1191: An import declaration cannot
export var m = a;
export default {};
==== tests/cases/compiler/client.ts (6 errors) ====
==== tests/cases/compiler/client.ts (12 errors) ====
export import defaultBinding1, { } from "server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
@@ -21,21 +27,33 @@ tests/cases/compiler/client.ts(11,1): error TS1191: An import declaration cannot
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = a;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding3, { a as b } from "server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = b;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding4, { x, a as y } from "server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = x;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export var x1: number = y;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding5, { x as z, } from "server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = z;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
export import defaultBinding6, { m, } from "server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var x1: number = m;
~~
!!! error TS2323: Cannot redeclare exported variable 'x1'.
@@ -1,11 +1,21 @@
tests/cases/compiler/client.ts(1,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(2,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(3,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(4,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(5,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(6,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(7,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(8,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(9,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(10,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(11,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(12,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(13,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(14,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(15,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(16,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(17,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(18,12): error TS2323: Cannot redeclare exported variable 'xxxx'.
tests/cases/compiler/client.ts(19,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(21,1): error TS1191: An import declaration cannot have modifiers.
tests/cases/compiler/client.ts(25,1): error TS1191: An import declaration cannot have modifiers.
@@ -23,7 +33,7 @@ tests/cases/compiler/client.ts(26,1): error TS1191: An import declaration cannot
export var z2 = 10;
export var aaaa = 10;
==== tests/cases/compiler/client.ts (12 errors) ====
==== tests/cases/compiler/client.ts (22 errors) ====
export import { } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
@@ -31,33 +41,53 @@ tests/cases/compiler/client.ts(26,1): error TS1191: An import declaration cannot
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = a;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { a as b } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = b;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { x, a as y } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = x;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export var xxxx = y;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { x as z, } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = z;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { m, } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = m;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { a1, x1 } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = a1;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export var xxxx = x1;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { a1 as a11, x1 as x11 } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
export var xxxx = a11;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export var xxxx = x11;
~~~~
!!! error TS2323: Cannot redeclare exported variable 'xxxx'.
export import { z1 } from "./server";
~~~~~~
!!! error TS1191: An import declaration cannot have modifiers.
@@ -58,7 +58,6 @@ export var M;
// alias
M.M_A = M_M;
})(M || (M = {}));
export var M;
(function (M) {
// Reexports
export { M_V as v };
@@ -1,4 +1,6 @@
tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export.
tests/cases/conformance/es6/modules/t4.ts(3,1): error TS2308: Module "./t1" has already exported a member named 'x'. Consider explicitly re-exporting to resolve the ambiguity.
tests/cases/conformance/es6/modules/t4.ts(3,1): error TS2308: Module "./t1" has already exported a member named 'y'. Consider explicitly re-exporting to resolve the ambiguity.
==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ====
@@ -16,10 +18,14 @@ tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/c
var z = "z";
export { x, y, z };
==== tests/cases/conformance/es6/modules/t4.ts (0 errors) ====
==== tests/cases/conformance/es6/modules/t4.ts (2 errors) ====
export * from "./t1";
export * from "./t2";
export * from "./t3";
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2308: Module "./t1" has already exported a member named 'x'. Consider explicitly re-exporting to resolve the ambiguity.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2308: Module "./t1" has already exported a member named 'y'. Consider explicitly re-exporting to resolve the ambiguity.
==== tests/cases/conformance/es6/modules/main.ts (1 errors) ====
import hello, { x, y, z, foo } from "./t4";
@@ -1,4 +1,6 @@
tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/cases/conformance/es6/modules/t4"' has no default export.
tests/cases/conformance/es6/modules/t4.ts(3,1): error TS2308: Module "./t1" has already exported a member named 'x'. Consider explicitly re-exporting to resolve the ambiguity.
tests/cases/conformance/es6/modules/t4.ts(3,1): error TS2308: Module "./t1" has already exported a member named 'y'. Consider explicitly re-exporting to resolve the ambiguity.
==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ====
@@ -16,10 +18,14 @@ tests/cases/conformance/es6/modules/main.ts(1,8): error TS1192: Module '"tests/c
var z = "z";
export { x, y, z };
==== tests/cases/conformance/es6/modules/t4.ts (0 errors) ====
==== tests/cases/conformance/es6/modules/t4.ts (2 errors) ====
export * from "./t1";
export * from "./t2";
export * from "./t3";
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2308: Module "./t1" has already exported a member named 'x'. Consider explicitly re-exporting to resolve the ambiguity.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2308: Module "./t1" has already exported a member named 'y'. Consider explicitly re-exporting to resolve the ambiguity.
==== tests/cases/conformance/es6/modules/main.ts (1 errors) ====
import hello, { x, y, z, foo } from "./t4";
@@ -41,6 +41,7 @@ export { a, b, c, d, e1, e2, f1, f2 };
//// [t1.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = "hello";
//// [t3.js]
"use strict";
@@ -0,0 +1,27 @@
//// [extendConstructSignatureInInterface.ts]
interface C {
new(x: number): C;
}
var CStatic: C;
class E extends CStatic {
}
var e: E = new E(1);
//// [extendConstructSignatureInInterface.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var CStatic;
var E = (function (_super) {
__extends(E, _super);
function E() {
_super.apply(this, arguments);
}
return E;
})(CStatic);
var e = new E(1);
@@ -0,0 +1,23 @@
=== tests/cases/compiler/extendConstructSignatureInInterface.ts ===
interface C {
>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0))
new(x: number): C;
>x : Symbol(x, Decl(extendConstructSignatureInInterface.ts, 1, 8))
>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0))
}
var CStatic: C;
>CStatic : Symbol(CStatic, Decl(extendConstructSignatureInInterface.ts, 4, 3))
>C : Symbol(C, Decl(extendConstructSignatureInInterface.ts, 0, 0))
class E extends CStatic {
>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15))
>CStatic : Symbol(CStatic, Decl(extendConstructSignatureInInterface.ts, 4, 3))
}
var e: E = new E(1);
>e : Symbol(e, Decl(extendConstructSignatureInInterface.ts, 8, 3))
>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15))
>E : Symbol(E, Decl(extendConstructSignatureInInterface.ts, 4, 15))
@@ -0,0 +1,25 @@
=== tests/cases/compiler/extendConstructSignatureInInterface.ts ===
interface C {
>C : C
new(x: number): C;
>x : number
>C : C
}
var CStatic: C;
>CStatic : C
>C : C
class E extends CStatic {
>E : E
>CStatic : C
}
var e: E = new E(1);
>e : E
>E : E
>new E(1) : E
>E : typeof E
>1 : number
@@ -10,7 +10,7 @@ function foo() {
//// [a.js]
define("tests/cases/compiler/a", ["require", "exports"], function (require, exports) {
define("a", ["require", "exports"], function (require, exports) {
"use strict";
var c = (function () {
function c() {
@@ -3,15 +3,21 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
Type 'Function' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(24,15): error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
Types of parameters 'x' and 'x' are incompatible.
Type 'string[]' is not assignable to type 'string'.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(25,15): error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'.
Type 'typeof C' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(26,15): error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
Type 'new (x: string) => string' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(28,16): error TS2345: Argument of type '<U, V>(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(29,16): error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
Type 'typeof C2' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(30,16): error TS2345: Argument of type 'new <T>(x: T) => T' is not assignable to parameter of type '(x: string) => string'.
Type 'new <T>(x: T) => T' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(34,16): error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'.
Type 'F2' provides no match for the signature '(x: string): string'
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(36,38): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'.
Type '() => void' is not assignable to type '(x: string) => string'.
@@ -51,6 +57,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
var r = foo2(new Function());
~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'Function' provides no match for the signature '(x: string): string'
var r2 = foo2((x: string[]) => x);
~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'.
@@ -59,9 +66,11 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
var r6 = foo2(C);
~
!!! error TS2345: Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'typeof C' provides no match for the signature '(x: string): string'
var r7 = foo2(b);
~
!!! error TS2345: Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'new (x: string) => string' provides no match for the signature '(x: string): string'
var r8 = foo2(<U>(x: U) => x); // no error expected
var r11 = foo2(<U, V>(x: U, y: V) => x);
~~~~~~~~~~~~~~~~~~~~~~~
@@ -69,15 +78,18 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain
var r13 = foo2(C2);
~~
!!! error TS2345: Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'typeof C2' provides no match for the signature '(x: string): string'
var r14 = foo2(b2);
~~
!!! error TS2345: Argument of type 'new <T>(x: T) => T' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'new <T>(x: T) => T' provides no match for the signature '(x: string): string'
interface F2 extends Function { foo: string; }
var f2: F2;
var r16 = foo2(f2);
~~
!!! error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'.
!!! error TS2345: Type 'F2' provides no match for the signature '(x: string): string'
function fff<T extends { (): void }, U extends T>(x: T, y: U) {
~~~~~~~~~~~
@@ -1,4 +1,5 @@
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'.
Type 'IterableIterator<(x: any) => any>' provides no match for the signature '(): Iterable<(x: string) => number>'
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts (1 errors) ====
@@ -10,4 +11,5 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts(2,11): erro
} ()
~~~~~~~~
!!! error TS2322: Type 'IterableIterator<(x: any) => any>' is not assignable to type '() => Iterable<(x: string) => number>'.
!!! error TS2322: Type 'IterableIterator<(x: any) => any>' provides no match for the signature '(): Iterable<(x: string) => number>'
}
@@ -0,0 +1,32 @@
//// [genericSignatureIdentity.ts]
// This test is here to remind us of our current limits of type identity checking.
// Ideally all of the below declarations would be considered different (and thus errors)
// but they aren't because we erase type parameters to type any and don't check that
// constraints are identical.
var x: {
<T extends Date>(x: T): T;
};
var x: {
<T extends number>(x: T): T;
};
var x: {
<T>(x: T): T;
};
var x: {
<T>(x: any): any;
};
//// [genericSignatureIdentity.js]
// This test is here to remind us of our current limits of type identity checking.
// Ideally all of the below declarations would be considered different (and thus errors)
// but they aren't because we erase type parameters to type any and don't check that
// constraints are identical.
var x;
var x;
var x;
var x;
@@ -0,0 +1,49 @@
=== tests/cases/compiler/genericSignatureIdentity.ts ===
// This test is here to remind us of our current limits of type identity checking.
// Ideally all of the below declarations would be considered different (and thus errors)
// but they aren't because we erase type parameters to type any and don't check that
// constraints are identical.
var x: {
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 5, 3), Decl(genericSignatureIdentity.ts, 9, 3), Decl(genericSignatureIdentity.ts, 13, 3), Decl(genericSignatureIdentity.ts, 17, 3))
<T extends Date>(x: T): T;
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5))
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 6, 21))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5))
};
var x: {
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 5, 3), Decl(genericSignatureIdentity.ts, 9, 3), Decl(genericSignatureIdentity.ts, 13, 3), Decl(genericSignatureIdentity.ts, 17, 3))
<T extends number>(x: T): T;
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 10, 5))
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 10, 23))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 10, 5))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 10, 5))
};
var x: {
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 5, 3), Decl(genericSignatureIdentity.ts, 9, 3), Decl(genericSignatureIdentity.ts, 13, 3), Decl(genericSignatureIdentity.ts, 17, 3))
<T>(x: T): T;
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 14, 5))
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 14, 8))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 14, 5))
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 14, 5))
};
var x: {
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 5, 3), Decl(genericSignatureIdentity.ts, 9, 3), Decl(genericSignatureIdentity.ts, 13, 3), Decl(genericSignatureIdentity.ts, 17, 3))
<T>(x: any): any;
>T : Symbol(T, Decl(genericSignatureIdentity.ts, 18, 5))
>x : Symbol(x, Decl(genericSignatureIdentity.ts, 18, 8))
};
@@ -0,0 +1,49 @@
=== tests/cases/compiler/genericSignatureIdentity.ts ===
// This test is here to remind us of our current limits of type identity checking.
// Ideally all of the below declarations would be considered different (and thus errors)
// but they aren't because we erase type parameters to type any and don't check that
// constraints are identical.
var x: {
>x : <T extends Date>(x: T) => T
<T extends Date>(x: T): T;
>T : T
>Date : Date
>x : T
>T : T
>T : T
};
var x: {
>x : <T extends Date>(x: T) => T
<T extends number>(x: T): T;
>T : T
>x : T
>T : T
>T : T
};
var x: {
>x : <T extends Date>(x: T) => T
<T>(x: T): T;
>T : T
>x : T
>T : T
>T : T
};
var x: {
>x : <T extends Date>(x: T) => T
<T>(x: any): any;
>T : T
>x : any
};
@@ -14,17 +14,24 @@ tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'.
tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(112,5): error TS2322: Type '{}' is not assignable to type 'i2'.
Type '{}' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Object' is not assignable to type 'i2'.
Type 'Object' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(114,17): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/intTypeCheck.ts(115,5): error TS2322: Type 'Base' is not assignable to type 'i2'.
Type 'Base' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(120,5): error TS2322: Type 'boolean' is not assignable to type 'i2'.
tests/cases/compiler/intTypeCheck.ts(120,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(120,22): error TS2304: Cannot find name 'i2'.
tests/cases/compiler/intTypeCheck.ts(121,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(126,5): error TS2322: Type '{}' is not assignable to type 'i3'.
Type '{}' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Object' is not assignable to type 'i3'.
Type 'Object' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type 'Base' is not assignable to type 'i3'.
Type 'Base' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(131,5): error TS2322: Type '() => void' is not assignable to type 'i3'.
Type '() => void' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not assignable to type 'i3'.
tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'.
@@ -50,9 +57,12 @@ tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'.
tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(168,5): error TS2322: Type '{}' is not assignable to type 'i6'.
Type '{}' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Object' is not assignable to type 'i6'.
Type 'Object' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(170,17): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type 'Base' is not assignable to type 'i6'.
Type 'Base' provides no match for the signature '(): any'
tests/cases/compiler/intTypeCheck.ts(173,5): error TS2322: Type '() => void' is not assignable to type 'i6'.
Type 'void' is not assignable to type 'number'.
tests/cases/compiler/intTypeCheck.ts(176,5): error TS2322: Type 'boolean' is not assignable to type 'i6'.
@@ -60,9 +70,13 @@ tests/cases/compiler/intTypeCheck.ts(176,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(176,22): error TS2304: Cannot find name 'i6'.
tests/cases/compiler/intTypeCheck.ts(177,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
tests/cases/compiler/intTypeCheck.ts(182,5): error TS2322: Type '{}' is not assignable to type 'i7'.
Type '{}' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(183,5): error TS2322: Type 'Object' is not assignable to type 'i7'.
Type 'Object' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(185,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other.
Type 'Base' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(187,5): error TS2322: Type '() => void' is not assignable to type 'i7'.
Type '() => void' provides no match for the signature 'new (): any'
tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not assignable to type 'i7'.
tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected.
tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'.
@@ -216,15 +230,18 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj12: i2 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i2'.
!!! error TS2322: Type '{}' provides no match for the signature '(): any'
var obj13: i2 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i2'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
var obj14: i2 = new obj11;
~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
var obj15: i2 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i2'.
!!! error TS2322: Type 'Base' provides no match for the signature '(): any'
var obj16: i2 = null;
var obj17: i2 = function ():any { return 0; };
//var obj18: i2 = function foo() { };
@@ -246,17 +263,21 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj23: i3 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i3'.
!!! error TS2322: Type '{}' provides no match for the signature 'new (): any'
var obj24: i3 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i3'.
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
var obj25: i3 = new obj22;
var obj26: i3 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i3'.
!!! error TS2322: Type 'Base' provides no match for the signature 'new (): any'
var obj27: i3 = null;
var obj28: i3 = function () { };
~~~~~
!!! error TS2322: Type '() => void' is not assignable to type 'i3'.
!!! error TS2322: Type '() => void' provides no match for the signature 'new (): any'
//var obj29: i3 = function foo() { };
var obj30: i3 = <i3> anyVar;
var obj31: i3 = new <i3> anyVar;
@@ -338,15 +359,18 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj56: i6 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i6'.
!!! error TS2322: Type '{}' provides no match for the signature '(): any'
var obj57: i6 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i6'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): any'
var obj58: i6 = new obj55;
~~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
var obj59: i6 = new Base;
~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'i6'.
!!! error TS2322: Type 'Base' provides no match for the signature '(): any'
var obj60: i6 = null;
var obj61: i6 = function () { };
~~~~~
@@ -371,17 +395,21 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit
var obj67: i7 = {};
~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'i7'.
!!! error TS2322: Type '{}' provides no match for the signature 'new (): any'
var obj68: i7 = new Object();
~~~~~
!!! error TS2322: Type 'Object' is not assignable to type 'i7'.
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
var obj69: i7 = new obj66;
var obj70: i7 = <i7>new Base;
~~~~~~~~~~~~
!!! error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other.
!!! error TS2352: Type 'Base' provides no match for the signature 'new (): any'
var obj71: i7 = null;
var obj72: i7 = function () { };
~~~~~
!!! error TS2322: Type '() => void' is not assignable to type 'i7'.
!!! error TS2322: Type '() => void' provides no match for the signature 'new (): any'
//var obj73: i7 = function foo() { };
var obj74: i7 = <i7> anyVar;
var obj75: i7 = new <i7> anyVar;
@@ -3,6 +3,7 @@ tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1'
tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'.
Property 'iFn' is private in type 'C1' but not in type 'I2'.
tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'.
Type '() => C2' provides no match for the signature 'new (): I3'
==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ====
@@ -48,6 +49,7 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() =
var a:I4 = function(){
~
!!! error TS2322: Type '() => C2' is not assignable to type 'I4'.
!!! error TS2322: Type '() => C2' provides no match for the signature 'new (): I3'
return new C2();
}
new a();
@@ -0,0 +1,22 @@
tests/cases/compiler/invalidLetInForOfAndForIn_ES5.ts(5,13): error TS1005: '=' expected.
tests/cases/compiler/invalidLetInForOfAndForIn_ES5.ts(5,20): error TS1005: ',' expected.
tests/cases/compiler/invalidLetInForOfAndForIn_ES5.ts(7,1): error TS1005: ';' expected.
==== tests/cases/compiler/invalidLetInForOfAndForIn_ES5.ts (3 errors) ====
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of [1,2,3]) {}
~
!!! error TS1005: '=' expected.
~
!!! error TS1005: ',' expected.
for (let in [1,2,3]) {}
~~~
!!! error TS1005: ';' expected.
@@ -0,0 +1,18 @@
//// [invalidLetInForOfAndForIn_ES5.ts]
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of [1,2,3]) {}
for (let in [1,2,3]) {}
//// [invalidLetInForOfAndForIn_ES5.js]
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of = [1, 2, 3], { }; ; )
for ( in [1, 2, 3]) { }
@@ -0,0 +1,22 @@
tests/cases/compiler/invalidLetInForOfAndForIn_ES6.ts(5,13): error TS1005: '=' expected.
tests/cases/compiler/invalidLetInForOfAndForIn_ES6.ts(5,20): error TS1005: ',' expected.
tests/cases/compiler/invalidLetInForOfAndForIn_ES6.ts(7,1): error TS1005: ';' expected.
==== tests/cases/compiler/invalidLetInForOfAndForIn_ES6.ts (3 errors) ====
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of [1,2,3]) {}
~
!!! error TS1005: '=' expected.
~
!!! error TS1005: ',' expected.
for (let in [1,2,3]) {}
~~~
!!! error TS1005: ';' expected.
@@ -0,0 +1,18 @@
//// [invalidLetInForOfAndForIn_ES6.ts]
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of [1,2,3]) {}
for (let in [1,2,3]) {}
//// [invalidLetInForOfAndForIn_ES6.js]
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of = [1, 2, 3], { }; ; )
for ( in [1, 2, 3]) { }
@@ -0,0 +1,12 @@
tests/cases/compiler/a.js(1,5): error TS2300: Duplicate identifier 'a'.
tests/cases/compiler/a.js(2,7): error TS2300: Duplicate identifier 'a'.
==== tests/cases/compiler/a.js (2 errors) ====
var a = 10;
~
!!! error TS2300: Duplicate identifier 'a'.
class a {
~
!!! error TS2300: Duplicate identifier 'a'.
}
@@ -0,0 +1,27 @@
tests/cases/compiler/a.js(1,5): error TS2451: Cannot redeclare block-scoped variable 'C'.
tests/cases/compiler/a.js(2,5): error TS2451: Cannot redeclare block-scoped variable 'C'.
tests/cases/compiler/a.js(6,5): error TS7027: Unreachable code detected.
tests/cases/compiler/a.js(11,9): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/compiler/a.js (4 errors) ====
let C = "sss";
~
!!! error TS2451: Cannot redeclare block-scoped variable 'C'.
let C = 0; // Error: Cannot redeclare block-scoped variable 'C'.
~
!!! error TS2451: Cannot redeclare block-scoped variable 'C'.
function f() {
return;
return; // Error: Unreachable code detected.
~~~~~~
!!! error TS7027: Unreachable code detected.
}
function b() {
"use strict";
var arguments = 0; // Error: Invalid use of 'arguments' in strict mode.
~~~~~~~~~
!!! error TS1100: Invalid use of 'arguments' in strict mode.
}
@@ -1,21 +0,0 @@
=== tests/cases/compiler/a.js ===
let C = "sss";
>C : Symbol(C, Decl(a.js, 0, 3))
let C = 0; // Error: Cannot redeclare block-scoped variable 'C'.
>C : Symbol(C, Decl(a.js, 1, 3))
function f() {
>f : Symbol(f, Decl(a.js, 1, 10))
return;
return; // Error: Unreachable code detected.
}
function b() {
>b : Symbol(b, Decl(a.js, 6, 1))
"use strict";
var arguments = 0; // Error: Invalid use of 'arguments' in strict mode.
>arguments : Symbol(arguments, Decl(a.js, 10, 7))
}
@@ -1,26 +0,0 @@
=== tests/cases/compiler/a.js ===
let C = "sss";
>C : string
>"sss" : string
let C = 0; // Error: Cannot redeclare block-scoped variable 'C'.
>C : number
>0 : number
function f() {
>f : () => void
return;
return; // Error: Unreachable code detected.
}
function b() {
>b : () => void
"use strict";
>"use strict" : string
var arguments = 0; // Error: Invalid use of 'arguments' in strict mode.
>arguments : number
>0 : number
}
@@ -0,0 +1,18 @@
tests/cases/compiler/a.js(1,22): error TS2528: A module cannot have multiple default exports.
tests/cases/compiler/a.js(3,1): error TS2528: A module cannot have multiple default exports.
tests/cases/compiler/a.js(3,1): error TS8003: 'export=' can only be used in a .ts file.
tests/cases/compiler/a.js(3,16): error TS1109: Expression expected.
==== tests/cases/compiler/a.js (4 errors) ====
export default class a {
~
!!! error TS2528: A module cannot have multiple default exports.
}
export default var a = 10;
~~~~~~~~~~~~~~
!!! error TS2528: A module cannot have multiple default exports.
~~~~~~~~~~~~~~
!!! error TS8003: 'export=' can only be used in a .ts file.
~~~
!!! error TS1109: Expression expected.
@@ -0,0 +1,31 @@
tests/cases/compiler/a.js(3,9): error TS7029: Fallthrough case in switch.
tests/cases/compiler/a.js(16,5): error TS7027: Unreachable code detected.
tests/cases/compiler/a.js(19,1): error TS7028: Unused label.
==== tests/cases/compiler/a.js (3 errors) ====
function foo(a, b) {
switch (a) {
case 10:
~~~~
!!! error TS7029: Fallthrough case in switch.
if (b) {
return b;
}
case 20:
return a;
}
}
function bar() {
return x;
function bar2() {
}
var x = 10; // error
~~~
!!! error TS7027: Unreachable code detected.
}
label1: var x2 = 10;
~~~~~~
!!! error TS7028: Unused label.
@@ -0,0 +1,81 @@
tests/cases/compiler/a.js(3,5): error TS2300: Duplicate identifier 'a'.
tests/cases/compiler/a.js(5,5): error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
tests/cases/compiler/a.js(5,5): error TS2300: Duplicate identifier 'a'.
tests/cases/compiler/a.js(7,5): error TS1212: Identifier expected. 'let' is a reserved word in strict mode
tests/cases/compiler/a.js(8,8): error TS1102: 'delete' cannot be called on an identifier in strict mode.
tests/cases/compiler/a.js(10,10): error TS1100: Invalid use of 'eval' in strict mode.
tests/cases/compiler/a.js(12,10): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/a.js(15,1): error TS1101: 'with' statements are not allowed in strict mode.
tests/cases/compiler/b.js(3,7): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode.
tests/cases/compiler/b.js(6,13): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode.
tests/cases/compiler/c.js(1,12): error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
tests/cases/compiler/c.js(2,5): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
tests/cases/compiler/d.js(2,9): error TS1121: Octal literals are not allowed in strict mode.
tests/cases/compiler/d.js(2,11): error TS1005: ',' expected.
==== tests/cases/compiler/a.js (8 errors) ====
"use strict";
var a = {
a: "hello", // error
~
!!! error TS2300: Duplicate identifier 'a'.
b: 10,
a: 10 // error
~
!!! error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
~
!!! error TS2300: Duplicate identifier 'a'.
};
var let = 10; // error
~~~
!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode
delete a; // error
~
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
try {
} catch (eval) { // error
~~~~
!!! error TS1100: Invalid use of 'eval' in strict mode.
}
function arguments() { // error
~~~~~~~~~
!!! error TS1100: Invalid use of 'arguments' in strict mode.
}
with (a) {
~~~~
!!! error TS1101: 'with' statements are not allowed in strict mode.
b = 10;
}
==== tests/cases/compiler/b.js (2 errors) ====
// this is not in strict mode but class definitions are always in strict mode
class c {
a(eval) { //error
~~~~
!!! error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode.
}
method() {
var let = 10; // error
~~~
!!! error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode.
}
}
==== tests/cases/compiler/c.js (2 errors) ====
export var let = 10; // external modules are automatically in strict mode
~~~
!!! error TS1214: Identifier expected. 'let' is a reserved word in strict mode. Modules are automatically in strict mode.
var eval = function () {
~~~~
!!! error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
};
==== tests/cases/compiler/d.js (2 errors) ====
"use strict";
var x = 009; // error
~~
!!! error TS1121: Octal literals are not allowed in strict mode.
~
!!! error TS1005: ',' expected.
@@ -1,9 +1,12 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided.
tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
==== tests/cases/compiler/a.js (2 errors) ====
export = b;
~~~~~~~~~~~
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided.
~~~~~~~~~~~
!!! error TS8003: 'export=' can only be used in a .ts file.
@@ -0,0 +1,19 @@
tests/cases/compiler/moduleA/a.js(2,17): error TS2656: Exported external package typings file 'tests/cases/compiler/node_modules/b.ts' is not a module. Please contact the package author to update the package definition.
==== tests/cases/compiler/moduleA/a.js (1 errors) ====
import {a} from "b";
~~~
!!! error TS2656: Exported external package typings file 'b.ts' is not a module. Please contact the package author to update the package definition.
a++;
import {c} from "c";
c++;
==== tests/cases/compiler/node_modules/b.ts (0 errors) ====
var a = 10;
==== tests/cases/compiler/node_modules/c.js (0 errors) ====
exports.a = 10;
c = 10;
@@ -0,0 +1,6 @@
//// [letAsIdentifier2.ts]
function let() {}
//// [letAsIdentifier2.js]
function let() { }
@@ -0,0 +1,5 @@
=== tests/cases/compiler/letAsIdentifier2.ts ===
function let() {}
>let : Symbol(let, Decl(letAsIdentifier2.ts, 0, 0))
@@ -0,0 +1,5 @@
=== tests/cases/compiler/letAsIdentifier2.ts ===
function let() {}
>let : () => void
@@ -0,0 +1,16 @@
tests/cases/compiler/letInConstDeclarations_ES5.ts(3,15): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInConstDeclarations_ES5.ts(6,19): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInConstDeclarations_ES5.ts (2 errors) ====
// All use of let in const declaration should be an error
const x = 50, let = 5;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
const x = 10, let = 20;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,15 @@
//// [letInConstDeclarations_ES5.ts]
// All use of let in const declaration should be an error
const x = 50, let = 5;
{
const x = 10, let = 20;
}
//// [letInConstDeclarations_ES5.js]
// All use of let in const declaration should be an error
var x = 50, let = 5;
{
var x_1 = 10, let_1 = 20;
}
@@ -0,0 +1,16 @@
tests/cases/compiler/letInConstDeclarations_ES6.ts(3,15): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInConstDeclarations_ES6.ts(6,19): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInConstDeclarations_ES6.ts (2 errors) ====
// All use of let in const declaration should be an error
const x = 50, let = 5;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
const x = 10, let = 20;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,15 @@
//// [letInConstDeclarations_ES6.ts]
// All use of let in const declaration should be an error
const x = 50, let = 5;
{
const x = 10, let = 20;
}
//// [letInConstDeclarations_ES6.js]
// All use of let in const declaration should be an error
const x = 50, let = 5;
{
const x = 10, let = 20;
}
@@ -0,0 +1,48 @@
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(3,10): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(5,12): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(7,10): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(9,12): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(12,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(14,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(16,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts(18,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES5.ts (8 errors) ====
// Should be an error
for (let let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
for (let let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,43 @@
//// [letInLetConstDeclOfForOfAndForIn_ES5.ts]
// Should be an error
for (let let of [1,2,3]) {}
for (const let of [1,2,3]) {}
for (let let in [1,2,3]) {}
for (const let in [1,2,3]) {}
{
for (let let of [1,2,3]) {}
for (const let of [1,2,3]) {}
for (let let in [1,2,3]) {}
for (const let in [1,2,3]) {}
}
//// [letInLetConstDeclOfForOfAndForIn_ES5.js]
// Should be an error
for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
var let = _a[_i];
}
for (var _b = 0, _c = [1, 2, 3]; _b < _c.length; _b++) {
var let = _c[_b];
}
for (var let in [1, 2, 3]) { }
for (var let in [1, 2, 3]) { }
{
for (var _d = 0, _e = [1, 2, 3]; _d < _e.length; _d++) {
var let = _e[_d];
}
for (var _f = 0, _g = [1, 2, 3]; _f < _g.length; _f++) {
var let = _g[_f];
}
for (var let in [1, 2, 3]) { }
for (var let in [1, 2, 3]) { }
}
@@ -0,0 +1,48 @@
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(3,10): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(5,12): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(7,10): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(9,12): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(12,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(14,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(16,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts(18,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetConstDeclOfForOfAndForIn_ES6.ts (8 errors) ====
// Should be an error
for (let let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
for (let let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let of [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (const let in [1,2,3]) {}
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,35 @@
//// [letInLetConstDeclOfForOfAndForIn_ES6.ts]
// Should be an error
for (let let of [1,2,3]) {}
for (const let of [1,2,3]) {}
for (let let in [1,2,3]) {}
for (const let in [1,2,3]) {}
{
for (let let of [1,2,3]) {}
for (const let of [1,2,3]) {}
for (let let in [1,2,3]) {}
for (const let in [1,2,3]) {}
}
//// [letInLetConstDeclOfForOfAndForIn_ES6.js]
// Should be an error
for (let let of [1, 2, 3]) { }
for (const let of [1, 2, 3]) { }
for (let let in [1, 2, 3]) { }
for (const let in [1, 2, 3]) { }
{
for (let let of [1, 2, 3]) { }
for (const let of [1, 2, 3]) { }
for (let let in [1, 2, 3]) { }
for (const let in [1, 2, 3]) { }
}
@@ -0,0 +1,16 @@
tests/cases/compiler/letInLetDeclarations_ES5.ts(3,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetDeclarations_ES5.ts(6,17): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetDeclarations_ES5.ts (2 errors) ====
// All use of let in const declaration should be an error
let x = 50, let = 5;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
let x = 10, let = 20;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,15 @@
//// [letInLetDeclarations_ES5.ts]
// All use of let in const declaration should be an error
let x = 50, let = 5;
{
let x = 10, let = 20;
}
//// [letInLetDeclarations_ES5.js]
// All use of let in const declaration should be an error
var x = 50, let = 5;
{
var x_1 = 10, let_1 = 20;
}
@@ -0,0 +1,16 @@
tests/cases/compiler/letInLetDeclarations_ES6.ts(3,13): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetDeclarations_ES6.ts(6,17): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetDeclarations_ES6.ts (2 errors) ====
// All use of let in const declaration should be an error
let x = 50, let = 5;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
{
let x = 10, let = 20;
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
@@ -0,0 +1,15 @@
//// [letInLetDeclarations_ES6.ts]
// All use of let in const declaration should be an error
let x = 50, let = 5;
{
let x = 10, let = 20;
}
//// [letInLetDeclarations_ES6.js]
// All use of let in const declaration should be an error
let x = 50, let = 5;
{
let x = 10, let = 20;
}
@@ -1,23 +0,0 @@
tests/cases/compiler/letInLetOrConstDeclarations.ts(2,9): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(3,14): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
tests/cases/compiler/letInLetOrConstDeclarations.ts(6,11): error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
==== tests/cases/compiler/letInLetOrConstDeclarations.ts (3 errors) ====
{
let let = 1; // should error
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
for (let let in []) { } // should error
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
{
const let = 1; // should error
~~~
!!! error TS2480: 'let' is not allowed to be used as a name in 'let' or 'const' declarations.
}
{
function let() { // should be ok
}
}
@@ -1,25 +0,0 @@
//// [letInLetOrConstDeclarations.ts]
{
let let = 1; // should error
for (let let in []) { } // should error
}
{
const let = 1; // should error
}
{
function let() { // should be ok
}
}
//// [letInLetOrConstDeclarations.js]
{
let let = 1; // should error
for (let let in []) { } // should error
}
{
const let = 1; // should error
}
{
function let() {
}
}
@@ -0,0 +1,16 @@
//// [letInVarDeclOfForIn_ES5.ts]
// should not be an error
for (var let in [1,2,3]) {}
{
for (var let in [1,2,3]) {}
}
//// [letInVarDeclOfForIn_ES5.js]
// should not be an error
for (var let in [1, 2, 3]) { }
{
for (var let in [1, 2, 3]) { }
}
@@ -0,0 +1,11 @@
=== tests/cases/compiler/letInVarDeclOfForIn_ES5.ts ===
// should not be an error
for (var let in [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForIn_ES5.ts, 2, 8), Decl(letInVarDeclOfForIn_ES5.ts, 5, 9))
{
for (var let in [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForIn_ES5.ts, 2, 8), Decl(letInVarDeclOfForIn_ES5.ts, 5, 9))
}
@@ -0,0 +1,19 @@
=== tests/cases/compiler/letInVarDeclOfForIn_ES5.ts ===
// should not be an error
for (var let in [1,2,3]) {}
>let : any
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
{
for (var let in [1,2,3]) {}
>let : any
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
}
@@ -0,0 +1,16 @@
//// [letInVarDeclOfForIn_ES6.ts]
// should not be an error
for (var let in [1,2,3]) {}
{
for (var let in [1,2,3]) {}
}
//// [letInVarDeclOfForIn_ES6.js]
// should not be an error
for (var let in [1, 2, 3]) { }
{
for (var let in [1, 2, 3]) { }
}
@@ -0,0 +1,11 @@
=== tests/cases/compiler/letInVarDeclOfForIn_ES6.ts ===
// should not be an error
for (var let in [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForIn_ES6.ts, 2, 8), Decl(letInVarDeclOfForIn_ES6.ts, 5, 9))
{
for (var let in [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForIn_ES6.ts, 2, 8), Decl(letInVarDeclOfForIn_ES6.ts, 5, 9))
}
@@ -0,0 +1,19 @@
=== tests/cases/compiler/letInVarDeclOfForIn_ES6.ts ===
// should not be an error
for (var let in [1,2,3]) {}
>let : any
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
{
for (var let in [1,2,3]) {}
>let : any
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
}
@@ -0,0 +1,20 @@
//// [letInVarDeclOfForOf_ES5.ts]
// should not be an error
for (var let of [1,2,3]) {}
{
for (var let of [1,2,3]) {}
}
//// [letInVarDeclOfForOf_ES5.js]
// should not be an error
for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
var let = _a[_i];
}
{
for (var _b = 0, _c = [1, 2, 3]; _b < _c.length; _b++) {
var let = _c[_b];
}
}
@@ -0,0 +1,11 @@
=== tests/cases/compiler/letInVarDeclOfForOf_ES5.ts ===
// should not be an error
for (var let of [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForOf_ES5.ts, 2, 8), Decl(letInVarDeclOfForOf_ES5.ts, 5, 9))
{
for (var let of [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForOf_ES5.ts, 2, 8), Decl(letInVarDeclOfForOf_ES5.ts, 5, 9))
}
@@ -0,0 +1,19 @@
=== tests/cases/compiler/letInVarDeclOfForOf_ES5.ts ===
// should not be an error
for (var let of [1,2,3]) {}
>let : number
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
{
for (var let of [1,2,3]) {}
>let : number
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
}
@@ -0,0 +1,16 @@
//// [letInVarDeclOfForOf_ES6.ts]
// should not be an error
for (var let of [1,2,3]) {}
{
for (var let of [1,2,3]) {}
}
//// [letInVarDeclOfForOf_ES6.js]
// should not be an error
for (var let of [1, 2, 3]) { }
{
for (var let of [1, 2, 3]) { }
}
@@ -0,0 +1,11 @@
=== tests/cases/compiler/letInVarDeclOfForOf_ES6.ts ===
// should not be an error
for (var let of [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForOf_ES6.ts, 2, 8), Decl(letInVarDeclOfForOf_ES6.ts, 5, 9))
{
for (var let of [1,2,3]) {}
>let : Symbol(let, Decl(letInVarDeclOfForOf_ES6.ts, 2, 8), Decl(letInVarDeclOfForOf_ES6.ts, 5, 9))
}
@@ -0,0 +1,19 @@
=== tests/cases/compiler/letInVarDeclOfForOf_ES6.ts ===
// should not be an error
for (var let of [1,2,3]) {}
>let : number
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
{
for (var let of [1,2,3]) {}
>let : number
>[1,2,3] : number[]
>1 : number
>2 : number
>3 : number
}
@@ -0,0 +1,16 @@
//// [tests/cases/compiler/missingSemicolonInModuleSpecifier.ts] ////
//// [a.ts]
export const x = 1;
//// [b.ts]
import {x} from "./a"
(function() { return 1; }())
//// [a.js]
"use strict";
exports.x = 1;
//// [b.js]
"use strict";
(function () { return 1; }());
@@ -0,0 +1,10 @@
=== tests/cases/compiler/a.ts ===
export const x = 1;
>x : Symbol(x, Decl(a.ts, 1, 12))
=== tests/cases/compiler/b.ts ===
import {x} from "./a"
>x : Symbol(x, Decl(b.ts, 0, 8))
(function() { return 1; }())
@@ -0,0 +1,16 @@
=== tests/cases/compiler/a.ts ===
export const x = 1;
>x : number
>1 : number
=== tests/cases/compiler/b.ts ===
import {x} from "./a"
>x : number
(function() { return 1; }())
>(function() { return 1; }()) : number
>function() { return 1; }() : number
>function() { return 1; } : () => number
>1 : number
@@ -0,0 +1,55 @@
tests/cases/compiler/moduleDuplicateIdentifiers.ts(1,12): error TS2323: Cannot redeclare exported variable 'Foo'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(2,12): error TS2323: Cannot redeclare exported variable 'Foo'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(20,14): error TS2300: Duplicate identifier 'Kettle'.
tests/cases/compiler/moduleDuplicateIdentifiers.ts(24,14): error TS2300: Duplicate identifier 'Kettle'.
==== tests/cases/compiler/moduleDuplicateIdentifiers.ts (4 errors) ====
export var Foo = 2;
~~~
!!! error TS2323: Cannot redeclare exported variable 'Foo'.
export var Foo = 42; // Should error
~~~
!!! error TS2323: Cannot redeclare exported variable 'Foo'.
export interface Bar {
_brand1: any;
}
export interface Bar { // Shouldn't error
_brand2: any;
}
export namespace FooBar {
export var member1 = 2;
}
export namespace FooBar { // Shouldn't error
export var member2 = 42;
}
export class Kettle {
~~~~~~
!!! error TS2300: Duplicate identifier 'Kettle'.
member1 = 2;
}
export class Kettle { // Should error
~~~~~~
!!! error TS2300: Duplicate identifier 'Kettle'.
member2 = 42;
}
export var Pot = 2;
Pot = 42; // Shouldn't error
export enum Utensils {
Spoon,
Fork,
Knife
}
export enum Utensils { // Shouldn't error
Spork = 3
}
@@ -0,0 +1,80 @@
//// [moduleDuplicateIdentifiers.ts]
export var Foo = 2;
export var Foo = 42; // Should error
export interface Bar {
_brand1: any;
}
export interface Bar { // Shouldn't error
_brand2: any;
}
export namespace FooBar {
export var member1 = 2;
}
export namespace FooBar { // Shouldn't error
export var member2 = 42;
}
export class Kettle {
member1 = 2;
}
export class Kettle { // Should error
member2 = 42;
}
export var Pot = 2;
Pot = 42; // Shouldn't error
export enum Utensils {
Spoon,
Fork,
Knife
}
export enum Utensils { // Shouldn't error
Spork = 3
}
//// [moduleDuplicateIdentifiers.js]
"use strict";
exports.Foo = 2;
exports.Foo = 42; // Should error
var FooBar;
(function (FooBar) {
FooBar.member1 = 2;
})(FooBar = exports.FooBar || (exports.FooBar = {}));
var FooBar;
(function (FooBar) {
FooBar.member2 = 42;
})(FooBar = exports.FooBar || (exports.FooBar = {}));
var Kettle = (function () {
function Kettle() {
this.member1 = 2;
}
return Kettle;
})();
exports.Kettle = Kettle;
var Kettle = (function () {
function Kettle() {
this.member2 = 42;
}
return Kettle;
})();
exports.Kettle = Kettle;
exports.Pot = 2;
exports.Pot = 42; // Shouldn't error
(function (Utensils) {
Utensils[Utensils["Spoon"] = 0] = "Spoon";
Utensils[Utensils["Fork"] = 1] = "Fork";
Utensils[Utensils["Knife"] = 2] = "Knife";
})(exports.Utensils || (exports.Utensils = {}));
var Utensils = exports.Utensils;
(function (Utensils) {
Utensils[Utensils["Spork"] = 3] = "Spork";
})(exports.Utensils || (exports.Utensils = {}));
var Utensils = exports.Utensils;
@@ -0,0 +1,28 @@
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings1.ts] ////
//// [a.ts]
export * from "./b";
export * from "./c";
//// [b.ts]
export * from "./c";
//// [c.ts]
export var foo = 42;
//// [c.js]
"use strict";
exports.foo = 42;
//// [b.js]
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./c"));
//// [a.js]
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./b"));
__export(require("./c"));
@@ -0,0 +1,11 @@
=== tests/cases/compiler/a.ts ===
export * from "./b";
No type information for this code.export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/b.ts ===
export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/c.ts ===
export var foo = 42;
>foo : Symbol(foo, Decl(c.ts, 0, 10))
@@ -0,0 +1,12 @@
=== tests/cases/compiler/a.ts ===
export * from "./b";
No type information for this code.export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/b.ts ===
export * from "./c";
No type information for this code.
No type information for this code.=== tests/cases/compiler/c.ts ===
export var foo = 42;
>foo : number
>42 : number
@@ -0,0 +1,34 @@
//// [tests/cases/compiler/moduleSameValueDuplicateExportedBindings2.ts] ////
//// [a.ts]
export * from "./b";
export * from "./c";
//// [b.ts]
export {Animals} from "./c";
//// [c.ts]
export enum Animals {
Cat,
Dog
};
//// [c.js]
"use strict";
(function (Animals) {
Animals[Animals["Cat"] = 0] = "Cat";
Animals[Animals["Dog"] = 1] = "Dog";
})(exports.Animals || (exports.Animals = {}));
var Animals = exports.Animals;
;
//// [b.js]
"use strict";
var c_1 = require("./c");
exports.Animals = c_1.Animals;
//// [a.js]
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./b"));
__export(require("./c"));
Loaded 100 of 257 files, more files were not shown because too many files have changed in this diff. Show more