Merge branch 'master' into literalTypes

# Conflicts:
#	src/compiler/checker.ts
This commit is contained in:
Anders Hejlsberg
2016-07-24 07:28:11 -07:00
306 changed files with 4481 additions and 3322 deletions

View File

@@ -0,0 +1,28 @@
//// [decoratedClassExportsCommonJS1.ts]
declare var Something: any;
@Something({ v: () => Testing123 })
export class Testing123 {
static prop0: string;
static prop1 = Testing123.prop0;
}
//// [decoratedClassExportsCommonJS1.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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Testing123_1 = class Testing123 {
};
let Testing123 = Testing123_1;
Testing123.prop1 = Testing123.prop0;
Testing123 = Testing123_1 = __decorate([
Something({ v: () => Testing123 }),
__metadata('design:paramtypes', [])
], Testing123);
exports.Testing123 = Testing123;

View File

@@ -0,0 +1,21 @@
=== tests/cases/conformance/decorators/class/decoratedClassExportsCommonJS1.ts ===
declare var Something: any;
>Something : Symbol(Something, Decl(decoratedClassExportsCommonJS1.ts, 0, 11))
@Something({ v: () => Testing123 })
>Something : Symbol(Something, Decl(decoratedClassExportsCommonJS1.ts, 0, 11))
>v : Symbol(v, Decl(decoratedClassExportsCommonJS1.ts, 1, 12))
>Testing123 : Symbol(Testing123, Decl(decoratedClassExportsCommonJS1.ts, 0, 27))
export class Testing123 {
>Testing123 : Symbol(Testing123, Decl(decoratedClassExportsCommonJS1.ts, 0, 27))
static prop0: string;
>prop0 : Symbol(Testing123.prop0, Decl(decoratedClassExportsCommonJS1.ts, 2, 25))
static prop1 = Testing123.prop0;
>prop1 : Symbol(Testing123.prop1, Decl(decoratedClassExportsCommonJS1.ts, 3, 25))
>Testing123.prop0 : Symbol(Testing123.prop0, Decl(decoratedClassExportsCommonJS1.ts, 2, 25))
>Testing123 : Symbol(Testing123, Decl(decoratedClassExportsCommonJS1.ts, 0, 27))
>prop0 : Symbol(Testing123.prop0, Decl(decoratedClassExportsCommonJS1.ts, 2, 25))
}

View File

@@ -0,0 +1,24 @@
=== tests/cases/conformance/decorators/class/decoratedClassExportsCommonJS1.ts ===
declare var Something: any;
>Something : any
@Something({ v: () => Testing123 })
>Something({ v: () => Testing123 }) : any
>Something : any
>{ v: () => Testing123 } : { v: () => typeof Testing123; }
>v : () => typeof Testing123
>() => Testing123 : () => typeof Testing123
>Testing123 : typeof Testing123
export class Testing123 {
>Testing123 : Testing123
static prop0: string;
>prop0 : string
static prop1 = Testing123.prop0;
>prop1 : string
>Testing123.prop0 : string
>Testing123 : typeof Testing123
>prop0 : string
}

View File

@@ -0,0 +1,26 @@
//// [a.ts]
declare function forwardRef(x: any): any;
declare var Something: any;
@Something({ v: () => Testing123 })
export class Testing123 { }
//// [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;
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
let Testing123_1 = class Testing123 {
};
let Testing123 = Testing123_1;
Testing123 = Testing123_1 = __decorate([
Something({ v: () => Testing123 }),
__metadata('design:paramtypes', [])
], Testing123);
exports.Testing123 = Testing123;

View File

@@ -0,0 +1,17 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : Symbol(forwardRef, Decl(a.ts, 0, 0))
>x : Symbol(x, Decl(a.ts, 1, 28))
declare var Something: any;
>Something : Symbol(Something, Decl(a.ts, 2, 11))
@Something({ v: () => Testing123 })
>Something : Symbol(Something, Decl(a.ts, 2, 11))
>v : Symbol(v, Decl(a.ts, 3, 12))
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))
export class Testing123 { }
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : (x: any) => any
>x : any
declare var Something: any;
>Something : any
@Something({ v: () => Testing123 })
>Something({ v: () => Testing123 }) : any
>Something : any
>{ v: () => Testing123 } : { v: () => typeof Testing123; }
>v : () => typeof Testing123
>() => Testing123 : () => typeof Testing123
>Testing123 : typeof Testing123
export class Testing123 { }
>Testing123 : Testing123

View File

@@ -0,0 +1,39 @@
//// [a.ts]
declare function forwardRef(x: any): any;
declare var Something: any;
@Something({ v: () => Testing123 })
export class Testing123 {
static prop0: string;
static prop1 = Testing123.prop0;
}
//// [a.js]
System.register([], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var Testing123;
return {
setters:[],
execute: function() {
let Testing123_1 = class Testing123 {
};
let Testing123 = Testing123_1;
Testing123.prop1 = Testing123.prop0;
Testing123 = Testing123_1 = __decorate([
Something({ v: () => Testing123 }),
__metadata('design:paramtypes', [])
], Testing123);
exports_1("Testing123", Testing123);
}
}
});

View File

@@ -0,0 +1,26 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : Symbol(forwardRef, Decl(a.ts, 0, 0))
>x : Symbol(x, Decl(a.ts, 1, 28))
declare var Something: any;
>Something : Symbol(Something, Decl(a.ts, 2, 11))
@Something({ v: () => Testing123 })
>Something : Symbol(Something, Decl(a.ts, 2, 11))
>v : Symbol(v, Decl(a.ts, 3, 12))
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))
export class Testing123 {
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))
static prop0: string;
>prop0 : Symbol(Testing123.prop0, Decl(a.ts, 4, 25))
static prop1 = Testing123.prop0;
>prop1 : Symbol(Testing123.prop1, Decl(a.ts, 5, 25))
>Testing123.prop0 : Symbol(Testing123.prop0, Decl(a.ts, 4, 25))
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))
>prop0 : Symbol(Testing123.prop0, Decl(a.ts, 4, 25))
}

View File

@@ -0,0 +1,29 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : (x: any) => any
>x : any
declare var Something: any;
>Something : any
@Something({ v: () => Testing123 })
>Something({ v: () => Testing123 }) : any
>Something : any
>{ v: () => Testing123 } : { v: () => typeof Testing123; }
>v : () => typeof Testing123
>() => Testing123 : () => typeof Testing123
>Testing123 : typeof Testing123
export class Testing123 {
>Testing123 : Testing123
static prop0: string;
>prop0 : string
static prop1 = Testing123.prop0;
>prop1 : string
>Testing123.prop0 : string
>Testing123 : typeof Testing123
>prop0 : string
}

View File

@@ -0,0 +1,35 @@
//// [a.ts]
declare function forwardRef(x: any): any;
declare var Something: any;
@Something({ v: () => Testing123 })
export class Testing123 { }
//// [a.js]
System.register([], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
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 __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var Testing123;
return {
setters:[],
execute: function() {
let Testing123_1 = class Testing123 {
};
let Testing123 = Testing123_1;
Testing123 = Testing123_1 = __decorate([
Something({ v: () => Testing123 }),
__metadata('design:paramtypes', [])
], Testing123);
exports_1("Testing123", Testing123);
}
}
});

View File

@@ -0,0 +1,17 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : Symbol(forwardRef, Decl(a.ts, 0, 0))
>x : Symbol(x, Decl(a.ts, 1, 28))
declare var Something: any;
>Something : Symbol(Something, Decl(a.ts, 2, 11))
@Something({ v: () => Testing123 })
>Something : Symbol(Something, Decl(a.ts, 2, 11))
>v : Symbol(v, Decl(a.ts, 3, 12))
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))
export class Testing123 { }
>Testing123 : Symbol(Testing123, Decl(a.ts, 2, 27))

View File

@@ -0,0 +1,20 @@
=== tests/cases/conformance/decorators/class/a.ts ===
declare function forwardRef(x: any): any;
>forwardRef : (x: any) => any
>x : any
declare var Something: any;
>Something : any
@Something({ v: () => Testing123 })
>Something({ v: () => Testing123 }) : any
>Something : any
>{ v: () => Testing123 } : { v: () => typeof Testing123; }
>v : () => typeof Testing123
>() => Testing123 : () => typeof Testing123
>Testing123 : typeof Testing123
export class Testing123 { }
>Testing123 : Testing123

View File

@@ -14,7 +14,7 @@ class A {
class B {
constructor(...args: number[]) {}
@MyMethodDecorator
method(...args: string[]) {}
method(this: this, ...args: string[]) {}
}

View File

@@ -37,8 +37,9 @@ class B {
@MyMethodDecorator
>MyMethodDecorator : Symbol(MyMethodDecorator, Decl(emitDecoratorMetadata_restArgs.ts, 2, 13))
method(...args: string[]) {}
method(this: this, ...args: string[]) {}
>method : Symbol(B.method, Decl(emitDecoratorMetadata_restArgs.ts, 13, 37))
>args : Symbol(args, Decl(emitDecoratorMetadata_restArgs.ts, 15, 11))
>this : Symbol(this, Decl(emitDecoratorMetadata_restArgs.ts, 15, 11))
>args : Symbol(args, Decl(emitDecoratorMetadata_restArgs.ts, 15, 22))
}

View File

@@ -37,8 +37,9 @@ class B {
@MyMethodDecorator
>MyMethodDecorator : MethodDecorator
method(...args: string[]) {}
>method : (...args: string[]) => void
method(this: this, ...args: string[]) {}
>method : (this: this, ...args: string[]) => void
>this : this
>args : string[]
}

View File

@@ -0,0 +1,18 @@
//// [emitSkipsThisWithRestParameter.ts]
function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any {
return function(this: any, ...args: any[]) {
return fn.apply(this, [ this ].concat(args));
};
}
//// [emitSkipsThisWithRestParameter.js]
function rebase(fn) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
return fn.apply(this, [this].concat(args));
};
}

View File

@@ -0,0 +1,25 @@
=== tests/cases/compiler/emitSkipsThisWithRestParameter.ts ===
function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any {
>rebase : Symbol(rebase, Decl(emitSkipsThisWithRestParameter.ts, 0, 0))
>fn : Symbol(fn, Decl(emitSkipsThisWithRestParameter.ts, 0, 16))
>base : Symbol(base, Decl(emitSkipsThisWithRestParameter.ts, 0, 21))
>args : Symbol(args, Decl(emitSkipsThisWithRestParameter.ts, 0, 31))
>args : Symbol(args, Decl(emitSkipsThisWithRestParameter.ts, 0, 58))
return function(this: any, ...args: any[]) {
>this : Symbol(this, Decl(emitSkipsThisWithRestParameter.ts, 1, 20))
>args : Symbol(args, Decl(emitSkipsThisWithRestParameter.ts, 1, 30))
return fn.apply(this, [ this ].concat(args));
>fn.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>fn : Symbol(fn, Decl(emitSkipsThisWithRestParameter.ts, 0, 16))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>this : Symbol(this, Decl(emitSkipsThisWithRestParameter.ts, 1, 20))
>[ this ].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
>this : Symbol(this, Decl(emitSkipsThisWithRestParameter.ts, 1, 20))
>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --))
>args : Symbol(args, Decl(emitSkipsThisWithRestParameter.ts, 1, 30))
};
}

View File

@@ -0,0 +1,29 @@
=== tests/cases/compiler/emitSkipsThisWithRestParameter.ts ===
function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any {
>rebase : (fn: (base: any, ...args: any[]) => any) => (...args: any[]) => any
>fn : (base: any, ...args: any[]) => any
>base : any
>args : any[]
>args : any[]
return function(this: any, ...args: any[]) {
>function(this: any, ...args: any[]) { return fn.apply(this, [ this ].concat(args)); } : (this: any, ...args: any[]) => any
>this : any
>args : any[]
return fn.apply(this, [ this ].concat(args));
>fn.apply(this, [ this ].concat(args)) : any
>fn.apply : (this: Function, thisArg: any, argArray?: any) => any
>fn : (base: any, ...args: any[]) => any
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : any
>[ this ].concat(args) : any[]
>[ this ].concat : (...items: any[]) => any[]
>[ this ] : any[]
>this : any
>concat : (...items: any[]) => any[]
>args : any[]
};
}

View File

@@ -0,0 +1,36 @@
//// [input.js]
function Class()
{
}
// error: 'Class' doesn't have property 'notPresent'
Class.prototype.containsError = function () { return this.notPresent; };
// lots of methods that return this, which caused out-of-memory in #9527
Class.prototype.m1 = function (a, b, c, d, tx, ty) { return this; };
Class.prototype.m2 = function (x, y) { return this; };
Class.prototype.m3 = function (x, y) { return this; };
Class.prototype.m4 = function (angle) { return this; };
Class.prototype.m5 = function (matrix) { return this; };
Class.prototype.m6 = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; };
Class.prototype.m7 = function(matrix) { return this; };
Class.prototype.m8 = function() { return this; };
Class.prototype.m9 = function () { return this; };
//// [output.js]
function Class() {
}
// error: 'Class' doesn't have property 'notPresent'
Class.prototype.containsError = function () { return this.notPresent; };
// lots of methods that return this, which caused out-of-memory in #9527
Class.prototype.m1 = function (a, b, c, d, tx, ty) { return this; };
Class.prototype.m2 = function (x, y) { return this; };
Class.prototype.m3 = function (x, y) { return this; };
Class.prototype.m4 = function (angle) { return this; };
Class.prototype.m5 = function (matrix) { return this; };
Class.prototype.m6 = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; };
Class.prototype.m7 = function (matrix) { return this; };
Class.prototype.m8 = function () { return this; };
Class.prototype.m9 = function () { return this; };

View File

@@ -0,0 +1,101 @@
=== tests/cases/conformance/salsa/input.js ===
function Class()
>Class : Symbol(Class, Decl(input.js, 0, 0))
{
}
// error: 'Class' doesn't have property 'notPresent'
Class.prototype.containsError = function () { return this.notPresent; };
>Class.prototype : Symbol(Class.containsError, Decl(input.js, 2, 1))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>containsError : Symbol(Class.containsError, Decl(input.js, 2, 1))
>this : Symbol(Class, Decl(input.js, 0, 0))
// lots of methods that return this, which caused out-of-memory in #9527
Class.prototype.m1 = function (a, b, c, d, tx, ty) { return this; };
>Class.prototype : Symbol(Class.m1, Decl(input.js, 5, 72))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m1 : Symbol(Class.m1, Decl(input.js, 5, 72))
>a : Symbol(a, Decl(input.js, 8, 31))
>b : Symbol(b, Decl(input.js, 8, 33))
>c : Symbol(c, Decl(input.js, 8, 36))
>d : Symbol(d, Decl(input.js, 8, 39))
>tx : Symbol(tx, Decl(input.js, 8, 42))
>ty : Symbol(ty, Decl(input.js, 8, 46))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m2 = function (x, y) { return this; };
>Class.prototype : Symbol(Class.m2, Decl(input.js, 8, 68))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m2 : Symbol(Class.m2, Decl(input.js, 8, 68))
>x : Symbol(x, Decl(input.js, 9, 31))
>y : Symbol(y, Decl(input.js, 9, 33))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m3 = function (x, y) { return this; };
>Class.prototype : Symbol(Class.m3, Decl(input.js, 9, 54))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m3 : Symbol(Class.m3, Decl(input.js, 9, 54))
>x : Symbol(x, Decl(input.js, 10, 31))
>y : Symbol(y, Decl(input.js, 10, 33))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m4 = function (angle) { return this; };
>Class.prototype : Symbol(Class.m4, Decl(input.js, 10, 54))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m4 : Symbol(Class.m4, Decl(input.js, 10, 54))
>angle : Symbol(angle, Decl(input.js, 11, 31))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m5 = function (matrix) { return this; };
>Class.prototype : Symbol(Class.m5, Decl(input.js, 11, 55))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m5 : Symbol(Class.m5, Decl(input.js, 11, 55))
>matrix : Symbol(matrix, Decl(input.js, 12, 31))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m6 = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; };
>Class.prototype : Symbol(Class.m6, Decl(input.js, 12, 56))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m6 : Symbol(Class.m6, Decl(input.js, 12, 56))
>x : Symbol(x, Decl(input.js, 13, 31))
>y : Symbol(y, Decl(input.js, 13, 33))
>pivotX : Symbol(pivotX, Decl(input.js, 13, 36))
>pivotY : Symbol(pivotY, Decl(input.js, 13, 44))
>scaleX : Symbol(scaleX, Decl(input.js, 13, 52))
>scaleY : Symbol(scaleY, Decl(input.js, 13, 60))
>rotation : Symbol(rotation, Decl(input.js, 13, 68))
>skewX : Symbol(skewX, Decl(input.js, 13, 78))
>skewY : Symbol(skewY, Decl(input.js, 13, 85))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m7 = function(matrix) { return this; };
>Class.prototype : Symbol(Class.m7, Decl(input.js, 13, 110))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m7 : Symbol(Class.m7, Decl(input.js, 13, 110))
>matrix : Symbol(matrix, Decl(input.js, 14, 30))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m8 = function() { return this; };
>Class.prototype : Symbol(Class.m8, Decl(input.js, 14, 55))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m8 : Symbol(Class.m8, Decl(input.js, 14, 55))
>this : Symbol(Class, Decl(input.js, 0, 0))
Class.prototype.m9 = function () { return this; };
>Class.prototype : Symbol(Class.m9, Decl(input.js, 15, 49))
>Class : Symbol(Class, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m9 : Symbol(Class.m9, Decl(input.js, 15, 49))
>this : Symbol(Class, Decl(input.js, 0, 0))

View File

@@ -0,0 +1,133 @@
=== tests/cases/conformance/salsa/input.js ===
function Class()
>Class : () => void
{
}
// error: 'Class' doesn't have property 'notPresent'
Class.prototype.containsError = function () { return this.notPresent; };
>Class.prototype.containsError = function () { return this.notPresent; } : () => any
>Class.prototype.containsError : any
>Class.prototype : any
>Class : () => void
>prototype : any
>containsError : any
>function () { return this.notPresent; } : () => any
>this.notPresent : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>notPresent : any
// lots of methods that return this, which caused out-of-memory in #9527
Class.prototype.m1 = function (a, b, c, d, tx, ty) { return this; };
>Class.prototype.m1 = function (a, b, c, d, tx, ty) { return this; } : (a: any, b: any, c: any, d: any, tx: any, ty: any) => { containsError: () => any; m1: any; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m1 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m1 : any
>function (a, b, c, d, tx, ty) { return this; } : (a: any, b: any, c: any, d: any, tx: any, ty: any) => { containsError: () => any; m1: any; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>a : any
>b : any
>c : any
>d : any
>tx : any
>ty : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m2 = function (x, y) { return this; };
>Class.prototype.m2 = function (x, y) { return this; } : (x: any, y: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: any; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m2 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m2 : any
>function (x, y) { return this; } : (x: any, y: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: any; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>x : any
>y : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m3 = function (x, y) { return this; };
>Class.prototype.m3 = function (x, y) { return this; } : (x: any, y: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: any; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m3 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m3 : any
>function (x, y) { return this; } : (x: any, y: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: any; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>x : any
>y : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m4 = function (angle) { return this; };
>Class.prototype.m4 = function (angle) { return this; } : (angle: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: any; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m4 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m4 : any
>function (angle) { return this; } : (angle: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: any; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>angle : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m5 = function (matrix) { return this; };
>Class.prototype.m5 = function (matrix) { return this; } : (matrix: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: any; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m5 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m5 : any
>function (matrix) { return this; } : (matrix: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: any; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>matrix : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m6 = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; };
>Class.prototype.m6 = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; } : (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: any; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m6 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m6 : any
>function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { return this; } : (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: any; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
>x : any
>y : any
>pivotX : any
>pivotY : any
>scaleX : any
>scaleY : any
>rotation : any
>skewX : any
>skewY : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m7 = function(matrix) { return this; };
>Class.prototype.m7 = function(matrix) { return this; } : (matrix: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: any; m8: () => typeof Class; m9: () => typeof Class; }
>Class.prototype.m7 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m7 : any
>function(matrix) { return this; } : (matrix: any) => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: any; m8: () => typeof Class; m9: () => typeof Class; }
>matrix : any
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m8 = function() { return this; };
>Class.prototype.m8 = function() { return this; } : () => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: any; m9: () => typeof Class; }
>Class.prototype.m8 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m8 : any
>function() { return this; } : () => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: any; m9: () => typeof Class; }
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }
Class.prototype.m9 = function () { return this; };
>Class.prototype.m9 = function () { return this; } : () => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: any; }
>Class.prototype.m9 : any
>Class.prototype : any
>Class : () => void
>prototype : any
>m9 : any
>function () { return this; } : () => { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: any; }
>this : { containsError: () => any; m1: (a: any, b: any, c: any, d: any, tx: any, ty: any) => typeof Class; m2: (x: any, y: any) => typeof Class; m3: (x: any, y: any) => typeof Class; m4: (angle: any) => typeof Class; m5: (matrix: any) => typeof Class; m6: (x: any, y: any, pivotX: any, pivotY: any, scaleX: any, scaleY: any, rotation: any, skewX: any, skewY: any) => typeof Class; m7: (matrix: any) => typeof Class; m8: () => typeof Class; m9: () => typeof Class; }

View File

@@ -8,6 +8,8 @@ export {};
//// [app.ts]
import "A"
//// [index.js]
"use strict";
//// [app.js]
"use strict";
require("A");

View File

@@ -0,0 +1,17 @@
//// [input.js]
function C() {
this.m = null;
}
C.prototype.m = function() {
this.nothing();
};
//// [output.js]
function C() {
this.m = null;
}
C.prototype.m = function () {
this.nothing();
};

View File

@@ -0,0 +1,19 @@
=== tests/cases/conformance/salsa/input.js ===
function C() {
>C : Symbol(C, Decl(input.js, 0, 0))
this.m = null;
>m : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1))
}
C.prototype.m = function() {
>C.prototype : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1))
>C : Symbol(C, Decl(input.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --))
>m : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1))
this.nothing();
>this : Symbol(C, Decl(input.js, 0, 0))
};

View File

@@ -0,0 +1,29 @@
=== tests/cases/conformance/salsa/input.js ===
function C() {
>C : () => void
this.m = null;
>this.m = null : null
>this.m : any
>this : any
>m : any
>null : null
}
C.prototype.m = function() {
>C.prototype.m = function() { this.nothing();} : () => void
>C.prototype.m : any
>C.prototype : any
>C : () => void
>prototype : any
>m : any
>function() { this.nothing();} : () => void
this.nothing();
>this.nothing() : any
>this.nothing : any
>this : { m: () => void; }
>nothing : any
};

View File

@@ -0,0 +1,8 @@
=== tests/cases/compiler/0.d.ts ===
export = a;
>a : Symbol(a, Decl(0.d.ts, 2, 11))
declare var a: number;
>a : Symbol(a, Decl(0.d.ts, 2, 11))

View File

@@ -0,0 +1,8 @@
=== tests/cases/compiler/0.d.ts ===
export = a;
>a : number
declare var a: number;
>a : number

View File

@@ -0,0 +1,12 @@
tests/cases/compiler/1.ts(2,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
==== tests/cases/compiler/1.ts (1 errors) ====
export var j = "hello"; // error
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
==== tests/cases/compiler/0.d.ts (0 errors) ====
export = a;
declare var a: number;

View File

@@ -0,0 +1,13 @@
//// [tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile2.ts] ////
//// [1.ts]
export var j = "hello"; // error
//// [0.d.ts]
export = a;
declare var a: number;
//// [1.js]
"use strict";
exports.j = "hello"; // error

View File

@@ -0,0 +1,13 @@
tests/cases/compiler/1.ts(1,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.
==== tests/cases/compiler/0.d.ts (0 errors) ====
export = a;
declare var a: number;
==== tests/cases/compiler/1.ts (1 errors) ====
export var j = "hello"; // error
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'.

View File

@@ -0,0 +1,14 @@
//// [tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile3.ts] ////
//// [0.d.ts]
export = a;
declare var a: number;
//// [1.ts]
export var j = "hello"; // error
//// [1.js]
"use strict";
exports.j = "hello"; // error

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/test.d.ts ===
declare var S: typeof A; // no error
>S : Symbol(S, Decl(test.d.ts, 1, 11))
>A : Symbol(A, Decl(test.d.ts, 2, 13))
declare const A: number;
>A : Symbol(A, Decl(test.d.ts, 2, 13))

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/test.d.ts ===
declare var S: typeof A; // no error
>S : number
>A : number
declare const A: number;
>A : number

View File

@@ -13,7 +13,5 @@ export declare var y;
import y = require("a");
//// [ref.js]
var x = 1;
//// [b.js]
"use strict";

View File

@@ -12,7 +12,5 @@ export declare var y;
//// [b.ts]
import y = require("a");
//// [ref.js]
var x = 1;
//// [b.js]
"use strict";

View File

@@ -31,6 +31,9 @@ exports.x = 1;
//// [file2.js]
"use strict";
exports.y = 1;
//// [file4.js]
"use strict";
exports.z1 = 1;
//// [file1.js]
"use strict";
var file1_1 = require("folder2/file1");

View File

@@ -0,0 +1,6 @@
error TS5066: Substitutions for pattern 'foo' shouldn't be an empty array.
!!! error TS5066: Substitutions for pattern 'foo' shouldn't be an empty array.
==== tests/cases/compiler/a.ts (0 errors) ====
let x = 1;

View File

@@ -0,0 +1,5 @@
//// [a.ts]
let x = 1;
//// [a.js]
var x = 1;

View File

@@ -0,0 +1,10 @@
var m2 = require('m2');
var rel = require('./relative');
/**
* @param {string} p1 The first param
*/
exports.f1 = function (p1) {
return 42;
};
exports.f2 = m2;
exports.rel = rel.relativeProp;

View File

@@ -0,0 +1 @@
exports.relativeProp = true;

View File

@@ -2,5 +2,6 @@ define(["require", "exports", "m1"], function (require, exports, m1) {
"use strict";
m1.f1("test");
m1.f2.a = "10"; // Error: Should be number
m1.rel = 42; // Error: Should be boolean
m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any".
});

View File

@@ -1,4 +1,5 @@
maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'.
maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
==== entry.js (0 errors) ====
@@ -10,8 +11,12 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== index.js (0 errors) ====
==== relative.js (0 errors) ====
exports.relativeProp = true;
==== maxDepthExceeded/node_modules/m1/index.js (0 errors) ====
var m2 = require('m2');
var rel = require('./relative');
/**
* @param {string} p1 The first param
@@ -22,11 +27,17 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
exports.f2 = m2;
==== maxDepthExceeded/root.ts (1 errors) ====
exports.rel = rel.relativeProp;
==== maxDepthExceeded/root.ts (2 errors) ====
import * as m1 from "m1";
m1.f1("test");
m1.f2.a = "10"; // Error: Should be number
~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
m1.rel = 42; // Error: Should be boolean
~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any".

View File

@@ -8,10 +8,13 @@
"resolvedInputFiles": [
"lib.d.ts",
"maxDepthExceeded/node_modules/m2/entry.js",
"maxDepthExceeded/node_modules/m1/relative.js",
"maxDepthExceeded/node_modules/m1/index.js",
"maxDepthExceeded/root.ts"
],
"emittedFiles": [
"maxDepthExceeded/root.js"
"maxDepthExceeded/built/node_modules/m1/relative.js",
"maxDepthExceeded/built/node_modules/m1/index.js",
"maxDepthExceeded/built/root.js"
]
}

View File

@@ -0,0 +1,10 @@
var m2 = require('m2');
var rel = require('./relative');
/**
* @param {string} p1 The first param
*/
exports.f1 = function (p1) {
return 42;
};
exports.f2 = m2;
exports.rel = rel.relativeProp;

View File

@@ -0,0 +1 @@
exports.relativeProp = true;

View File

@@ -2,4 +2,5 @@
var m1 = require("m1");
m1.f1("test");
m1.f2.a = "10"; // Error: Should be number
m1.rel = 42; // Error: Should be boolean
m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any".

View File

@@ -1,4 +1,5 @@
maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'.
maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
==== entry.js (0 errors) ====
@@ -10,8 +11,12 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
"person": m3.person
};
==== index.js (0 errors) ====
==== relative.js (0 errors) ====
exports.relativeProp = true;
==== maxDepthExceeded/node_modules/m1/index.js (0 errors) ====
var m2 = require('m2');
var rel = require('./relative');
/**
* @param {string} p1 The first param
@@ -22,11 +27,17 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to
exports.f2 = m2;
==== maxDepthExceeded/root.ts (1 errors) ====
exports.rel = rel.relativeProp;
==== maxDepthExceeded/root.ts (2 errors) ====
import * as m1 from "m1";
m1.f1("test");
m1.f2.a = "10"; // Error: Should be number
~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
m1.rel = 42; // Error: Should be boolean
~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any".

View File

@@ -8,10 +8,13 @@
"resolvedInputFiles": [
"lib.d.ts",
"maxDepthExceeded/node_modules/m2/entry.js",
"maxDepthExceeded/node_modules/m1/relative.js",
"maxDepthExceeded/node_modules/m1/index.js",
"maxDepthExceeded/root.ts"
],
"emittedFiles": [
"maxDepthExceeded/root.js"
"maxDepthExceeded/built/node_modules/m1/relative.js",
"maxDepthExceeded/built/node_modules/m1/index.js",
"maxDepthExceeded/built/root.js"
]
}

View File

@@ -0,0 +1,42 @@
//// [tests/cases/compiler/relativeModuleWithoutSlash.ts] ////
//// [a.ts]
export default { a: 0 };
//// [index.ts]
export default { aIndex: 0 };
//// [test.ts]
import a from ".";
import aIndex from "./";
a.a;
aIndex.a; //aIndex.aIndex; See GH#9690
//// [test.ts]
import a from "..";
import aIndex from "../";
a.a;
aIndex.a; //aIndex.aIndex;
//// [a.js]
"use strict";
exports.__esModule = true;
exports["default"] = { a: 0 };
//// [index.js]
"use strict";
exports.__esModule = true;
exports["default"] = { aIndex: 0 };
//// [test.js]
"use strict";
var _1 = require(".");
var _2 = require("./");
_1["default"].a;
_2["default"].a; //aIndex.aIndex; See GH#9690
//// [test.js]
"use strict";
var __1 = require("..");
var _1 = require("../");
__1["default"].a;
_1["default"].a; //aIndex.aIndex;

View File

@@ -0,0 +1,43 @@
=== /a.ts ===
export default { a: 0 };
>a : Symbol(a, Decl(a.ts, 1, 16))
=== /a/index.ts ===
export default { aIndex: 0 };
>aIndex : Symbol(aIndex, Decl(index.ts, 0, 16))
=== /a/test.ts ===
import a from ".";
>a : Symbol(a, Decl(test.ts, 0, 6))
import aIndex from "./";
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
a.a;
>a.a : Symbol(a, Decl(a.ts, 1, 16))
>a : Symbol(a, Decl(test.ts, 0, 6))
>a : Symbol(a, Decl(a.ts, 1, 16))
aIndex.a; //aIndex.aIndex; See GH#9690
>aIndex.a : Symbol(a, Decl(a.ts, 1, 16))
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
>a : Symbol(a, Decl(a.ts, 1, 16))
=== /a/b/test.ts ===
import a from "..";
>a : Symbol(a, Decl(test.ts, 0, 6))
import aIndex from "../";
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
a.a;
>a.a : Symbol(a, Decl(a.ts, 1, 16))
>a : Symbol(a, Decl(test.ts, 0, 6))
>a : Symbol(a, Decl(a.ts, 1, 16))
aIndex.a; //aIndex.aIndex;
>aIndex.a : Symbol(a, Decl(a.ts, 1, 16))
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
>a : Symbol(a, Decl(a.ts, 1, 16))

View File

@@ -0,0 +1,26 @@
[
"======== Resolving module '.' from '/a/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a'.",
"File '/a.ts' exist - use it as a name resolution result.",
"Resolving real path for '/a.ts', result '/a.ts'",
"======== Module name '.' was successfully resolved to '/a.ts'. ========",
"======== Resolving module './' from '/a/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a'.",
"File '/a.ts' exist - use it as a name resolution result.",
"Resolving real path for '/a.ts', result '/a.ts'",
"======== Module name './' was successfully resolved to '/a.ts'. ========",
"======== Resolving module '..' from '/a/b/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a'.",
"File '/a.ts' exist - use it as a name resolution result.",
"Resolving real path for '/a.ts', result '/a.ts'",
"======== Module name '..' was successfully resolved to '/a.ts'. ========",
"======== Resolving module '../' from '/a/b/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a'.",
"File '/a.ts' exist - use it as a name resolution result.",
"Resolving real path for '/a.ts', result '/a.ts'",
"======== Module name '../' was successfully resolved to '/a.ts'. ========"
]

View File

@@ -0,0 +1,47 @@
=== /a.ts ===
export default { a: 0 };
>{ a: 0 } : { a: number; }
>a : number
>0 : number
=== /a/index.ts ===
export default { aIndex: 0 };
>{ aIndex: 0 } : { aIndex: number; }
>aIndex : number
>0 : number
=== /a/test.ts ===
import a from ".";
>a : { a: number; }
import aIndex from "./";
>aIndex : { a: number; }
a.a;
>a.a : number
>a : { a: number; }
>a : number
aIndex.a; //aIndex.aIndex; See GH#9690
>aIndex.a : number
>aIndex : { a: number; }
>a : number
=== /a/b/test.ts ===
import a from "..";
>a : { a: number; }
import aIndex from "../";
>aIndex : { a: number; }
a.a;
>a.a : number
>a : { a: number; }
>a : number
aIndex.a; //aIndex.aIndex;
>aIndex.a : number
>aIndex : { a: number; }
>a : number

View File

@@ -19,6 +19,8 @@ MyClass.prototype.optionalParam = function(required, notRequired) {
>notRequired : Symbol(notRequired, Decl(jsDocOptionality.js, 8, 52))
return this;
>this : Symbol(MyClass, Decl(jsDocOptionality.js, 0, 0))
};
let pInst = new MyClass();
>pInst : Symbol(pInst, Decl(jsDocOptionality.js, 11, 3))

View File

@@ -26,27 +26,27 @@ MyClass.prototype.optionalParam = function(required, notRequired) {
>notRequired : string
return this;
>this : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>this : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
};
let pInst = new MyClass();
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>new MyClass() : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>new MyClass() : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>MyClass : () => void
let c1 = pInst.optionalParam('hello')
>c1 : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>pInst.optionalParam('hello') : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>c1 : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>pInst.optionalParam('hello') : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; }
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; }
>'hello' : string
let c2 = pInst.optionalParam('hello', null)
>c2 : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>pInst.optionalParam('hello', null) : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>c2 : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>pInst.optionalParam('hello', null) : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; }
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => { prop: null; optionalParam: any; }; }
>pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; }
>optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; }
>'hello' : string
>null : null

View File

@@ -13,60 +13,60 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference
noParams ``;
// Generic tag with parameter which does not use type parameter
function noGenericParams<T>(n: string[]) { }
function noGenericParams<T>(n: TemplateStringsArray) { }
noGenericParams ``;
// Generic tag with multiple type parameters and only one used in parameter type annotation
function someGenerics1a<T, U>(n: T, m: number) { }
someGenerics1a `${3}`;
function someGenerics1b<T, U>(n: string[], m: U) { }
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
someGenerics1b `${3}`;
// Generic tag with argument of function type whose parameter is of type parameter type
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
someGenerics2a `${(n: string) => n}`;
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
someGenerics2b `${ (n: string, x: number) => n }`;
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
function someGenerics3<T>(strs: string[], producer: () => T) { }
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
someGenerics3 `${() => ''}`;
someGenerics3 `${() => undefined}`;
someGenerics3 `${() => 3}`;
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics4 `${4}${ () => null }`;
someGenerics4 `${''}${ () => 3 }`;
someGenerics4 `${ null }${ null }`;
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics5 `${ 4 } ${ () => null }`;
someGenerics5 `${ '' }${ () => 3 }`;
someGenerics5 `${null}${null}`;
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
// Generic tag with multiple arguments of function types that each have parameters of different generic type
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
// Generic tag with argument of generic function type
function someGenerics8<T>(strs: string[], n: T): T { return n; }
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
var x = someGenerics8 `${ someGenerics7 }`;
x `${null}${null}${null}`;
// Generic tag with multiple parameters of generic type passed arguments with no best common type
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
return null;
}
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

View File

@@ -6,60 +6,60 @@ function noParams<T>(n: T) { }
noParams ``;
// Generic tag with parameter which does not use type parameter
function noGenericParams<T>(n: string[]) { }
function noGenericParams<T>(n: TemplateStringsArray) { }
noGenericParams ``;
// Generic tag with multiple type parameters and only one used in parameter type annotation
function someGenerics1a<T, U>(n: T, m: number) { }
someGenerics1a `${3}`;
function someGenerics1b<T, U>(n: string[], m: U) { }
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
someGenerics1b `${3}`;
// Generic tag with argument of function type whose parameter is of type parameter type
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
someGenerics2a `${(n: string) => n}`;
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
someGenerics2b `${ (n: string, x: number) => n }`;
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
function someGenerics3<T>(strs: string[], producer: () => T) { }
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
someGenerics3 `${() => ''}`;
someGenerics3 `${() => undefined}`;
someGenerics3 `${() => 3}`;
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics4 `${4}${ () => null }`;
someGenerics4 `${''}${ () => 3 }`;
someGenerics4 `${ null }${ null }`;
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics5 `${ 4 } ${ () => null }`;
someGenerics5 `${ '' }${ () => 3 }`;
someGenerics5 `${null}${null}`;
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
// Generic tag with multiple arguments of function types that each have parameters of different generic type
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
// Generic tag with argument of generic function type
function someGenerics8<T>(strs: string[], n: T): T { return n; }
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
var x = someGenerics8 `${ someGenerics7 }`;
x `${null}${null}${null}`;
// Generic tag with multiple parameters of generic type passed arguments with no best common type
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
return null;
}
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

View File

@@ -12,60 +12,60 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference
noParams ``;
// Generic tag with parameter which does not use type parameter
function noGenericParams<T>(n: string[]) { }
function noGenericParams<T>(n: TemplateStringsArray) { }
noGenericParams ``;
// Generic tag with multiple type parameters and only one used in parameter type annotation
function someGenerics1a<T, U>(n: T, m: number) { }
someGenerics1a `${3}`;
function someGenerics1b<T, U>(n: string[], m: U) { }
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
someGenerics1b `${3}`;
// Generic tag with argument of function type whose parameter is of type parameter type
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
someGenerics2a `${(n: string) => n}`;
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
someGenerics2b `${ (n: string, x: number) => n }`;
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
function someGenerics3<T>(strs: string[], producer: () => T) { }
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
someGenerics3 `${() => ''}`;
someGenerics3 `${() => undefined}`;
someGenerics3 `${() => 3}`;
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics4 `${4}${ () => null }`;
someGenerics4 `${''}${ () => 3 }`;
someGenerics4 `${ null }${ null }`;
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics5 `${ 4 } ${ () => null }`;
someGenerics5 `${ '' }${ () => 3 }`;
someGenerics5 `${null}${null}`;
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
// Generic tag with multiple arguments of function types that each have parameters of different generic type
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
// Generic tag with argument of generic function type
function someGenerics8<T>(strs: string[], n: T): T { return n; }
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
var x = someGenerics8 `${ someGenerics7 }`;
x `${null}${null}${null}`;
// Generic tag with multiple parameters of generic type passed arguments with no best common type
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
return null;
}
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

View File

@@ -5,60 +5,60 @@ function noParams<T>(n: T) { }
noParams ``;
// Generic tag with parameter which does not use type parameter
function noGenericParams<T>(n: string[]) { }
function noGenericParams<T>(n: TemplateStringsArray) { }
noGenericParams ``;
// Generic tag with multiple type parameters and only one used in parameter type annotation
function someGenerics1a<T, U>(n: T, m: number) { }
someGenerics1a `${3}`;
function someGenerics1b<T, U>(n: string[], m: U) { }
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
someGenerics1b `${3}`;
// Generic tag with argument of function type whose parameter is of type parameter type
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
someGenerics2a `${(n: string) => n}`;
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
someGenerics2b `${ (n: string, x: number) => n }`;
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
function someGenerics3<T>(strs: string[], producer: () => T) { }
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
someGenerics3 `${() => ''}`;
someGenerics3 `${() => undefined}`;
someGenerics3 `${() => 3}`;
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics4 `${4}${ () => null }`;
someGenerics4 `${''}${ () => 3 }`;
someGenerics4 `${ null }${ null }`;
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
someGenerics5 `${ 4 } ${ () => null }`;
someGenerics5 `${ '' }${ () => 3 }`;
someGenerics5 `${null}${null}`;
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
// Generic tag with multiple arguments of function types that each have parameters of different generic type
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
// Generic tag with argument of generic function type
function someGenerics8<T>(strs: string[], n: T): T { return n; }
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
var x = someGenerics8 `${ someGenerics7 }`;
x `${null}${null}${null}`;
// Generic tag with multiple parameters of generic type passed arguments with no best common type
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
return null;
}
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

View File

@@ -8,7 +8,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (6 errors) ====
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithIncompatibleTypedTags.ts]
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@@ -8,7 +8,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ====
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithIncompatibleTypedTagsES6.ts]
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithManyCallAndMemberExpressions.ts]
interface I {
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
member: {
new (s: string): {
new (n: number): {

View File

@@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 0, 0))
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : Symbol(strs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 5))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 20))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, --, --))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 32))
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 0, 0))
member: {
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))
new (s: string): {
>s : Symbol(s, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 3, 13))
@@ -27,8 +28,8 @@ var f: I;
var x = new new new f `abc${ 0 }def`.member("hello")(42) === true;
>x : Symbol(x, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 12, 3))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))
>f : Symbol(f, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 10, 3))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))

View File

@@ -2,8 +2,9 @@
interface I {
>I : I
(strs: string[], ...subs: number[]): I;
>strs : string[]
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>subs : number[]
>I : I

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts]
interface I {
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
member: {
new (s: string): {
new (n: number): {

View File

@@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 0, 0))
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : Symbol(strs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 5))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 20))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 32))
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 0, 0))
member: {
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))
new (s: string): {
>s : Symbol(s, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 3, 13))
@@ -27,8 +28,8 @@ var f: I;
var x = new new new f `abc${ 0 }def`.member("hello")(42) === true;
>x : Symbol(x, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 12, 3))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))
>f : Symbol(f, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 10, 3))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))

View File

@@ -2,8 +2,9 @@
interface I {
>I : I
(strs: string[], ...subs: number[]): I;
>strs : string[]
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>subs : number[]
>I : I

View File

@@ -1,25 +1,39 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (4 errors) ====
function foo(strs: string[]): number;
function foo(strs: string[], x: number): string;
function foo(strs: string[], x: number, y: number): boolean;
function foo(strs: string[], x: number, y: string): {};
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (8 errors) ====
function foo(strs: TemplateStringsArray): number;
function foo(strs: TemplateStringsArray, x: number): string;
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
function foo(strs: TemplateStringsArray, x: number, y: string): {};
function foo(...stuff: any[]): any {
return undefined;
}
var a = foo([]); // number
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]'.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.

View File

@@ -1,8 +1,8 @@
//// [taggedTemplateStringsWithOverloadResolution1.ts]
function foo(strs: string[]): number;
function foo(strs: string[], x: number): string;
function foo(strs: string[], x: number, y: number): boolean;
function foo(strs: string[], x: number, y: string): {};
function foo(strs: TemplateStringsArray): number;
function foo(strs: TemplateStringsArray, x: number): string;
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
function foo(strs: TemplateStringsArray, x: number, y: string): {};
function foo(...stuff: any[]): any {
return undefined;
}

View File

@@ -1,25 +1,39 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (4 errors) ====
function foo(strs: string[]): number;
function foo(strs: string[], x: number): string;
function foo(strs: string[], x: number, y: number): boolean;
function foo(strs: string[], x: number, y: string): {};
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (8 errors) ====
function foo(strs: TemplateStringsArray): number;
function foo(strs: TemplateStringsArray, x: number): string;
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
function foo(strs: TemplateStringsArray, x: number, y: string): {};
function foo(...stuff: any[]): any {
return undefined;
}
var a = foo([]); // number
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]'.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.

View File

@@ -1,8 +1,8 @@
//// [taggedTemplateStringsWithOverloadResolution1_ES6.ts]
function foo(strs: string[]): number;
function foo(strs: string[], x: number): string;
function foo(strs: string[], x: number, y: number): boolean;
function foo(strs: string[], x: number, y: string): {};
function foo(strs: TemplateStringsArray): number;
function foo(strs: TemplateStringsArray, x: number): string;
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
function foo(strs: TemplateStringsArray, x: number, y: string): {};
function foo(...stuff: any[]): any {
return undefined;
}

View File

@@ -6,8 +6,8 @@ function foo1(...stuff: any[]): any {
return undefined;
}
var a = foo1 `${1}`; // string
var b = foo1([], 1); // number
var a = foo1 `${1}`;
var b = foo1([], 1);
function foo2(strs: string[], x: number): number;
function foo2(strs: TemplateStringsArray, x: number): string;
@@ -15,8 +15,8 @@ function foo2(...stuff: any[]): any {
return undefined;
}
var c = foo2 `${1}`; // number
var d = foo2([], 1); // number
var c = foo2 `${1}`;
var d = foo2([], 1);
//// [taggedTemplateStringsWithOverloadResolution2.js]
function foo1() {
@@ -26,8 +26,8 @@ function foo1() {
}
return undefined;
}
var a = (_a = ["", ""], _a.raw = ["", ""], foo1(_a, 1)); // string
var b = foo1([], 1); // number
var a = (_a = ["", ""], _a.raw = ["", ""], foo1(_a, 1));
var b = foo1([], 1);
function foo2() {
var stuff = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -35,6 +35,6 @@ function foo2() {
}
return undefined;
}
var c = (_b = ["", ""], _b.raw = ["", ""], foo2(_b, 1)); // number
var d = foo2([], 1); // number
var c = (_b = ["", ""], _b.raw = ["", ""], foo2(_b, 1));
var d = foo2([], 1);
var _a, _b;

View File

@@ -19,11 +19,11 @@ function foo1(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : Symbol(a, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 7, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 1, 61), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 2, 49))
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : Symbol(b, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 1, 61), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 2, 49))
@@ -46,11 +46,11 @@ function foo2(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var c = foo2 `${1}`; // number
var c = foo2 `${1}`;
>c : Symbol(c, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 16, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 20), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 10, 49), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 11, 61))
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : Symbol(d, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 17, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 20), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 10, 49), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 11, 61))

View File

@@ -19,14 +19,14 @@ function foo1(...stuff: any[]): any {
>undefined : undefined
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : string
>foo1 `${1}` : string
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
>`${1}` : string
>1 : number
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : number
>foo1([], 1) : number
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
@@ -52,14 +52,14 @@ function foo2(...stuff: any[]): any {
>undefined : undefined
}
var c = foo2 `${1}`; // number
>c : number
>foo2 `${1}` : number
var c = foo2 `${1}`;
>c : string
>foo2 `${1}` : string
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }
>`${1}` : string
>1 : number
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : number
>foo2([], 1) : number
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }

View File

@@ -5,8 +5,8 @@ function foo1(...stuff: any[]): any {
return undefined;
}
var a = foo1 `${1}`; // string
var b = foo1([], 1); // number
var a = foo1 `${1}`;
var b = foo1([], 1);
function foo2(strs: string[], x: number): number;
function foo2(strs: TemplateStringsArray, x: number): string;
@@ -14,17 +14,17 @@ function foo2(...stuff: any[]): any {
return undefined;
}
var c = foo2 `${1}`; // number
var d = foo2([], 1); // number
var c = foo2 `${1}`;
var d = foo2([], 1);
//// [taggedTemplateStringsWithOverloadResolution2_ES6.js]
function foo1(...stuff) {
return undefined;
}
var a = foo1 `${1}`; // string
var b = foo1([], 1); // number
var a = foo1 `${1}`;
var b = foo1([], 1);
function foo2(...stuff) {
return undefined;
}
var c = foo2 `${1}`; // number
var d = foo2([], 1); // number
var c = foo2 `${1}`;
var d = foo2([], 1);

View File

@@ -18,11 +18,11 @@ function foo1(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : Symbol(a, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 6, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 61), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 1, 49))
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : Symbol(b, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 61), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 1, 49))
@@ -45,11 +45,11 @@ function foo2(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var c = foo2 `${1}`; // number
var c = foo2 `${1}`;
>c : Symbol(c, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 15, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 20), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 9, 49), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 61))
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : Symbol(d, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 16, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 20), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 9, 49), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 61))

View File

@@ -18,14 +18,14 @@ function foo1(...stuff: any[]): any {
>undefined : undefined
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : string
>foo1 `${1}` : string
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
>`${1}` : string
>1 : number
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : number
>foo1([], 1) : number
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
@@ -51,14 +51,14 @@ function foo2(...stuff: any[]): any {
>undefined : undefined
}
var c = foo2 `${1}`; // number
>c : number
>foo2 `${1}` : number
var c = foo2 `${1}`;
>c : string
>foo2 `${1}` : string
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }
>`${1}` : string
>1 : number
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : number
>foo2([], 1) : number
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithTypedTags.ts]
interface I {
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
g: I;
h: I;
member: I;

View File

@@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 5))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 27))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, --, --))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 39))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
g: I;
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 50))
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 62))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
h: I;

View File

@@ -2,8 +2,9 @@
interface I {
>I : I
(stringParts: string[], ...rest: number[]): I;
>stringParts : string[]
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>rest : number[]
>I : I

View File

@@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithTypedTagsES6.ts]
interface I {
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
g: I;
h: I;
member: I;

View File

@@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 5))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 27))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 39))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
g: I;
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 50))
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 62))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
h: I;

View File

@@ -2,8 +2,9 @@
interface I {
>I : I
(stringParts: string[], ...rest: number[]): I;
>stringParts : string[]
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>rest : number[]
>I : I

View File

@@ -0,0 +1,20 @@
tests/cases/compiler/b.d.ts(2,20): error TS2305: Module '"tests/cases/compiler/a".ns' has no exported member 'IFoo'.
==== tests/cases/compiler/a.d.ts (0 errors) ====
export = ns;
export as namespace ns;
declare namespace ns {
export var x: number;
export interface IFoo { }
}
==== tests/cases/compiler/b.d.ts (1 errors) ====
declare namespace ns.something {
export var p: ns.IFoo;
~~~~
!!! error TS2305: Module '"tests/cases/compiler/a".ns' has no exported member 'IFoo'.
}

View File

@@ -0,0 +1,67 @@
//// [unusedParametersThis.ts]
class A {
public a: number;
public method(this: this): number {
return this.a;
}
public method2(this: A): number {
return this.a;
}
public method3(this: this): number {
var fn = () => this.a;
return fn();
}
public method4(this: A): number {
var fn = () => this.a;
return fn();
}
static staticMethod(this: A): number {
return this.a;
}
}
function f(this: A): number {
return this.a
}
var f2 = function f2(this: A): number {
return this.a;
};
//// [unusedParametersThis.js]
var A = (function () {
function A() {
}
A.prototype.method = function () {
return this.a;
};
A.prototype.method2 = function () {
return this.a;
};
A.prototype.method3 = function () {
var _this = this;
var fn = function () { return _this.a; };
return fn();
};
A.prototype.method4 = function () {
var _this = this;
var fn = function () { return _this.a; };
return fn();
};
A.staticMethod = function () {
return this.a;
};
return A;
}());
function f() {
return this.a;
}
var f2 = function f2() {
return this.a;
};

View File

@@ -0,0 +1,93 @@
=== tests/cases/compiler/unusedParametersThis.ts ===
class A {
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
public a: number;
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
public method(this: this): number {
>method : Symbol(A.method, Decl(unusedParametersThis.ts, 2, 21))
>this : Symbol(this, Decl(unusedParametersThis.ts, 4, 18))
return this.a;
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 4, 18))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
}
public method2(this: A): number {
>method2 : Symbol(A.method2, Decl(unusedParametersThis.ts, 6, 5))
>this : Symbol(this, Decl(unusedParametersThis.ts, 8, 19))
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
return this.a;
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 8, 19))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
}
public method3(this: this): number {
>method3 : Symbol(A.method3, Decl(unusedParametersThis.ts, 10, 5))
>this : Symbol(this, Decl(unusedParametersThis.ts, 12, 19))
var fn = () => this.a;
>fn : Symbol(fn, Decl(unusedParametersThis.ts, 13, 11))
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 12, 19))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
return fn();
>fn : Symbol(fn, Decl(unusedParametersThis.ts, 13, 11))
}
public method4(this: A): number {
>method4 : Symbol(A.method4, Decl(unusedParametersThis.ts, 15, 5))
>this : Symbol(this, Decl(unusedParametersThis.ts, 17, 19))
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
var fn = () => this.a;
>fn : Symbol(fn, Decl(unusedParametersThis.ts, 18, 11))
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 17, 19))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
return fn();
>fn : Symbol(fn, Decl(unusedParametersThis.ts, 18, 11))
}
static staticMethod(this: A): number {
>staticMethod : Symbol(A.staticMethod, Decl(unusedParametersThis.ts, 20, 5))
>this : Symbol(this, Decl(unusedParametersThis.ts, 22, 24))
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
return this.a;
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 22, 24))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
}
}
function f(this: A): number {
>f : Symbol(f, Decl(unusedParametersThis.ts, 25, 1))
>this : Symbol(this, Decl(unusedParametersThis.ts, 27, 11))
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
return this.a
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 27, 11))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
}
var f2 = function f2(this: A): number {
>f2 : Symbol(f2, Decl(unusedParametersThis.ts, 31, 3))
>f2 : Symbol(f2, Decl(unusedParametersThis.ts, 31, 8))
>this : Symbol(this, Decl(unusedParametersThis.ts, 31, 21))
>A : Symbol(A, Decl(unusedParametersThis.ts, 0, 0))
return this.a;
>this.a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
>this : Symbol(this, Decl(unusedParametersThis.ts, 31, 21))
>a : Symbol(A.a, Decl(unusedParametersThis.ts, 1, 9))
};

View File

@@ -0,0 +1,98 @@
=== tests/cases/compiler/unusedParametersThis.ts ===
class A {
>A : A
public a: number;
>a : number
public method(this: this): number {
>method : (this: this) => number
>this : this
return this.a;
>this.a : number
>this : this
>a : number
}
public method2(this: A): number {
>method2 : (this: A) => number
>this : A
>A : A
return this.a;
>this.a : number
>this : A
>a : number
}
public method3(this: this): number {
>method3 : (this: this) => number
>this : this
var fn = () => this.a;
>fn : () => number
>() => this.a : () => number
>this.a : number
>this : this
>a : number
return fn();
>fn() : number
>fn : () => number
}
public method4(this: A): number {
>method4 : (this: A) => number
>this : A
>A : A
var fn = () => this.a;
>fn : () => number
>() => this.a : () => number
>this.a : number
>this : A
>a : number
return fn();
>fn() : number
>fn : () => number
}
static staticMethod(this: A): number {
>staticMethod : (this: A) => number
>this : A
>A : A
return this.a;
>this.a : number
>this : A
>a : number
}
}
function f(this: A): number {
>f : (this: A) => number
>this : A
>A : A
return this.a
>this.a : number
>this : A
>a : number
}
var f2 = function f2(this: A): number {
>f2 : (this: A) => number
>function f2(this: A): number { return this.a;} : (this: A) => number
>f2 : (this: A) => number
>this : A
>A : A
return this.a;
>this.a : number
>this : A
>a : number
};

View File

@@ -0,0 +1,16 @@
//// [tests/cases/compiler/unusedTypeParameters6.ts] ////
//// [a.ts]
class C<T> { }
//// [b.ts]
interface C<T> { a: T; }
//// [a.js]
var C = (function () {
function C() {
}
return C;
}());
//// [b.js]

View File

@@ -0,0 +1,13 @@
=== tests/cases/compiler/a.ts ===
class C<T> { }
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(b.ts, 0, 0))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))
=== tests/cases/compiler/b.ts ===
interface C<T> { a: T; }
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(b.ts, 0, 0))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))
>a : Symbol(C.a, Decl(b.ts, 0, 16))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))

View File

@@ -0,0 +1,13 @@
=== tests/cases/compiler/a.ts ===
class C<T> { }
>C : C<T>
>T : T
=== tests/cases/compiler/b.ts ===
interface C<T> { a: T; }
>C : C<T>
>T : T
>a : T
>T : T

View File

@@ -0,0 +1,16 @@
//// [tests/cases/compiler/unusedTypeParameters7.ts] ////
//// [a.ts]
class C<T> { a: T; }
//// [b.ts]
interface C<T> { }
//// [a.js]
var C = (function () {
function C() {
}
return C;
}());
//// [b.js]

View File

@@ -0,0 +1,13 @@
=== tests/cases/compiler/a.ts ===
class C<T> { a: T; }
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(b.ts, 0, 0))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))
>a : Symbol(C.a, Decl(a.ts, 1, 12))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))
=== tests/cases/compiler/b.ts ===
interface C<T> { }
>C : Symbol(C, Decl(a.ts, 0, 0), Decl(b.ts, 0, 0))
>T : Symbol(T, Decl(a.ts, 1, 8), Decl(b.ts, 0, 12))

View File

@@ -0,0 +1,13 @@
=== tests/cases/compiler/a.ts ===
class C<T> { a: T; }
>C : C<T>
>T : T
>a : T
>T : T
=== tests/cases/compiler/b.ts ===
interface C<T> { }
>C : C<T>
>T : T

View File

@@ -0,0 +1,11 @@
tests/cases/compiler/b.ts(1,13): error TS6133: 'T' is declared but never used.
==== tests/cases/compiler/a.ts (0 errors) ====
class C<T> { }
==== tests/cases/compiler/b.ts (1 errors) ====
interface C<T> { }
~
!!! error TS6133: 'T' is declared but never used.

View File

@@ -0,0 +1,16 @@
//// [tests/cases/compiler/unusedTypeParameters8.ts] ////
//// [a.ts]
class C<T> { }
//// [b.ts]
interface C<T> { }
//// [a.js]
var C = (function () {
function C() {
}
return C;
}());
//// [b.js]

View File

@@ -0,0 +1,30 @@
//// [unusedTypeParameters9.ts]
// clas + interface
class C1<T> { }
interface C1<T> { a: T; }
// interface + class
class C2<T> { a: T; }
interface C2<T> { }
// interfaces
interface C3<T> { a(c: (p: T) => void): void; }
interface C3<T> { b: string; }
interface C3<T> { c: number; }
interface C3<T> { d: boolean; }
interface C3<T> { e: any; }
//// [unusedTypeParameters9.js]
// clas + interface
var C1 = (function () {
function C1() {
}
return C1;
}());
// interface + class
var C2 = (function () {
function C2() {
}
return C2;
}());

View File

@@ -0,0 +1,53 @@
=== tests/cases/compiler/unusedTypeParameters9.ts ===
// clas + interface
class C1<T> { }
>C1 : Symbol(C1, Decl(unusedTypeParameters9.ts, 0, 0), Decl(unusedTypeParameters9.ts, 2, 15))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 2, 9), Decl(unusedTypeParameters9.ts, 3, 13))
interface C1<T> { a: T; }
>C1 : Symbol(C1, Decl(unusedTypeParameters9.ts, 0, 0), Decl(unusedTypeParameters9.ts, 2, 15))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 2, 9), Decl(unusedTypeParameters9.ts, 3, 13))
>a : Symbol(C1.a, Decl(unusedTypeParameters9.ts, 3, 17))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 2, 9), Decl(unusedTypeParameters9.ts, 3, 13))
// interface + class
class C2<T> { a: T; }
>C2 : Symbol(C2, Decl(unusedTypeParameters9.ts, 3, 25), Decl(unusedTypeParameters9.ts, 6, 21))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 6, 9), Decl(unusedTypeParameters9.ts, 7, 13))
>a : Symbol(C2.a, Decl(unusedTypeParameters9.ts, 6, 13))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 6, 9), Decl(unusedTypeParameters9.ts, 7, 13))
interface C2<T> { }
>C2 : Symbol(C2, Decl(unusedTypeParameters9.ts, 3, 25), Decl(unusedTypeParameters9.ts, 6, 21))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 6, 9), Decl(unusedTypeParameters9.ts, 7, 13))
// interfaces
interface C3<T> { a(c: (p: T) => void): void; }
>C3 : Symbol(C3, Decl(unusedTypeParameters9.ts, 7, 19), Decl(unusedTypeParameters9.ts, 10, 47), Decl(unusedTypeParameters9.ts, 11, 30), Decl(unusedTypeParameters9.ts, 12, 30), Decl(unusedTypeParameters9.ts, 13, 32))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
>a : Symbol(C3.a, Decl(unusedTypeParameters9.ts, 10, 17))
>c : Symbol(c, Decl(unusedTypeParameters9.ts, 10, 20))
>p : Symbol(p, Decl(unusedTypeParameters9.ts, 10, 24))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
interface C3<T> { b: string; }
>C3 : Symbol(C3, Decl(unusedTypeParameters9.ts, 7, 19), Decl(unusedTypeParameters9.ts, 10, 47), Decl(unusedTypeParameters9.ts, 11, 30), Decl(unusedTypeParameters9.ts, 12, 30), Decl(unusedTypeParameters9.ts, 13, 32))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
>b : Symbol(C3.b, Decl(unusedTypeParameters9.ts, 11, 17))
interface C3<T> { c: number; }
>C3 : Symbol(C3, Decl(unusedTypeParameters9.ts, 7, 19), Decl(unusedTypeParameters9.ts, 10, 47), Decl(unusedTypeParameters9.ts, 11, 30), Decl(unusedTypeParameters9.ts, 12, 30), Decl(unusedTypeParameters9.ts, 13, 32))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
>c : Symbol(C3.c, Decl(unusedTypeParameters9.ts, 12, 17))
interface C3<T> { d: boolean; }
>C3 : Symbol(C3, Decl(unusedTypeParameters9.ts, 7, 19), Decl(unusedTypeParameters9.ts, 10, 47), Decl(unusedTypeParameters9.ts, 11, 30), Decl(unusedTypeParameters9.ts, 12, 30), Decl(unusedTypeParameters9.ts, 13, 32))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
>d : Symbol(C3.d, Decl(unusedTypeParameters9.ts, 13, 17))
interface C3<T> { e: any; }
>C3 : Symbol(C3, Decl(unusedTypeParameters9.ts, 7, 19), Decl(unusedTypeParameters9.ts, 10, 47), Decl(unusedTypeParameters9.ts, 11, 30), Decl(unusedTypeParameters9.ts, 12, 30), Decl(unusedTypeParameters9.ts, 13, 32))
>T : Symbol(T, Decl(unusedTypeParameters9.ts, 10, 13), Decl(unusedTypeParameters9.ts, 11, 13), Decl(unusedTypeParameters9.ts, 12, 13), Decl(unusedTypeParameters9.ts, 13, 13), Decl(unusedTypeParameters9.ts, 14, 13))
>e : Symbol(C3.e, Decl(unusedTypeParameters9.ts, 14, 17))

View File

@@ -0,0 +1,53 @@
=== tests/cases/compiler/unusedTypeParameters9.ts ===
// clas + interface
class C1<T> { }
>C1 : C1<T>
>T : T
interface C1<T> { a: T; }
>C1 : C1<T>
>T : T
>a : T
>T : T
// interface + class
class C2<T> { a: T; }
>C2 : C2<T>
>T : T
>a : T
>T : T
interface C2<T> { }
>C2 : C2<T>
>T : T
// interfaces
interface C3<T> { a(c: (p: T) => void): void; }
>C3 : C3<T>
>T : T
>a : (c: (p: T) => void) => void
>c : (p: T) => void
>p : T
>T : T
interface C3<T> { b: string; }
>C3 : C3<T>
>T : T
>b : string
interface C3<T> { c: number; }
>C3 : C3<T>
>T : T
>c : number
interface C3<T> { d: boolean; }
>C3 : C3<T>
>T : T
>d : boolean
interface C3<T> { e: any; }
>C3 : C3<T>
>T : T
>e : any

View File

@@ -16,5 +16,5 @@ class A {
class B {
constructor(...args: number[]) {}
@MyMethodDecorator
method(...args: string[]) {}
method(this: this, ...args: string[]) {}
}

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