Merge remote-tracking branch 'upstream/master' into javaScriptPrototypes

This commit is contained in:
Ryan Cavanaugh
2015-12-04 14:12:01 -08:00
191 changed files with 20509 additions and 384 deletions

View File

@@ -0,0 +1,23 @@
//// [tests/cases/conformance/es6/moduleExportsAmd/anonymousDefaultExportsAmd.ts] ////
//// [a.ts]
export default class {}
//// [b.ts]
export default function() {}
//// [a.js]
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;
});

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,19 @@
//// [tests/cases/conformance/es6/moduleExportsCommonjs/anonymousDefaultExportsCommonjs.ts] ////
//// [a.ts]
export default class {}
//// [b.ts]
export default function() {}
//// [a.js]
"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;

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,32 @@
//// [tests/cases/conformance/es6/moduleExportsSystem/anonymousDefaultExportsSystem.ts] ////
//// [a.ts]
export default class {}
//// [b.ts]
export default function() {}
//// [a.js]
System.register([], function(exports_1) {
"use strict";
var default_1;
return {
setters:[],
execute: function() {
class default_1 {
}
exports_1("default", default_1);
}
}
});
//// [b.js]
System.register([], function(exports_1) {
"use strict";
function default_1() { }
exports_1("default", default_1);
return {
setters:[],
execute: function() {
}
}
});

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,37 @@
//// [tests/cases/conformance/es6/moduleExportsUmd/anonymousDefaultExportsUmd.ts] ////
//// [a.ts]
export default class {}
//// [b.ts]
export default function() {}
//// [a.js]
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
class default_1 {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});
//// [b.js]
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
function default_1() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
export default class {}
No type information for this code.
No type information for this code.=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
export default function() {}
No type information for this code.

View File

@@ -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'

View File

@@ -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; }'.

View File

@@ -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[]'.

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -0,0 +1,10 @@
tests/cases/conformance/async/es6/asyncAliasReturnType_es6.ts(3,16): error TS1055: Type 'PromiseAlias' is not a valid async function return type.
==== tests/cases/conformance/async/es6/asyncAliasReturnType_es6.ts (1 errors) ====
type PromiseAlias<T> = Promise<T>;
async function f(): PromiseAlias<void> {
~
!!! error TS1055: Type 'PromiseAlias' is not a valid async function return type.
}

View File

@@ -0,0 +1,11 @@
//// [asyncAliasReturnType_es6.ts]
type PromiseAlias<T> = Promise<T>;
async function f(): PromiseAlias<void> {
}
//// [asyncAliasReturnType_es6.js]
function f() {
return __awaiter(this, void 0, PromiseAlias, function* () {
});
}

View File

@@ -0,0 +1,37 @@
//// [tests/cases/conformance/async/es6/asyncImportedPromise_es6.ts] ////
//// [task.ts]
export class Task<T> extends Promise<T> { }
//// [test.ts]
import { Task } from "./task";
class Test {
async example<T>(): Task<T> { return; }
}
//// [task.js]
"use strict";
class Task extends Promise {
}
exports.Task = Task;
//// [test.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {
return new Promise(function (resolve, reject) {
generator = generator.call(thisArg, _arguments);
function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }
function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } }
function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } }
function step(verb, value) {
var result = generator[verb](value);
result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);
}
step("next", void 0);
});
};
var task_1 = require("./task");
class Test {
example() {
return __awaiter(this, void 0, task_1.Task, function* () { return; });
}
}

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/async/es6/task.ts ===
export class Task<T> extends Promise<T> { }
>Task : Symbol(Task, Decl(task.ts, 0, 0))
>T : Symbol(T, Decl(task.ts, 0, 18))
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>T : Symbol(T, Decl(task.ts, 0, 18))
=== tests/cases/conformance/async/es6/test.ts ===
import { Task } from "./task";
>Task : Symbol(Task, Decl(test.ts, 0, 8))
class Test {
>Test : Symbol(Test, Decl(test.ts, 0, 30))
async example<T>(): Task<T> { return; }
>example : Symbol(example, Decl(test.ts, 1, 12))
>T : Symbol(T, Decl(test.ts, 2, 18))
>Task : Symbol(Task, Decl(test.ts, 0, 8))
>T : Symbol(T, Decl(test.ts, 2, 18))
}

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/async/es6/task.ts ===
export class Task<T> extends Promise<T> { }
>Task : Task<T>
>T : T
>Promise : Promise<T>
>T : T
=== tests/cases/conformance/async/es6/test.ts ===
import { Task } from "./task";
>Task : typeof Task
class Test {
>Test : Test
async example<T>(): Task<T> { return; }
>example : <T>() => Task<T>
>T : T
>Task : Task<T>
>T : T
}

View File

@@ -0,0 +1,20 @@
//// [asyncQualifiedReturnType_es6.ts]
namespace X {
export class MyPromise<T> extends Promise<T> {
}
}
async function f(): X.MyPromise<void> {
}
//// [asyncQualifiedReturnType_es6.js]
var X;
(function (X) {
class MyPromise extends Promise {
}
X.MyPromise = MyPromise;
})(X || (X = {}));
function f() {
return __awaiter(this, void 0, X.MyPromise, function* () {
});
}

View File

@@ -0,0 +1,17 @@
=== tests/cases/conformance/async/es6/asyncQualifiedReturnType_es6.ts ===
namespace X {
>X : Symbol(X, Decl(asyncQualifiedReturnType_es6.ts, 0, 0))
export class MyPromise<T> extends Promise<T> {
>MyPromise : Symbol(MyPromise, Decl(asyncQualifiedReturnType_es6.ts, 0, 13))
>T : Symbol(T, Decl(asyncQualifiedReturnType_es6.ts, 1, 27))
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>T : Symbol(T, Decl(asyncQualifiedReturnType_es6.ts, 1, 27))
}
}
async function f(): X.MyPromise<void> {
>f : Symbol(f, Decl(asyncQualifiedReturnType_es6.ts, 3, 1))
>X : Symbol(X, Decl(asyncQualifiedReturnType_es6.ts, 0, 0))
>MyPromise : Symbol(X.MyPromise, Decl(asyncQualifiedReturnType_es6.ts, 0, 13))
}

View File

@@ -0,0 +1,17 @@
=== tests/cases/conformance/async/es6/asyncQualifiedReturnType_es6.ts ===
namespace X {
>X : typeof X
export class MyPromise<T> extends Promise<T> {
>MyPromise : MyPromise<T>
>T : T
>Promise : Promise<T>
>T : T
}
}
async function f(): X.MyPromise<void> {
>f : () => X.MyPromise<void>
>X : any
>MyPromise : X.MyPromise<T>
}

View File

@@ -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'

View File

@@ -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;
});

View File

@@ -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;};};

View File

@@ -1,12 +1,19 @@
//// [decoratedDefaultExportsGetExportedAmd.ts]
//// [tests/cases/conformance/es6/moduleExportsAmd/decoratedDefaultExportsGetExportedAmd.ts] ////
//// [a.ts]
var decorator: ClassDecorator;
@decorator
export default class Foo {}
//// [b.ts]
var decorator: ClassDecorator;
@decorator
export default class {}
//// [decoratedDefaultExportsGetExportedAmd.js]
//// [a.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -21,5 +28,24 @@ define(["require", "exports"], function (require, exports) {
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports"], function (require, exports) {
"use strict";
var decorator;
let default_1 = class {
};
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});

View File

@@ -1,12 +1,21 @@
=== tests/cases/conformance/es6/moduleExportsAmd/decoratedDefaultExportsGetExportedAmd.ts ===
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedAmd.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedAmd.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
export default class Foo {}
>Foo : Symbol(Foo, Decl(decoratedDefaultExportsGetExportedAmd.ts, 1, 30))
>Foo : Symbol(Foo, Decl(a.ts, 0, 30))
=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
export default class {}

View File

@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/moduleExportsAmd/decoratedDefaultExportsGetExportedAmd.ts ===
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@@ -10,3 +9,13 @@ var decorator: ClassDecorator;
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@decorator
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
export default class {}

View File

@@ -1,12 +1,19 @@
//// [decoratedDefaultExportsGetExportedCommonjs.ts]
//// [tests/cases/conformance/es6/moduleExportsCommonjs/decoratedDefaultExportsGetExportedCommonjs.ts] ////
//// [a.ts]
var decorator: ClassDecorator;
@decorator
export default class Foo {}
//// [b.ts]
var decorator: ClassDecorator;
@decorator
export default class {}
//// [decoratedDefaultExportsGetExportedCommonjs.js]
//// [a.js]
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -20,4 +27,21 @@ let Foo = class {
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
//// [b.js]
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var decorator;
let default_1 = class {
};
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;

View File

@@ -1,12 +1,21 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/decoratedDefaultExportsGetExportedCommonjs.ts ===
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedCommonjs.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedCommonjs.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
export default class Foo {}
>Foo : Symbol(Foo, Decl(decoratedDefaultExportsGetExportedCommonjs.ts, 1, 30))
>Foo : Symbol(Foo, Decl(a.ts, 0, 30))
=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
export default class {}

View File

@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/decoratedDefaultExportsGetExportedCommonjs.ts ===
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@@ -10,3 +9,13 @@ var decorator: ClassDecorator;
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@decorator
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
export default class {}

View File

@@ -1,12 +1,18 @@
//// [decoratedDefaultExportsGetExportedSystem.ts]
//// [tests/cases/conformance/es6/moduleExportsSystem/decoratedDefaultExportsGetExportedSystem.ts] ////
//// [a.ts]
var decorator: ClassDecorator;
@decorator
export default class Foo {}
//// [b.ts]
var decorator: ClassDecorator;
@decorator
export default class {}
//// [decoratedDefaultExportsGetExportedSystem.js]
//// [a.js]
System.register([], function(exports_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -28,3 +34,25 @@ System.register([], function(exports_1) {
}
}
});
//// [b.js]
System.register([], function(exports_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var decorator, default_1;
return {
setters:[],
execute: function() {
let default_1 = class {
};
default_1 = __decorate([
decorator
], default_1);
exports_1("default", default_1);
}
}
});

View File

@@ -1,12 +1,20 @@
=== tests/cases/conformance/es6/moduleExportsSystem/decoratedDefaultExportsGetExportedSystem.ts ===
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedSystem.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedSystem.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
export default class Foo {}
>Foo : Symbol(Foo, Decl(decoratedDefaultExportsGetExportedSystem.ts, 1, 30))
>Foo : Symbol(Foo, Decl(a.ts, 0, 30))
=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
export default class {}

View File

@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/moduleExportsSystem/decoratedDefaultExportsGetExportedSystem.ts ===
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@@ -10,3 +9,12 @@ var decorator: ClassDecorator;
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@decorator
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
export default class {}

View File

@@ -1,12 +1,19 @@
//// [decoratedDefaultExportsGetExportedUmd.ts]
//// [tests/cases/conformance/es6/moduleExportsUmd/decoratedDefaultExportsGetExportedUmd.ts] ////
//// [a.ts]
var decorator: ClassDecorator;
@decorator
export default class Foo {}
//// [b.ts]
var decorator: ClassDecorator;
@decorator
export default class {}
//// [decoratedDefaultExportsGetExportedUmd.js]
//// [a.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -28,5 +35,31 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
Foo = __decorate([
decorator
], Foo);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
var decorator;
let default_1 = class {
};
default_1 = __decorate([
decorator
], default_1);
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
});

View File

@@ -1,12 +1,21 @@
=== tests/cases/conformance/es6/moduleExportsUmd/decoratedDefaultExportsGetExportedUmd.ts ===
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedUmd.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(decoratedDefaultExportsGetExportedUmd.ts, 1, 3))
>decorator : Symbol(decorator, Decl(a.ts, 0, 3))
export default class Foo {}
>Foo : Symbol(Foo, Decl(decoratedDefaultExportsGetExportedUmd.ts, 1, 30))
>Foo : Symbol(Foo, Decl(a.ts, 0, 30))
=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
var decorator: ClassDecorator;
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
@decorator
>decorator : Symbol(decorator, Decl(b.ts, 0, 3))
export default class {}

View File

@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/moduleExportsUmd/decoratedDefaultExportsGetExportedUmd.ts ===
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@@ -10,3 +9,13 @@ var decorator: ClassDecorator;
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
var decorator: ClassDecorator;
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
>ClassDecorator : <TFunction extends Function>(target: TFunction) => TFunction | void
@decorator
>decorator : <TFunction extends Function>(target: TFunction) => TFunction | void
export default class {}

View File

@@ -1,11 +1,24 @@
//// [defaultExportsGetExportedAmd.ts]
//// [tests/cases/conformance/es6/moduleExportsAmd/defaultExportsGetExportedAmd.ts] ////
//// [a.ts]
export default class Foo {}
//// [b.ts]
export default function foo() {}
//// [defaultExportsGetExportedAmd.js]
//// [a.js]
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;
});

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsAmd/defaultExportsGetExportedAmd.ts ===
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
export default class Foo {}
>Foo : Symbol(Foo, Decl(defaultExportsGetExportedAmd.ts, 0, 0))
>Foo : Symbol(Foo, Decl(a.ts, 0, 0))
=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
export default function foo() {}
>foo : Symbol(foo, Decl(b.ts, 0, 0))

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsAmd/defaultExportsGetExportedAmd.ts ===
=== tests/cases/conformance/es6/moduleExportsAmd/a.ts ===
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsAmd/b.ts ===
export default function foo() {}
>foo : () => void

View File

@@ -1,9 +1,20 @@
//// [defaultExportsGetExportedCommonjs.ts]
//// [tests/cases/conformance/es6/moduleExportsCommonjs/defaultExportsGetExportedCommonjs.ts] ////
//// [a.ts]
export default class Foo {}
//// [b.ts]
export default function foo() {}
//// [defaultExportsGetExportedCommonjs.js]
//// [a.js]
"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;

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/defaultExportsGetExportedCommonjs.ts ===
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
export default class Foo {}
>Foo : Symbol(Foo, Decl(defaultExportsGetExportedCommonjs.ts, 0, 0))
>Foo : Symbol(Foo, Decl(a.ts, 0, 0))
=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
export default function foo() {}
>foo : Symbol(foo, Decl(b.ts, 0, 0))

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsCommonjs/defaultExportsGetExportedCommonjs.ts ===
=== tests/cases/conformance/es6/moduleExportsCommonjs/a.ts ===
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsCommonjs/b.ts ===
export default function foo() {}
>foo : () => void

View File

@@ -1,8 +1,13 @@
//// [defaultExportsGetExportedSystem.ts]
//// [tests/cases/conformance/es6/moduleExportsSystem/defaultExportsGetExportedSystem.ts] ////
//// [a.ts]
export default class Foo {}
//// [b.ts]
export default function foo() {}
//// [defaultExportsGetExportedSystem.js]
//// [a.js]
System.register([], function(exports_1) {
"use strict";
var Foo;
@@ -15,3 +20,14 @@ System.register([], function(exports_1) {
}
}
});
//// [b.js]
System.register([], function(exports_1) {
"use strict";
function foo() { }
exports_1("default", foo);
return {
setters:[],
execute: function() {
}
}
});

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsSystem/defaultExportsGetExportedSystem.ts ===
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
export default class Foo {}
>Foo : Symbol(Foo, Decl(defaultExportsGetExportedSystem.ts, 0, 0))
>Foo : Symbol(Foo, Decl(a.ts, 0, 0))
=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
export default function foo() {}
>foo : Symbol(foo, Decl(b.ts, 0, 0))

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsSystem/defaultExportsGetExportedSystem.ts ===
=== tests/cases/conformance/es6/moduleExportsSystem/a.ts ===
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsSystem/b.ts ===
export default function foo() {}
>foo : () => void

View File

@@ -1,8 +1,13 @@
//// [defaultExportsGetExportedUmd.ts]
//// [tests/cases/conformance/es6/moduleExportsUmd/defaultExportsGetExportedUmd.ts] ////
//// [a.ts]
export default class Foo {}
//// [b.ts]
export default function foo() {}
//// [defaultExportsGetExportedUmd.js]
//// [a.js]
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
@@ -14,5 +19,20 @@ export default class Foo {}
"use strict";
class Foo {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
});
//// [b.js]
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
function foo() { }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = foo;
});

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsUmd/defaultExportsGetExportedUmd.ts ===
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
export default class Foo {}
>Foo : Symbol(Foo, Decl(defaultExportsGetExportedUmd.ts, 0, 0))
>Foo : Symbol(Foo, Decl(a.ts, 0, 0))
=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
export default function foo() {}
>foo : Symbol(foo, Decl(b.ts, 0, 0))

View File

@@ -1,4 +1,8 @@
=== tests/cases/conformance/es6/moduleExportsUmd/defaultExportsGetExportedUmd.ts ===
=== tests/cases/conformance/es6/moduleExportsUmd/a.ts ===
export default class Foo {}
>Foo : Foo
=== tests/cases/conformance/es6/moduleExportsUmd/b.ts ===
export default function foo() {}
>foo : () => void

View File

@@ -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";

View File

@@ -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";

View File

@@ -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() {

View File

@@ -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) {
~~~~~~~~~~~

View File

@@ -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>'
}

View File

@@ -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;

View File

@@ -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))
};

View File

@@ -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
};

View File

@@ -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;

View File

@@ -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();

View File

@@ -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'.
}

View File

@@ -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.
}

View File

@@ -1,25 +0,0 @@
//// [a.js]
let C = "sss";
let C = 0; // Error: Cannot redeclare block-scoped variable 'C'.
function f() {
return;
return; // Error: Unreachable code detected.
}
function b() {
"use strict";
var arguments = 0; // Error: Invalid use of 'arguments' in strict mode.
}
//// [a.js]
var C = "sss";
var C = 0; // Error: Cannot redeclare block-scoped variable 'C'.
function f() {
return;
return; // Error: Unreachable code detected.
}
function b() {
"use strict";
var arguments = 0; // Error: Invalid use of 'arguments' in strict mode.
}

View File

@@ -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))
}

View File

@@ -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
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View 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;

View File

@@ -1,5 +1,7 @@
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
Type 'Object' provides no match for the signature '(): void'
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'.
Type 'Object' provides no match for the signature '(): void'
==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ====
@@ -13,6 +15,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
i = f;
~
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
var a: {
(): void
@@ -20,4 +23,5 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf
f = a;
a = f;
~
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'

View File

@@ -1,5 +1,7 @@
tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
Type 'Object' provides no match for the signature 'new (): any'
tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'.
Type 'Object' provides no match for the signature 'new (): any'
==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ====
@@ -13,6 +15,7 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb
i = f;
~
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'
var a: {
new(): any
@@ -20,4 +23,5 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb
f = a;
a = f;
~
!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'.
!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'.
!!! error TS2322: Type 'Object' provides no match for the signature 'new (): any'

View File

@@ -0,0 +1,27 @@
//// [tests/cases/conformance/es6/moduleExportsAmd/outFilerootDirModuleNamesAmd.ts] ////
//// [a.ts]
import foo from "./b";
export default class Foo {}
foo();
//// [b.ts]
import Foo from "./a";
export default function foo() { new Foo(); }
//// [output.js]
define("b", ["require", "exports", "a"], function (require, exports, a_1) {
"use strict";
function foo() { new a_1.default(); }
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = foo;
});
define("a", ["require", "exports", "b"], function (require, exports, b_1) {
"use strict";
class Foo {
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Foo;
b_1.default();
});

View File

@@ -0,0 +1,18 @@
=== tests/cases/conformance/es6/moduleExportsAmd/src/a.ts ===
import foo from "./b";
>foo : Symbol(foo, Decl(a.ts, 0, 6))
export default class Foo {}
>Foo : Symbol(Foo, Decl(a.ts, 0, 22))
foo();
>foo : Symbol(foo, Decl(a.ts, 0, 6))
=== tests/cases/conformance/es6/moduleExportsAmd/src/b.ts ===
import Foo from "./a";
>Foo : Symbol(Foo, Decl(b.ts, 0, 6))
export default function foo() { new Foo(); }
>foo : Symbol(foo, Decl(b.ts, 0, 22))
>Foo : Symbol(Foo, Decl(b.ts, 0, 6))

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/es6/moduleExportsAmd/src/a.ts ===
import foo from "./b";
>foo : () => void
export default class Foo {}
>Foo : Foo
foo();
>foo() : void
>foo : () => void
=== tests/cases/conformance/es6/moduleExportsAmd/src/b.ts ===
import Foo from "./a";
>Foo : typeof Foo
export default function foo() { new Foo(); }
>foo : () => void
>new Foo() : Foo
>Foo : typeof Foo

View File

@@ -0,0 +1,44 @@
//// [tests/cases/conformance/es6/moduleExportsSystem/outFilerootDirModuleNamesSystem.ts] ////
//// [a.ts]
import foo from "./b";
export default class Foo {}
foo();
//// [b.ts]
import Foo from "./a";
export default function foo() { new Foo(); }
//// [output.js]
System.register("b", ["a"], function(exports_1) {
"use strict";
var a_1;
function foo() { new a_1.default(); }
exports_1("default", foo);
return {
setters:[
function (a_1_1) {
a_1 = a_1_1;
}],
execute: function() {
}
}
});
System.register("a", ["b"], function(exports_2) {
"use strict";
var b_1;
var Foo;
return {
setters:[
function (b_1_1) {
b_1 = b_1_1;
}],
execute: function() {
class Foo {
}
exports_2("default", Foo);
b_1.default();
}
}
});

View File

@@ -0,0 +1,18 @@
=== tests/cases/conformance/es6/moduleExportsSystem/src/a.ts ===
import foo from "./b";
>foo : Symbol(foo, Decl(a.ts, 0, 6))
export default class Foo {}
>Foo : Symbol(Foo, Decl(a.ts, 0, 22))
foo();
>foo : Symbol(foo, Decl(a.ts, 0, 6))
=== tests/cases/conformance/es6/moduleExportsSystem/src/b.ts ===
import Foo from "./a";
>Foo : Symbol(Foo, Decl(b.ts, 0, 6))
export default function foo() { new Foo(); }
>foo : Symbol(foo, Decl(b.ts, 0, 22))
>Foo : Symbol(Foo, Decl(b.ts, 0, 6))

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/es6/moduleExportsSystem/src/a.ts ===
import foo from "./b";
>foo : () => void
export default class Foo {}
>Foo : Foo
foo();
>foo() : void
>foo : () => void
=== tests/cases/conformance/es6/moduleExportsSystem/src/b.ts ===
import Foo from "./a";
>Foo : typeof Foo
export default function foo() { new Foo(); }
>foo : () => void
>new Foo() : Foo
>Foo : typeof Foo

View File

@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || function (d, b) {
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) {
define("ref/a", ["require", "exports"], function (require, exports) {
"use strict";
var A = (function () {
function A() {
@@ -23,7 +23,7 @@ define("tests/cases/compiler/ref/a", ["require", "exports"], function (require,
})();
exports.A = A;
});
define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) {
define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) {
"use strict";
var B = (function (_super) {
__extends(B, _super);
@@ -37,12 +37,12 @@ define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/re
//# sourceMappingURL=all.js.map
//// [all.d.ts]
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -13,7 +13,7 @@ sourceFile:tests/cases/compiler/ref/a.ts
>>> function __() { this.constructor = d; }
>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
>>>};
>>>define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) {
>>>define("ref/a", ["require", "exports"], function (require, exports) {
>>> "use strict";
>>> var A = (function () {
1 >^^^^
@@ -79,7 +79,7 @@ emittedFile:all.js
sourceFile:tests/cases/compiler/b.ts
-------------------------------------------------------------------
>>>});
>>>define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) {
>>>define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) {
>>> "use strict";
>>> var B = (function (_super) {
1 >^^^^

View File

@@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || function (d, b) {
//# sourceMappingURL=all.js.map
//// [all.d.ts]
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -15,12 +15,12 @@ export class B extends A { }
//# sourceMappingURL=all.js.map
//// [all.d.ts]
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || function (d, b) {
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
System.register("tests/cases/compiler/ref/a", [], function(exports_1) {
System.register("ref/a", [], function(exports_1) {
"use strict";
var A;
return {
@@ -29,7 +29,7 @@ System.register("tests/cases/compiler/ref/a", [], function(exports_1) {
}
}
});
System.register("tests/cases/compiler/b", ["tests/cases/compiler/ref/a"], function(exports_2) {
System.register("b", ["ref/a"], function(exports_2) {
"use strict";
var a_1;
var B;
@@ -53,12 +53,12 @@ System.register("tests/cases/compiler/b", ["tests/cases/compiler/ref/a"], functi
//# sourceMappingURL=all.js.map
//// [all.d.ts]
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -13,7 +13,7 @@ sourceFile:tests/cases/compiler/ref/a.ts
>>> function __() { this.constructor = d; }
>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
>>>};
>>>System.register("tests/cases/compiler/ref/a", [], function(exports_1) {
>>>System.register("ref/a", [], function(exports_1) {
>>> "use strict";
>>> var A;
>>> return {
@@ -82,7 +82,7 @@ sourceFile:tests/cases/compiler/b.ts
>>> }
>>> }
>>>});
>>>System.register("tests/cases/compiler/b", ["tests/cases/compiler/ref/a"], function(exports_2) {
>>>System.register("b", ["ref/a"], function(exports_2) {
>>> "use strict";
>>> var a_1;
>>> var B;

View File

@@ -20,12 +20,12 @@ var __extends = (this && this.__extends) || function (d, b) {
//# sourceMappingURL=all.js.map
//// [all.d.ts]
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -42,7 +42,7 @@ var Foo = (function () {
}
return Foo;
})();
define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) {
define("ref/a", ["require", "exports"], function (require, exports) {
"use strict";
/// <reference path="./b.ts" />
var A = (function () {
@@ -52,7 +52,7 @@ define("tests/cases/compiler/ref/a", ["require", "exports"], function (require,
})();
exports.A = A;
});
define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) {
define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) {
"use strict";
var B = (function (_super) {
__extends(B, _super);
@@ -71,13 +71,13 @@ declare class Foo {
member: Bar;
}
declare var GlobalFoo: Foo;
declare module "tests/cases/compiler/ref/a" {
declare module "ref/a" {
export class A {
member: typeof GlobalFoo;
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
declare module "b" {
import { A } from "ref/a";
export class B extends A {
}
}

View File

@@ -58,7 +58,7 @@ sourceFile:tests/cases/compiler/ref/b.ts
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
@@ -74,7 +74,7 @@ sourceFile:tests/cases/compiler/ref/b.ts
emittedFile:all.js
sourceFile:tests/cases/compiler/ref/a.ts
-------------------------------------------------------------------
>>>define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) {
>>>define("ref/a", ["require", "exports"], function (require, exports) {
>>> "use strict";
>>> /// <reference path="./b.ts" />
1->^^^^
@@ -155,7 +155,7 @@ emittedFile:all.js
sourceFile:tests/cases/compiler/b.ts
-------------------------------------------------------------------
>>>});
>>>define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) {
>>>define("b", ["require", "exports", "ref/a"], function (require, exports, a_1) {
>>> "use strict";
>>> var B = (function (_super) {
1 >^^^^

View File

@@ -1,6 +1,7 @@
tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
Types of property 'addEventListener' are incompatible.
Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'.
Type '(x: "bar") => string' provides no match for the signature '(x: string): any'
tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
@@ -14,6 +15,7 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali
!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'addEventListener' are incompatible.
!!! error TS2430: Type '(x: "bar") => string' is not assignable to type '{ (x: string): any; (x: "foo"): string; }'.
!!! error TS2430: Type '(x: "bar") => string' provides no match for the signature '(x: string): any'
addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.

View File

@@ -1,6 +1,7 @@
tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
Types of property 'addEventListener' are incompatible.
Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'.
Type '{ (x: "bar"): string; (x: "foo"): string; }' provides no match for the signature '(x: string): any'
tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
@@ -14,6 +15,7 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali
!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'.
!!! error TS2430: Types of property 'addEventListener' are incompatible.
!!! error TS2430: Type '{ (x: "bar"): string; (x: "foo"): string; }' is not assignable to type '(x: string) => any'.
!!! error TS2430: Type '{ (x: "bar"): string; (x: "foo"): string; }' provides no match for the signature '(x: string): any'
// shouldn't need to redeclare the string overload
addEventListener(x: 'bar'): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -3,6 +3,7 @@ tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => voi
tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'.
Index signature is missing in type '(s: string) => void'.
tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'.
Type '(s: string) => void' provides no match for the signature 'new (): number'
==== tests/cases/compiler/parseTypes.ts (4 errors) ====
@@ -27,4 +28,5 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => voi
z=g;
~
!!! error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'.
!!! error TS2322: Type '(s: string) => void' provides no match for the signature 'new (): number'

View File

@@ -1,5 +1,7 @@
tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'.
Type 'Object' provides no match for the signature '(): void'
tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'.
Type 'Object' provides no match for the signature '(): void'
==== tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts (2 errors) ====
@@ -13,6 +15,7 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut
i = o;
~
!!! error TS2322: Type 'Object' is not assignable to type 'I'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'
var a: {
(): void
@@ -21,4 +24,5 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut
a = o;
~
!!! error TS2322: Type 'Object' is not assignable to type '() => void'.
!!! error TS2322: Type 'Object' provides no match for the signature '(): void'

View File

@@ -14,7 +14,7 @@ declare module "outputdir_module_multifolder_ref/m2" {
export var m2_instance1: m2_c1;
export function m2_f1(): m2_c1;
}
declare module "test" {
declare module "outputdir_module_multifolder/test" {
import m1 = require("outputdir_module_multifolder/ref/m1");
import m2 = require("outputdir_module_multifolder_ref/m2");
export var a1: number;

View File

@@ -28,7 +28,7 @@ define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (
}
exports.m2_f1 = m2_f1;
});
define("test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) {
define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) {
"use strict";
exports.a1 = 10;
var c1 = (function () {

View File

@@ -342,7 +342,7 @@ emittedFile:bin/test.js
sourceFile:../test.ts
-------------------------------------------------------------------
>>>});
>>>define("test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) {
>>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) {
>>> "use strict";
>>> exports.a1 = 10;
1 >^^^^

View File

@@ -14,7 +14,7 @@ declare module "outputdir_module_multifolder_ref/m2" {
export var m2_instance1: m2_c1;
export function m2_f1(): m2_c1;
}
declare module "test" {
declare module "outputdir_module_multifolder/test" {
import m1 = require("outputdir_module_multifolder/ref/m1");
import m2 = require("outputdir_module_multifolder_ref/m2");
export var a1: number;

Some files were not shown because too many files have changed in this diff Show More