mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'noParentNodesInEmitter' into transformPerf
This commit is contained in:
@@ -75,28 +75,28 @@ function delint(sourceFile) {
|
||||
delintNode(sourceFile);
|
||||
function delintNode(node) {
|
||||
switch (node.kind) {
|
||||
case 196 /* ForStatement */:
|
||||
case 197 /* ForInStatement */:
|
||||
case 195 /* WhileStatement */:
|
||||
case 194 /* DoStatement */:
|
||||
if (node.statement.kind !== 189 /* Block */) {
|
||||
case 197 /* ForStatement */:
|
||||
case 198 /* ForInStatement */:
|
||||
case 196 /* WhileStatement */:
|
||||
case 195 /* DoStatement */:
|
||||
if (node.statement.kind !== 190 /* Block */) {
|
||||
report(node, "A looping statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
break;
|
||||
case 193 /* IfStatement */:
|
||||
case 194 /* IfStatement */:
|
||||
var ifStatement = node;
|
||||
if (ifStatement.thenStatement.kind !== 189 /* Block */) {
|
||||
if (ifStatement.thenStatement.kind !== 190 /* Block */) {
|
||||
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
if (ifStatement.elseStatement &&
|
||||
ifStatement.elseStatement.kind !== 189 /* Block */ &&
|
||||
ifStatement.elseStatement.kind !== 193 /* IfStatement */) {
|
||||
ifStatement.elseStatement.kind !== 190 /* Block */ &&
|
||||
ifStatement.elseStatement.kind !== 194 /* IfStatement */) {
|
||||
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
|
||||
}
|
||||
break;
|
||||
case 178 /* BinaryExpression */:
|
||||
case 179 /* BinaryExpression */:
|
||||
var op = node.operatorToken.kind;
|
||||
if (op === 29 /* EqualsEqualsToken */ || op == 30 /* ExclamationEqualsToken */) {
|
||||
if (op === 30 /* EqualsEqualsToken */ || op == 31 /* ExclamationEqualsToken */) {
|
||||
report(node, "Use '===' and '!=='.");
|
||||
}
|
||||
break;
|
||||
@@ -112,7 +112,7 @@ exports.delint = delint;
|
||||
var fileNames = process.argv.slice(2);
|
||||
fileNames.forEach(function (fileName) {
|
||||
// Parse a file
|
||||
var sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), 2 /* ES6 */, true);
|
||||
var sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), 2 /* ES6 */, /*setParentNodes */ true);
|
||||
// delint it
|
||||
delint(sourceFile);
|
||||
});
|
||||
|
||||
@@ -22,8 +22,8 @@ System.register(['foo'], function(exports_1) {
|
||||
var cls, cls2, x, y, z, M;
|
||||
return {
|
||||
setters:[
|
||||
function (_alias) {
|
||||
alias = _alias;
|
||||
function (alias_1) {
|
||||
alias = alias_1;
|
||||
}],
|
||||
execute: function() {
|
||||
cls = alias.Class;
|
||||
|
||||
@@ -21,8 +21,8 @@ System.register(["foo"], function(exports_1) {
|
||||
var cls, cls2, x, y, z, M;
|
||||
return {
|
||||
setters:[
|
||||
function (_foo_1) {
|
||||
foo_1 = _foo_1;
|
||||
function (foo_1_1) {
|
||||
foo_1 = foo_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
cls = foo_1.alias.Class;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base'.
|
||||
Types of property 'x' are incompatible.
|
||||
Type 'U' is not assignable to type 'string'.
|
||||
Type 'String' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts (1 errors) ====
|
||||
@@ -17,5 +18,6 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSuperty
|
||||
!!! error TS2415: Class 'Derived<U>' incorrectly extends base class 'Base'.
|
||||
!!! error TS2415: Types of property 'x' are incompatible.
|
||||
!!! error TS2415: Type 'U' is not assignable to type 'string'.
|
||||
!!! error TS2415: Type 'String' is not assignable to type 'string'.
|
||||
x: U;
|
||||
}
|
||||
@@ -9,9 +9,9 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe
|
||||
let blah = arguments[Symbol.iterator];
|
||||
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
|
||||
>arguments : Symbol(arguments)
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1249, 31))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1199, 52), Decl(lib.d.ts, 1305, 11))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1249, 31))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 3890, 31))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.d.ts, 3840, 52), Decl(lib.d.ts, 3946, 11))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 3890, 31))
|
||||
|
||||
let result = [];
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
|
||||
|
||||
@@ -294,8 +294,8 @@ module EmptyTypes {
|
||||
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
>a1 : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
|
||||
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
|
||||
>a1 : { x: any; y: string; }[]
|
||||
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: 0, y: 'a' } : { x: number; y: string; }
|
||||
>x : number
|
||||
>0 : number
|
||||
@@ -313,8 +313,8 @@ module EmptyTypes {
|
||||
>'a' : string
|
||||
|
||||
var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
>a2 : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
|
||||
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
|
||||
>a2 : { x: any; y: string; }[]
|
||||
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
>x : any
|
||||
>anyObj : any
|
||||
@@ -332,8 +332,8 @@ module EmptyTypes {
|
||||
>'a' : string
|
||||
|
||||
var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
>a3 : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
|
||||
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
|
||||
>a3 : { x: any; y: string; }[]
|
||||
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: 0, y: 'a' } : { x: number; y: string; }
|
||||
>x : number
|
||||
>0 : number
|
||||
@@ -639,7 +639,7 @@ module NonEmptyTypes {
|
||||
>x : number
|
||||
>y : base
|
||||
>base : base
|
||||
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: number; y: derived; } | { x: number; y: base; })[]
|
||||
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[]
|
||||
>{ x: 7, y: new derived() } : { x: number; y: derived; }
|
||||
>x : number
|
||||
>7 : number
|
||||
@@ -658,7 +658,7 @@ module NonEmptyTypes {
|
||||
>x : boolean
|
||||
>y : base
|
||||
>base : base
|
||||
>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: boolean; y: derived; } | { x: boolean; y: base; })[]
|
||||
>[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[]
|
||||
>{ x: true, y: new derived() } : { x: boolean; y: derived; }
|
||||
>x : boolean
|
||||
>true : boolean
|
||||
@@ -697,8 +697,8 @@ module NonEmptyTypes {
|
||||
|
||||
// Order matters here so test all the variants
|
||||
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
|
||||
>a1 : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
|
||||
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
|
||||
>a1 : { x: any; y: string; }[]
|
||||
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: 0, y: 'a' } : { x: number; y: string; }
|
||||
>x : number
|
||||
>0 : number
|
||||
@@ -716,8 +716,8 @@ module NonEmptyTypes {
|
||||
>'a' : string
|
||||
|
||||
var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
>a2 : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
|
||||
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
|
||||
>a2 : { x: any; y: string; }[]
|
||||
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
|
||||
>x : any
|
||||
>anyObj : any
|
||||
@@ -735,8 +735,8 @@ module NonEmptyTypes {
|
||||
>'a' : string
|
||||
|
||||
var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
|
||||
>a3 : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
|
||||
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
|
||||
>a3 : { x: any; y: string; }[]
|
||||
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
|
||||
>{ x: 0, y: 'a' } : { x: number; y: string; }
|
||||
>x : number
|
||||
>0 : number
|
||||
@@ -769,29 +769,29 @@ module NonEmptyTypes {
|
||||
>base2 : typeof base2
|
||||
|
||||
var b1 = [baseObj, base2Obj, ifaceObj];
|
||||
>b1 : (base | base2 | iface)[]
|
||||
>[baseObj, base2Obj, ifaceObj] : (base | base2 | iface)[]
|
||||
>b1 : iface[]
|
||||
>[baseObj, base2Obj, ifaceObj] : iface[]
|
||||
>baseObj : base
|
||||
>base2Obj : base2
|
||||
>ifaceObj : iface
|
||||
|
||||
var b2 = [base2Obj, baseObj, ifaceObj];
|
||||
>b2 : (base2 | base | iface)[]
|
||||
>[base2Obj, baseObj, ifaceObj] : (base2 | base | iface)[]
|
||||
>b2 : iface[]
|
||||
>[base2Obj, baseObj, ifaceObj] : iface[]
|
||||
>base2Obj : base2
|
||||
>baseObj : base
|
||||
>ifaceObj : iface
|
||||
|
||||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
>b3 : (base | iface | base2)[]
|
||||
>[baseObj, ifaceObj, base2Obj] : (base | iface | base2)[]
|
||||
>b3 : iface[]
|
||||
>[baseObj, ifaceObj, base2Obj] : iface[]
|
||||
>baseObj : base
|
||||
>ifaceObj : iface
|
||||
>base2Obj : base2
|
||||
|
||||
var b4 = [ifaceObj, baseObj, base2Obj];
|
||||
>b4 : (iface | base | base2)[]
|
||||
>[ifaceObj, baseObj, base2Obj] : (iface | base | base2)[]
|
||||
>b4 : iface[]
|
||||
>[ifaceObj, baseObj, base2Obj] : iface[]
|
||||
>ifaceObj : iface
|
||||
>baseObj : base
|
||||
>base2Obj : base2
|
||||
|
||||
@@ -36,8 +36,8 @@ var cs = [a, b, c]; // { x: number; y?: number };[]
|
||||
>c : { x: number; a?: number; }
|
||||
|
||||
var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
|
||||
>ds : (((x: Object) => number) | ((x: string) => number))[]
|
||||
>[(x: Object) => 1, (x: string) => 2] : (((x: Object) => number) | ((x: string) => number))[]
|
||||
>ds : ((x: Object) => number)[]
|
||||
>[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[]
|
||||
>(x: Object) => 1 : (x: Object) => number
|
||||
>x : Object
|
||||
>Object : Object
|
||||
@@ -47,8 +47,8 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
|
||||
>2 : number
|
||||
|
||||
var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
|
||||
>es : (((x: string) => number) | ((x: Object) => number))[]
|
||||
>[(x: string) => 2, (x: Object) => 1] : (((x: string) => number) | ((x: Object) => number))[]
|
||||
>es : ((x: string) => number)[]
|
||||
>[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[]
|
||||
>(x: string) => 2 : (x: string) => number
|
||||
>x : string
|
||||
>2 : number
|
||||
|
||||
@@ -72,14 +72,14 @@ var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]];
|
||||
|
||||
interface myArray extends Array<Number> { }
|
||||
>myArray : Symbol(myArray, Decl(arrayLiterals2ES6.ts, 40, 67))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
interface myArray2 extends Array<Number|String> { }
|
||||
>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[]
|
||||
>d0 : Symbol(d0, Decl(arrayLiterals2ES6.ts, 44, 3))
|
||||
|
||||
@@ -77,8 +77,8 @@ var myDerivedList: DerivedList<number>;
|
||||
>DerivedList : DerivedList<U>
|
||||
|
||||
var as = [list, myDerivedList]; // List<number>[]
|
||||
>as : (List<number> | DerivedList<number>)[]
|
||||
>[list, myDerivedList] : (List<number> | DerivedList<number>)[]
|
||||
>as : List<number>[]
|
||||
>[list, myDerivedList] : List<number>[]
|
||||
>list : List<number>
|
||||
>myDerivedList : DerivedList<number>
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts(17,13): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts(26,10): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts (2 errors) ====
|
||||
// valid uses of arrays of function types
|
||||
|
||||
var x = [() => 1, () => { }];
|
||||
var r2 = x[0]();
|
||||
|
||||
class C {
|
||||
foo: string;
|
||||
}
|
||||
var y = [C, C];
|
||||
var r3 = new y[0]();
|
||||
|
||||
var a: { (x: number): number; (x: string): string; };
|
||||
var b: { (x: number): number; (x: string): string; };
|
||||
var c: { (x: number): number; (x: any): any; };
|
||||
var z = [a, b, c];
|
||||
var r4 = z[0];
|
||||
var r5 = r4(''); // any not string
|
||||
~~
|
||||
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
var r5b = r4(1);
|
||||
|
||||
var a2: { <T>(x: T): number; (x: string): string;};
|
||||
var b2: { <T>(x: T): number; (x: string): string; };
|
||||
var c2: { (x: number): number; <T>(x: T): any; };
|
||||
|
||||
var z2 = [a2, b2, c2];
|
||||
var r6 = z2[0];
|
||||
var r7 = r6(''); // any not string
|
||||
~~~~~~
|
||||
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
@@ -0,0 +1,93 @@
|
||||
=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts ===
|
||||
// valid uses of arrays of function types
|
||||
|
||||
var x = [() => 1, () => { }];
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3))
|
||||
|
||||
var r2 = x[0]();
|
||||
>r2 : Symbol(r2, Decl(arrayOfFunctionTypes3.ts, 3, 3))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3))
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))
|
||||
|
||||
foo: string;
|
||||
>foo : Symbol(foo, Decl(arrayOfFunctionTypes3.ts, 5, 9))
|
||||
}
|
||||
var y = [C, C];
|
||||
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3))
|
||||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))
|
||||
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))
|
||||
|
||||
var r3 = new y[0]();
|
||||
>r3 : Symbol(r3, Decl(arrayOfFunctionTypes3.ts, 9, 3))
|
||||
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3))
|
||||
|
||||
var a: { (x: number): number; (x: string): string; };
|
||||
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 10))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 31))
|
||||
|
||||
var b: { (x: number): number; (x: string): string; };
|
||||
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 10))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 31))
|
||||
|
||||
var c: { (x: number): number; (x: any): any; };
|
||||
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 10))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 31))
|
||||
|
||||
var z = [a, b, c];
|
||||
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3))
|
||||
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3))
|
||||
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3))
|
||||
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3))
|
||||
|
||||
var r4 = z[0];
|
||||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))
|
||||
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3))
|
||||
|
||||
var r5 = r4(''); // any not string
|
||||
>r5 : Symbol(r5, Decl(arrayOfFunctionTypes3.ts, 16, 3))
|
||||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))
|
||||
|
||||
var r5b = r4(1);
|
||||
>r5b : Symbol(r5b, Decl(arrayOfFunctionTypes3.ts, 17, 3))
|
||||
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))
|
||||
|
||||
var a2: { <T>(x: T): number; (x: string): string;};
|
||||
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 14))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 30))
|
||||
|
||||
var b2: { <T>(x: T): number; (x: string): string; };
|
||||
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 14))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 30))
|
||||
|
||||
var c2: { (x: number): number; <T>(x: T): any; };
|
||||
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 11))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32))
|
||||
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 35))
|
||||
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32))
|
||||
|
||||
var z2 = [a2, b2, c2];
|
||||
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3))
|
||||
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3))
|
||||
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3))
|
||||
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3))
|
||||
|
||||
var r6 = z2[0];
|
||||
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3))
|
||||
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3))
|
||||
|
||||
var r7 = r6(''); // any not string
|
||||
>r7 : Symbol(r7, Decl(arrayOfFunctionTypes3.ts, 25, 3))
|
||||
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3))
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts ===
|
||||
// valid uses of arrays of function types
|
||||
|
||||
var x = [() => 1, () => { }];
|
||||
>x : (() => void)[]
|
||||
>[() => 1, () => { }] : (() => void)[]
|
||||
>() => 1 : () => number
|
||||
>1 : number
|
||||
>() => { } : () => void
|
||||
|
||||
var r2 = x[0]();
|
||||
>r2 : void
|
||||
>x[0]() : void
|
||||
>x[0] : () => void
|
||||
>x : (() => void)[]
|
||||
>0 : number
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
foo: string;
|
||||
>foo : string
|
||||
}
|
||||
var y = [C, C];
|
||||
>y : typeof C[]
|
||||
>[C, C] : typeof C[]
|
||||
>C : typeof C
|
||||
>C : typeof C
|
||||
|
||||
var r3 = new y[0]();
|
||||
>r3 : C
|
||||
>new y[0]() : C
|
||||
>y[0] : typeof C
|
||||
>y : typeof C[]
|
||||
>0 : number
|
||||
|
||||
var a: { (x: number): number; (x: string): string; };
|
||||
>a : { (x: number): number; (x: string): string; }
|
||||
>x : number
|
||||
>x : string
|
||||
|
||||
var b: { (x: number): number; (x: string): string; };
|
||||
>b : { (x: number): number; (x: string): string; }
|
||||
>x : number
|
||||
>x : string
|
||||
|
||||
var c: { (x: number): number; (x: any): any; };
|
||||
>c : { (x: number): number; (x: any): any; }
|
||||
>x : number
|
||||
>x : any
|
||||
|
||||
var z = [a, b, c];
|
||||
>z : { (x: number): number; (x: any): any; }[]
|
||||
>[a, b, c] : { (x: number): number; (x: any): any; }[]
|
||||
>a : { (x: number): number; (x: string): string; }
|
||||
>b : { (x: number): number; (x: string): string; }
|
||||
>c : { (x: number): number; (x: any): any; }
|
||||
|
||||
var r4 = z[0];
|
||||
>r4 : { (x: number): number; (x: any): any; }
|
||||
>z[0] : { (x: number): number; (x: any): any; }
|
||||
>z : { (x: number): number; (x: any): any; }[]
|
||||
>0 : number
|
||||
|
||||
var r5 = r4(''); // any not string
|
||||
>r5 : any
|
||||
>r4('') : any
|
||||
>r4 : { (x: number): number; (x: any): any; }
|
||||
>'' : string
|
||||
|
||||
var r5b = r4(1);
|
||||
>r5b : number
|
||||
>r4(1) : number
|
||||
>r4 : { (x: number): number; (x: any): any; }
|
||||
>1 : number
|
||||
|
||||
var a2: { <T>(x: T): number; (x: string): string;};
|
||||
>a2 : { <T>(x: T): number; (x: string): string; }
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
>x : string
|
||||
|
||||
var b2: { <T>(x: T): number; (x: string): string; };
|
||||
>b2 : { <T>(x: T): number; (x: string): string; }
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
>x : string
|
||||
|
||||
var c2: { (x: number): number; <T>(x: T): any; };
|
||||
>c2 : { (x: number): number; <T>(x: T): any; }
|
||||
>x : number
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
var z2 = [a2, b2, c2];
|
||||
>z2 : { (x: number): number; <T>(x: T): any; }[]
|
||||
>[a2, b2, c2] : { (x: number): number; <T>(x: T): any; }[]
|
||||
>a2 : { <T>(x: T): number; (x: string): string; }
|
||||
>b2 : { <T>(x: T): number; (x: string): string; }
|
||||
>c2 : { (x: number): number; <T>(x: T): any; }
|
||||
|
||||
var r6 = z2[0];
|
||||
>r6 : { (x: number): number; <T>(x: T): any; }
|
||||
>z2[0] : { (x: number): number; <T>(x: T): any; }
|
||||
>z2 : { (x: number): number; <T>(x: T): any; }[]
|
||||
>0 : number
|
||||
|
||||
var r7 = r6(''); // any not string
|
||||
>r7 : any
|
||||
>r6('') : any
|
||||
>r6 : { (x: number): number; <T>(x: T): any; }
|
||||
>'' : string
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'.
|
||||
Property 'one' is missing in type '{ [index: string]: any; }'.
|
||||
tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'.
|
||||
Index signature is missing in type '{ one: number; }'.
|
||||
tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
|
||||
Property 'one' is missing in type '{ [index: number]: any; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompat1.ts (2 errors) ====
|
||||
var x = {one: 1};
|
||||
var y: {[index:string]: any};
|
||||
|
||||
x = y;
|
||||
var x = { one: 1 };
|
||||
var y: { [index: string]: any };
|
||||
var z: { [index: number]: any };
|
||||
x = y; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'.
|
||||
!!! error TS2322: Property 'one' is missing in type '{ [index: string]: any; }'.
|
||||
y = x;
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
~
|
||||
!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: any; }'.
|
||||
!!! error TS2322: Index signature is missing in type '{ one: number; }'.
|
||||
!!! error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'.
|
||||
!!! error TS2322: Property 'one' is missing in type '{ [index: number]: any; }'.
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
//// [assignmentCompat1.ts]
|
||||
var x = {one: 1};
|
||||
var y: {[index:string]: any};
|
||||
|
||||
x = y;
|
||||
y = x;
|
||||
var x = { one: 1 };
|
||||
var y: { [index: string]: any };
|
||||
var z: { [index: number]: any };
|
||||
x = y; // Error
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
|
||||
//// [assignmentCompat1.js]
|
||||
var x = { one: 1 };
|
||||
var y;
|
||||
x = y;
|
||||
y = x;
|
||||
var z;
|
||||
x = y; // Error
|
||||
y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
|
||||
@@ -12,12 +12,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived'.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived2' is not assignable to type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived2'.
|
||||
Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts (6 errors) ====
|
||||
@@ -72,6 +74,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
|
||||
|
||||
var b2: { [x: number]: Derived2; }
|
||||
a = b2; // error
|
||||
@@ -84,6 +87,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
var b3: { [x: number]: T; }
|
||||
a = b3; // ok
|
||||
|
||||
@@ -12,12 +12,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived'.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived2' is not assignable to type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived2'.
|
||||
Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts (6 errors) ====
|
||||
@@ -72,6 +74,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
|
||||
|
||||
var b2: { [x: number]: Derived2; }
|
||||
a = b2; // error
|
||||
@@ -84,6 +87,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
var b3: { [x: number]: T; }
|
||||
a = b3; // ok
|
||||
|
||||
@@ -18,12 +18,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived'.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived2' is not assignable to type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived2'.
|
||||
Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts (8 errors) ====
|
||||
@@ -100,6 +102,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
|
||||
|
||||
var b4: { [x: string]: Derived2; };
|
||||
a3 = b4; // error
|
||||
@@ -112,5 +115,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived'.
|
||||
Type 'Base' is not assignable to type 'Derived'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A<T>'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Derived2' is not assignable to type 'T'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'Derived2'.
|
||||
Type 'Base' is not assignable to type 'Derived2'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts (8 errors) ====
|
||||
@@ -100,6 +102,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
|
||||
|
||||
var b4: { [x: string]: Derived2; };
|
||||
a3 = b4; // error
|
||||
@@ -112,5 +115,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
|
||||
!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'.
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
|
||||
Index signatures are incompatible.
|
||||
Type 'T' is not assignable to type 'string'.
|
||||
Type 'Derived' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts (3 errors) ====
|
||||
@@ -39,5 +40,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: string; }'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'T' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type 'Derived' is not assignable to type 'string'.
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [index: string]: any; }'.
|
||||
Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/assignmentCompatability36.ts (1 errors) ====
|
||||
module __test1__ {
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
export var __val__obj4 = obj4;
|
||||
}
|
||||
module __test2__ {
|
||||
export var aa:{[index:string]:any;};;
|
||||
export var __val__aa = aa;
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ [index: string]: any; }'.
|
||||
!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional<number, string>'.
|
||||
@@ -0,0 +1,39 @@
|
||||
=== tests/cases/compiler/assignmentCompatability36.ts ===
|
||||
module __test1__ {
|
||||
>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0))
|
||||
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18))
|
||||
>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52))
|
||||
>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54))
|
||||
>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 58))
|
||||
>T : Symbol(T, Decl(assignmentCompatability36.ts, 1, 52))
|
||||
>two : Symbol(two, Decl(assignmentCompatability36.ts, 1, 66))
|
||||
>U : Symbol(U, Decl(assignmentCompatability36.ts, 1, 54))
|
||||
>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83))
|
||||
>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability36.ts, 0, 18))
|
||||
>one : Symbol(one, Decl(assignmentCompatability36.ts, 1, 139))
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
>obj4 : Symbol(obj4, Decl(assignmentCompatability36.ts, 1, 83))
|
||||
}
|
||||
module __test2__ {
|
||||
>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1))
|
||||
|
||||
export var aa:{[index:string]:any;};;
|
||||
>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14))
|
||||
>index : Symbol(index, Decl(assignmentCompatability36.ts, 5, 20))
|
||||
|
||||
export var __val__aa = aa;
|
||||
>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>aa : Symbol(aa, Decl(assignmentCompatability36.ts, 5, 14))
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>__test2__ : Symbol(__test2__, Decl(assignmentCompatability36.ts, 3, 1))
|
||||
>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability36.ts, 6, 14))
|
||||
>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
>__test1__ : Symbol(__test1__, Decl(assignmentCompatability36.ts, 0, 0))
|
||||
>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability36.ts, 2, 14))
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/compiler/assignmentCompatability36.ts ===
|
||||
module __test1__ {
|
||||
>__test1__ : typeof __test1__
|
||||
|
||||
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>T : T
|
||||
>U : U
|
||||
>one : T
|
||||
>T : T
|
||||
>two : U
|
||||
>U : U
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>interfaceWithPublicAndOptional : interfaceWithPublicAndOptional<T, U>
|
||||
>{ one: 1 } : { one: number; }
|
||||
>one : number
|
||||
>1 : number
|
||||
|
||||
export var __val__obj4 = obj4;
|
||||
>__val__obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
>obj4 : interfaceWithPublicAndOptional<number, string>
|
||||
}
|
||||
module __test2__ {
|
||||
>__test2__ : typeof __test2__
|
||||
|
||||
export var aa:{[index:string]:any;};;
|
||||
>aa : { [index: string]: any; }
|
||||
>index : string
|
||||
|
||||
export var __val__aa = aa;
|
||||
>__val__aa : { [index: string]: any; }
|
||||
>aa : { [index: string]: any; }
|
||||
}
|
||||
__test2__.__val__aa = __test1__.__val__obj4
|
||||
>__test2__.__val__aa = __test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test2__.__val__aa : { [index: string]: any; }
|
||||
>__test2__ : typeof __test2__
|
||||
>__val__aa : { [index: string]: any; }
|
||||
>__test1__.__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
>__test1__ : typeof __test1__
|
||||
>__val__obj4 : __test1__.interfaceWithPublicAndOptional<number, string>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//// [assignmentNonObjectTypeConstraints.ts]
|
||||
const enum E { A, B, C }
|
||||
|
||||
function foo<T extends number>(x: T) {
|
||||
var y: number = x; // Ok
|
||||
}
|
||||
|
||||
foo(5);
|
||||
foo(E.A);
|
||||
|
||||
class A { a }
|
||||
class B { b }
|
||||
|
||||
function bar<T extends A | B>(x: T) {
|
||||
var y: A | B = x; // Ok
|
||||
}
|
||||
|
||||
bar(new A);
|
||||
bar(new B);
|
||||
|
||||
|
||||
//// [assignmentNonObjectTypeConstraints.js]
|
||||
function foo(x) {
|
||||
var y = x; // Ok
|
||||
}
|
||||
foo(5);
|
||||
foo(0 /* A */);
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B = (function () {
|
||||
function B() {
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
function bar(x) {
|
||||
var y = x; // Ok
|
||||
}
|
||||
bar(new A);
|
||||
bar(new B);
|
||||
@@ -0,0 +1,58 @@
|
||||
=== tests/cases/compiler/assignmentNonObjectTypeConstraints.ts ===
|
||||
const enum E { A, B, C }
|
||||
>E : Symbol(E, Decl(assignmentNonObjectTypeConstraints.ts, 0, 0))
|
||||
>A : Symbol(E.A, Decl(assignmentNonObjectTypeConstraints.ts, 0, 14))
|
||||
>B : Symbol(E.B, Decl(assignmentNonObjectTypeConstraints.ts, 0, 17))
|
||||
>C : Symbol(E.C, Decl(assignmentNonObjectTypeConstraints.ts, 0, 20))
|
||||
|
||||
function foo<T extends number>(x: T) {
|
||||
>foo : Symbol(foo, Decl(assignmentNonObjectTypeConstraints.ts, 0, 24))
|
||||
>T : Symbol(T, Decl(assignmentNonObjectTypeConstraints.ts, 2, 13))
|
||||
>x : Symbol(x, Decl(assignmentNonObjectTypeConstraints.ts, 2, 31))
|
||||
>T : Symbol(T, Decl(assignmentNonObjectTypeConstraints.ts, 2, 13))
|
||||
|
||||
var y: number = x; // Ok
|
||||
>y : Symbol(y, Decl(assignmentNonObjectTypeConstraints.ts, 3, 7))
|
||||
>x : Symbol(x, Decl(assignmentNonObjectTypeConstraints.ts, 2, 31))
|
||||
}
|
||||
|
||||
foo(5);
|
||||
>foo : Symbol(foo, Decl(assignmentNonObjectTypeConstraints.ts, 0, 24))
|
||||
|
||||
foo(E.A);
|
||||
>foo : Symbol(foo, Decl(assignmentNonObjectTypeConstraints.ts, 0, 24))
|
||||
>E.A : Symbol(E.A, Decl(assignmentNonObjectTypeConstraints.ts, 0, 14))
|
||||
>E : Symbol(E, Decl(assignmentNonObjectTypeConstraints.ts, 0, 0))
|
||||
>A : Symbol(E.A, Decl(assignmentNonObjectTypeConstraints.ts, 0, 14))
|
||||
|
||||
class A { a }
|
||||
>A : Symbol(A, Decl(assignmentNonObjectTypeConstraints.ts, 7, 9))
|
||||
>a : Symbol(a, Decl(assignmentNonObjectTypeConstraints.ts, 9, 9))
|
||||
|
||||
class B { b }
|
||||
>B : Symbol(B, Decl(assignmentNonObjectTypeConstraints.ts, 9, 13))
|
||||
>b : Symbol(b, Decl(assignmentNonObjectTypeConstraints.ts, 10, 9))
|
||||
|
||||
function bar<T extends A | B>(x: T) {
|
||||
>bar : Symbol(bar, Decl(assignmentNonObjectTypeConstraints.ts, 10, 13))
|
||||
>T : Symbol(T, Decl(assignmentNonObjectTypeConstraints.ts, 12, 13))
|
||||
>A : Symbol(A, Decl(assignmentNonObjectTypeConstraints.ts, 7, 9))
|
||||
>B : Symbol(B, Decl(assignmentNonObjectTypeConstraints.ts, 9, 13))
|
||||
>x : Symbol(x, Decl(assignmentNonObjectTypeConstraints.ts, 12, 30))
|
||||
>T : Symbol(T, Decl(assignmentNonObjectTypeConstraints.ts, 12, 13))
|
||||
|
||||
var y: A | B = x; // Ok
|
||||
>y : Symbol(y, Decl(assignmentNonObjectTypeConstraints.ts, 13, 7))
|
||||
>A : Symbol(A, Decl(assignmentNonObjectTypeConstraints.ts, 7, 9))
|
||||
>B : Symbol(B, Decl(assignmentNonObjectTypeConstraints.ts, 9, 13))
|
||||
>x : Symbol(x, Decl(assignmentNonObjectTypeConstraints.ts, 12, 30))
|
||||
}
|
||||
|
||||
bar(new A);
|
||||
>bar : Symbol(bar, Decl(assignmentNonObjectTypeConstraints.ts, 10, 13))
|
||||
>A : Symbol(A, Decl(assignmentNonObjectTypeConstraints.ts, 7, 9))
|
||||
|
||||
bar(new B);
|
||||
>bar : Symbol(bar, Decl(assignmentNonObjectTypeConstraints.ts, 10, 13))
|
||||
>B : Symbol(B, Decl(assignmentNonObjectTypeConstraints.ts, 9, 13))
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
=== tests/cases/compiler/assignmentNonObjectTypeConstraints.ts ===
|
||||
const enum E { A, B, C }
|
||||
>E : E
|
||||
>A : E
|
||||
>B : E
|
||||
>C : E
|
||||
|
||||
function foo<T extends number>(x: T) {
|
||||
>foo : <T extends number>(x: T) => void
|
||||
>T : T
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
var y: number = x; // Ok
|
||||
>y : number
|
||||
>x : T
|
||||
}
|
||||
|
||||
foo(5);
|
||||
>foo(5) : void
|
||||
>foo : <T extends number>(x: T) => void
|
||||
>5 : number
|
||||
|
||||
foo(E.A);
|
||||
>foo(E.A) : void
|
||||
>foo : <T extends number>(x: T) => void
|
||||
>E.A : E
|
||||
>E : typeof E
|
||||
>A : E
|
||||
|
||||
class A { a }
|
||||
>A : A
|
||||
>a : any
|
||||
|
||||
class B { b }
|
||||
>B : B
|
||||
>b : any
|
||||
|
||||
function bar<T extends A | B>(x: T) {
|
||||
>bar : <T extends A | B>(x: T) => void
|
||||
>T : T
|
||||
>A : A
|
||||
>B : B
|
||||
>x : T
|
||||
>T : T
|
||||
|
||||
var y: A | B = x; // Ok
|
||||
>y : A | B
|
||||
>A : A
|
||||
>B : B
|
||||
>x : T
|
||||
}
|
||||
|
||||
bar(new A);
|
||||
>bar(new A) : void
|
||||
>bar : <T extends A | B>(x: T) => void
|
||||
>new A : A
|
||||
>A : typeof A
|
||||
|
||||
bar(new B);
|
||||
>bar(new B) : void
|
||||
>bar : <T extends A | B>(x: T) => void
|
||||
>new B : B
|
||||
>B : typeof B
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
var foo = async (): Promise<void> => {
|
||||
>foo : Symbol(foo, Decl(asyncArrowFunction1_es6.ts, 1, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
};
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
type MyPromise<T> = Promise<T>;
|
||||
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11))
|
||||
>T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15))
|
||||
|
||||
declare var MyPromise: typeof Promise;
|
||||
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare var p: Promise<number>;
|
||||
>p : Symbol(p, Decl(asyncAwait_es6.ts, 2, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare var mp: MyPromise<number>;
|
||||
>mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11))
|
||||
@@ -22,7 +22,7 @@ async function f0() { }
|
||||
|
||||
async function f1(): Promise<void> { }
|
||||
>f1 : Symbol(f1, Decl(asyncAwait_es6.ts, 5, 23))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function f3(): MyPromise<void> { }
|
||||
>f3 : Symbol(f3, Decl(asyncAwait_es6.ts, 6, 38))
|
||||
@@ -33,7 +33,7 @@ let f4 = async function() { }
|
||||
|
||||
let f5 = async function(): Promise<void> { }
|
||||
>f5 : Symbol(f5, Decl(asyncAwait_es6.ts, 10, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
let f6 = async function(): MyPromise<void> { }
|
||||
>f6 : Symbol(f6, Decl(asyncAwait_es6.ts, 11, 3))
|
||||
@@ -44,7 +44,7 @@ let f7 = async () => { };
|
||||
|
||||
let f8 = async (): Promise<void> => { };
|
||||
>f8 : Symbol(f8, Decl(asyncAwait_es6.ts, 14, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
let f9 = async (): MyPromise<void> => { };
|
||||
>f9 : Symbol(f9, Decl(asyncAwait_es6.ts, 15, 3))
|
||||
@@ -60,7 +60,7 @@ let f11 = async () => mp;
|
||||
|
||||
let f12 = async (): Promise<number> => mp;
|
||||
>f12 : Symbol(f12, Decl(asyncAwait_es6.ts, 18, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11))
|
||||
|
||||
let f13 = async (): MyPromise<number> => p;
|
||||
@@ -76,7 +76,7 @@ let o = {
|
||||
|
||||
async m2(): Promise<void> { },
|
||||
>m2 : Symbol(m2, Decl(asyncAwait_es6.ts, 22, 16))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async m3(): MyPromise<void> { }
|
||||
>m3 : Symbol(m3, Decl(asyncAwait_es6.ts, 23, 31))
|
||||
@@ -92,7 +92,7 @@ class C {
|
||||
|
||||
async m2(): Promise<void> { }
|
||||
>m2 : Symbol(m2, Decl(asyncAwait_es6.ts, 28, 15))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async m3(): MyPromise<void> { }
|
||||
>m3 : Symbol(m3, Decl(asyncAwait_es6.ts, 29, 30))
|
||||
@@ -103,7 +103,7 @@ class C {
|
||||
|
||||
static async m5(): Promise<void> { }
|
||||
>m5 : Symbol(C.m5, Decl(asyncAwait_es6.ts, 31, 22))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
static async m6(): MyPromise<void> { }
|
||||
>m6 : Symbol(C.m6, Decl(asyncAwait_es6.ts, 32, 37))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration11_es6.ts ===
|
||||
async function await(): Promise<void> {
|
||||
>await : Symbol(await, Decl(asyncFunctionDeclaration11_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration14_es6.ts ===
|
||||
async function foo(): Promise<void> {
|
||||
>foo : Symbol(foo, Decl(asyncFunctionDeclaration14_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1_es6.ts ===
|
||||
async function foo(): Promise<void> {
|
||||
>foo : Symbol(foo, Decl(asyncFunctionDeclaration1_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression1_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression1_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p || a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression2_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression2_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p && a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: number;
|
||||
|
||||
declare var p: Promise<number>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression3_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression3_es6.ts, 1, 31))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p + a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression4_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression4_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p, a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression5_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression5_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var o: { a: boolean; };
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression1_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression1_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression1_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression1_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression1_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression2_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression2_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression2_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression2_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression2_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(await p, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression3_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression3_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression3_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression3_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression3_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(a, await p, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression4_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression4_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression4_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression4_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression4_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = (await pfn)(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression5_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression5_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression5_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression5_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression5_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression6_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression6_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression6_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression6_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression6_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(await p, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression7_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression7_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression7_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression7_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression7_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(a, await p, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression8_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression8_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression8_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression8_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression8_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = (await po).fn(a, a, a);
|
||||
|
||||
@@ -46,8 +46,8 @@ var r = true ? 1 : 2;
|
||||
>2 : number
|
||||
|
||||
var r3 = true ? 1 : {};
|
||||
>r3 : number | {}
|
||||
>true ? 1 : {} : number | {}
|
||||
>r3 : {}
|
||||
>true ? 1 : {} : {}
|
||||
>true : boolean
|
||||
>1 : number
|
||||
>{} : {}
|
||||
@@ -67,8 +67,8 @@ var r5 = true ? b : a; // typeof b
|
||||
>a : { x: number; y?: number; }
|
||||
|
||||
var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void
|
||||
>r6 : ((x: number) => void) | ((x: Object) => void)
|
||||
>true ? (x: number) => { } : (x: Object) => { } : ((x: number) => void) | ((x: Object) => void)
|
||||
>r6 : (x: number) => void
|
||||
>true ? (x: number) => { } : (x: Object) => { } : (x: number) => void
|
||||
>true : boolean
|
||||
>(x: number) => { } : (x: number) => void
|
||||
>x : number
|
||||
@@ -80,7 +80,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { };
|
||||
>r7 : (x: Object) => void
|
||||
>x : Object
|
||||
>Object : Object
|
||||
>true ? (x: number) => { } : (x: Object) => { } : ((x: number) => void) | ((x: Object) => void)
|
||||
>true ? (x: number) => { } : (x: Object) => { } : (x: number) => void
|
||||
>true : boolean
|
||||
>(x: number) => { } : (x: number) => void
|
||||
>x : number
|
||||
@@ -89,8 +89,8 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { };
|
||||
>Object : Object
|
||||
|
||||
var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void
|
||||
>r8 : ((x: Object) => void) | ((x: number) => void)
|
||||
>true ? (x: Object) => { } : (x: number) => { } : ((x: Object) => void) | ((x: number) => void)
|
||||
>r8 : (x: Object) => void
|
||||
>true ? (x: Object) => { } : (x: number) => { } : (x: Object) => void
|
||||
>true : boolean
|
||||
>(x: Object) => { } : (x: Object) => void
|
||||
>x : Object
|
||||
@@ -107,8 +107,8 @@ var r10: Base = true ? derived : derived2; // no error since we use the contextu
|
||||
>derived2 : Derived2
|
||||
|
||||
var r11 = true ? base : derived2;
|
||||
>r11 : Base | Derived2
|
||||
>true ? base : derived2 : Base | Derived2
|
||||
>r11 : Base
|
||||
>true ? base : derived2 : Base
|
||||
>true : boolean
|
||||
>base : Base
|
||||
>derived2 : Derived2
|
||||
|
||||
@@ -27,43 +27,43 @@ var z: Z;
|
||||
|
||||
// All these arrays should be X[]
|
||||
var b1 = [x, y, z];
|
||||
>b1 : (X | Y | Z)[]
|
||||
>[x, y, z] : (X | Y | Z)[]
|
||||
>b1 : X[]
|
||||
>[x, y, z] : X[]
|
||||
>x : X
|
||||
>y : Y
|
||||
>z : Z
|
||||
|
||||
var b2 = [x, z, y];
|
||||
>b2 : (X | Z | Y)[]
|
||||
>[x, z, y] : (X | Z | Y)[]
|
||||
>b2 : X[]
|
||||
>[x, z, y] : X[]
|
||||
>x : X
|
||||
>z : Z
|
||||
>y : Y
|
||||
|
||||
var b3 = [y, x, z];
|
||||
>b3 : (Y | X | Z)[]
|
||||
>[y, x, z] : (Y | X | Z)[]
|
||||
>b3 : X[]
|
||||
>[y, x, z] : X[]
|
||||
>y : Y
|
||||
>x : X
|
||||
>z : Z
|
||||
|
||||
var b4 = [y, z, x];
|
||||
>b4 : (Y | Z | X)[]
|
||||
>[y, z, x] : (Y | Z | X)[]
|
||||
>b4 : X[]
|
||||
>[y, z, x] : X[]
|
||||
>y : Y
|
||||
>z : Z
|
||||
>x : X
|
||||
|
||||
var b5 = [z, x, y];
|
||||
>b5 : (Z | X | Y)[]
|
||||
>[z, x, y] : (Z | X | Y)[]
|
||||
>b5 : X[]
|
||||
>[z, x, y] : X[]
|
||||
>z : Z
|
||||
>x : X
|
||||
>y : Y
|
||||
|
||||
var b6 = [z, y, x];
|
||||
>b6 : (Z | Y | X)[]
|
||||
>[z, y, x] : (Z | Y | X)[]
|
||||
>b6 : X[]
|
||||
>[z, y, x] : X[]
|
||||
>z : Z
|
||||
>y : Y
|
||||
>x : X
|
||||
|
||||
@@ -94,7 +94,7 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3))
|
||||
|
||||
(<Function>xa[1].foo)(...[1, 2, "abc"]);
|
||||
>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 1368, 1))
|
||||
>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 4009, 1))
|
||||
>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13))
|
||||
>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3))
|
||||
>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13))
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
|
||||
Cannot assign an abstract constructor type to a non-abstract constructor type.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts (2 errors) ====
|
||||
abstract class A { }
|
||||
|
||||
// var AA: typeof A;
|
||||
var AAA: new() => A;
|
||||
|
||||
// AA = A; // okay
|
||||
AAA = A; // error.
|
||||
~~~
|
||||
!!! error TS2322: Type 'typeof A' is not assignable to type 'new () => A'.
|
||||
!!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type.
|
||||
AAA = "asdf";
|
||||
~~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'new () => A'.
|
||||
@@ -0,0 +1,21 @@
|
||||
//// [classAbstractAssignabilityConstructorFunction.ts]
|
||||
abstract class A { }
|
||||
|
||||
// var AA: typeof A;
|
||||
var AAA: new() => A;
|
||||
|
||||
// AA = A; // okay
|
||||
AAA = A; // error.
|
||||
AAA = "asdf";
|
||||
|
||||
//// [classAbstractAssignabilityConstructorFunction.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
// var AA: typeof A;
|
||||
var AAA;
|
||||
// AA = A; // okay
|
||||
AAA = A; // error.
|
||||
AAA = "asdf";
|
||||
@@ -0,0 +1,21 @@
|
||||
tests/cases/compiler/classExtendsNull.ts(2,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsNull.ts (1 errors) ====
|
||||
class C extends null {
|
||||
constructor() {
|
||||
~~~~~~~~~~~~~~~
|
||||
super();
|
||||
~~~~~~~~~~~~~~~~
|
||||
return Object.create(null);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
constructor() {
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [classExtendsNull.ts]
|
||||
class C extends null {
|
||||
constructor() {
|
||||
super();
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
class D extends null {
|
||||
constructor() {
|
||||
return Object.create(null);
|
||||
}
|
||||
}
|
||||
|
||||
//// [classExtendsNull.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var C = (function (_super) {
|
||||
__extends(C, _super);
|
||||
function C() {
|
||||
_super.call(this);
|
||||
return Object.create(null);
|
||||
}
|
||||
return C;
|
||||
})(null);
|
||||
var D = (function (_super) {
|
||||
__extends(D, _super);
|
||||
function D() {
|
||||
return Object.create(null);
|
||||
}
|
||||
return D;
|
||||
})(null);
|
||||
@@ -8,4 +8,5 @@ s.map(// do something
|
||||
//// [commentInMethodCall.js]
|
||||
//commment here
|
||||
var s;
|
||||
s.map(function () { });
|
||||
s.map(// do something
|
||||
function () { });
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [commentsArgumentsOfCallExpression1.ts]
|
||||
function foo(/*c1*/ x: any) { }
|
||||
foo(/*c2*/ 1);
|
||||
foo(/*c3*/ function () { });
|
||||
foo(
|
||||
/*c4*/
|
||||
() => { });
|
||||
foo(
|
||||
/*c5*/
|
||||
/*c6*/
|
||||
() => { });
|
||||
foo(/*c7*/
|
||||
() => { });
|
||||
foo(
|
||||
/*c7*/
|
||||
/*c8*/() => { });
|
||||
|
||||
//// [commentsArgumentsOfCallExpression1.js]
|
||||
function foo(/*c1*/ x) { }
|
||||
foo(/*c2*/ 1);
|
||||
foo(/*c3*/ function () { });
|
||||
foo(
|
||||
/*c4*/
|
||||
function () { });
|
||||
foo(
|
||||
/*c5*/
|
||||
/*c6*/
|
||||
function () { });
|
||||
foo(/*c7*/ function () { });
|
||||
foo(
|
||||
/*c7*/
|
||||
/*c8*/ function () { });
|
||||
@@ -0,0 +1,31 @@
|
||||
=== tests/cases/compiler/commentsArgumentsOfCallExpression1.ts ===
|
||||
function foo(/*c1*/ x: any) { }
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(commentsArgumentsOfCallExpression1.ts, 0, 13))
|
||||
|
||||
foo(/*c2*/ 1);
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
foo(/*c3*/ function () { });
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
foo(
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
/*c4*/
|
||||
() => { });
|
||||
foo(
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
/*c5*/
|
||||
/*c6*/
|
||||
() => { });
|
||||
foo(/*c7*/
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
() => { });
|
||||
foo(
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression1.ts, 0, 0))
|
||||
|
||||
/*c7*/
|
||||
/*c8*/() => { });
|
||||
@@ -0,0 +1,47 @@
|
||||
=== tests/cases/compiler/commentsArgumentsOfCallExpression1.ts ===
|
||||
function foo(/*c1*/ x: any) { }
|
||||
>foo : (x: any) => void
|
||||
>x : any
|
||||
|
||||
foo(/*c2*/ 1);
|
||||
>foo(/*c2*/ 1) : void
|
||||
>foo : (x: any) => void
|
||||
>1 : number
|
||||
|
||||
foo(/*c3*/ function () { });
|
||||
>foo(/*c3*/ function () { }) : void
|
||||
>foo : (x: any) => void
|
||||
>function () { } : () => void
|
||||
|
||||
foo(
|
||||
>foo( /*c4*/ () => { }) : void
|
||||
>foo : (x: any) => void
|
||||
|
||||
/*c4*/
|
||||
() => { });
|
||||
>() => { } : () => void
|
||||
|
||||
foo(
|
||||
>foo( /*c5*/ /*c6*/ () => { }) : void
|
||||
>foo : (x: any) => void
|
||||
|
||||
/*c5*/
|
||||
/*c6*/
|
||||
() => { });
|
||||
>() => { } : () => void
|
||||
|
||||
foo(/*c7*/
|
||||
>foo(/*c7*/ () => { }) : void
|
||||
>foo : (x: any) => void
|
||||
|
||||
() => { });
|
||||
>() => { } : () => void
|
||||
|
||||
foo(
|
||||
>foo( /*c7*/ /*c8*/() => { }) : void
|
||||
>foo : (x: any) => void
|
||||
|
||||
/*c7*/
|
||||
/*c8*/() => { });
|
||||
>() => { } : () => void
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [commentsArgumentsOfCallExpression2.ts]
|
||||
function foo(/*c1*/ x: any, /*d1*/ y: any,/*e1*/w?: any) { }
|
||||
var a, b: any;
|
||||
foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
|
||||
foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b);
|
||||
foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b));
|
||||
foo(
|
||||
/*c4*/ function () { },
|
||||
/*d4*/() => { },
|
||||
/*e4*/
|
||||
/*e5*/ "hello");
|
||||
|
||||
//// [commentsArgumentsOfCallExpression2.js]
|
||||
function foo(/*c1*/ x, /*d1*/ y, /*e1*/ w) { }
|
||||
var a, b;
|
||||
foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
|
||||
foo(/*c3*/ function () { }, /*d2*/ function () { }, /*e2*/ a + b);
|
||||
foo(/*c3*/ function () { }, /*d3*/ function () { }, /*e3*/ (a + b));
|
||||
foo(
|
||||
/*c4*/ function () { },
|
||||
/*d4*/ function () { },
|
||||
/*e4*/
|
||||
/*e5*/ "hello");
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/commentsArgumentsOfCallExpression2.ts ===
|
||||
function foo(/*c1*/ x: any, /*d1*/ y: any,/*e1*/w?: any) { }
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression2.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(commentsArgumentsOfCallExpression2.ts, 0, 13))
|
||||
>y : Symbol(y, Decl(commentsArgumentsOfCallExpression2.ts, 0, 27))
|
||||
>w : Symbol(w, Decl(commentsArgumentsOfCallExpression2.ts, 0, 42))
|
||||
|
||||
var a, b: any;
|
||||
>a : Symbol(a, Decl(commentsArgumentsOfCallExpression2.ts, 1, 3))
|
||||
>b : Symbol(b, Decl(commentsArgumentsOfCallExpression2.ts, 1, 6))
|
||||
|
||||
foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression2.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(commentsArgumentsOfCallExpression2.ts, 1, 3))
|
||||
>b : Symbol(b, Decl(commentsArgumentsOfCallExpression2.ts, 1, 6))
|
||||
|
||||
foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b);
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression2.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(commentsArgumentsOfCallExpression2.ts, 1, 3))
|
||||
>b : Symbol(b, Decl(commentsArgumentsOfCallExpression2.ts, 1, 6))
|
||||
|
||||
foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b));
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression2.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(commentsArgumentsOfCallExpression2.ts, 1, 3))
|
||||
>b : Symbol(b, Decl(commentsArgumentsOfCallExpression2.ts, 1, 6))
|
||||
|
||||
foo(
|
||||
>foo : Symbol(foo, Decl(commentsArgumentsOfCallExpression2.ts, 0, 0))
|
||||
|
||||
/*c4*/ function () { },
|
||||
/*d4*/() => { },
|
||||
/*e4*/
|
||||
/*e5*/ "hello");
|
||||
@@ -0,0 +1,55 @@
|
||||
=== tests/cases/compiler/commentsArgumentsOfCallExpression2.ts ===
|
||||
function foo(/*c1*/ x: any, /*d1*/ y: any,/*e1*/w?: any) { }
|
||||
>foo : (x: any, y: any, w?: any) => void
|
||||
>x : any
|
||||
>y : any
|
||||
>w : any
|
||||
|
||||
var a, b: any;
|
||||
>a : any
|
||||
>b : any
|
||||
|
||||
foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b);
|
||||
>foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b) : void
|
||||
>foo : (x: any, y: any, w?: any) => void
|
||||
>1 : number
|
||||
>1 + 2 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>a + b : any
|
||||
>a : any
|
||||
>b : any
|
||||
|
||||
foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b);
|
||||
>foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b) : void
|
||||
>foo : (x: any, y: any, w?: any) => void
|
||||
>function () { } : () => void
|
||||
>() => { } : () => void
|
||||
>a + /*e3*/ b : any
|
||||
>a : any
|
||||
>b : any
|
||||
|
||||
foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b));
|
||||
>foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b)) : void
|
||||
>foo : (x: any, y: any, w?: any) => void
|
||||
>function () { } : () => void
|
||||
>() => { } : () => void
|
||||
>(a + b) : any
|
||||
>a + b : any
|
||||
>a : any
|
||||
>b : any
|
||||
|
||||
foo(
|
||||
>foo( /*c4*/ function () { }, /*d4*/() => { }, /*e4*/ /*e5*/ "hello") : void
|
||||
>foo : (x: any, y: any, w?: any) => void
|
||||
|
||||
/*c4*/ function () { },
|
||||
>function () { } : () => void
|
||||
|
||||
/*d4*/() => { },
|
||||
>() => { } : () => void
|
||||
|
||||
/*e4*/
|
||||
/*e5*/ "hello");
|
||||
>"hello" : string
|
||||
|
||||
@@ -6,5 +6,5 @@ var v = {
|
||||
|
||||
//// [commentsBeforeFunctionExpression1.js]
|
||||
var v = {
|
||||
f: function (a) { return 0; }
|
||||
f: /**own f*/ function (a) { return 0; }
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ var i2_i_nc_fnfoo = i2_i.nc_fnfoo;
|
||||
var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10);
|
||||
var i3_i;
|
||||
i3_i = {
|
||||
f: function (/**i3_i a*/ a) { return "Hello" + a; },
|
||||
f: /**own f*/ function (/**i3_i a*/ a) { return "Hello" + a; },
|
||||
l: this.f,
|
||||
/** own x*/
|
||||
x: this.f(10),
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [commentsOnPropertyOfObjectLiteral1.ts]
|
||||
var resolve = {
|
||||
id: /*! @ngInject */ (details: any) => details.id,
|
||||
id1: /* c1 */ "hello",
|
||||
id2:
|
||||
/*! @ngInject */ (details: any) => details.id,
|
||||
id3:
|
||||
/*! @ngInject */
|
||||
(details: any) => details.id,
|
||||
id4:
|
||||
/*! @ngInject */
|
||||
/* C2 */
|
||||
(details: any) => details.id,
|
||||
};
|
||||
|
||||
//// [commentsOnPropertyOfObjectLiteral1.js]
|
||||
var resolve = {
|
||||
id: /*! @ngInject */ function (details) { return details.id; },
|
||||
id1: /* c1 */ "hello",
|
||||
id2:
|
||||
/*! @ngInject */ function (details) { return details.id; },
|
||||
id3:
|
||||
/*! @ngInject */
|
||||
function (details) { return details.id; },
|
||||
id4:
|
||||
/*! @ngInject */
|
||||
/* C2 */
|
||||
function (details) { return details.id; }
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/compiler/commentsOnPropertyOfObjectLiteral1.ts ===
|
||||
var resolve = {
|
||||
>resolve : Symbol(resolve, Decl(commentsOnPropertyOfObjectLiteral1.ts, 0, 3))
|
||||
|
||||
id: /*! @ngInject */ (details: any) => details.id,
|
||||
>id : Symbol(id, Decl(commentsOnPropertyOfObjectLiteral1.ts, 0, 15))
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 1, 26))
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 1, 26))
|
||||
|
||||
id1: /* c1 */ "hello",
|
||||
>id1 : Symbol(id1, Decl(commentsOnPropertyOfObjectLiteral1.ts, 1, 54))
|
||||
|
||||
id2:
|
||||
>id2 : Symbol(id2, Decl(commentsOnPropertyOfObjectLiteral1.ts, 2, 26))
|
||||
|
||||
/*! @ngInject */ (details: any) => details.id,
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 4, 26))
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 4, 26))
|
||||
|
||||
id3:
|
||||
>id3 : Symbol(id3, Decl(commentsOnPropertyOfObjectLiteral1.ts, 4, 54))
|
||||
|
||||
/*! @ngInject */
|
||||
(details: any) => details.id,
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 7, 5))
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 7, 5))
|
||||
|
||||
id4:
|
||||
>id4 : Symbol(id4, Decl(commentsOnPropertyOfObjectLiteral1.ts, 7, 33))
|
||||
|
||||
/*! @ngInject */
|
||||
/* C2 */
|
||||
(details: any) => details.id,
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 11, 5))
|
||||
>details : Symbol(details, Decl(commentsOnPropertyOfObjectLiteral1.ts, 11, 5))
|
||||
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
=== tests/cases/compiler/commentsOnPropertyOfObjectLiteral1.ts ===
|
||||
var resolve = {
|
||||
>resolve : { id: (details: any) => any; id1: string; id2: (details: any) => any; id3: (details: any) => any; id4: (details: any) => any; }
|
||||
>{ id: /*! @ngInject */ (details: any) => details.id, id1: /* c1 */ "hello", id2: /*! @ngInject */ (details: any) => details.id, id3: /*! @ngInject */ (details: any) => details.id, id4: /*! @ngInject */ /* C2 */ (details: any) => details.id,} : { id: (details: any) => any; id1: string; id2: (details: any) => any; id3: (details: any) => any; id4: (details: any) => any; }
|
||||
|
||||
id: /*! @ngInject */ (details: any) => details.id,
|
||||
>id : (details: any) => any
|
||||
>(details: any) => details.id : (details: any) => any
|
||||
>details : any
|
||||
>details.id : any
|
||||
>details : any
|
||||
>id : any
|
||||
|
||||
id1: /* c1 */ "hello",
|
||||
>id1 : string
|
||||
>"hello" : string
|
||||
|
||||
id2:
|
||||
>id2 : (details: any) => any
|
||||
|
||||
/*! @ngInject */ (details: any) => details.id,
|
||||
>(details: any) => details.id : (details: any) => any
|
||||
>details : any
|
||||
>details.id : any
|
||||
>details : any
|
||||
>id : any
|
||||
|
||||
id3:
|
||||
>id3 : (details: any) => any
|
||||
|
||||
/*! @ngInject */
|
||||
(details: any) => details.id,
|
||||
>(details: any) => details.id : (details: any) => any
|
||||
>details : any
|
||||
>details.id : any
|
||||
>details : any
|
||||
>id : any
|
||||
|
||||
id4:
|
||||
>id4 : (details: any) => any
|
||||
|
||||
/*! @ngInject */
|
||||
/* C2 */
|
||||
(details: any) => details.id,
|
||||
>(details: any) => details.id : (details: any) => any
|
||||
>details : any
|
||||
>details.id : any
|
||||
>details : any
|
||||
>id : any
|
||||
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/compiler/commonjsSafeImport.ts] ////
|
||||
|
||||
//// [10_lib.ts]
|
||||
|
||||
export function Foo() {}
|
||||
|
||||
//// [main.ts]
|
||||
import { Foo } from './10_lib';
|
||||
|
||||
Foo();
|
||||
|
||||
|
||||
//// [10_lib.js]
|
||||
function Foo() { }
|
||||
exports.Foo = Foo;
|
||||
//// [main.js]
|
||||
var _10_lib_1 = require('./10_lib');
|
||||
_10_lib_1.Foo();
|
||||
|
||||
|
||||
//// [10_lib.d.ts]
|
||||
export declare function Foo(): void;
|
||||
//// [main.d.ts]
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/10_lib.ts ===
|
||||
|
||||
export function Foo() {}
|
||||
>Foo : Symbol(Foo, Decl(10_lib.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { Foo } from './10_lib';
|
||||
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))
|
||||
|
||||
Foo();
|
||||
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/10_lib.ts ===
|
||||
|
||||
export function Foo() {}
|
||||
>Foo : () => void
|
||||
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { Foo } from './10_lib';
|
||||
>Foo : () => void
|
||||
|
||||
Foo();
|
||||
>Foo() : void
|
||||
>Foo : () => void
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
//// [computedPropertyNamesSourceMap2_ES5.js.map]
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"}
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC,GAAT;QACIA,QAAQA,CAACA;IACbA,CAACA;;CACJ,CAAA"}
|
||||
@@ -28,26 +28,28 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
2 > ^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^->
|
||||
5 > ^^^
|
||||
1->{
|
||||
>
|
||||
2 > [
|
||||
3 > "hello"
|
||||
4 > ]
|
||||
5 >
|
||||
1->Emitted(2, 5) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0)
|
||||
5 >Emitted(2, 19) Source(2, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> debugger;
|
||||
1->^^^^^^^^
|
||||
1 >^^^^^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
1->() {
|
||||
1 >["hello"]() {
|
||||
>
|
||||
2 > debugger
|
||||
3 > ;
|
||||
1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"])
|
||||
1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) name (["hello"])
|
||||
2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) name (["hello"])
|
||||
3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) name (["hello"])
|
||||
---
|
||||
|
||||
@@ -31,21 +31,21 @@ var b: B;
|
||||
//Cond ? Expr1 : Expr2, Expr1 is supertype
|
||||
//Be Not contextually typed
|
||||
true ? x : a;
|
||||
>true ? x : a : X | A
|
||||
>true ? x : a : X
|
||||
>true : boolean
|
||||
>x : X
|
||||
>a : A
|
||||
|
||||
var result1 = true ? x : a;
|
||||
>result1 : X | A
|
||||
>true ? x : a : X | A
|
||||
>result1 : X
|
||||
>true ? x : a : X
|
||||
>true : boolean
|
||||
>x : X
|
||||
>a : A
|
||||
|
||||
//Expr1 and Expr2 are literals
|
||||
true ? {} : 1;
|
||||
>true ? {} : 1 : {} | number
|
||||
>true ? {} : 1 : {}
|
||||
>true : boolean
|
||||
>{} : {}
|
||||
>1 : number
|
||||
@@ -63,8 +63,8 @@ true ? { a: 1 } : { a: 2, b: 'string' };
|
||||
>'string' : string
|
||||
|
||||
var result2 = true ? {} : 1;
|
||||
>result2 : {} | number
|
||||
>true ? {} : 1 : {} | number
|
||||
>result2 : {}
|
||||
>true ? {} : 1 : {}
|
||||
>true : boolean
|
||||
>{} : {}
|
||||
>1 : number
|
||||
@@ -86,7 +86,7 @@ var result3 = true ? { a: 1 } : { a: 2, b: 'string' };
|
||||
var resultIsX1: X = true ? x : a;
|
||||
>resultIsX1 : X
|
||||
>X : X
|
||||
>true ? x : a : X | A
|
||||
>true ? x : a : X
|
||||
>true : boolean
|
||||
>x : X
|
||||
>a : A
|
||||
@@ -95,7 +95,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA;
|
||||
>result4 : (t: A) => any
|
||||
>t : A
|
||||
>A : A
|
||||
>true ? (m) => m.propertyX : (n) => n.propertyA : ((m: A) => any) | ((n: A) => number)
|
||||
>true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any
|
||||
>true : boolean
|
||||
>(m) => m.propertyX : (m: A) => any
|
||||
>m : A
|
||||
@@ -111,21 +111,21 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA;
|
||||
//Cond ? Expr1 : Expr2, Expr2 is supertype
|
||||
//Be Not contextually typed
|
||||
true ? a : x;
|
||||
>true ? a : x : A | X
|
||||
>true ? a : x : X
|
||||
>true : boolean
|
||||
>a : A
|
||||
>x : X
|
||||
|
||||
var result5 = true ? a : x;
|
||||
>result5 : A | X
|
||||
>true ? a : x : A | X
|
||||
>result5 : X
|
||||
>true ? a : x : X
|
||||
>true : boolean
|
||||
>a : A
|
||||
>x : X
|
||||
|
||||
//Expr1 and Expr2 are literals
|
||||
true ? 1 : {};
|
||||
>true ? 1 : {} : number | {}
|
||||
>true ? 1 : {} : {}
|
||||
>true : boolean
|
||||
>1 : number
|
||||
>{} : {}
|
||||
@@ -143,8 +143,8 @@ true ? { a: 2, b: 'string' } : { a: 1 };
|
||||
>1 : number
|
||||
|
||||
var result6 = true ? 1 : {};
|
||||
>result6 : number | {}
|
||||
>true ? 1 : {} : number | {}
|
||||
>result6 : {}
|
||||
>true ? 1 : {} : {}
|
||||
>true : boolean
|
||||
>1 : number
|
||||
>{} : {}
|
||||
@@ -166,7 +166,7 @@ var result7 = true ? { a: 2, b: 'string' } : { a: 1 };
|
||||
var resultIsX2: X = true ? x : a;
|
||||
>resultIsX2 : X
|
||||
>X : X
|
||||
>true ? x : a : X | A
|
||||
>true ? x : a : X
|
||||
>true : boolean
|
||||
>x : X
|
||||
>a : A
|
||||
@@ -175,7 +175,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX;
|
||||
>result8 : (t: A) => any
|
||||
>t : A
|
||||
>A : A
|
||||
>true ? (m) => m.propertyA : (n) => n.propertyX : ((m: A) => number) | ((n: A) => any)
|
||||
>true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any
|
||||
>true : boolean
|
||||
>(m) => m.propertyA : (m: A) => number
|
||||
>m : A
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'.
|
||||
tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'.
|
||||
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(12,9): error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.
|
||||
tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
tests/cases/compiler/constEnumErrors.ts(22,13): error TS2476: A const enum member can only be accessed using a string literal.
|
||||
@@ -31,7 +31,7 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member
|
||||
// forward reference to the element of the same enum
|
||||
X = Y,
|
||||
~
|
||||
!!! error TS2474: In 'const' enum declarations member initializer must be constant expression.
|
||||
!!! error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.
|
||||
// forward reference to the element of the same enum
|
||||
Y = E1.Z,
|
||||
~~~~
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//// [constEnumToStringNoComments.ts]
|
||||
const enum Foo {
|
||||
X = 100,
|
||||
Y = 0.5,
|
||||
Z = 2.,
|
||||
A = -1,
|
||||
B = -1.5,
|
||||
C = -1.
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
let x1 = Foo["X"].toString();
|
||||
let y0 = Foo.Y.toString();
|
||||
let y1 = Foo["Y"].toString();
|
||||
let z0 = Foo.Z.toString();
|
||||
let z1 = Foo["Z"].toString();
|
||||
let a0 = Foo.A.toString();
|
||||
let a1 = Foo["A"].toString();
|
||||
let b0 = Foo.B.toString();
|
||||
let b1 = Foo["B"].toString();
|
||||
let c0 = Foo.C.toString();
|
||||
let c1 = Foo["C"].toString();
|
||||
|
||||
|
||||
//// [constEnumToStringNoComments.js]
|
||||
var x0 = 100 .toString();
|
||||
var x1 = 100 .toString();
|
||||
var y0 = 0.5.toString();
|
||||
var y1 = 0.5.toString();
|
||||
var z0 = 2 .toString();
|
||||
var z1 = 2 .toString();
|
||||
var a0 = -1 .toString();
|
||||
var a1 = -1 .toString();
|
||||
var b0 = -1.5.toString();
|
||||
var b1 = -1.5.toString();
|
||||
var c0 = -1 .toString();
|
||||
var c1 = -1 .toString();
|
||||
@@ -0,0 +1,113 @@
|
||||
=== tests/cases/compiler/constEnumToStringNoComments.ts ===
|
||||
const enum Foo {
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
|
||||
X = 100,
|
||||
>X : Symbol(Foo.X, Decl(constEnumToStringNoComments.ts, 0, 16))
|
||||
|
||||
Y = 0.5,
|
||||
>Y : Symbol(Foo.Y, Decl(constEnumToStringNoComments.ts, 1, 12))
|
||||
|
||||
Z = 2.,
|
||||
>Z : Symbol(Foo.Z, Decl(constEnumToStringNoComments.ts, 2, 12))
|
||||
|
||||
A = -1,
|
||||
>A : Symbol(Foo.A, Decl(constEnumToStringNoComments.ts, 3, 11))
|
||||
|
||||
B = -1.5,
|
||||
>B : Symbol(Foo.B, Decl(constEnumToStringNoComments.ts, 4, 11))
|
||||
|
||||
C = -1.
|
||||
>C : Symbol(Foo.C, Decl(constEnumToStringNoComments.ts, 5, 13))
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
>x0 : Symbol(x0, Decl(constEnumToStringNoComments.ts, 9, 3))
|
||||
>Foo.X.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.X : Symbol(Foo.X, Decl(constEnumToStringNoComments.ts, 0, 16))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>X : Symbol(Foo.X, Decl(constEnumToStringNoComments.ts, 0, 16))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let x1 = Foo["X"].toString();
|
||||
>x1 : Symbol(x1, Decl(constEnumToStringNoComments.ts, 10, 3))
|
||||
>Foo["X"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"X" : Symbol(Foo.X, Decl(constEnumToStringNoComments.ts, 0, 16))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let y0 = Foo.Y.toString();
|
||||
>y0 : Symbol(y0, Decl(constEnumToStringNoComments.ts, 11, 3))
|
||||
>Foo.Y.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.Y : Symbol(Foo.Y, Decl(constEnumToStringNoComments.ts, 1, 12))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>Y : Symbol(Foo.Y, Decl(constEnumToStringNoComments.ts, 1, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let y1 = Foo["Y"].toString();
|
||||
>y1 : Symbol(y1, Decl(constEnumToStringNoComments.ts, 12, 3))
|
||||
>Foo["Y"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"Y" : Symbol(Foo.Y, Decl(constEnumToStringNoComments.ts, 1, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let z0 = Foo.Z.toString();
|
||||
>z0 : Symbol(z0, Decl(constEnumToStringNoComments.ts, 13, 3))
|
||||
>Foo.Z.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.Z : Symbol(Foo.Z, Decl(constEnumToStringNoComments.ts, 2, 12))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>Z : Symbol(Foo.Z, Decl(constEnumToStringNoComments.ts, 2, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let z1 = Foo["Z"].toString();
|
||||
>z1 : Symbol(z1, Decl(constEnumToStringNoComments.ts, 14, 3))
|
||||
>Foo["Z"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"Z" : Symbol(Foo.Z, Decl(constEnumToStringNoComments.ts, 2, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let a0 = Foo.A.toString();
|
||||
>a0 : Symbol(a0, Decl(constEnumToStringNoComments.ts, 15, 3))
|
||||
>Foo.A.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.A : Symbol(Foo.A, Decl(constEnumToStringNoComments.ts, 3, 11))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>A : Symbol(Foo.A, Decl(constEnumToStringNoComments.ts, 3, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let a1 = Foo["A"].toString();
|
||||
>a1 : Symbol(a1, Decl(constEnumToStringNoComments.ts, 16, 3))
|
||||
>Foo["A"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"A" : Symbol(Foo.A, Decl(constEnumToStringNoComments.ts, 3, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let b0 = Foo.B.toString();
|
||||
>b0 : Symbol(b0, Decl(constEnumToStringNoComments.ts, 17, 3))
|
||||
>Foo.B.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.B : Symbol(Foo.B, Decl(constEnumToStringNoComments.ts, 4, 11))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>B : Symbol(Foo.B, Decl(constEnumToStringNoComments.ts, 4, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let b1 = Foo["B"].toString();
|
||||
>b1 : Symbol(b1, Decl(constEnumToStringNoComments.ts, 18, 3))
|
||||
>Foo["B"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"B" : Symbol(Foo.B, Decl(constEnumToStringNoComments.ts, 4, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let c0 = Foo.C.toString();
|
||||
>c0 : Symbol(c0, Decl(constEnumToStringNoComments.ts, 19, 3))
|
||||
>Foo.C.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.C : Symbol(Foo.C, Decl(constEnumToStringNoComments.ts, 5, 13))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>C : Symbol(Foo.C, Decl(constEnumToStringNoComments.ts, 5, 13))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let c1 = Foo["C"].toString();
|
||||
>c1 : Symbol(c1, Decl(constEnumToStringNoComments.ts, 20, 3))
|
||||
>Foo["C"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringNoComments.ts, 0, 0))
|
||||
>"C" : Symbol(Foo.C, Decl(constEnumToStringNoComments.ts, 5, 13))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
=== tests/cases/compiler/constEnumToStringNoComments.ts ===
|
||||
const enum Foo {
|
||||
>Foo : Foo
|
||||
|
||||
X = 100,
|
||||
>X : Foo
|
||||
>100 : number
|
||||
|
||||
Y = 0.5,
|
||||
>Y : Foo
|
||||
>0.5 : number
|
||||
|
||||
Z = 2.,
|
||||
>Z : Foo
|
||||
>2. : number
|
||||
|
||||
A = -1,
|
||||
>A : Foo
|
||||
>-1 : number
|
||||
>1 : number
|
||||
|
||||
B = -1.5,
|
||||
>B : Foo
|
||||
>-1.5 : number
|
||||
>1.5 : number
|
||||
|
||||
C = -1.
|
||||
>C : Foo
|
||||
>-1. : number
|
||||
>1. : number
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
>x0 : string
|
||||
>Foo.X.toString() : string
|
||||
>Foo.X.toString : (radix?: number) => string
|
||||
>Foo.X : Foo
|
||||
>Foo : typeof Foo
|
||||
>X : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let x1 = Foo["X"].toString();
|
||||
>x1 : string
|
||||
>Foo["X"].toString() : string
|
||||
>Foo["X"].toString : (radix?: number) => string
|
||||
>Foo["X"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"X" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let y0 = Foo.Y.toString();
|
||||
>y0 : string
|
||||
>Foo.Y.toString() : string
|
||||
>Foo.Y.toString : (radix?: number) => string
|
||||
>Foo.Y : Foo
|
||||
>Foo : typeof Foo
|
||||
>Y : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let y1 = Foo["Y"].toString();
|
||||
>y1 : string
|
||||
>Foo["Y"].toString() : string
|
||||
>Foo["Y"].toString : (radix?: number) => string
|
||||
>Foo["Y"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"Y" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let z0 = Foo.Z.toString();
|
||||
>z0 : string
|
||||
>Foo.Z.toString() : string
|
||||
>Foo.Z.toString : (radix?: number) => string
|
||||
>Foo.Z : Foo
|
||||
>Foo : typeof Foo
|
||||
>Z : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let z1 = Foo["Z"].toString();
|
||||
>z1 : string
|
||||
>Foo["Z"].toString() : string
|
||||
>Foo["Z"].toString : (radix?: number) => string
|
||||
>Foo["Z"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"Z" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let a0 = Foo.A.toString();
|
||||
>a0 : string
|
||||
>Foo.A.toString() : string
|
||||
>Foo.A.toString : (radix?: number) => string
|
||||
>Foo.A : Foo
|
||||
>Foo : typeof Foo
|
||||
>A : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let a1 = Foo["A"].toString();
|
||||
>a1 : string
|
||||
>Foo["A"].toString() : string
|
||||
>Foo["A"].toString : (radix?: number) => string
|
||||
>Foo["A"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"A" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let b0 = Foo.B.toString();
|
||||
>b0 : string
|
||||
>Foo.B.toString() : string
|
||||
>Foo.B.toString : (radix?: number) => string
|
||||
>Foo.B : Foo
|
||||
>Foo : typeof Foo
|
||||
>B : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let b1 = Foo["B"].toString();
|
||||
>b1 : string
|
||||
>Foo["B"].toString() : string
|
||||
>Foo["B"].toString : (radix?: number) => string
|
||||
>Foo["B"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"B" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let c0 = Foo.C.toString();
|
||||
>c0 : string
|
||||
>Foo.C.toString() : string
|
||||
>Foo.C.toString : (radix?: number) => string
|
||||
>Foo.C : Foo
|
||||
>Foo : typeof Foo
|
||||
>C : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let c1 = Foo["C"].toString();
|
||||
>c1 : string
|
||||
>Foo["C"].toString() : string
|
||||
>Foo["C"].toString : (radix?: number) => string
|
||||
>Foo["C"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"C" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//// [constEnumToStringWithComments.ts]
|
||||
const enum Foo {
|
||||
X = 100,
|
||||
Y = 0.5,
|
||||
Z = 2.,
|
||||
A = -1,
|
||||
B = -1.5,
|
||||
C = -1.
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
let x1 = Foo["X"].toString();
|
||||
let y0 = Foo.Y.toString();
|
||||
let y1 = Foo["Y"].toString();
|
||||
let z0 = Foo.Z.toString();
|
||||
let z1 = Foo["Z"].toString();
|
||||
let a0 = Foo.A.toString();
|
||||
let a1 = Foo["A"].toString();
|
||||
let b0 = Foo.B.toString();
|
||||
let b1 = Foo["B"].toString();
|
||||
let c0 = Foo.C.toString();
|
||||
let c1 = Foo["C"].toString();
|
||||
|
||||
|
||||
//// [constEnumToStringWithComments.js]
|
||||
var x0 = 100 /* X */ .toString();
|
||||
var x1 = 100 /* "X" */ .toString();
|
||||
var y0 = 0.5 /* Y */.toString();
|
||||
var y1 = 0.5 /* "Y" */.toString();
|
||||
var z0 = 2 /* Z */ .toString();
|
||||
var z1 = 2 /* "Z" */ .toString();
|
||||
var a0 = -1 /* A */ .toString();
|
||||
var a1 = -1 /* "A" */ .toString();
|
||||
var b0 = -1.5 /* B */.toString();
|
||||
var b1 = -1.5 /* "B" */.toString();
|
||||
var c0 = -1 /* C */ .toString();
|
||||
var c1 = -1 /* "C" */ .toString();
|
||||
@@ -0,0 +1,113 @@
|
||||
=== tests/cases/compiler/constEnumToStringWithComments.ts ===
|
||||
const enum Foo {
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
|
||||
X = 100,
|
||||
>X : Symbol(Foo.X, Decl(constEnumToStringWithComments.ts, 0, 16))
|
||||
|
||||
Y = 0.5,
|
||||
>Y : Symbol(Foo.Y, Decl(constEnumToStringWithComments.ts, 1, 12))
|
||||
|
||||
Z = 2.,
|
||||
>Z : Symbol(Foo.Z, Decl(constEnumToStringWithComments.ts, 2, 12))
|
||||
|
||||
A = -1,
|
||||
>A : Symbol(Foo.A, Decl(constEnumToStringWithComments.ts, 3, 11))
|
||||
|
||||
B = -1.5,
|
||||
>B : Symbol(Foo.B, Decl(constEnumToStringWithComments.ts, 4, 11))
|
||||
|
||||
C = -1.
|
||||
>C : Symbol(Foo.C, Decl(constEnumToStringWithComments.ts, 5, 13))
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
>x0 : Symbol(x0, Decl(constEnumToStringWithComments.ts, 9, 3))
|
||||
>Foo.X.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.X : Symbol(Foo.X, Decl(constEnumToStringWithComments.ts, 0, 16))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>X : Symbol(Foo.X, Decl(constEnumToStringWithComments.ts, 0, 16))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let x1 = Foo["X"].toString();
|
||||
>x1 : Symbol(x1, Decl(constEnumToStringWithComments.ts, 10, 3))
|
||||
>Foo["X"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"X" : Symbol(Foo.X, Decl(constEnumToStringWithComments.ts, 0, 16))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let y0 = Foo.Y.toString();
|
||||
>y0 : Symbol(y0, Decl(constEnumToStringWithComments.ts, 11, 3))
|
||||
>Foo.Y.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.Y : Symbol(Foo.Y, Decl(constEnumToStringWithComments.ts, 1, 12))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>Y : Symbol(Foo.Y, Decl(constEnumToStringWithComments.ts, 1, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let y1 = Foo["Y"].toString();
|
||||
>y1 : Symbol(y1, Decl(constEnumToStringWithComments.ts, 12, 3))
|
||||
>Foo["Y"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"Y" : Symbol(Foo.Y, Decl(constEnumToStringWithComments.ts, 1, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let z0 = Foo.Z.toString();
|
||||
>z0 : Symbol(z0, Decl(constEnumToStringWithComments.ts, 13, 3))
|
||||
>Foo.Z.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.Z : Symbol(Foo.Z, Decl(constEnumToStringWithComments.ts, 2, 12))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>Z : Symbol(Foo.Z, Decl(constEnumToStringWithComments.ts, 2, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let z1 = Foo["Z"].toString();
|
||||
>z1 : Symbol(z1, Decl(constEnumToStringWithComments.ts, 14, 3))
|
||||
>Foo["Z"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"Z" : Symbol(Foo.Z, Decl(constEnumToStringWithComments.ts, 2, 12))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let a0 = Foo.A.toString();
|
||||
>a0 : Symbol(a0, Decl(constEnumToStringWithComments.ts, 15, 3))
|
||||
>Foo.A.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.A : Symbol(Foo.A, Decl(constEnumToStringWithComments.ts, 3, 11))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>A : Symbol(Foo.A, Decl(constEnumToStringWithComments.ts, 3, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let a1 = Foo["A"].toString();
|
||||
>a1 : Symbol(a1, Decl(constEnumToStringWithComments.ts, 16, 3))
|
||||
>Foo["A"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"A" : Symbol(Foo.A, Decl(constEnumToStringWithComments.ts, 3, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let b0 = Foo.B.toString();
|
||||
>b0 : Symbol(b0, Decl(constEnumToStringWithComments.ts, 17, 3))
|
||||
>Foo.B.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.B : Symbol(Foo.B, Decl(constEnumToStringWithComments.ts, 4, 11))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>B : Symbol(Foo.B, Decl(constEnumToStringWithComments.ts, 4, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let b1 = Foo["B"].toString();
|
||||
>b1 : Symbol(b1, Decl(constEnumToStringWithComments.ts, 18, 3))
|
||||
>Foo["B"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"B" : Symbol(Foo.B, Decl(constEnumToStringWithComments.ts, 4, 11))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let c0 = Foo.C.toString();
|
||||
>c0 : Symbol(c0, Decl(constEnumToStringWithComments.ts, 19, 3))
|
||||
>Foo.C.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo.C : Symbol(Foo.C, Decl(constEnumToStringWithComments.ts, 5, 13))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>C : Symbol(Foo.C, Decl(constEnumToStringWithComments.ts, 5, 13))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
let c1 = Foo["C"].toString();
|
||||
>c1 : Symbol(c1, Decl(constEnumToStringWithComments.ts, 20, 3))
|
||||
>Foo["C"].toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>Foo : Symbol(Foo, Decl(constEnumToStringWithComments.ts, 0, 0))
|
||||
>"C" : Symbol(Foo.C, Decl(constEnumToStringWithComments.ts, 5, 13))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
=== tests/cases/compiler/constEnumToStringWithComments.ts ===
|
||||
const enum Foo {
|
||||
>Foo : Foo
|
||||
|
||||
X = 100,
|
||||
>X : Foo
|
||||
>100 : number
|
||||
|
||||
Y = 0.5,
|
||||
>Y : Foo
|
||||
>0.5 : number
|
||||
|
||||
Z = 2.,
|
||||
>Z : Foo
|
||||
>2. : number
|
||||
|
||||
A = -1,
|
||||
>A : Foo
|
||||
>-1 : number
|
||||
>1 : number
|
||||
|
||||
B = -1.5,
|
||||
>B : Foo
|
||||
>-1.5 : number
|
||||
>1.5 : number
|
||||
|
||||
C = -1.
|
||||
>C : Foo
|
||||
>-1. : number
|
||||
>1. : number
|
||||
}
|
||||
|
||||
let x0 = Foo.X.toString();
|
||||
>x0 : string
|
||||
>Foo.X.toString() : string
|
||||
>Foo.X.toString : (radix?: number) => string
|
||||
>Foo.X : Foo
|
||||
>Foo : typeof Foo
|
||||
>X : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let x1 = Foo["X"].toString();
|
||||
>x1 : string
|
||||
>Foo["X"].toString() : string
|
||||
>Foo["X"].toString : (radix?: number) => string
|
||||
>Foo["X"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"X" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let y0 = Foo.Y.toString();
|
||||
>y0 : string
|
||||
>Foo.Y.toString() : string
|
||||
>Foo.Y.toString : (radix?: number) => string
|
||||
>Foo.Y : Foo
|
||||
>Foo : typeof Foo
|
||||
>Y : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let y1 = Foo["Y"].toString();
|
||||
>y1 : string
|
||||
>Foo["Y"].toString() : string
|
||||
>Foo["Y"].toString : (radix?: number) => string
|
||||
>Foo["Y"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"Y" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let z0 = Foo.Z.toString();
|
||||
>z0 : string
|
||||
>Foo.Z.toString() : string
|
||||
>Foo.Z.toString : (radix?: number) => string
|
||||
>Foo.Z : Foo
|
||||
>Foo : typeof Foo
|
||||
>Z : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let z1 = Foo["Z"].toString();
|
||||
>z1 : string
|
||||
>Foo["Z"].toString() : string
|
||||
>Foo["Z"].toString : (radix?: number) => string
|
||||
>Foo["Z"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"Z" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let a0 = Foo.A.toString();
|
||||
>a0 : string
|
||||
>Foo.A.toString() : string
|
||||
>Foo.A.toString : (radix?: number) => string
|
||||
>Foo.A : Foo
|
||||
>Foo : typeof Foo
|
||||
>A : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let a1 = Foo["A"].toString();
|
||||
>a1 : string
|
||||
>Foo["A"].toString() : string
|
||||
>Foo["A"].toString : (radix?: number) => string
|
||||
>Foo["A"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"A" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let b0 = Foo.B.toString();
|
||||
>b0 : string
|
||||
>Foo.B.toString() : string
|
||||
>Foo.B.toString : (radix?: number) => string
|
||||
>Foo.B : Foo
|
||||
>Foo : typeof Foo
|
||||
>B : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let b1 = Foo["B"].toString();
|
||||
>b1 : string
|
||||
>Foo["B"].toString() : string
|
||||
>Foo["B"].toString : (radix?: number) => string
|
||||
>Foo["B"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"B" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let c0 = Foo.C.toString();
|
||||
>c0 : string
|
||||
>Foo.C.toString() : string
|
||||
>Foo.C.toString : (radix?: number) => string
|
||||
>Foo.C : Foo
|
||||
>Foo : typeof Foo
|
||||
>C : Foo
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
let c1 = Foo["C"].toString();
|
||||
>c1 : string
|
||||
>Foo["C"].toString() : string
|
||||
>Foo["C"].toString : (radix?: number) => string
|
||||
>Foo["C"] : Foo
|
||||
>Foo : typeof Foo
|
||||
>"C" : string
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
@@ -82,5 +82,7 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any
|
||||
>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1))
|
||||
>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1))
|
||||
>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52))
|
||||
>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
||||
|
||||
|
||||
@@ -90,10 +90,10 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any
|
||||
>x4 : IWithCallSignatures | IWithCallSignatures4
|
||||
>IWithCallSignatures : IWithCallSignatures
|
||||
>IWithCallSignatures4 : IWithCallSignatures4
|
||||
>a => /*here a should be any*/ a.toString() : (a: any) => any
|
||||
>a : any
|
||||
>a.toString() : any
|
||||
>a.toString : any
|
||||
>a : any
|
||||
>toString : any
|
||||
>a => /*here a should be any*/ a.toString() : (a: number) => string
|
||||
>a : number
|
||||
>a.toString() : string
|
||||
>a.toString : (radix?: number) => string
|
||||
>a : number
|
||||
>toString : (radix?: number) => string
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,8 +10,7 @@ sourceFile:contextualTyping.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>// CONTEXT: Class property declaration
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >// DEFAULT INTERFACES
|
||||
>interface IFoo {
|
||||
> n: number;
|
||||
@@ -24,21 +23,23 @@ sourceFile:contextualTyping.ts
|
||||
> foo: IFoo;
|
||||
>}
|
||||
>
|
||||
>// CONTEXT: Class property declaration
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Class property declaration
|
||||
1 >Emitted(1, 1) Source(14, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 1) Source(13, 1) + SourceIndex(0)
|
||||
3 >Emitted(1, 39) Source(13, 39) + SourceIndex(0)
|
||||
2 >// CONTEXT: Class property declaration
|
||||
1 >Emitted(1, 1) Source(13, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 39) Source(13, 39) + SourceIndex(0)
|
||||
---
|
||||
>>>var C1T5 = (function () {
|
||||
>>> function C1T5() {
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
|
||||
1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C1T5() {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
1->Emitted(3, 5) Source(14, 1) + SourceIndex(0) name (C1T5)
|
||||
---
|
||||
>>> this.foo = function (i) {
|
||||
1->^^^^^^^^
|
||||
@@ -127,17 +128,13 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Module property declaration
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Module property declaration
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Module property declaration
|
||||
1->Emitted(10, 1) Source(21, 1) + SourceIndex(0)
|
||||
2 >Emitted(10, 1) Source(20, 1) + SourceIndex(0)
|
||||
3 >Emitted(10, 40) Source(20, 40) + SourceIndex(0)
|
||||
2 >// CONTEXT: Module property declaration
|
||||
1->Emitted(10, 1) Source(20, 1) + SourceIndex(0)
|
||||
2 >Emitted(10, 40) Source(20, 40) + SourceIndex(0)
|
||||
---
|
||||
>>>var C2T5;
|
||||
1 >
|
||||
@@ -257,66 +254,65 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Variable declaration
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^^^^^^^^^->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Variable declaration
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Variable declaration
|
||||
1->Emitted(17, 1) Source(28, 1) + SourceIndex(0)
|
||||
2 >Emitted(17, 1) Source(27, 1) + SourceIndex(0)
|
||||
3 >Emitted(17, 33) Source(27, 33) + SourceIndex(0)
|
||||
2 >// CONTEXT: Variable declaration
|
||||
1->Emitted(17, 1) Source(27, 1) + SourceIndex(0)
|
||||
2 >Emitted(17, 33) Source(27, 33) + SourceIndex(0)
|
||||
---
|
||||
>>>var c3t1 = (function (s) { return s; });
|
||||
1->^^^^
|
||||
2 > ^^^^
|
||||
3 > ^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^
|
||||
8 > ^^^^^^
|
||||
9 > ^
|
||||
10> ^
|
||||
11> ^
|
||||
12> ^
|
||||
13> ^
|
||||
14> ^
|
||||
15> ^
|
||||
1->
|
||||
2 >^^^^
|
||||
3 > ^^^^
|
||||
4 > ^^^
|
||||
5 > ^
|
||||
6 > ^^^^^^^^^^
|
||||
7 > ^
|
||||
8 > ^^^^
|
||||
9 > ^^^^^^
|
||||
10> ^
|
||||
11> ^
|
||||
12> ^
|
||||
13> ^
|
||||
14> ^
|
||||
15> ^
|
||||
16> ^
|
||||
1->
|
||||
>var
|
||||
2 > c3t1
|
||||
3 > : (s: string) => string =
|
||||
4 > (
|
||||
5 > function(
|
||||
6 > s
|
||||
7 > ) {
|
||||
8 > return
|
||||
9 >
|
||||
10> s
|
||||
11>
|
||||
12>
|
||||
13> }
|
||||
14> )
|
||||
15> ;
|
||||
1->Emitted(18, 5) Source(28, 5) + SourceIndex(0)
|
||||
2 >Emitted(18, 9) Source(28, 9) + SourceIndex(0)
|
||||
3 >Emitted(18, 12) Source(28, 35) + SourceIndex(0)
|
||||
4 >Emitted(18, 13) Source(28, 36) + SourceIndex(0)
|
||||
5 >Emitted(18, 23) Source(28, 45) + SourceIndex(0)
|
||||
6 >Emitted(18, 24) Source(28, 46) + SourceIndex(0)
|
||||
7 >Emitted(18, 28) Source(28, 50) + SourceIndex(0)
|
||||
8 >Emitted(18, 34) Source(28, 56) + SourceIndex(0)
|
||||
9 >Emitted(18, 35) Source(28, 57) + SourceIndex(0)
|
||||
10>Emitted(18, 36) Source(28, 58) + SourceIndex(0)
|
||||
11>Emitted(18, 37) Source(28, 58) + SourceIndex(0)
|
||||
12>Emitted(18, 38) Source(28, 59) + SourceIndex(0)
|
||||
13>Emitted(18, 39) Source(28, 60) + SourceIndex(0)
|
||||
14>Emitted(18, 40) Source(28, 61) + SourceIndex(0)
|
||||
15>Emitted(18, 41) Source(28, 62) + SourceIndex(0)
|
||||
>
|
||||
2 >var
|
||||
3 > c3t1
|
||||
4 > : (s: string) => string =
|
||||
5 > (
|
||||
6 > function(
|
||||
7 > s
|
||||
8 > ) {
|
||||
9 > return
|
||||
10>
|
||||
11> s
|
||||
12>
|
||||
13>
|
||||
14> }
|
||||
15> )
|
||||
16> ;
|
||||
1->Emitted(18, 1) Source(28, 1) + SourceIndex(0)
|
||||
2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0)
|
||||
3 >Emitted(18, 9) Source(28, 9) + SourceIndex(0)
|
||||
4 >Emitted(18, 12) Source(28, 35) + SourceIndex(0)
|
||||
5 >Emitted(18, 13) Source(28, 36) + SourceIndex(0)
|
||||
6 >Emitted(18, 23) Source(28, 45) + SourceIndex(0)
|
||||
7 >Emitted(18, 24) Source(28, 46) + SourceIndex(0)
|
||||
8 >Emitted(18, 28) Source(28, 50) + SourceIndex(0)
|
||||
9 >Emitted(18, 34) Source(28, 56) + SourceIndex(0)
|
||||
10>Emitted(18, 35) Source(28, 57) + SourceIndex(0)
|
||||
11>Emitted(18, 36) Source(28, 58) + SourceIndex(0)
|
||||
12>Emitted(18, 37) Source(28, 58) + SourceIndex(0)
|
||||
13>Emitted(18, 38) Source(28, 59) + SourceIndex(0)
|
||||
14>Emitted(18, 39) Source(28, 60) + SourceIndex(0)
|
||||
15>Emitted(18, 40) Source(28, 61) + SourceIndex(0)
|
||||
16>Emitted(18, 41) Source(28, 62) + SourceIndex(0)
|
||||
---
|
||||
>>>var c3t2 = ({
|
||||
1 >
|
||||
@@ -945,27 +941,28 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Class property assignment
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Class property assignment
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Class property assignment
|
||||
1->Emitted(40, 1) Source(56, 1) + SourceIndex(0)
|
||||
2 >Emitted(40, 1) Source(55, 1) + SourceIndex(0)
|
||||
3 >Emitted(40, 38) Source(55, 38) + SourceIndex(0)
|
||||
2 >// CONTEXT: Class property assignment
|
||||
1->Emitted(40, 1) Source(55, 1) + SourceIndex(0)
|
||||
2 >Emitted(40, 38) Source(55, 38) + SourceIndex(0)
|
||||
---
|
||||
>>>var C4T5 = (function () {
|
||||
>>> function C4T5() {
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>class C4T5 {
|
||||
>
|
||||
1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C4T5() {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->class C4T5 {
|
||||
> foo: (i: number, s: string) => string;
|
||||
>
|
||||
1 >Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
|
||||
1->Emitted(42, 5) Source(58, 5) + SourceIndex(0) name (C4T5)
|
||||
---
|
||||
>>> this.foo = function (i, s) {
|
||||
1->^^^^^^^^
|
||||
@@ -1070,17 +1067,13 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Module property assignment
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Module property assignment
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Module property assignment
|
||||
1->Emitted(49, 1) Source(66, 1) + SourceIndex(0)
|
||||
2 >Emitted(49, 1) Source(65, 1) + SourceIndex(0)
|
||||
3 >Emitted(49, 39) Source(65, 39) + SourceIndex(0)
|
||||
2 >// CONTEXT: Module property assignment
|
||||
1->Emitted(49, 1) Source(65, 1) + SourceIndex(0)
|
||||
2 >Emitted(49, 39) Source(65, 39) + SourceIndex(0)
|
||||
---
|
||||
>>>var C5T5;
|
||||
1 >
|
||||
@@ -1209,30 +1202,29 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Variable assignment
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Variable assignment
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Variable assignment
|
||||
1->Emitted(56, 1) Source(74, 1) + SourceIndex(0)
|
||||
2 >Emitted(56, 1) Source(73, 1) + SourceIndex(0)
|
||||
3 >Emitted(56, 32) Source(73, 32) + SourceIndex(0)
|
||||
2 >// CONTEXT: Variable assignment
|
||||
1->Emitted(56, 1) Source(73, 1) + SourceIndex(0)
|
||||
2 >Emitted(56, 32) Source(73, 32) + SourceIndex(0)
|
||||
---
|
||||
>>>var c6t5;
|
||||
1 >^^^^
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>var
|
||||
2 > c6t5: (n: number) => IFoo
|
||||
3 > ;
|
||||
1 >Emitted(57, 5) Source(74, 5) + SourceIndex(0)
|
||||
2 >Emitted(57, 9) Source(74, 30) + SourceIndex(0)
|
||||
3 >Emitted(57, 10) Source(74, 31) + SourceIndex(0)
|
||||
>
|
||||
2 >var
|
||||
3 > c6t5: (n: number) => IFoo
|
||||
4 > ;
|
||||
1 >Emitted(57, 1) Source(74, 1) + SourceIndex(0)
|
||||
2 >Emitted(57, 5) Source(74, 5) + SourceIndex(0)
|
||||
3 >Emitted(57, 9) Source(74, 30) + SourceIndex(0)
|
||||
4 >Emitted(57, 10) Source(74, 31) + SourceIndex(0)
|
||||
---
|
||||
>>>c6t5 = function (n) { return ({}); };
|
||||
1->
|
||||
@@ -1284,30 +1276,29 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Array index assignment
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 >
|
||||
>
|
||||
>// CONTEXT: Array index assignment
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Array index assignment
|
||||
1 >Emitted(59, 1) Source(78, 1) + SourceIndex(0)
|
||||
2 >Emitted(59, 1) Source(77, 1) + SourceIndex(0)
|
||||
3 >Emitted(59, 35) Source(77, 35) + SourceIndex(0)
|
||||
2 >// CONTEXT: Array index assignment
|
||||
1 >Emitted(59, 1) Source(77, 1) + SourceIndex(0)
|
||||
2 >Emitted(59, 35) Source(77, 35) + SourceIndex(0)
|
||||
---
|
||||
>>>var c7t2;
|
||||
1 >^^^^
|
||||
2 > ^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>var
|
||||
2 > c7t2: IFoo[]
|
||||
3 > ;
|
||||
1 >Emitted(60, 5) Source(78, 5) + SourceIndex(0)
|
||||
2 >Emitted(60, 9) Source(78, 17) + SourceIndex(0)
|
||||
3 >Emitted(60, 10) Source(78, 18) + SourceIndex(0)
|
||||
>
|
||||
2 >var
|
||||
3 > c7t2: IFoo[]
|
||||
4 > ;
|
||||
1 >Emitted(60, 1) Source(78, 1) + SourceIndex(0)
|
||||
2 >Emitted(60, 5) Source(78, 5) + SourceIndex(0)
|
||||
3 >Emitted(60, 9) Source(78, 17) + SourceIndex(0)
|
||||
4 >Emitted(60, 10) Source(78, 18) + SourceIndex(0)
|
||||
---
|
||||
>>>c7t2[0] = ({ n: 1 });
|
||||
1->
|
||||
@@ -2140,31 +2131,30 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Function call
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>// CONTEXT: Function call
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Function call
|
||||
1->Emitted(85, 1) Source(146, 1) + SourceIndex(0)
|
||||
2 >Emitted(85, 1) Source(145, 1) + SourceIndex(0)
|
||||
3 >Emitted(85, 26) Source(145, 26) + SourceIndex(0)
|
||||
2 >// CONTEXT: Function call
|
||||
1->Emitted(85, 1) Source(145, 1) + SourceIndex(0)
|
||||
2 >Emitted(85, 26) Source(145, 26) + SourceIndex(0)
|
||||
---
|
||||
>>>function c9t5(f) { }
|
||||
1 >^^^^^^^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^
|
||||
4 > ^
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^
|
||||
5 > ^
|
||||
1 >
|
||||
>function c9t5(
|
||||
2 > f: (n: number) => IFoo
|
||||
3 > ) {
|
||||
4 > }
|
||||
1 >Emitted(86, 15) Source(146, 15) + SourceIndex(0)
|
||||
2 >Emitted(86, 16) Source(146, 37) + SourceIndex(0)
|
||||
3 >Emitted(86, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
|
||||
4 >Emitted(86, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
|
||||
>
|
||||
2 >function c9t5(
|
||||
3 > f: (n: number) => IFoo
|
||||
4 > ) {
|
||||
5 > }
|
||||
1 >Emitted(86, 1) Source(146, 1) + SourceIndex(0)
|
||||
2 >Emitted(86, 15) Source(146, 15) + SourceIndex(0)
|
||||
3 >Emitted(86, 16) Source(146, 37) + SourceIndex(0)
|
||||
4 >Emitted(86, 20) Source(146, 40) + SourceIndex(0) name (c9t5)
|
||||
5 >Emitted(86, 21) Source(146, 41) + SourceIndex(0) name (c9t5)
|
||||
---
|
||||
>>>;
|
||||
1 >
|
||||
@@ -2236,107 +2226,107 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Return statement
|
||||
1->
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
>// CONTEXT: Return statement
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Return statement
|
||||
1->Emitted(91, 1) Source(152, 1) + SourceIndex(0)
|
||||
2 >Emitted(91, 1) Source(151, 1) + SourceIndex(0)
|
||||
3 >Emitted(91, 29) Source(151, 29) + SourceIndex(0)
|
||||
2 >// CONTEXT: Return statement
|
||||
1->Emitted(91, 1) Source(151, 1) + SourceIndex(0)
|
||||
2 >Emitted(91, 29) Source(151, 29) + SourceIndex(0)
|
||||
---
|
||||
>>>var c10t5 = function () { return function (n) { return ({}); }; };
|
||||
1->^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^^
|
||||
4 > ^^^^^^^^^^^^^^
|
||||
5 > ^^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^
|
||||
8 > ^
|
||||
9 > ^^^^
|
||||
10> ^^^^^^
|
||||
11> ^
|
||||
12> ^
|
||||
13> ^^
|
||||
14> ^
|
||||
15> ^
|
||||
16> ^
|
||||
17> ^
|
||||
18> ^
|
||||
19> ^
|
||||
20> ^
|
||||
21> ^
|
||||
1->
|
||||
2 >^^^^
|
||||
3 > ^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^^^^^^^^^^^^^
|
||||
6 > ^^^^^^
|
||||
7 > ^
|
||||
8 > ^^^^^^^^^^
|
||||
9 > ^
|
||||
10> ^^^^
|
||||
11> ^^^^^^
|
||||
12> ^
|
||||
13> ^
|
||||
14> ^^
|
||||
15> ^
|
||||
16> ^
|
||||
17> ^
|
||||
18> ^
|
||||
19> ^
|
||||
20> ^
|
||||
21> ^
|
||||
22> ^
|
||||
1->
|
||||
>var
|
||||
2 > c10t5
|
||||
3 > : () => (n: number) => IFoo =
|
||||
4 > function() {
|
||||
5 > return
|
||||
6 >
|
||||
7 > function(
|
||||
8 > n
|
||||
9 > ) {
|
||||
10> return
|
||||
11> <IFoo>
|
||||
12> (
|
||||
13> {}
|
||||
14> )
|
||||
15>
|
||||
16>
|
||||
17> }
|
||||
18>
|
||||
19>
|
||||
20> }
|
||||
21> ;
|
||||
1->Emitted(92, 5) Source(152, 5) + SourceIndex(0)
|
||||
2 >Emitted(92, 10) Source(152, 10) + SourceIndex(0)
|
||||
3 >Emitted(92, 13) Source(152, 40) + SourceIndex(0)
|
||||
4 >Emitted(92, 27) Source(152, 53) + SourceIndex(0)
|
||||
5 >Emitted(92, 33) Source(152, 59) + SourceIndex(0)
|
||||
6 >Emitted(92, 34) Source(152, 60) + SourceIndex(0)
|
||||
7 >Emitted(92, 44) Source(152, 69) + SourceIndex(0)
|
||||
8 >Emitted(92, 45) Source(152, 70) + SourceIndex(0)
|
||||
9 >Emitted(92, 49) Source(152, 74) + SourceIndex(0)
|
||||
10>Emitted(92, 55) Source(152, 80) + SourceIndex(0)
|
||||
11>Emitted(92, 56) Source(152, 87) + SourceIndex(0)
|
||||
12>Emitted(92, 57) Source(152, 88) + SourceIndex(0)
|
||||
13>Emitted(92, 59) Source(152, 90) + SourceIndex(0)
|
||||
14>Emitted(92, 60) Source(152, 91) + SourceIndex(0)
|
||||
15>Emitted(92, 61) Source(152, 91) + SourceIndex(0)
|
||||
16>Emitted(92, 62) Source(152, 92) + SourceIndex(0)
|
||||
17>Emitted(92, 63) Source(152, 93) + SourceIndex(0)
|
||||
18>Emitted(92, 64) Source(152, 93) + SourceIndex(0)
|
||||
19>Emitted(92, 65) Source(152, 94) + SourceIndex(0)
|
||||
20>Emitted(92, 66) Source(152, 95) + SourceIndex(0)
|
||||
21>Emitted(92, 67) Source(152, 96) + SourceIndex(0)
|
||||
>
|
||||
2 >var
|
||||
3 > c10t5
|
||||
4 > : () => (n: number) => IFoo =
|
||||
5 > function() {
|
||||
6 > return
|
||||
7 >
|
||||
8 > function(
|
||||
9 > n
|
||||
10> ) {
|
||||
11> return
|
||||
12> <IFoo>
|
||||
13> (
|
||||
14> {}
|
||||
15> )
|
||||
16>
|
||||
17>
|
||||
18> }
|
||||
19>
|
||||
20>
|
||||
21> }
|
||||
22> ;
|
||||
1->Emitted(92, 1) Source(152, 1) + SourceIndex(0)
|
||||
2 >Emitted(92, 5) Source(152, 5) + SourceIndex(0)
|
||||
3 >Emitted(92, 10) Source(152, 10) + SourceIndex(0)
|
||||
4 >Emitted(92, 13) Source(152, 40) + SourceIndex(0)
|
||||
5 >Emitted(92, 27) Source(152, 53) + SourceIndex(0)
|
||||
6 >Emitted(92, 33) Source(152, 59) + SourceIndex(0)
|
||||
7 >Emitted(92, 34) Source(152, 60) + SourceIndex(0)
|
||||
8 >Emitted(92, 44) Source(152, 69) + SourceIndex(0)
|
||||
9 >Emitted(92, 45) Source(152, 70) + SourceIndex(0)
|
||||
10>Emitted(92, 49) Source(152, 74) + SourceIndex(0)
|
||||
11>Emitted(92, 55) Source(152, 80) + SourceIndex(0)
|
||||
12>Emitted(92, 56) Source(152, 87) + SourceIndex(0)
|
||||
13>Emitted(92, 57) Source(152, 88) + SourceIndex(0)
|
||||
14>Emitted(92, 59) Source(152, 90) + SourceIndex(0)
|
||||
15>Emitted(92, 60) Source(152, 91) + SourceIndex(0)
|
||||
16>Emitted(92, 61) Source(152, 91) + SourceIndex(0)
|
||||
17>Emitted(92, 62) Source(152, 92) + SourceIndex(0)
|
||||
18>Emitted(92, 63) Source(152, 93) + SourceIndex(0)
|
||||
19>Emitted(92, 64) Source(152, 93) + SourceIndex(0)
|
||||
20>Emitted(92, 65) Source(152, 94) + SourceIndex(0)
|
||||
21>Emitted(92, 66) Source(152, 95) + SourceIndex(0)
|
||||
22>Emitted(92, 67) Source(152, 96) + SourceIndex(0)
|
||||
---
|
||||
>>>// CONTEXT: Newing a class
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^->
|
||||
1 >
|
||||
>
|
||||
>// CONTEXT: Newing a class
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Newing a class
|
||||
1 >Emitted(93, 1) Source(155, 1) + SourceIndex(0)
|
||||
2 >Emitted(93, 1) Source(154, 1) + SourceIndex(0)
|
||||
3 >Emitted(93, 27) Source(154, 27) + SourceIndex(0)
|
||||
2 >// CONTEXT: Newing a class
|
||||
1 >Emitted(93, 1) Source(154, 1) + SourceIndex(0)
|
||||
2 >Emitted(93, 27) Source(154, 27) + SourceIndex(0)
|
||||
---
|
||||
>>>var C11t5 = (function () {
|
||||
1->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
1->Emitted(94, 1) Source(155, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function C11t5(f) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
1->
|
||||
>class C11t5 {
|
||||
1->class C11t5 {
|
||||
2 > constructor(
|
||||
3 > f: (n: number) => IFoo
|
||||
1->Emitted(95, 5) Source(155, 15) + SourceIndex(0) name (C11t5)
|
||||
@@ -2448,66 +2438,65 @@ sourceFile:contextualTyping.ts
|
||||
---
|
||||
>>>// CONTEXT: Type annotated expression
|
||||
1 >
|
||||
2 >
|
||||
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
4 > ^^^^^->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^->
|
||||
1 >
|
||||
>
|
||||
>// CONTEXT: Type annotated expression
|
||||
>
|
||||
2 >
|
||||
3 >// CONTEXT: Type annotated expression
|
||||
1 >Emitted(101, 1) Source(159, 1) + SourceIndex(0)
|
||||
2 >Emitted(101, 1) Source(158, 1) + SourceIndex(0)
|
||||
3 >Emitted(101, 38) Source(158, 38) + SourceIndex(0)
|
||||
2 >// CONTEXT: Type annotated expression
|
||||
1 >Emitted(101, 1) Source(158, 1) + SourceIndex(0)
|
||||
2 >Emitted(101, 38) Source(158, 38) + SourceIndex(0)
|
||||
---
|
||||
>>>var c12t1 = (function (s) { return s; });
|
||||
1->^^^^
|
||||
2 > ^^^^^
|
||||
3 > ^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^
|
||||
8 > ^^^^^^
|
||||
9 > ^
|
||||
10> ^
|
||||
11> ^
|
||||
12> ^
|
||||
13> ^
|
||||
14> ^
|
||||
15> ^
|
||||
1->
|
||||
2 >^^^^
|
||||
3 > ^^^^^
|
||||
4 > ^^^
|
||||
5 > ^
|
||||
6 > ^^^^^^^^^^
|
||||
7 > ^
|
||||
8 > ^^^^
|
||||
9 > ^^^^^^
|
||||
10> ^
|
||||
11> ^
|
||||
12> ^
|
||||
13> ^
|
||||
14> ^
|
||||
15> ^
|
||||
16> ^
|
||||
1->
|
||||
>var
|
||||
2 > c12t1
|
||||
3 > = <(s: string) => string>
|
||||
4 > (
|
||||
5 > function(
|
||||
6 > s
|
||||
7 > ) {
|
||||
8 > return
|
||||
9 >
|
||||
10> s
|
||||
11>
|
||||
12>
|
||||
13> }
|
||||
14> )
|
||||
15> ;
|
||||
1->Emitted(102, 5) Source(159, 5) + SourceIndex(0)
|
||||
2 >Emitted(102, 10) Source(159, 10) + SourceIndex(0)
|
||||
3 >Emitted(102, 13) Source(159, 37) + SourceIndex(0)
|
||||
4 >Emitted(102, 14) Source(159, 38) + SourceIndex(0)
|
||||
5 >Emitted(102, 24) Source(159, 47) + SourceIndex(0)
|
||||
6 >Emitted(102, 25) Source(159, 48) + SourceIndex(0)
|
||||
7 >Emitted(102, 29) Source(159, 52) + SourceIndex(0)
|
||||
8 >Emitted(102, 35) Source(159, 58) + SourceIndex(0)
|
||||
9 >Emitted(102, 36) Source(159, 59) + SourceIndex(0)
|
||||
10>Emitted(102, 37) Source(159, 60) + SourceIndex(0)
|
||||
11>Emitted(102, 38) Source(159, 60) + SourceIndex(0)
|
||||
12>Emitted(102, 39) Source(159, 61) + SourceIndex(0)
|
||||
13>Emitted(102, 40) Source(159, 62) + SourceIndex(0)
|
||||
14>Emitted(102, 41) Source(159, 63) + SourceIndex(0)
|
||||
15>Emitted(102, 42) Source(159, 64) + SourceIndex(0)
|
||||
>
|
||||
2 >var
|
||||
3 > c12t1
|
||||
4 > = <(s: string) => string>
|
||||
5 > (
|
||||
6 > function(
|
||||
7 > s
|
||||
8 > ) {
|
||||
9 > return
|
||||
10>
|
||||
11> s
|
||||
12>
|
||||
13>
|
||||
14> }
|
||||
15> )
|
||||
16> ;
|
||||
1->Emitted(102, 1) Source(159, 1) + SourceIndex(0)
|
||||
2 >Emitted(102, 5) Source(159, 5) + SourceIndex(0)
|
||||
3 >Emitted(102, 10) Source(159, 10) + SourceIndex(0)
|
||||
4 >Emitted(102, 13) Source(159, 37) + SourceIndex(0)
|
||||
5 >Emitted(102, 14) Source(159, 38) + SourceIndex(0)
|
||||
6 >Emitted(102, 24) Source(159, 47) + SourceIndex(0)
|
||||
7 >Emitted(102, 25) Source(159, 48) + SourceIndex(0)
|
||||
8 >Emitted(102, 29) Source(159, 52) + SourceIndex(0)
|
||||
9 >Emitted(102, 35) Source(159, 58) + SourceIndex(0)
|
||||
10>Emitted(102, 36) Source(159, 59) + SourceIndex(0)
|
||||
11>Emitted(102, 37) Source(159, 60) + SourceIndex(0)
|
||||
12>Emitted(102, 38) Source(159, 60) + SourceIndex(0)
|
||||
13>Emitted(102, 39) Source(159, 61) + SourceIndex(0)
|
||||
14>Emitted(102, 40) Source(159, 62) + SourceIndex(0)
|
||||
15>Emitted(102, 41) Source(159, 63) + SourceIndex(0)
|
||||
16>Emitted(102, 42) Source(159, 64) + SourceIndex(0)
|
||||
---
|
||||
>>>var c12t2 = ({
|
||||
1 >
|
||||
|
||||
@@ -23,8 +23,8 @@ class C extends A {
|
||||
}
|
||||
|
||||
var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }];
|
||||
>xs : (((x: A) => void) | ((x: B) => void) | ((x: C) => void))[]
|
||||
>[(x: A) => { }, (x: B) => { }, (x: C) => { }] : (((x: A) => void) | ((x: B) => void) | ((x: C) => void))[]
|
||||
>xs : ((x: A) => void)[]
|
||||
>[(x: A) => { }, (x: B) => { }, (x: C) => { }] : ((x: A) => void)[]
|
||||
>(x: A) => { } : (x: A) => void
|
||||
>x : A
|
||||
>A : A
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [declFileClassExtendsNull.ts]
|
||||
|
||||
class ExtendsNull extends null {
|
||||
}
|
||||
|
||||
//// [declFileClassExtendsNull.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var ExtendsNull = (function (_super) {
|
||||
__extends(ExtendsNull, _super);
|
||||
function ExtendsNull() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return ExtendsNull;
|
||||
})(null);
|
||||
|
||||
|
||||
//// [declFileClassExtendsNull.d.ts]
|
||||
declare class ExtendsNull extends null {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/declFileClassExtendsNull.ts ===
|
||||
|
||||
class ExtendsNull extends null {
|
||||
>ExtendsNull : Symbol(ExtendsNull, Decl(declFileClassExtendsNull.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/declFileClassExtendsNull.ts ===
|
||||
|
||||
class ExtendsNull extends null {
|
||||
>ExtendsNull : ExtendsNull
|
||||
>null : null
|
||||
}
|
||||
@@ -20,8 +20,8 @@ function makePoint(x) {
|
||||
};
|
||||
}
|
||||
;
|
||||
var point = makePoint(2);
|
||||
var x = point.x;
|
||||
var /*4*/ point = makePoint(2);
|
||||
var /*2*/ x = point.x;
|
||||
point.x = 30;
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ function makePoint(x) {
|
||||
};
|
||||
}
|
||||
;
|
||||
var point = makePoint(2);
|
||||
var x = point.x;
|
||||
var /*4*/ point = makePoint(2);
|
||||
var /*2*/ x = point.x;
|
||||
|
||||
|
||||
//// [declFileObjectLiteralWithOnlyGetter.d.ts]
|
||||
|
||||
@@ -17,7 +17,7 @@ function makePoint(x) {
|
||||
};
|
||||
}
|
||||
;
|
||||
var point = makePoint(2);
|
||||
var /*3*/ point = makePoint(2);
|
||||
point.x = 30;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//// [tests/cases/compiler/declarationEmit_exportAssignment.ts] ////
|
||||
|
||||
//// [utils.ts]
|
||||
|
||||
export function foo() { }
|
||||
export function bar() { }
|
||||
export interface Buzz { }
|
||||
|
||||
//// [index.ts]
|
||||
import {foo} from "utils";
|
||||
export = foo;
|
||||
|
||||
//// [utils.js]
|
||||
function foo() { }
|
||||
exports.foo = foo;
|
||||
function bar() { }
|
||||
exports.bar = bar;
|
||||
//// [index.js]
|
||||
var utils_1 = require("utils");
|
||||
module.exports = utils_1.foo;
|
||||
|
||||
|
||||
//// [utils.d.ts]
|
||||
export declare function foo(): void;
|
||||
export declare function bar(): void;
|
||||
export interface Buzz {
|
||||
}
|
||||
//// [index.d.ts]
|
||||
import { foo } from "utils";
|
||||
export = foo;
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/utils.ts ===
|
||||
|
||||
export function foo() { }
|
||||
>foo : Symbol(foo, Decl(utils.ts, 0, 0))
|
||||
|
||||
export function bar() { }
|
||||
>bar : Symbol(bar, Decl(utils.ts, 1, 25))
|
||||
|
||||
export interface Buzz { }
|
||||
>Buzz : Symbol(Buzz, Decl(utils.ts, 2, 25))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import {foo} from "utils";
|
||||
>foo : Symbol(foo, Decl(index.ts, 0, 8))
|
||||
|
||||
export = foo;
|
||||
>foo : Symbol(foo, Decl(index.ts, 0, 8))
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/utils.ts ===
|
||||
|
||||
export function foo() { }
|
||||
>foo : () => void
|
||||
|
||||
export function bar() { }
|
||||
>bar : () => void
|
||||
|
||||
export interface Buzz { }
|
||||
>Buzz : Buzz
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import {foo} from "utils";
|
||||
>foo : () => void
|
||||
|
||||
export = foo;
|
||||
>foo : () => void
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [tests/cases/compiler/declarationEmit_exportDeclaration.ts] ////
|
||||
|
||||
//// [utils.ts]
|
||||
|
||||
export function foo() { }
|
||||
export function bar() { }
|
||||
export interface Buzz { }
|
||||
|
||||
//// [index.ts]
|
||||
import {foo, bar, Buzz} from "utils";
|
||||
|
||||
foo();
|
||||
let obj: Buzz;
|
||||
export {bar};
|
||||
|
||||
//// [utils.js]
|
||||
function foo() { }
|
||||
exports.foo = foo;
|
||||
function bar() { }
|
||||
exports.bar = bar;
|
||||
//// [index.js]
|
||||
var utils_1 = require("utils");
|
||||
exports.bar = utils_1.bar;
|
||||
utils_1.foo();
|
||||
var obj;
|
||||
|
||||
|
||||
//// [utils.d.ts]
|
||||
export declare function foo(): void;
|
||||
export declare function bar(): void;
|
||||
export interface Buzz {
|
||||
}
|
||||
//// [index.d.ts]
|
||||
import { bar } from "utils";
|
||||
export { bar };
|
||||
@@ -0,0 +1,27 @@
|
||||
=== tests/cases/compiler/utils.ts ===
|
||||
|
||||
export function foo() { }
|
||||
>foo : Symbol(foo, Decl(utils.ts, 0, 0))
|
||||
|
||||
export function bar() { }
|
||||
>bar : Symbol(bar, Decl(utils.ts, 1, 25))
|
||||
|
||||
export interface Buzz { }
|
||||
>Buzz : Symbol(Buzz, Decl(utils.ts, 2, 25))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import {foo, bar, Buzz} from "utils";
|
||||
>foo : Symbol(foo, Decl(index.ts, 0, 8))
|
||||
>bar : Symbol(bar, Decl(index.ts, 0, 12))
|
||||
>Buzz : Symbol(Buzz, Decl(index.ts, 0, 17))
|
||||
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(index.ts, 0, 8))
|
||||
|
||||
let obj: Buzz;
|
||||
>obj : Symbol(obj, Decl(index.ts, 3, 3))
|
||||
>Buzz : Symbol(Buzz, Decl(index.ts, 0, 17))
|
||||
|
||||
export {bar};
|
||||
>bar : Symbol(bar, Decl(index.ts, 4, 8))
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/compiler/utils.ts ===
|
||||
|
||||
export function foo() { }
|
||||
>foo : () => void
|
||||
|
||||
export function bar() { }
|
||||
>bar : () => void
|
||||
|
||||
export interface Buzz { }
|
||||
>Buzz : Buzz
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import {foo, bar, Buzz} from "utils";
|
||||
>foo : () => void
|
||||
>bar : () => void
|
||||
>Buzz : any
|
||||
|
||||
foo();
|
||||
>foo() : void
|
||||
>foo : () => void
|
||||
|
||||
let obj: Buzz;
|
||||
>obj : Buzz
|
||||
>Buzz : Buzz
|
||||
|
||||
export {bar};
|
||||
>bar : () => void
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//// [tests/cases/conformance/decorators/decoratorMetadata.ts] ////
|
||||
|
||||
//// [service.ts]
|
||||
export default class Service {
|
||||
}
|
||||
//// [component.ts]
|
||||
import Service from "./service";
|
||||
|
||||
declare var decorator: any;
|
||||
|
||||
@decorator
|
||||
class MyComponent {
|
||||
constructor(public Service: Service) {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.js]
|
||||
var Service = (function () {
|
||||
function Service() {
|
||||
}
|
||||
return Service;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = Service;
|
||||
//// [component.js]
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var service_1 = require("./service");
|
||||
var MyComponent = (function () {
|
||||
function MyComponent(Service) {
|
||||
this.Service = Service;
|
||||
}
|
||||
MyComponent = __decorate([
|
||||
decorator,
|
||||
__metadata('design:paramtypes', [service_1.default])
|
||||
], MyComponent);
|
||||
return MyComponent;
|
||||
})();
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/decorators/service.ts ===
|
||||
export default class Service {
|
||||
>Service : Symbol(Service, Decl(service.ts, 0, 0))
|
||||
}
|
||||
=== tests/cases/conformance/decorators/component.ts ===
|
||||
import Service from "./service";
|
||||
>Service : Symbol(Service, Decl(component.ts, 0, 6))
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : Symbol(decorator, Decl(component.ts, 2, 11))
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(component.ts, 2, 11))
|
||||
|
||||
class MyComponent {
|
||||
>MyComponent : Symbol(MyComponent, Decl(component.ts, 2, 27))
|
||||
|
||||
constructor(public Service: Service) {
|
||||
>Service : Symbol(Service, Decl(component.ts, 6, 16))
|
||||
>Service : Symbol(Service, Decl(component.ts, 0, 6))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/decorators/service.ts ===
|
||||
export default class Service {
|
||||
>Service : Service
|
||||
}
|
||||
=== tests/cases/conformance/decorators/component.ts ===
|
||||
import Service from "./service";
|
||||
>Service : typeof Service
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : any
|
||||
|
||||
@decorator
|
||||
>decorator : any
|
||||
|
||||
class MyComponent {
|
||||
>MyComponent : MyComponent
|
||||
|
||||
constructor(public Service: Service) {
|
||||
>Service : Service
|
||||
>Service : Service
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//// [decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts]
|
||||
|
||||
declare var decorator: any;
|
||||
|
||||
class MyClass {
|
||||
constructor(test: string, test2: number) {
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
doSomething() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [decoratorMetadataForMethodWithNoReturnTypeAnnotation01.js]
|
||||
var MyClass = (function () {
|
||||
function MyClass(test, test2) {
|
||||
}
|
||||
MyClass.prototype.doSomething = function () {
|
||||
};
|
||||
Object.defineProperty(MyClass.prototype, "doSomething",
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', void 0)
|
||||
], MyClass.prototype, "doSomething", Object.getOwnPropertyDescriptor(MyClass.prototype, "doSomething")));
|
||||
return MyClass;
|
||||
})();
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts ===
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 11))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 27))
|
||||
|
||||
constructor(test: string, test2: number) {
|
||||
>test : Symbol(test, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 4, 16))
|
||||
>test2 : Symbol(test2, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 4, 29))
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 1, 11))
|
||||
|
||||
doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts, 6, 5))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/decoratorMetadataForMethodWithNoReturnTypeAnnotation01.ts ===
|
||||
|
||||
declare var decorator: any;
|
||||
>decorator : any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
constructor(test: string, test2: number) {
|
||||
>test : string
|
||||
>test2 : number
|
||||
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : any
|
||||
|
||||
doSomething() {
|
||||
>doSomething : () => void
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//// [decoratorMetadataWithConstructorType.ts]
|
||||
|
||||
declare var console: {
|
||||
log(msg: string): void;
|
||||
};
|
||||
|
||||
class A {
|
||||
constructor() { console.log('new A'); }
|
||||
}
|
||||
|
||||
function decorator(target: Object, propertyKey: string) {
|
||||
}
|
||||
|
||||
export class B {
|
||||
@decorator
|
||||
x: A = new A();
|
||||
}
|
||||
|
||||
|
||||
//// [decoratorMetadataWithConstructorType.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
console.log('new A');
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
function decorator(target, propertyKey) {
|
||||
}
|
||||
var B = (function () {
|
||||
function B() {
|
||||
this.x = new A();
|
||||
}
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', A)
|
||||
], B.prototype, "x");
|
||||
return B;
|
||||
})();
|
||||
exports.B = B;
|
||||
@@ -0,0 +1,39 @@
|
||||
=== tests/cases/compiler/decoratorMetadataWithConstructorType.ts ===
|
||||
|
||||
declare var console: {
|
||||
>console : Symbol(console, Decl(decoratorMetadataWithConstructorType.ts, 1, 11))
|
||||
|
||||
log(msg: string): void;
|
||||
>log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
>msg : Symbol(msg, Decl(decoratorMetadataWithConstructorType.ts, 2, 8))
|
||||
|
||||
};
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
|
||||
constructor() { console.log('new A'); }
|
||||
>console.log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
>console : Symbol(console, Decl(decoratorMetadataWithConstructorType.ts, 1, 11))
|
||||
>log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
}
|
||||
|
||||
function decorator(target: Object, propertyKey: string) {
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataWithConstructorType.ts, 7, 1))
|
||||
>target : Symbol(target, Decl(decoratorMetadataWithConstructorType.ts, 9, 19))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
||||
>propertyKey : Symbol(propertyKey, Decl(decoratorMetadataWithConstructorType.ts, 9, 34))
|
||||
}
|
||||
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(decoratorMetadataWithConstructorType.ts, 10, 1))
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataWithConstructorType.ts, 7, 1))
|
||||
|
||||
x: A = new A();
|
||||
>x : Symbol(x, Decl(decoratorMetadataWithConstructorType.ts, 12, 16))
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user