diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e88da2c261ce3..ee4c1f5b31867 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19952,7 +19952,7 @@ namespace ts { } } - return produceDiagnostics || !args ? resolveErrorCall(node) : getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); + return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); function chooseOverload(candidates: Signature[], relation: Map, signatureHelpTrailingComma = false) { candidateForArgumentError = undefined; diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.types b/tests/baselines/reference/argumentExpressionContextualTyping.types index 46ef3a3857027..a67b0b5e609f4 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.types +++ b/tests/baselines/reference/argumentExpressionContextualTyping.types @@ -122,7 +122,7 @@ baz(array); // Error baz(["string", 1, true, ...array]); // Error >baz(["string", 1, true, ...array]) : void >baz : (x: [string, number, boolean]) => void ->["string", 1, true, ...array] : (string | number | boolean)[] +>["string", 1, true, ...array] : [string, number, true, ...(string | number | boolean)[]] >"string" : "string" >1 : 1 >true : true diff --git a/tests/baselines/reference/arrayAssignmentTest3.types b/tests/baselines/reference/arrayAssignmentTest3.types index ec1b5de51b27d..df87d9d7fc481 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.types +++ b/tests/baselines/reference/arrayAssignmentTest3.types @@ -17,8 +17,8 @@ class a { var xx = new a(null, 7, new B()); ->xx : any ->new a(null, 7, new B()) : any +>xx : a +>new a(null, 7, new B()) : a >a : typeof a >null : null >7 : 7 diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index 67358a1033834..634ce2b66a647 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -1,15 +1,13 @@ tests/cases/compiler/baseCheck.ts(9,18): error TS2552: Cannot find name 'loc'. Did you mean 'ELoc'? tests/cases/compiler/baseCheck.ts(17,53): error TS2554: Expected 2 arguments, but got 1. -tests/cases/compiler/baseCheck.ts(17,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(18,62): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/compiler/baseCheck.ts(19,68): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(22,9): error TS2304: Cannot find name 'x'. tests/cases/compiler/baseCheck.ts(23,7): error TS2304: Cannot find name 'x'. tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. -==== tests/cases/compiler/baseCheck.ts (9 errors) ==== +==== tests/cases/compiler/baseCheck.ts (7 errors) ==== class C { constructor(x: number, y: number) { } } class ELoc extends C { constructor(x: number) { @@ -33,16 +31,12 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. ~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. !!! related TS6210 tests/cases/compiler/baseCheck.ts:1:34: An argument for 'y' was not provided. - ~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. class E extends C { constructor(public z: number) { super(0, this.z) } } ~~~~ !!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. - ~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. function f() { if (x<10) { diff --git a/tests/baselines/reference/bigintWithLib.types b/tests/baselines/reference/bigintWithLib.types index a1d79119cf6e5..6715dc70c3b2b 100644 --- a/tests/baselines/reference/bigintWithLib.types +++ b/tests/baselines/reference/bigintWithLib.types @@ -94,9 +94,9 @@ bigIntArray = new BigInt64Array([1n, 2n, 3n]); >3n : 3n bigIntArray = new BigInt64Array([1, 2, 3]); // should error ->bigIntArray = new BigInt64Array([1, 2, 3]) : any +>bigIntArray = new BigInt64Array([1, 2, 3]) : BigInt64Array >bigIntArray : BigInt64Array ->new BigInt64Array([1, 2, 3]) : any +>new BigInt64Array([1, 2, 3]) : BigInt64Array >BigInt64Array : BigInt64ArrayConstructor >[1, 2, 3] : number[] >1 : 1 @@ -174,9 +174,9 @@ bigUintArray = new BigUint64Array([1n, 2n, 3n]); >3n : 3n bigUintArray = new BigUint64Array([1, 2, 3]); // should error ->bigUintArray = new BigUint64Array([1, 2, 3]) : any +>bigUintArray = new BigUint64Array([1, 2, 3]) : BigUint64Array >bigUintArray : BigUint64Array ->new BigUint64Array([1, 2, 3]) : any +>new BigUint64Array([1, 2, 3]) : BigUint64Array >BigUint64Array : BigUint64ArrayConstructor >[1, 2, 3] : number[] >1 : 1 diff --git a/tests/baselines/reference/bigintWithoutLib.types b/tests/baselines/reference/bigintWithoutLib.types index 6881b53b7da12..24470aa45db6e 100644 --- a/tests/baselines/reference/bigintWithoutLib.types +++ b/tests/baselines/reference/bigintWithoutLib.types @@ -56,7 +56,7 @@ let stringVal: string = bigintVal.toString(); // should not error - bigintVal in >toString : () => string stringVal = bigintVal.toString(2); // should error - bigintVal inferred as {} ->stringVal = bigintVal.toString(2) : any +>stringVal = bigintVal.toString(2) : string >stringVal : string >bigintVal.toString(2) : string >bigintVal.toString : () => string diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.types b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.types index ca53002f949f7..28a718cb328be 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.types +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5.types @@ -16,7 +16,7 @@ function foo(a: number) { >foo : { (): void; (): void; } foo(10); // not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 } @@ -29,12 +29,12 @@ function foo(a: number) { >foo : { (): void; (): void; } foo(10); // not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 } foo(10); // not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types index 982ace6809c46..967ec902a16e4 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types @@ -16,7 +16,7 @@ function foo(a: number) { >foo : { (): void; (): void; } foo(10); // not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 } @@ -29,12 +29,12 @@ function foo(a: number) { >foo : { (): void; (): void; } foo(10);// not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 } foo(10); // not ok ->foo(10) : any +>foo(10) : void >foo : { (): void; (): void; } >10 : 10 diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types index 992b8f30ba356..9997d6865698d 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types @@ -9,15 +9,15 @@ function f(x: T, y: U): T { return null; } >null : null var r1 = f(1, ''); ->r1 : any ->f(1, '') : any +>r1 : number +>f(1, '') : number >f : (x: T, y: U) => T >1 : 1 >'' : "" var r1b = f(1, ''); ->r1b : any ->f(1, '') : any +>r1b : number +>f(1, '') : number >f : (x: T, y: U) => T >1 : 1 >'' : "" @@ -30,15 +30,15 @@ var f2 = (x: T, y: U): T => { return null; } >null : null var r2 = f2(1, ''); ->r2 : any ->f2(1, '') : any +>r2 : number +>f2(1, '') : number >f2 : (x: T, y: U) => T >1 : 1 >'' : "" var r2b = f2(1, ''); ->r2b : any ->f2(1, '') : any +>r2b : number +>f2(1, '') : number >f2 : (x: T, y: U) => T >1 : 1 >'' : "" @@ -49,15 +49,15 @@ var f3: { (x: T, y: U): T; } >y : U var r3 = f3(1, ''); ->r3 : any ->f3(1, '') : any +>r3 : number +>f3(1, '') : number >f3 : (x: T, y: U) => T >1 : 1 >'' : "" var r3b = f3(1, ''); ->r3b : any ->f3(1, '') : any +>r3b : number +>f3(1, '') : number >f3 : (x: T, y: U) => T >1 : 1 >'' : "" @@ -75,8 +75,8 @@ class C { } } var r4 = (new C()).f(1, ''); ->r4 : any ->(new C()).f(1, '') : any +>r4 : number +>(new C()).f(1, '') : number >(new C()).f : (x: T, y: U) => T >(new C()) : C >new C() : C @@ -86,8 +86,8 @@ var r4 = (new C()).f(1, ''); >'' : "" var r4b = (new C()).f(1, ''); ->r4b : any ->(new C()).f(1, '') : any +>r4b : number +>(new C()).f(1, '') : number >(new C()).f : (x: T, y: U) => T >(new C()) : C >new C() : C @@ -106,8 +106,8 @@ var i: I; >i : I var r5 = i.f(1, ''); ->r5 : any ->i.f(1, '') : any +>r5 : number +>i.f(1, '') : number >i.f : (x: T, y: U) => T >i : I >f : (x: T, y: U) => T @@ -115,8 +115,8 @@ var r5 = i.f(1, ''); >'' : "" var r5b = i.f(1, ''); ->r5b : any ->i.f(1, '') : any +>r5b : number +>i.f(1, '') : number >i.f : (x: T, y: U) => T >i : I >f : (x: T, y: U) => T diff --git a/tests/baselines/reference/callOnInstance.errors.txt b/tests/baselines/reference/callOnInstance.errors.txt index 6ecd659fbbadd..5a6bb31ca286b 100644 --- a/tests/baselines/reference/callOnInstance.errors.txt +++ b/tests/baselines/reference/callOnInstance.errors.txt @@ -1,10 +1,11 @@ tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier 'D'. tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'. +tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/callOnInstance.ts(7,19): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures. -==== tests/cases/compiler/callOnInstance.ts (4 errors) ==== +==== tests/cases/compiler/callOnInstance.ts (5 errors) ==== declare function D(): string; // error ~ !!! error TS2300: Duplicate identifier 'D'. @@ -17,6 +18,8 @@ tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an exp var s2: string = (new D(1))(); ~~~~~~~~ +!!! error TS2350: Only a void function can be called with the 'new' keyword. + ~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. declare class C { constructor(value: number); } diff --git a/tests/baselines/reference/callOverloads1.errors.txt b/tests/baselines/reference/callOverloads1.errors.txt index 0f75abfe0a4d7..ea29698159dd5 100644 --- a/tests/baselines/reference/callOverloads1.errors.txt +++ b/tests/baselines/reference/callOverloads1.errors.txt @@ -1,10 +1,11 @@ tests/cases/compiler/callOverloads1.ts(1,7): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/callOverloads1.ts(9,10): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/callOverloads1.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads1.ts(13,10): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/callOverloads1.ts(13,10): error TS2554: Expected 0 arguments, but got 1. -==== tests/cases/compiler/callOverloads1.ts (4 errors) ==== +==== tests/cases/compiler/callOverloads1.ts (5 errors) ==== class Foo { // error ~~~ !!! error TS2300: Duplicate identifier 'Foo'. @@ -25,6 +26,8 @@ tests/cases/compiler/callOverloads1.ts(13,10): error TS2554: Expected 0 argument var f1 = new Foo("hey"); ~~~~~~~~~~~~~~ +!!! error TS2350: Only a void function can be called with the 'new' keyword. + ~~~~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. diff --git a/tests/baselines/reference/callOverloads2.errors.txt b/tests/baselines/reference/callOverloads2.errors.txt index ab809ae137dc4..34927375877d8 100644 --- a/tests/baselines/reference/callOverloads2.errors.txt +++ b/tests/baselines/reference/callOverloads2.errors.txt @@ -4,10 +4,11 @@ tests/cases/compiler/callOverloads2.ts(11,10): error TS2389: Function implementa tests/cases/compiler/callOverloads2.ts(11,10): error TS2393: Duplicate function implementation. tests/cases/compiler/callOverloads2.ts(12,10): error TS2393: Duplicate function implementation. tests/cases/compiler/callOverloads2.ts(14,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/compiler/callOverloads2.ts(18,10): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/callOverloads2.ts(18,10): error TS2554: Expected 0 arguments, but got 1. -==== tests/cases/compiler/callOverloads2.ts (7 errors) ==== +==== tests/cases/compiler/callOverloads2.ts (8 errors) ==== class Foo { // error ~~~ !!! error TS2300: Duplicate identifier 'Foo'. @@ -39,6 +40,8 @@ tests/cases/compiler/callOverloads2.ts(18,10): error TS2554: Expected 0 argument var f1 = new Foo("hey"); ~~~~~~~~~~~~~~ +!!! error TS2350: Only a void function can be called with the 'new' keyword. + ~~~~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types index da2b23747a5ae..f0d875055337c 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types @@ -19,7 +19,7 @@ function foo() { >"expects boolean instead of string" : "expects boolean instead of string" test(true); // should error - string expected ->test(true) : any +>test(true) : void >test : I1 >true : true } diff --git a/tests/baselines/reference/callWithMissingVoid.types b/tests/baselines/reference/callWithMissingVoid.types index 4fbcbbf5d1b8f..6f9638daae567 100644 --- a/tests/baselines/reference/callWithMissingVoid.types +++ b/tests/baselines/reference/callWithMissingVoid.types @@ -99,7 +99,7 @@ new MyPromise(resolve => resolve()); // no error new MyPromise(resolve => resolve()); // error, `any` arguments cannot be omitted >new MyPromise(resolve => resolve()) : MyPromise >MyPromise : typeof MyPromise ->resolve => resolve() : (resolve: (value: any) => void) => any +>resolve => resolve() : (resolve: (value: any) => void) => void >resolve : (value: any) => void >resolve() : void >resolve : (value: any) => void @@ -107,7 +107,7 @@ new MyPromise(resolve => resolve()); // error, `any` arguments cannot be om new MyPromise(resolve => resolve()); // error, `unknown` arguments cannot be omitted >new MyPromise(resolve => resolve()) : MyPromise >MyPromise : typeof MyPromise ->resolve => resolve() : (resolve: (value: unknown) => void) => any +>resolve => resolve() : (resolve: (value: unknown) => void) => void >resolve : (value: unknown) => void >resolve() : void >resolve : (value: unknown) => void @@ -115,7 +115,7 @@ new MyPromise(resolve => resolve()); // error, `unknown` arguments cann new MyPromise(resolve => resolve()); // error, `never` arguments cannot be omitted >new MyPromise(resolve => resolve()) : MyPromise >MyPromise : typeof MyPromise ->resolve => resolve() : (resolve: (value: never) => void) => any +>resolve => resolve() : (resolve: (value: never) => void) => void >resolve : (value: never) => void >resolve() : void >resolve : (value: never) => void @@ -234,7 +234,7 @@ declare function call( >args : TS call((x: number, y: number) => x + y) // error ->call((x: number, y: number) => x + y) : any +>call((x: number, y: number) => x + y) : void >call : (handler: (...args: TS) => unknown, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types index 29d4ea5ec4b22..557c48e49e30b 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types @@ -3,7 +3,7 @@ function f() { } >f : () => void f(); ->f() : any +>f() : void >f : () => void f(); @@ -11,6 +11,6 @@ f(); >f : () => void f(); ->f() : any +>f() : void >f : () => void diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt index 2e39f19d86ad3..777130d8893b6 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,64): error TS2741: Property 'z' is missing in type 'B' but required in type 'C'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,81): error TS2739: Type 'A' is missing the following properties from type 'C': z, y -==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== +==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (2 errors) ==== class Chain { constructor(public value: T) { } then(cb: (x: T) => S): Chain { @@ -24,4 +25,7 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete ~~~~~ !!! error TS2741: Property 'z' is missing in type 'B' but required in type 'C'. !!! related TS2728 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts:15:5: 'z' is declared here. +!!! related TS6502 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts:3:27: The expected type comes from the return type of this signature. + ~~~~~ +!!! error TS2739: Type 'A' is missing the following properties from type 'C': z, y !!! related TS6502 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts:3:27: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.symbols b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.symbols index c4a3f7b5f4d77..164005d035c32 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.symbols +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.symbols @@ -46,6 +46,7 @@ class C extends B { // Ok to go down the chain, but error to try to climb back up (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); +>(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) >(new Chain(new A)).then(a => new B).then(b => new C).then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) >(new Chain(new A)).then(a => new B).then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) >(new Chain(new A)).then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) @@ -60,6 +61,7 @@ class C extends B { >then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) >c : Symbol(c, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 18, 58)) >B : Symbol(B, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 9, 1)) +>then : Symbol(Chain.then, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 1, 36)) >b : Symbol(b, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 18, 75)) >A : Symbol(A, Decl(chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts, 5, 1)) diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types index 3716b9b56f1d5..d6712329fc42f 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types @@ -38,9 +38,9 @@ class C extends B { // Ok to go down the chain, but error to try to climb back up (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); ->(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A) : any ->(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then : any ->(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B) : any +>(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A) : Chain +>(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then : (cb: (x: C) => S) => Chain +>(new Chain(new A)).then(a => new B).then(b => new C).then(c => new B) : Chain >(new Chain(new A)).then(a => new B).then(b => new C).then : (cb: (x: C) => S) => Chain >(new Chain(new A)).then(a => new B).then(b => new C) : Chain >(new Chain(new A)).then(a => new B).then : (cb: (x: B) => S) => Chain @@ -66,9 +66,9 @@ class C extends B { >c : C >new B : B >B : typeof B ->then : any ->b => new A : (b: any) => A ->b : any +>then : (cb: (x: C) => S) => Chain +>b => new A : (b: C) => A +>b : C >new A : A >A : typeof A diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types index 59627a5f620df..91b0d4fcb37cd 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types @@ -18,7 +18,7 @@ class Chain { // Ok to go down the chain, but error to climb up the chain (new Chain(t)).then(tt => s).then(ss => t); ->(new Chain(t)).then(tt => s).then(ss => t) : any +>(new Chain(t)).then(tt => s).then(ss => t) : Chain >(new Chain(t)).then(tt => s).then : (cb: (x: S) => S) => Chain >(new Chain(t)).then(tt => s) : Chain >(new Chain(t)).then : (cb: (x: T) => S) => Chain @@ -37,7 +37,7 @@ class Chain { // But error to try to climb up the chain (new Chain(s)).then(ss => t); ->(new Chain(s)).then(ss => t) : any +>(new Chain(s)).then(ss => t) : Chain >(new Chain(s)).then : (cb: (x: S) => S) => Chain >(new Chain(s)) : Chain >new Chain(s) : Chain diff --git a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.errors.txt b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.errors.txt index 3d1051fdfd441..a94d8f7a3ba36 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.errors.txt @@ -4,10 +4,11 @@ tests/cases/conformance/jsdoc/0.js(11,20): error TS2322: Type '"lol"' is not ass tests/cases/conformance/jsdoc/0.js(13,15): error TS2322: Type '"0"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/0.js(15,3): error TS2322: Type 'undefined' is not assignable to type 'string'. tests/cases/conformance/jsdoc/0.js(19,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/0.js(22,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/jsdoc/0.js(22,22): error TS2345: Argument of type '"0"' is not assignable to parameter of type 'number'. -==== tests/cases/conformance/jsdoc/0.js (7 errors) ==== +==== tests/cases/conformance/jsdoc/0.js (8 errors) ==== // @ts-check var lol; const obj = { @@ -42,5 +43,7 @@ tests/cases/conformance/jsdoc/0.js(22,22): error TS2345: Argument of type '"0"' /** @type {string} */ var s1 = obj.method2("0"); + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. ~~~ !!! error TS2345: Argument of type '"0"' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.types b/tests/baselines/reference/classWithBaseClassButNoConstructor.types index 416e195f5b2a8..fe974a56bbdd5 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.types +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.types @@ -19,8 +19,8 @@ var r = C; >C : typeof C var c = new C(); // error ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C var c2 = new C(1); // ok @@ -49,8 +49,8 @@ var r2 = D; >D : typeof D var d = new D(); // error ->d : any ->new D() : any +>d : D<{}, {}> +>new D() : D<{}, {}> >D : typeof D var d2 = new D(1); // ok @@ -73,8 +73,8 @@ var r3 = D2; >D2 : typeof D2 var d3 = new D(); // error ->d3 : any ->new D() : any +>d3 : D<{}, {}> +>new D() : D<{}, {}> >D : typeof D var d4 = new D(1); // ok @@ -96,8 +96,8 @@ var r4 = D3; >D3 : typeof D3 var d5 = new D(); // error ->d5 : any ->new D() : any +>d5 : D<{}, {}> +>new D() : D<{}, {}> >D : typeof D var d6 = new D(1); // ok diff --git a/tests/baselines/reference/classWithConstructors.types b/tests/baselines/reference/classWithConstructors.types index db2d88969bf33..271c82d8e704c 100644 --- a/tests/baselines/reference/classWithConstructors.types +++ b/tests/baselines/reference/classWithConstructors.types @@ -10,8 +10,8 @@ module NonGeneric { } var c = new C(); // error ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C var c2 = new C(''); // ok @@ -34,8 +34,8 @@ module NonGeneric { } var c3 = new C2(); // error ->c3 : any ->new C2() : any +>c3 : C2 +>new C2() : C2 >C2 : typeof C2 var c4 = new C2(''); // ok @@ -55,8 +55,8 @@ module NonGeneric { >C2 : C2 var d = new D(); // error ->d : any ->new D() : any +>d : D +>new D() : D >D : typeof D var d2 = new D(1); // ok @@ -83,8 +83,8 @@ module Generics { } var c = new C(); // error ->c : any ->new C() : any +>c : C<{}> +>new C() : C<{}> >C : typeof C var c2 = new C(''); // ok @@ -108,8 +108,8 @@ module Generics { } var c3 = new C2(); // error ->c3 : any ->new C2() : any +>c3 : C2<{}, {}> +>new C2() : C2<{}, {}> >C2 : typeof C2 var c4 = new C2(''); // ok @@ -130,8 +130,8 @@ module Generics { >C2 : C2 var d = new D(); // error ->d : any ->new D() : any +>d : D<{}, {}> +>new D() : D<{}, {}> >D : typeof D var d2 = new D(1); // ok diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.types b/tests/baselines/reference/classWithoutExplicitConstructor.types index 4fdf46227bf50..682baa38e6e06 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.types +++ b/tests/baselines/reference/classWithoutExplicitConstructor.types @@ -17,8 +17,8 @@ var c = new C(); >C : typeof C var c2 = new C(null); // error ->c2 : any ->new C(null) : any +>c2 : C +>new C(null) : C >C : typeof C >null : null @@ -40,8 +40,8 @@ var d = new D(); >D : typeof D var d2 = new D(null); // error ->d2 : any ->new D(null) : any +>d2 : D +>new D(null) : D >D : typeof D >null : null diff --git a/tests/baselines/reference/cloduleTest2.types b/tests/baselines/reference/cloduleTest2.types index 2dbd5f13e953a..74204130c261c 100644 --- a/tests/baselines/reference/cloduleTest2.types +++ b/tests/baselines/reference/cloduleTest2.types @@ -14,8 +14,8 @@ module T1 { >bar : () => any var r = new m3d(); // error ->r : any ->new m3d() : any +>r : m3d +>new m3d() : m3d >m3d : typeof m3d } @@ -34,8 +34,8 @@ module T2 { >2 : 2 var r = new m3d(); // error ->r : any ->new m3d() : any +>r : m3d +>new m3d() : m3d >m3d : typeof m3d } @@ -123,8 +123,8 @@ declare class m3d { constructor(foo); foo(): void; static bar(); } >bar : () => any var r = new m3d(); // error ->r : any ->new m3d() : any +>r : m3d +>new m3d() : m3d >m3d : typeof m3d declare class m4d extends m3d { } @@ -132,7 +132,7 @@ declare class m4d extends m3d { } >m3d : m3d var r2 = new m4d(); // error ->r2 : any ->new m4d() : any +>r2 : m4d +>new m4d() : m4d >m4d : typeof m4d diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt index f149bce5080fd..5eb2ffdfd6a04 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.errors.txt @@ -1,8 +1,9 @@ tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(1,7): error TS2506: 'S18' is referenced directly or indirectly in its own base expression. tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): error TS2554: Expected 0 arguments, but got 1. +tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,16): error TS2339: Property 'S18' does not exist on type 'S18<{}, {}, {}>'. -==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (2 errors) ==== +==== tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts (3 errors) ==== class S18 extends S18 ~~~ !!! error TS2506: 'S18' is referenced directly or indirectly in its own base expression. @@ -11,4 +12,6 @@ tests/cases/compiler/complicatedGenericRecursiveBaseClassReference.ts(4,2): erro (new S18(123)).S18 = 0; ~~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. + ~~~ +!!! error TS2339: Property 'S18' does not exist on type 'S18<{}, {}, {}>'. \ No newline at end of file diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.types b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.types index 0e03c6df8aa0d..e66d1e17285b3 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.types +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.types @@ -8,8 +8,8 @@ class S18 extends S18 (new S18(123)).S18 = 0; >(new S18(123)).S18 = 0 : 0 >(new S18(123)).S18 : any ->(new S18(123)) : any ->new S18(123) : any +>(new S18(123)) : S18<{}, {}, {}> +>new S18(123) : S18<{}, {}, {}> >S18 : typeof S18 >123 : 123 >S18 : any diff --git a/tests/baselines/reference/constructorFunctions.types b/tests/baselines/reference/constructorFunctions.types index d5bd442543518..7c2ae4aa85a17 100644 --- a/tests/baselines/reference/constructorFunctions.types +++ b/tests/baselines/reference/constructorFunctions.types @@ -178,7 +178,7 @@ function C7(num) {} >num : number var c7_v1 = new C7(); ->c7_v1 : any ->new C7() : any +>c7_v1 : C7 +>new C7() : C7 >C7 : typeof C7 diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.types b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.types index bd93ce518e9b3..c23b8361fbde4 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.types +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.types @@ -11,7 +11,7 @@ class D { } var d = new D(); ->d : any ->new D() : any +>d : D +>new D() : D >D : typeof D diff --git a/tests/baselines/reference/constructorOverloads1.errors.txt b/tests/baselines/reference/constructorOverloads1.errors.txt index 2e8c79d159ab7..f5b38690fb48c 100644 --- a/tests/baselines/reference/constructorOverloads1.errors.txt +++ b/tests/baselines/reference/constructorOverloads1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple const tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. -tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. +tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'Foo[]' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ==== @@ -39,7 +39,7 @@ tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of !!! error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~ -!!! error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'Foo[]' is not assignable to parameter of type 'number'. f1.bar1(); f1.bar2(); diff --git a/tests/baselines/reference/constructorOverloads1.types b/tests/baselines/reference/constructorOverloads1.types index 40a806b9e71c6..312f52fc9b64b 100644 --- a/tests/baselines/reference/constructorOverloads1.types +++ b/tests/baselines/reference/constructorOverloads1.types @@ -36,19 +36,19 @@ var f2 = new Foo(0); >0 : 0 var f3 = new Foo(f1); ->f3 : any ->new Foo(f1) : any +>f3 : Foo +>new Foo(f1) : Foo >Foo : typeof Foo >f1 : Foo var f4 = new Foo([f1,f2,f3]); ->f4 : any ->new Foo([f1,f2,f3]) : any +>f4 : Foo +>new Foo([f1,f2,f3]) : Foo >Foo : typeof Foo ->[f1,f2,f3] : any[] +>[f1,f2,f3] : Foo[] >f1 : Foo >f2 : Foo ->f3 : any +>f3 : Foo f1.bar1(); >f1.bar1() : void diff --git a/tests/baselines/reference/contextualSignatureInstantiation.errors.txt b/tests/baselines/reference/contextualSignatureInstantiation.errors.txt index 6c14ad3c1503a..6d4583f5c02ac 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.errors.txt +++ b/tests/baselines/reference/contextualSignatureInstantiation.errors.txt @@ -1,15 +1,19 @@ +tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(19,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(19,13): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(20,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(20,23): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(21,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(21,23): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: string, y: number) => string'. Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. -==== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts (3 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts (7 errors) ==== // TypeScript Spec, section 4.12.2: // If e is an expression of a function type that contains exactly one generic call signature and no other members, // and T is a function type with exactly one non - generic call signature and no other members, then any inferences @@ -29,21 +33,29 @@ tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatur var b: number | string; var b = foo(g); // Error, number and string are disjoint types + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. !!! error TS2345: Types of parameters 'y' and 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var b = bar(1, "one", g); // Error, number and string are disjoint types + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. !!! error TS2345: Types of parameters 'y' and 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var b = bar("one", 1, g); // Error, number and string are disjoint types + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: string, y: number) => string'. !!! error TS2345: Types of parameters 'y' and 'y' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var b = baz(b, b, g); // Should be number | string + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. var d: number[] | string[]; var d = foo(h); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index ae5a40005377e..b9aff405069d5 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -61,13 +61,13 @@ var b: number | string; var b = foo(g); // Error, number and string are disjoint types >b : string | number ->foo(g) : any +>foo(g) : number >foo : (cb: (x: number, y: string) => T) => T >g : (x: T, y: T) => T var b = bar(1, "one", g); // Error, number and string are disjoint types >b : string | number ->bar(1, "one", g) : any +>bar(1, "one", g) : number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V >1 : 1 >"one" : "one" @@ -75,7 +75,7 @@ var b = bar(1, "one", g); // Error, number and string are disjoint types var b = bar("one", 1, g); // Error, number and string are disjoint types >b : string | number ->bar("one", 1, g) : any +>bar("one", 1, g) : string >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V >"one" : "one" >1 : 1 @@ -83,10 +83,10 @@ var b = bar("one", 1, g); // Error, number and string are disjoint types var b = baz(b, b, g); // Should be number | string >b : string | number ->baz(b, b, g) : string | number +>baz(b, b, g) : string >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->b : string | number ->b : string | number +>b : string +>b : string >g : (x: T, y: T) => T var d: number[] | string[]; diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.types b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.types index c7466ec2ebb87..dc3e1e40599cc 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.types +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.types @@ -37,8 +37,8 @@ var f = (x: number) => { return x.toFixed() }; >toFixed : (fractionDigits?: number) => string var r5 = _.forEach(c2, f); ->r5 : any ->_.forEach(c2, f) : any +>r5 : void +>_.forEach(c2, f) : void >_.forEach : (c: Collection, f: (x: T) => Date) => void >_ : Combinators >forEach : (c: Collection, f: (x: T) => Date) => void @@ -46,8 +46,8 @@ var r5 = _.forEach(c2, f); >f : (x: number) => string var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ->r6 : any ->_.forEach(c2, (x) => { return x.toFixed() }) : any +>r6 : void +>_.forEach(c2, (x) => { return x.toFixed() }) : void >_.forEach : (c: Collection, f: (x: T) => Date) => void >_ : Combinators >forEach : (c: Collection, f: (x: T) => Date) => void diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.types b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.types index cd2e946ed7263..35784d79f3cc0 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.types +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.types @@ -19,8 +19,8 @@ f10('', () => a => a.foo, ''); // a is "" >'' : "" var r9 = f10('', () => (a => a.foo), 1); // error ->r9 : any ->f10('', () => (a => a.foo), 1) : any +>r9 : string +>f10('', () => (a => a.foo), 1) : "" >f10 : (x: T, b: () => (a: T) => void, y: T) => T >'' : "" >() => (a => a.foo) : () => (a: "") => any diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.types b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.types index 01b5e85100786..3ce1ee12915b8 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.types +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.types @@ -36,11 +36,11 @@ const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo}; > : JSX.Element >FooComponent : (props: { foo: "A" | "B" | "C"; }) => JSX.Element ->foo : string +>foo : "f" >"f" : "f" ; > : JSX.Element >FooComponent : (props: { foo: "A" | "B" | "C"; }) => JSX.Element ->foo : string +>foo : "f" diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types index 1d3508ff5c7d5..a0bd66ecf03b3 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types @@ -95,8 +95,8 @@ const b3 = ; // goTo has type"home" | "c >b3 : JSX.Element > : JSX.Element >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; } ->{goTo:"home"} : { goTo: string; } ->goTo : string +>{goTo:"home"} : { goTo: "home"; } +>goTo : "home" >"home" : "home" >extra : true @@ -104,7 +104,7 @@ const b4 = ; // goTo has type "home" | "contact >b4 : JSX.Element > : JSX.Element >MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; } ->goTo : string +>goTo : "home" >extra : true export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } @@ -138,8 +138,8 @@ const d1 = ; // goTo has type "home" | >d1 : JSX.Element > : JSX.Element >NoOverload1 : (linkProps: LinkProps) => JSX.Element ->{goTo:"home"} : { goTo: string; } ->goTo : string +>{goTo:"home"} : { goTo: "home"; } +>goTo : "home" >"home" : "home" >extra : true diff --git a/tests/baselines/reference/controlFlowIterationErrors.types b/tests/baselines/reference/controlFlowIterationErrors.types index 7312944e3bf37..d2e8d25a4755d 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.types +++ b/tests/baselines/reference/controlFlowIterationErrors.types @@ -27,7 +27,7 @@ function f1() { >cond : boolean x = len(x); ->x = len(x) : any +>x = len(x) : number >x : string | number | boolean >len(x) : number >len : (s: string) => number @@ -58,7 +58,7 @@ function f2() { >x : string | number x = len(x); ->x = len(x) : any +>x = len(x) : number >x : string | number | boolean >len(x) : number >len : (s: string) => number @@ -91,14 +91,14 @@ function g1() { >cond : boolean x = foo(x); ->x = foo(x) : any +>x = foo(x) : number & string >x : string | number | boolean ->foo(x) : any +>foo(x) : number & string >foo : { (x: string): number; (x: number): string; } >x : string | number x; ->x : string | number | boolean +>x : string | number } x; >x : string | number @@ -122,9 +122,9 @@ function g2() { >x : string | number x = foo(x); ->x = foo(x) : any +>x = foo(x) : number & string >x : string | number | boolean ->foo(x) : any +>foo(x) : number & string >foo : { (x: string): number; (x: number): string; } >x : string | number } diff --git a/tests/baselines/reference/controlFlowLoopAnalysis.types b/tests/baselines/reference/controlFlowLoopAnalysis.types index c38a0d735e7d7..f3aa3bd2bd0da 100644 --- a/tests/baselines/reference/controlFlowLoopAnalysis.types +++ b/tests/baselines/reference/controlFlowLoopAnalysis.types @@ -25,7 +25,7 @@ function test1() { >cond : true x = foo(x); ->x = foo(x) : any +>x = foo(x) : number >x : number | undefined >foo(x) : number >foo : (x: number) => number diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.types b/tests/baselines/reference/couldNotSelectGenericOverload.types index 3fbcd77647d51..96d12893ab519 100644 --- a/tests/baselines/reference/couldNotSelectGenericOverload.types +++ b/tests/baselines/reference/couldNotSelectGenericOverload.types @@ -11,8 +11,8 @@ var b = [1, ""]; >"" : "" var b1G = makeArray(1, ""); // any, no error ->b1G : any ->makeArray(1, "") : any +>b1G : {}[] +>makeArray(1, "") : {}[] >makeArray : (items: T[]) => T[] >1 : 1 >"" : "" diff --git a/tests/baselines/reference/declarationsAndAssignments.types b/tests/baselines/reference/declarationsAndAssignments.types index edb00c9879b0d..78b7da195708f 100644 --- a/tests/baselines/reference/declarationsAndAssignments.types +++ b/tests/baselines/reference/declarationsAndAssignments.types @@ -463,12 +463,12 @@ f14([2, ["abc", { x: 0 }]]); f14([2, ["abc", { y: false }]]); // Error, no x >f14([2, ["abc", { y: false }]]) : void >f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void ->[2, ["abc", { y: false }]] : (number | (string | { y: boolean; })[])[] +>[2, ["abc", { y: false }]] : [number, [string, { y: false; }]] >2 : 2 ->["abc", { y: false }] : (string | { y: boolean; })[] +>["abc", { y: false }] : [string, { y: false; }] >"abc" : "abc" ->{ y: false } : { y: boolean; } ->y : boolean +>{ y: false } : { y: false; } +>y : false >false : false module M { diff --git a/tests/baselines/reference/decoratorOnArrowFunction.types b/tests/baselines/reference/decoratorOnArrowFunction.types index 5edbff0e92113..1b44003e91dc6 100644 --- a/tests/baselines/reference/decoratorOnArrowFunction.types +++ b/tests/baselines/reference/decoratorOnArrowFunction.types @@ -6,6 +6,6 @@ declare function dec(target: T): T; var F = @dec () => { >F : any > : any ->dec () : any +>dec () : {} >dec : (target: T) => T } diff --git a/tests/baselines/reference/decoratorOnClassMethod8.errors.txt b/tests/baselines/reference/decoratorOnClassMethod8.errors.txt index 3ada30296b6b1..adfd69b9dff99 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod8.errors.txt @@ -1,11 +1,16 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts(4,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts(4,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. + Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. -==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts (1 errors) ==== +==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts (2 errors) ==== declare function dec(target: T): T; class C { @dec method() {} ~~~~ !!! error TS1241: Unable to resolve signature of method decorator when called as an expression. + ~~~~ +!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1241: Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } \ No newline at end of file diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index 805f25d8dbcd6..ef919a768ec6d 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,3 +1,4 @@ +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type '3' is not assignable to type 'string'. @@ -8,11 +9,13 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: C tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2708: Cannot use namespace 'T' as a value. -==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (8 errors) ==== +==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (9 errors) ==== var f = function (a = 3) { return a; }; // Type should be (a?: number) => number var n: number = f(4); n = f(); var s: string = f(''); + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. ~~ !!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. s = f(); diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index a59e8c59fdfcb..5b8772a881566 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,9 +1,11 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,24): error TS2345: Argument of type '""' is not assignable to parameter of type '1'. +tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(9,27): error TS2339: Property 'length' does not exist on type 'number'. +tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(13,28): error TS2339: Property 'length' does not exist on type 'number'. -==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== +==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (5 errors) ==== var obj1: {}; obj1.length; ~~~~~~ @@ -19,9 +21,13 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,24): error TS2345: Arg ~~ !!! error TS2345: Argument of type '""' is not assignable to parameter of type '1'. var elementCount = result.length; + ~~~~~~ +!!! error TS2339: Property 'length' does not exist on type 'number'. function concat2(x: T, y: U) { return null; } var result2 = concat2(1, ""); // result2 will be number|string var elementCount2 = result.length; + ~~~~~~ +!!! error TS2339: Property 'length' does not exist on type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.types b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.types index 7fb09643d899f..90e1c6df9a339 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.types +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.types @@ -22,8 +22,8 @@ function concat(x: T, y: T): T { return null; } >null : null var result = concat(1, ""); // error ->result : any ->concat(1, "") : any +>result : number +>concat(1, "") : 1 >concat : (x: T, y: T) => T >1 : 1 >"" : "" @@ -31,7 +31,7 @@ var result = concat(1, ""); // error var elementCount = result.length; >elementCount : any >result.length : any ->result : any +>result : number >length : any function concat2(x: T, y: U) { return null; } @@ -50,7 +50,7 @@ var result2 = concat2(1, ""); // result2 will be number|string var elementCount2 = result.length; >elementCount2 : any >result.length : any ->result : any +>result : number >length : any diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.types b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.types index 3a719ebd59790..04dd1ee3717e7 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.types +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.types @@ -29,8 +29,8 @@ class Derived extends Base { } var r = new Derived(); // error ->r : any ->new Derived() : any +>r : Derived +>new Derived() : Derived >Derived : typeof Derived var r2 = new Derived(1); @@ -68,8 +68,8 @@ class D extends Base2 { } var d = new D(); // error ->d : any ->new D() : any +>d : D +>new D() : D >D : typeof D var d2 = new D(new Date()); // ok diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.types b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.types index bfe6cf18613cd..a7561b044e460 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.types +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.types @@ -38,8 +38,8 @@ class Derived extends Base { } var r = new Derived(); // error ->r : any ->new Derived() : any +>r : Derived +>new Derived() : Derived >Derived : typeof Derived var r2 = new Derived(1); @@ -101,8 +101,8 @@ class D extends Base2 { } var d = new D(); // error ->d : any ->new D() : any +>d : D +>new D() : D >D : typeof D var d2 = new D(new Date()); // ok diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.types b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.types index bb63fe1ab615b..b674626ec0038 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.types +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.types @@ -57,13 +57,13 @@ class Derived2 extends Derived { } var r = new Derived(); // error ->r : any ->new Derived() : any +>r : Derived +>new Derived() : Derived >Derived : typeof Derived var r2 = new Derived2(1); // error ->r2 : any ->new Derived2(1) : any +>r2 : Derived2 +>new Derived2(1) : Derived2 >Derived2 : typeof Derived2 >1 : 1 @@ -130,13 +130,13 @@ class D2 extends D { } var d = new D2(); // error ->d : any ->new D2() : any +>d : D2 +>new D2() : D2 >D2 : typeof D2 var d2 = new D2(new Date()); // error ->d2 : any ->new D2(new Date()) : any +>d2 : D2 +>new D2(new Date()) : D2 >D2 : typeof D2 >new Date() : Date >Date : DateConstructor diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.types b/tests/baselines/reference/destructuringParameterDeclaration1ES5.types index a346856223a65..9b36241c7b0cd 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.types @@ -54,7 +54,7 @@ a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); >a1([1, 2, [["world"]], 3]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]], 3] : (number | string[][])[] +>[1, 2, [["world"]], 3] : [number, number, string[][], number] >1 : 1 >2 : 2 >[["world"]] : string[][] @@ -302,11 +302,11 @@ c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]] c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] >c5([1, 2, [["string"]], false, true]) : void >c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types index 3797a5da9570e..9b7c194480c87 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types @@ -54,7 +54,7 @@ a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); >a1([1, 2, [["world"]], 3]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]], 3] : (number | string[][])[] +>[1, 2, [["world"]], 3] : [number, number, string[][], number] >1 : 1 >2 : 2 >[["world"]] : string[][] @@ -302,11 +302,11 @@ c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]] c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] >c5([1, 2, [["string"]], false, true]) : void >c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.types b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types index 04d282c76b75c..d91aebfc1bf7e 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types @@ -56,7 +56,7 @@ a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); >a1([1, 2, [["world"]], 3]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]], 3] : (number | string[][])[] +>[1, 2, [["world"]], 3] : [number, number, string[][], number] >1 : 1 >2 : 2 >[["world"]] : string[][] @@ -285,11 +285,11 @@ c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]] c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] >c5([1, 2, [["string"]], false, true]) : void >c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.types b/tests/baselines/reference/destructuringParameterDeclaration2.types index 27ab690860681..6780d97d02667 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.types +++ b/tests/baselines/reference/destructuringParameterDeclaration2.types @@ -13,7 +13,7 @@ function a0([a, b, [[c]]]: [number, number, string[][]]) { } a0([1, "string", [["world"]]); // Error >a0([1, "string", [["world"]]) : void >a0 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, "string", [["world"]] : (string | number | string[][])[] +>[1, "string", [["world"]] : [number, string, string[][]] >1 : 1 >"string" : "string" >[["world"]] : string[][] @@ -23,7 +23,7 @@ a0([1, "string", [["world"]]); // Error a0([1, 2, [["world"]], "string"]); // Error >a0([1, 2, [["world"]], "string"]) : void >a0 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]], "string"] : (string | number | string[][])[] +>[1, 2, [["world"]], "string"] : [number, number, string[][], string] >1 : 1 >2 : 2 >[["world"]] : string[][] @@ -183,7 +183,7 @@ c3({ b: true }); // Error, implied type is { b: number|string }. c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] >c5([1, 2, false, true]) : void >c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, false, true] : (number | boolean)[] +>[1, 2, false, true] : [number, number, boolean, boolean] >1 : 1 >2 : 2 >false : false @@ -192,11 +192,11 @@ c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]] c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer >c6([1, 2, [["string"]]]) : void >c6 : ([a, b, [[c]]]: [any, any, [[number?]]]) => void ->[1, 2, [["string"]]] : (number | string[][])[] +>[1, 2, [["string"]]] : [number, number, [[string]]] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" // A parameter can be marked optional by following its name or binding pattern with a question mark (?) diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types index 96681054bd9e2..924db19a7e3e4 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -85,11 +85,11 @@ a1(...array); a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true @@ -109,7 +109,7 @@ a10([1, 2, [["string"]], false, true]); // Parameter type is any[] a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2, 3, false, true] : (number | boolean)[] +>[1, 2, 3, false, true] : [number, number, number, boolean, boolean] >1 : 1 >2 : 2 >3 : 3 @@ -119,7 +119,7 @@ a10([1, 2, 3, false, true]); // Parameter type is any[] a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2] : number[] +>[1, 2] : [number, number] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types index 441a079e4abb1..53484b1644ac8 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types @@ -85,11 +85,11 @@ a1(...array); a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true @@ -109,7 +109,7 @@ a10([1, 2, [["string"]], false, true]); // Parameter type is any[] a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2, 3, false, true] : (number | boolean)[] +>[1, 2, 3, false, true] : [number, number, number, boolean, boolean] >1 : 1 >2 : 2 >3 : 3 @@ -119,7 +119,7 @@ a10([1, 2, 3, false, true]); // Parameter type is any[] a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2] : number[] +>[1, 2] : [number, number] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types index a7fcb861e4c1a..fd34461548bad 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -85,11 +85,11 @@ a1(...array); a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] >1 : 1 >2 : 2 ->[["string"]] : string[][] ->["string"] : string[] +>[["string"]] : [[string]] +>["string"] : [string] >"string" : "string" >false : false >true : true @@ -109,7 +109,7 @@ a10([1, 2, [["string"]], false, true]); // Parameter type is any[] a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2, 3, false, true] : (number | boolean)[] +>[1, 2, 3, false, true] : [number, number, number, boolean, boolean] >1 : 1 >2 : 2 >3 : 3 @@ -119,7 +119,7 @@ a10([1, 2, 3, false, true]); // Parameter type is any[] a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2] : number[] +>[1, 2] : [number, number] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.types b/tests/baselines/reference/destructuringParameterDeclaration4.types index 444a70ff1969c..ad9b6a9f9ac85 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.types +++ b/tests/baselines/reference/destructuringParameterDeclaration4.types @@ -69,7 +69,7 @@ a1(...array2); // Error parameter type is (number|string)[] a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] >a5([1, 2, "string", false, true]) : void >a5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, "string", false, true] : (string | number | boolean)[] +>[1, 2, "string", false, true] : [number, number, string, boolean, boolean] >1 : 1 >2 : 2 >"string" : "string" @@ -79,7 +79,7 @@ a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, a5([1, 2]); // Error, parameter type is [any, any, [[any]]] >a5([1, 2]) : void >a5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2] : number[] +>[1, 2] : [number, number] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.types b/tests/baselines/reference/destructuringParameterDeclaration5.types index e3066702b7dc1..859b391f71c54 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration5.types @@ -156,7 +156,7 @@ d3({ y: new SubClass() }); // Error d3({ y: new Class() }); ->d3({ y: new Class() }) : any +>d3({ y: new Class() }) : void >d3 : ({ y }: { y: D; }) => void >{ y: new Class() } : { y: Class; } >y : Class @@ -164,19 +164,19 @@ d3({ y: new Class() }); >Class : typeof Class d3({}); ->d3({}) : any +>d3({}) : void >d3 : ({ y }: { y: D; }) => void >{} : {} d3({ y: 1 }); ->d3({ y: 1 }) : any +>d3({ y: 1 }) : void >d3 : ({ y }: { y: D; }) => void >{ y: 1 } : { y: number; } >y : number >1 : 1 d3({ y: "world" }); ->d3({ y: "world" }) : any +>d3({ y: "world" }) : void >d3 : ({ y }: { y: D; }) => void >{ y: "world" } : { y: string; } >y : string diff --git a/tests/baselines/reference/destructuringParameterDeclaration8.types b/tests/baselines/reference/destructuringParameterDeclaration8.types index 6ca691fcff158..870cbd057647a 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration8.types +++ b/tests/baselines/reference/destructuringParameterDeclaration8.types @@ -49,22 +49,22 @@ test({ method: 'x', nested: { p: 'a' } }) test({ method: 'z', nested: { p: 'b' } }) >test({ method: 'z', nested: { p: 'b' } }) : void >test : ({ method, nested: { p } }: { method?: "x" | "y"; nested?: { p: "a" | "b"; }; }) => void ->{ method: 'z', nested: { p: 'b' } } : { method: string; nested: { p: string; }; } ->method : string +>{ method: 'z', nested: { p: 'b' } } : { method: "z"; nested: { p: "b"; }; } +>method : "z" >'z' : "z" ->nested : { p: string; } ->{ p: 'b' } : { p: string; } ->p : string +>nested : { p: "b"; } +>{ p: 'b' } : { p: "b"; } +>p : "b" >'b' : "b" test({ method: 'one', nested: { p: 'a' } }) >test({ method: 'one', nested: { p: 'a' } }) : void >test : ({ method, nested: { p } }: { method?: "x" | "y"; nested?: { p: "a" | "b"; }; }) => void ->{ method: 'one', nested: { p: 'a' } } : { method: string; nested: { p: string; }; } ->method : string +>{ method: 'one', nested: { p: 'a' } } : { method: "one"; nested: { p: "a"; }; } +>method : "one" >'one' : "one" ->nested : { p: string; } ->{ p: 'a' } : { p: string; } ->p : string +>nested : { p: "a"; } +>{ p: 'a' } : { p: "a"; } +>p : "a" >'a' : "a" diff --git a/tests/baselines/reference/destructuringParameterProperties2.symbols b/tests/baselines/reference/destructuringParameterProperties2.symbols index 3b1662111e49b..b89a8fdb791dc 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.symbols +++ b/tests/baselines/reference/destructuringParameterProperties2.symbols @@ -57,9 +57,15 @@ var [x_a, x_b, x_c] = [x.getA(), x.getB(), x.getC()]; >x_a : Symbol(x_a, Decl(destructuringParameterProperties2.ts, 21, 5)) >x_b : Symbol(x_b, Decl(destructuringParameterProperties2.ts, 21, 9)) >x_c : Symbol(x_c, Decl(destructuringParameterProperties2.ts, 21, 14)) +>x.getA : Symbol(C1.getA, Decl(destructuringParameterProperties2.ts, 5, 5)) >x : Symbol(x, Decl(destructuringParameterProperties2.ts, 20, 3)) +>getA : Symbol(C1.getA, Decl(destructuringParameterProperties2.ts, 5, 5)) +>x.getB : Symbol(C1.getB, Decl(destructuringParameterProperties2.ts, 9, 5)) >x : Symbol(x, Decl(destructuringParameterProperties2.ts, 20, 3)) +>getB : Symbol(C1.getB, Decl(destructuringParameterProperties2.ts, 9, 5)) +>x.getC : Symbol(C1.getC, Decl(destructuringParameterProperties2.ts, 13, 5)) >x : Symbol(x, Decl(destructuringParameterProperties2.ts, 20, 3)) +>getC : Symbol(C1.getC, Decl(destructuringParameterProperties2.ts, 13, 5)) var y = new C1(10, [0, "", true]); >y : Symbol(y, Decl(destructuringParameterProperties2.ts, 23, 3)) diff --git a/tests/baselines/reference/destructuringParameterProperties2.types b/tests/baselines/reference/destructuringParameterProperties2.types index 3b9ea8d273f3a..54b6959f8fbcf 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.types +++ b/tests/baselines/reference/destructuringParameterProperties2.types @@ -71,11 +71,11 @@ class C1 { } var x = new C1(undefined, [0, undefined, ""]); ->x : any ->new C1(undefined, [0, undefined, ""]) : any +>x : C1 +>new C1(undefined, [0, undefined, ""]) : C1 >C1 : typeof C1 >undefined : undefined ->[0, undefined, ""] : (string | number)[] +>[0, undefined, ""] : [number, undefined, string] >0 : 0 >undefined : undefined >"" : "" @@ -86,17 +86,17 @@ var [x_a, x_b, x_c] = [x.getA(), x.getB(), x.getC()]; >x_c : any >[x.getA(), x.getB(), x.getC()] : [any, any, any] >x.getA() : any ->x.getA : any ->x : any ->getA : any +>x.getA : () => any +>x : C1 +>getA : () => any >x.getB() : any ->x.getB : any ->x : any ->getB : any +>x.getB : () => any +>x : C1 +>getB : () => any >x.getC() : any ->x.getC : any ->x : any ->getC : any +>x.getC : () => any +>x : C1 +>getC : () => any var y = new C1(10, [0, "", true]); >y : C1 diff --git a/tests/baselines/reference/destructuringParameterProperties5.errors.txt b/tests/baselines/reference/destructuringParameterProperties5.errors.txt index fa57ae150a053..6e0f017341da5 100644 --- a/tests/baselines/reference/destructuringParameterProperties5.errors.txt +++ b/tests/baselines/reference/destructuringParameterProperties5.errors.txt @@ -11,9 +11,14 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(1 Object literal may only specify known properties, and 'x1' does not exist in type 'ObjType1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(11,47): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(11,51): error TS2322: Type 'false' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(12,39): error TS2339: Property 'x1' does not exist on type 'C1'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(12,45): error TS2339: Property 'x2' does not exist on type 'C1'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(12,51): error TS2339: Property 'x3' does not exist on type 'C1'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(12,57): error TS2339: Property 'y' does not exist on type 'C1'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(12,62): error TS2339: Property 'z' does not exist on type 'C1'. -==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts (12 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts (17 errors) ==== type ObjType1 = { x: number; y: string; z: boolean } type TupleType1 = [ObjType1, number, string] @@ -50,4 +55,14 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts(1 !!! error TS2322: Type 'string' is not assignable to type 'number'. ~~~~~ !!! error TS2322: Type 'false' is not assignable to type 'string'. - var [a_x1, a_x2, a_x3, a_y, a_z] = [a.x1, a.x2, a.x3, a.y, a.z]; \ No newline at end of file + var [a_x1, a_x2, a_x3, a_y, a_z] = [a.x1, a.x2, a.x3, a.y, a.z]; + ~~ +!!! error TS2339: Property 'x1' does not exist on type 'C1'. + ~~ +!!! error TS2339: Property 'x2' does not exist on type 'C1'. + ~~ +!!! error TS2339: Property 'x3' does not exist on type 'C1'. + ~ +!!! error TS2339: Property 'y' does not exist on type 'C1'. + ~ +!!! error TS2339: Property 'z' does not exist on type 'C1'. \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterProperties5.types b/tests/baselines/reference/destructuringParameterProperties5.types index 60c3d074c6ef6..75d9d8b8f2ef3 100644 --- a/tests/baselines/reference/destructuringParameterProperties5.types +++ b/tests/baselines/reference/destructuringParameterProperties5.types @@ -55,10 +55,10 @@ class C1 { } var a = new C1([{ x1: 10, x2: "", x3: true }, "", false]); ->a : any ->new C1([{ x1: 10, x2: "", x3: true }, "", false]) : any +>a : C1 +>new C1([{ x1: 10, x2: "", x3: true }, "", false]) : C1 >C1 : typeof C1 ->[{ x1: 10, x2: "", x3: true }, "", false] : (string | boolean | { x1: number; x2: string; x3: boolean; })[] +>[{ x1: 10, x2: "", x3: true }, "", false] : [{ x1: number; x2: string; x3: boolean; }, string, boolean] >{ x1: 10, x2: "", x3: true } : { x1: number; x2: string; x3: boolean; } >x1 : number >10 : 10 @@ -77,18 +77,18 @@ var [a_x1, a_x2, a_x3, a_y, a_z] = [a.x1, a.x2, a.x3, a.y, a.z]; >a_z : any >[a.x1, a.x2, a.x3, a.y, a.z] : [any, any, any, any, any] >a.x1 : any ->a : any +>a : C1 >x1 : any >a.x2 : any ->a : any +>a : C1 >x2 : any >a.x3 : any ->a : any +>a : C1 >x3 : any >a.y : any ->a : any +>a : C1 >y : any >a.z : any ->a : any +>a : C1 >z : any diff --git a/tests/baselines/reference/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.types b/tests/baselines/reference/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.types index bd60a27864513..8bf53bf6dd025 100644 --- a/tests/baselines/reference/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.types +++ b/tests/baselines/reference/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.types @@ -71,7 +71,7 @@ foo({ }, getNum(), [ >getNum() : number >getNum : () => number ->[ 1, 2, getNum] : (number | (() => number))[] +>[ 1, 2, getNum] : [number, number, () => number] 1, >1 : 1 diff --git a/tests/baselines/reference/emptyTypeArgumentList.types b/tests/baselines/reference/emptyTypeArgumentList.types index 94eb2d878c839..d8db2c476bbf3 100644 --- a/tests/baselines/reference/emptyTypeArgumentList.types +++ b/tests/baselines/reference/emptyTypeArgumentList.types @@ -3,6 +3,6 @@ function foo() { } >foo : () => void foo<>(); ->foo<>() : any +>foo<>() : void >foo : () => void diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.types b/tests/baselines/reference/emptyTypeArgumentListWithNew.types index d89c3dd041f67..c75f69876d542 100644 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.types +++ b/tests/baselines/reference/emptyTypeArgumentListWithNew.types @@ -3,6 +3,6 @@ class foo { } >foo : foo new foo<>(); ->new foo<>() : any +>new foo<>() : foo<{}> >foo : typeof foo diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.types b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.types index 5610ea98be071..1cbecfbd3e351 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.types +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.types @@ -5,8 +5,8 @@ function f() { >f : () => void var d1 = new derived(); ->d1 : any ->new derived() : any +>d1 : derived +>new derived() : derived >derived : typeof derived var d2 = new derived(4); diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.types b/tests/baselines/reference/exportAssignmentConstrainedGenericType.types index f70d2001a112f..08ac4560e108e 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.types +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.types @@ -3,8 +3,8 @@ import foo = require("./foo_0"); >foo : typeof foo var x = new foo(true); // Should error ->x : any ->new foo(true) : any +>x : foo<{ a: string; b: number; }> +>new foo(true) : foo<{ a: string; b: number; }> >foo : typeof foo >true : true diff --git a/tests/baselines/reference/extractInferenceImprovement.errors.txt b/tests/baselines/reference/extractInferenceImprovement.errors.txt index b3582f6b02227..74b2f61451505 100644 --- a/tests/baselines/reference/extractInferenceImprovement.errors.txt +++ b/tests/baselines/reference/extractInferenceImprovement.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/extractInferenceImprovement.ts(26,26): error TS2345: Argument of type 'unique symbol' is not assignable to parameter of type 'never'. +tests/cases/compiler/extractInferenceImprovement.ts(28,1): error TS2322: Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/extractInferenceImprovement.ts(28,26): error TS2345: Argument of type 'unique symbol' is not assignable to parameter of type '"first" | "second"'. -==== tests/cases/compiler/extractInferenceImprovement.ts (2 errors) ==== +==== tests/cases/compiler/extractInferenceImprovement.ts (3 errors) ==== // repro mostly from https://github.com/Microsoft/TypeScript/issues/25065 function getProperty2(obj: T, key: Extract): T[K] { return obj[key]; @@ -33,6 +35,9 @@ tests/cases/compiler/extractInferenceImprovement.ts(28,26): error TS2345: Argume !!! error TS2345: Argument of type 'unique symbol' is not assignable to parameter of type 'never'. prop = getProperty3(obj, s); + ~~~~ +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. ~ !!! error TS2345: Argument of type 'unique symbol' is not assignable to parameter of type '"first" | "second"'. \ No newline at end of file diff --git a/tests/baselines/reference/extractInferenceImprovement.types b/tests/baselines/reference/extractInferenceImprovement.types index 0e18dc30ee005..e14e293e8197a 100644 --- a/tests/baselines/reference/extractInferenceImprovement.types +++ b/tests/baselines/reference/extractInferenceImprovement.types @@ -65,17 +65,17 @@ prop = getProperty3(obj, 'first'); // Should fail prop = getProperty2(obj, s); ->prop = getProperty2(obj, s) : any +>prop = getProperty2(obj, s) : string >prop : string ->getProperty2(obj, s) : any +>getProperty2(obj, s) : string >getProperty2 : (obj: T, key: Extract) => T[K] >obj : StrNum >s : unique symbol prop = getProperty3(obj, s); ->prop = getProperty3(obj, s) : any +>prop = getProperty3(obj, s) : string | number >prop : string ->getProperty3(obj, s) : any +>getProperty3(obj, s) : string | number >getProperty3 : >(obj: T, key: K) => T[K] >obj : StrNum >s : unique symbol diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types index 776ecd2fc5d61..e097957fcdfc0 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types @@ -5,7 +5,7 @@ function bar(item1: T, item2: T) { } >item2 : T bar(1, ""); // Should be ok ->bar(1, "") : any +>bar(1, "") : void >bar : (item1: T, item2: T) => void >1 : 1 >"" : "" diff --git a/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt b/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt index 24aa0d124ca19..e9d989b118c51 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly2.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(11,32): error TS2741: Property 'toBase' is missing in type 'Base' but required in type 'Derived'. +tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(17,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'result' must be of type 'Derived', but here has type 'Base'. -==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (1 errors) ==== +==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (2 errors) ==== interface Base { baseProp; } @@ -22,4 +23,6 @@ tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(11,32): error TS2741: Pr // The same error should be observed in both cases. declare function bar(x: T, func: (p: T) => T): T; declare function bar(x: T, func: (p: T) => T): T; - var result = bar(derived, d => d.toBase()); \ No newline at end of file + var result = bar(derived, d => d.toBase()); + ~~~~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'result' must be of type 'Derived', but here has type 'Base'. \ No newline at end of file diff --git a/tests/baselines/reference/fixingTypeParametersRepeatedly2.types b/tests/baselines/reference/fixingTypeParametersRepeatedly2.types index 204e83fe60048..52fb38c025c43 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly2.types +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly2.types @@ -18,8 +18,8 @@ declare function foo(x: T, func: (p: T) => T): T; >p : T var result = foo(derived, d => d.toBase()); ->result : any ->foo(derived, d => d.toBase()) : any +>result : Derived +>foo(derived, d => d.toBase()) : Derived >foo : (x: T, func: (p: T) => T) => T >derived : Derived >d => d.toBase() : (d: Derived) => Base @@ -44,7 +44,7 @@ declare function bar(x: T, func: (p: T) => T): T; >p : T var result = bar(derived, d => d.toBase()); ->result : any +>result : Derived >bar(derived, d => d.toBase()) : Base >bar : { (x: T, func: (p: T) => T): T; (x: T, func: (p: T) => T): T; } >derived : Derived diff --git a/tests/baselines/reference/for-of39.types b/tests/baselines/reference/for-of39.types index 0b69e4d1b3063..fe0b788c3b31d 100644 --- a/tests/baselines/reference/for-of39.types +++ b/tests/baselines/reference/for-of39.types @@ -1,24 +1,24 @@ === tests/cases/conformance/es6/for-ofStatements/for-of39.ts === var map = new Map([["", true], ["", 0]]); ->map : any ->new Map([["", true], ["", 0]]) : any +>map : Map +>new Map([["", true], ["", 0]]) : Map >Map : MapConstructor ->[["", true], ["", 0]] : ((string | boolean)[] | (string | number)[])[] ->["", true] : (string | boolean)[] +>[["", true], ["", 0]] : ([string, number] | [string, true])[] +>["", true] : [string, true] >"" : "" >true : true ->["", 0] : (string | number)[] +>["", 0] : [string, number] >"" : "" >0 : 0 for (var [k, v] of map) { ->k : any ->v : any ->map : any +>k : string +>v : boolean +>map : Map k; ->k : any +>k : string v; ->v : any +>v : boolean } diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.types b/tests/baselines/reference/functionConstraintSatisfaction2.types index f5a7eb0fd65ae..761dcaa2bedcb 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.types +++ b/tests/baselines/reference/functionConstraintSatisfaction2.types @@ -7,18 +7,18 @@ function foo(x: T): T { return x; } >x : T foo(1); ->foo(1) : any +>foo(1) : Function >foo : (x: T) => T >1 : 1 foo(() => { }, 1); ->foo(() => { }, 1) : any +>foo(() => { }, 1) : () => void >foo : (x: T) => T >() => { } : () => void >1 : 1 foo(1, () => { }); ->foo(1, () => { }) : any +>foo(1, () => { }) : Function >foo : (x: T) => T >1 : 1 >() => { } : () => void @@ -52,29 +52,29 @@ var b2: { new (x: T): T }; >x : T var r = foo2(new Function()); ->r : any ->foo2(new Function()) : any +>r : (x: string) => string +>foo2(new Function()) : (x: string) => string >foo2 : string>(x: T) => T >new Function() : Function >Function : FunctionConstructor var r2 = foo2((x: string[]) => x); ->r2 : any ->foo2((x: string[]) => x) : any +>r2 : (x: string) => string +>foo2((x: string[]) => x) : (x: string) => string >foo2 : string>(x: T) => T >(x: string[]) => x : (x: string[]) => string[] >x : string[] >x : string[] var r6 = foo2(C); ->r6 : any ->foo2(C) : any +>r6 : (x: string) => string +>foo2(C) : (x: string) => string >foo2 : string>(x: T) => T >C : typeof C var r7 = foo2(b); ->r7 : any ->foo2(b) : any +>r7 : (x: string) => string +>foo2(b) : (x: string) => string >foo2 : string>(x: T) => T >b : new (x: string) => string @@ -87,8 +87,8 @@ var r8 = foo2((x: U) => x); // no error expected >x : U var r11 = foo2((x: U, y: V) => x); ->r11 : any ->foo2((x: U, y: V) => x) : any +>r11 : (x: string) => string +>foo2((x: U, y: V) => x) : (x: string) => string >foo2 : string>(x: T) => T >(x: U, y: V) => x : (x: U, y: V) => U >x : U @@ -96,14 +96,14 @@ var r11 = foo2((x: U, y: V) => x); >x : U var r13 = foo2(C2); ->r13 : any ->foo2(C2) : any +>r13 : (x: string) => string +>foo2(C2) : (x: string) => string >foo2 : string>(x: T) => T >C2 : typeof C2 var r14 = foo2(b2); ->r14 : any ->foo2(b2) : any +>r14 : (x: string) => string +>foo2(b2) : (x: string) => string >foo2 : string>(x: T) => T >b2 : new (x: T) => T @@ -114,8 +114,8 @@ var f2: F2; >f2 : F2 var r16 = foo2(f2); ->r16 : any ->foo2(f2) : any +>r16 : (x: string) => string +>foo2(f2) : (x: string) => string >foo2 : string>(x: T) => T >f2 : F2 @@ -125,12 +125,12 @@ function fff(x: T, y: U) { >y : U foo2(x); ->foo2(x) : any +>foo2(x) : (x: string) => string >foo2 : string>(x: T) => T >x : T foo2(y); ->foo2(y) : any +>foo2(y) : (x: string) => string >foo2 : string>(x: T) => T >y : U } diff --git a/tests/baselines/reference/functionOverloads.types b/tests/baselines/reference/functionOverloads.types index f3fd68f1cb7a1..77d23b5574563 100644 --- a/tests/baselines/reference/functionOverloads.types +++ b/tests/baselines/reference/functionOverloads.types @@ -12,8 +12,8 @@ function foo(bar?: string): any { return "" }; >"" : "" var x = foo(5); ->x : any ->foo(5) : any +>x : string & number +>foo(5) : string & number >foo : { (): string; (bar: string): number; } >5 : 5 diff --git a/tests/baselines/reference/functionOverloads2.types b/tests/baselines/reference/functionOverloads2.types index 4b6c7edce6c0c..04a65d36668be 100644 --- a/tests/baselines/reference/functionOverloads2.types +++ b/tests/baselines/reference/functionOverloads2.types @@ -13,8 +13,8 @@ function foo(bar: any): any { return bar }; >bar : any var x = foo(true); ->x : any ->foo(true) : any +>x : string & number +>foo(true) : string & number >foo : { (bar: string): string; (bar: number): number; } >true : true diff --git a/tests/baselines/reference/functionOverloads27.types b/tests/baselines/reference/functionOverloads27.types index 49e4d80571786..d1210d06bd156 100644 --- a/tests/baselines/reference/functionOverloads27.types +++ b/tests/baselines/reference/functionOverloads27.types @@ -12,8 +12,8 @@ function foo(bar?:any):any{ return '' } >'' : "" var x = foo(5); ->x : any ->foo(5) : any +>x : string & number +>foo(5) : string & number >foo : { (): string; (bar: string): number; } >5 : 5 diff --git a/tests/baselines/reference/functionOverloads29.types b/tests/baselines/reference/functionOverloads29.types index cf24c2b1f24b0..4376f12b1e7cd 100644 --- a/tests/baselines/reference/functionOverloads29.types +++ b/tests/baselines/reference/functionOverloads29.types @@ -13,7 +13,7 @@ function foo(bar:any):any{ return bar } >bar : any var x = foo(); ->x : any ->foo() : any +>x : string & number +>foo() : string & number >foo : { (bar: string): string; (bar: number): number; } diff --git a/tests/baselines/reference/functionOverloads34.types b/tests/baselines/reference/functionOverloads34.types index e49f86b5f5a94..dbc7cf98e1e5a 100644 --- a/tests/baselines/reference/functionOverloads34.types +++ b/tests/baselines/reference/functionOverloads34.types @@ -16,7 +16,7 @@ function foo(bar:{a:any;}):any{ return bar } >bar : { a: any; } var x = foo(); ->x : any ->foo() : any +>x : string & number +>foo() : string & number >foo : { (bar: { a: number; }): string; (bar: { a: boolean; }): number; } diff --git a/tests/baselines/reference/functionOverloads37.types b/tests/baselines/reference/functionOverloads37.types index ccb7db26e5833..5bdc394d7401c 100644 --- a/tests/baselines/reference/functionOverloads37.types +++ b/tests/baselines/reference/functionOverloads37.types @@ -16,7 +16,7 @@ function foo(bar:{a:any;}[]):any{ return bar } >bar : { a: any; }[] var x = foo(); ->x : any ->foo() : any +>x : string & number +>foo() : string & number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } diff --git a/tests/baselines/reference/functionOverloads40.types b/tests/baselines/reference/functionOverloads40.types index 7d744c5b10c67..1f2a59db2f6ec 100644 --- a/tests/baselines/reference/functionOverloads40.types +++ b/tests/baselines/reference/functionOverloads40.types @@ -16,8 +16,8 @@ function foo(bar:{a:any;}[]):any{ return bar } >bar : { a: any; }[] var x = foo([{a:'bar'}]); ->x : any ->foo([{a:'bar'}]) : any +>x : string & number +>foo([{a:'bar'}]) : string & number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } >[{a:'bar'}] : { a: string; }[] >{a:'bar'} : { a: string; } diff --git a/tests/baselines/reference/functionOverloads41.types b/tests/baselines/reference/functionOverloads41.types index d16c412737ca4..e5cf4d2c9adb0 100644 --- a/tests/baselines/reference/functionOverloads41.types +++ b/tests/baselines/reference/functionOverloads41.types @@ -16,8 +16,8 @@ function foo(bar:{a:any;}[]):any{ return bar } >bar : { a: any; }[] var x = foo([{}]); ->x : any ->foo([{}]) : any +>x : string & number +>foo([{}]) : string & number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } >[{}] : {}[] >{} : {} diff --git a/tests/baselines/reference/generatorTypeCheck63.types b/tests/baselines/reference/generatorTypeCheck63.types index 67f9717162df8..c800ed0643ff3 100644 --- a/tests/baselines/reference/generatorTypeCheck63.types +++ b/tests/baselines/reference/generatorTypeCheck63.types @@ -50,7 +50,7 @@ export interface State extends StrategicState { export const Nothing: Strategy = strategy("Nothing", function* (state: State) { >Nothing : Strategy ->strategy("Nothing", function* (state: State) { yield 1; return state;}) : any +>strategy("Nothing", function* (state: State) { yield 1; return state;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" >function* (state: State) { yield 1; return state;} : (state: State) => IterableIterator @@ -77,7 +77,7 @@ export const Nothing1: Strategy = strategy("Nothing", function* (state: S export const Nothing2: Strategy = strategy("Nothing", function* (state: State) { >Nothing2 : Strategy ->strategy("Nothing", function* (state: State) { return 1;}) : any +>strategy("Nothing", function* (state: State) { return 1;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" >function* (state: State) { return 1;} : (state: State) => IterableIterator @@ -90,7 +90,7 @@ export const Nothing2: Strategy = strategy("Nothing", function* (state: S export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { >Nothing3 : Strategy ->strategy("Nothing", function* (state: State) { yield state; return 1;}) : any +>strategy("Nothing", function* (state: State) { yield state; return 1;}) : (a: State) => IterableIterator >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator >"Nothing" : "Nothing" >function* (state: State) { yield state; return 1;} : (state: State) => IterableIterator diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index abb103ccb5cb3..ff35469d81b3c 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -27,11 +27,11 @@ declare var _: Underscore.Static; // No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. // Ideally, we would not have a generic signature here, because it should be instantiated with {} during inferential typing _.all([true, 1, null, 'yes'], _.identity); ->_.all([true, 1, null, 'yes'], _.identity) : any +>_.all([true, 1, null, 'yes'], _.identity) : boolean >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true, 1, null, 'yes'] : (string | number | boolean)[] +>[true, 1, null, 'yes'] : (string | number | true)[] >true : true >1 : 1 >null : null diff --git a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.types b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.types index 4b7c092e01282..f9d17fc71b371 100644 --- a/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.types +++ b/tests/baselines/reference/genericCallToOverloadedMethodWithOverloadedArguments.types @@ -49,8 +49,8 @@ module m2 { >numPromise : Promise var newPromise = numPromise.then(testFunction); ->newPromise : any ->numPromise.then(testFunction) : any +>newPromise : Promise +>numPromise.then(testFunction) : Promise >numPromise.then : (cb: (x: number) => Promise) => Promise >numPromise : Promise >then : (cb: (x: number) => Promise) => Promise @@ -123,8 +123,8 @@ module m4 { >numPromise : Promise var newPromise = numPromise.then(testFunction); ->newPromise : any ->numPromise.then(testFunction) : any +>newPromise : Promise +>numPromise.then(testFunction) : Promise >numPromise.then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; } >numPromise : Promise >then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; } @@ -171,8 +171,8 @@ module m5 { >numPromise : Promise var newPromise = numPromise.then(testFunction); ->newPromise : any ->numPromise.then(testFunction) : any +>newPromise : Promise +>numPromise.then(testFunction) : Promise >numPromise.then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => U, progress?: (preservation: any) => void): Promise; } >numPromise : Promise >then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => U, progress?: (preservation: any) => void): Promise; } @@ -214,8 +214,8 @@ module m6 { >numPromise : Promise var newPromise = numPromise.then(testFunction); ->newPromise : any ->numPromise.then(testFunction) : any +>newPromise : Promise +>numPromise.then(testFunction) : Promise >numPromise.then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; } >numPromise : Promise >then : { (cb: (x: number) => Promise): Promise; (cb: (x: number) => Promise, error?: (error: any) => Promise): Promise; } diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types index cfd9e24182bec..325412a6eddc9 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.types @@ -32,8 +32,8 @@ var r3 = foo(new Object()); // {} >Object : ObjectConstructor var r4 = foo(1); // error ->r4 : any ->foo(1) : any +>r4 : Date +>foo(1) : Date >foo : (t: T) => U >1 : 1 diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.types b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.types index 75d775c761c31..4902b207eafd6 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.types +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.types @@ -34,8 +34,8 @@ var arg2: { cb: new (x: T, y: T) => string }; >y : T var r2 = foo(arg2); // error ->r2 : any ->foo(arg2) : any +>r2 : string +>foo(arg2) : string >foo : (arg: { cb: new (t: T) => U; }) => U >arg2 : { cb: new (x: T, y: T) => string; } @@ -46,8 +46,8 @@ var arg3: { cb: new (x: string, y: number) => string }; >y : number var r3 = foo(arg3); // error ->r3 : any ->foo(arg3) : any +>r3 : string +>foo(arg3) : string >foo : (arg: { cb: new (t: T) => U; }) => U >arg3 : { cb: new (x: string, y: number) => string; } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types index 32a10d3cad40a..ba1ca07af9104 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types @@ -100,8 +100,8 @@ var r7 = foo3(1, (a: Z) => '', ''); // string >'' : "" var r8 = foo3(1, function (a) { return '' }, 1); // error ->r8 : any ->foo3(1, function (a) { return '' }, 1) : any +>r8 : number +>foo3(1, function (a) { return '' }, 1) : 1 >foo3 : (x: T, cb: (a: T) => U, y: U) => U >1 : 1 >function (a) { return '' } : (a: number) => string @@ -125,8 +125,8 @@ function other(t: T, u: U) { >u : U var r10 = foo2(1, (x: T) => ''); // error ->r10 : any ->foo2(1, (x: T) => '') : any +>r10 : string +>foo2(1, (x: T) => '') : string >foo2 : (x: T, cb: (a: T) => U) => U >1 : 1 >(x: T) => '' : (x: T) => string @@ -134,7 +134,7 @@ function other(t: T, u: U) { >'' : "" var r10 = foo2(1, (x) => ''); // string ->r10 : any +>r10 : string >foo2(1, (x) => '') : string >foo2 : (x: T, cb: (a: T) => U) => U >1 : 1 @@ -143,8 +143,8 @@ function other(t: T, u: U) { >'' : "" var r11 = foo3(1, (x: T) => '', ''); // error ->r11 : any ->foo3(1, (x: T) => '', '') : any +>r11 : string +>foo3(1, (x: T) => '', '') : string >foo3 : (x: T, cb: (a: T) => U, y: U) => U >1 : 1 >(x: T) => '' : (x: T) => string @@ -153,8 +153,8 @@ function other(t: T, u: U) { >'' : "" var r11b = foo3(1, (x: T) => '', 1); // error ->r11b : any ->foo3(1, (x: T) => '', 1) : any +>r11b : string +>foo3(1, (x: T) => '', 1) : string >foo3 : (x: T, cb: (a: T) => U, y: U) => U >1 : 1 >(x: T) => '' : (x: T) => string @@ -163,8 +163,8 @@ function other(t: T, u: U) { >1 : 1 var r12 = foo3(1, function (a) { return '' }, 1); // error ->r12 : any ->foo3(1, function (a) { return '' }, 1) : any +>r12 : number +>foo3(1, function (a) { return '' }, 1) : 1 >foo3 : (x: T, cb: (a: T) => U, y: U) => U >1 : 1 >function (a) { return '' } : (a: number) => string diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types index 43391dd7cc6e4..23830f839805f 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types @@ -71,8 +71,8 @@ function foo2(x: T, cb: new(a: T) => U) { } var r4 = foo2(1, i2); // error ->r4 : any ->foo2(1, i2) : any +>r4 : string +>foo2(1, i2) : string >foo2 : (x: T, cb: new (a: T) => U) => U >1 : 1 >i2 : I2 @@ -128,8 +128,8 @@ var r7b = foo3(null, a, ''); // any >'' : "" var r8 = foo3(1, i2, 1); // error ->r8 : any ->foo3(1, i2, 1) : any +>r8 : string +>foo3(1, i2, 1) : string >foo3 : (x: T, cb: new (a: T) => U, y: U) => U >1 : 1 >i2 : I2 diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types index 864aa0ec90d87..822486564651a 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types @@ -31,8 +31,8 @@ var r = foo(arg); // {} // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error ->r2 : any ->foo({ cb: (x: T, y: T) => '' }) : any +>r2 : string +>foo({ cb: (x: T, y: T) => '' }) : string >foo : (arg: { cb: (t: T) => U; }) => U >{ cb: (x: T, y: T) => '' } : { cb: (x: T, y: T) => string; } >cb : (x: T, y: T) => string @@ -42,8 +42,8 @@ var r2 = foo({ cb: (x: T, y: T) => '' }); // error >'' : "" var r3 = foo({ cb: (x: string, y: number) => '' }); // error ->r3 : any ->foo({ cb: (x: string, y: number) => '' }) : any +>r3 : string +>foo({ cb: (x: string, y: number) => '' }) : string >foo : (arg: { cb: (t: T) => U; }) => U >{ cb: (x: string, y: number) => '' } : { cb: (x: string, y: number) => string; } >cb : (x: string, y: number) => string diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.types index 64acb69d4e600..30394aa970f53 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.types +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.types @@ -23,7 +23,7 @@ module onlyT { var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); >r1 : (x: {}) => {} >x : {} ->foo((x: number) => 1, (x: string) => '') : any +>foo((x: number) => 1, (x: string) => '') : (x: number) => number >foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T >(x: number) => 1 : (x: number) => number >x : number @@ -82,8 +82,8 @@ module onlyT { >x : T var r7 = foo2((a: T) => a, (b: T) => b); // error ->r7 : any ->foo2((a: T) => a, (b: T) => b) : any +>r7 : (x: Date) => Date +>foo2((a: T) => a, (b: T) => b) : (x: Date) => Date >foo2 : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T >(a: T) => a : (a: T) => T >a : T @@ -129,8 +129,8 @@ module onlyT { } var r7 = foo3(E.A, (x) => E.A, (x) => F.A); // error ->r7 : any ->foo3(E.A, (x) => E.A, (x) => F.A) : any +>r7 : (x: E) => E +>foo3(E.A, (x) => E.A, (x) => F.A) : (x: E) => E >foo3 : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T >E.A : E >E : typeof E @@ -226,8 +226,8 @@ module TU { >x : T var r7 = foo2((a: T) => a, (b: T) => b); ->r7 : any ->foo2((a: T) => a, (b: T) => b) : any +>r7 : (x: Date) => Date +>foo2((a: T) => a, (b: T) => b) : (x: Date) => Date >foo2 : (a: (x: T) => T, b: (x: U) => U) => (x: T) => T >(a: T) => a : (a: T) => T >a : T diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types index 5bd041097239a..531225ad6b25f 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types @@ -175,8 +175,8 @@ var x: (a: string) => boolean; >a : string var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // error ->r11 : any ->foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2) : any +>r11 : (x: (a: string) => boolean) => (n: Object) => number +>foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2) : (x: (a: string) => boolean) => (n: Object) => number >foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U >x : (a: string) => boolean >(a1: (y: string) => string) => (n: Object) => 1 : (a1: (y: string) => string) => (n: Object) => number @@ -191,8 +191,8 @@ var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: stri >2 : 2 var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error ->r12 : any ->foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2) : any +>r12 : (x: (z: string) => boolean) => (n: Object) => number +>foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2) : (x: (z: string) => boolean) => (n: Object) => number >foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U >x : (a: string) => boolean >(a1: (y: string) => boolean) => (n: Object) => 1 : (a1: (y: string) => boolean) => (n: Object) => number diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types index e19a6b327c614..7343f8a703fab 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types @@ -10,8 +10,8 @@ function foo(x: { bar: T; baz: T }) { } var r = foo({ bar: 1, baz: '' }); // error ->r : any ->foo({ bar: 1, baz: '' }) : any +>r : { bar: number; baz: number; } +>foo({ bar: 1, baz: '' }) : { bar: number; baz: number; } >foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } >{ bar: 1, baz: '' } : { bar: number; baz: string; } >bar : number diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.types b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.types index 1ecc71016f701..633a0cd3fbbb4 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.types +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.types @@ -9,8 +9,8 @@ function foo(n: { x: T; y: T }, m: T) { return m; } // these are all errors var x = foo({ x: 3, y: "" }, 4); ->x : any ->foo({ x: 3, y: "" }, 4) : any +>x : number +>foo({ x: 3, y: "" }, 4) : number >foo : (n: { x: T; y: T; }, m: T) => T >{ x: 3, y: "" } : { x: number; y: string; } >x : number @@ -20,8 +20,8 @@ var x = foo({ x: 3, y: "" }, 4); >4 : 4 var x2 = foo({ x: 3, y: "" }, 4); ->x2 : any ->foo({ x: 3, y: "" }, 4) : any +>x2 : number +>foo({ x: 3, y: "" }, 4) : number >foo : (n: { x: T; y: T; }, m: T) => T >{ x: 3, y: "" } : { x: number; y: string; } >x : number @@ -31,8 +31,8 @@ var x2 = foo({ x: 3, y: "" }, 4); >4 : 4 var x3 = foo({ x: 3, y: "" }, 4); ->x3 : any ->foo({ x: 3, y: "" }, 4) : any +>x3 : string +>foo({ x: 3, y: "" }, 4) : string >foo : (n: { x: T; y: T; }, m: T) => T >{ x: 3, y: "" } : { x: number; y: string; } >x : number @@ -42,8 +42,8 @@ var x3 = foo({ x: 3, y: "" }, 4); >4 : 4 var x4 = foo({ x: "", y: 4 }, ""); ->x4 : any ->foo({ x: "", y: 4 }, "") : any +>x4 : number +>foo({ x: "", y: 4 }, "") : number >foo : (n: { x: T; y: T; }, m: T) => T >{ x: "", y: 4 } : { x: string; y: number; } >x : string @@ -53,8 +53,8 @@ var x4 = foo({ x: "", y: 4 }, ""); >"" : "" var x5 = foo({ x: "", y: 4 }, ""); ->x5 : any ->foo({ x: "", y: 4 }, "") : any +>x5 : string +>foo({ x: "", y: 4 }, "") : string >foo : (n: { x: T; y: T; }, m: T) => T >{ x: "", y: 4 } : { x: string; y: number; } >x : string diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.types b/tests/baselines/reference/genericCallWithObjectTypeArgs.types index 1a82a3c6f55c2..17d86f72378e3 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.types @@ -43,8 +43,8 @@ var d1 = new X(); >X : typeof X var r = foo(c1, d1); // error ->r : any ->foo(c1, d1) : any +>r : C +>foo(c1, d1) : C >foo : (t: X, t2: X) => T >c1 : X >d1 : X diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.types index b0b6e89d23c7e..a670d20e03987 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.types @@ -36,8 +36,8 @@ function f(a: { x: T; y: T }) { } var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other ->r1 : any ->f({ x: new Derived(), y: new Derived2() }) : any +>r1 : Derived +>f({ x: new Derived(), y: new Derived2() }) : Derived >f : (a: { x: T; y: T; }) => T >{ x: new Derived(), y: new Derived2() } : { x: Derived; y: Derived2; } >x : Derived diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types index 4c058c8a265bf..e66319cdbc7db 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types @@ -43,8 +43,8 @@ var r = foo(c, d); >d : D var r2 = foo(d, c); // error because C does not extend D ->r2 : any ->foo(d, c) : any +>r2 : (x: D) => D +>foo(d, c) : (x: D) => D >foo : (t: T, t2: U) => (x: T) => U >d : D >c : C @@ -114,8 +114,8 @@ function other() { >d : D var r5 = foo(c, d); // error ->r5 : any ->foo(c, d) : any +>r5 : (x: T) => U +>foo(c, d) : (x: T) => U >foo : (t: T, t2: U) => (x: T) => U >c : C >d : D diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types index 1d54e41e6bec8..5b8b72fa61cef 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types @@ -36,15 +36,15 @@ var d: D; >d : D var r2 = foo(d, c); // the constraints are self-referencing, no downstream error ->r2 : any ->foo(d, c) : any +>r2 : (x: D) => D +>foo(d, c) : (x: D) => D >foo : (t: T, t2: U) => (x: T) => U >d : D >c : C var r9 = foo(() => 1, () => { }); // the constraints are self-referencing, no downstream error ->r9 : any ->foo(() => 1, () => { }) : any +>r9 : (x: () => number) => () => number +>foo(() => 1, () => { }) : (x: () => number) => () => number >foo : (t: T, t2: U) => (x: T) => U >() => 1 : () => number >1 : 1 @@ -54,8 +54,8 @@ function other() { >other : () => void var r5 = foo(c, d); // error ->r5 : any ->foo(c, d) : any +>r5 : (x: T) => U +>foo(c, d) : (x: T) => U >foo : (t: T, t2: U) => (x: T) => U >c : C >d : D diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types index 7c2075c4fa6a3..9536002a24c16 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types @@ -75,8 +75,8 @@ module GenericParameter { >y : T var r10 = foo6(b); // error ->r10 : any ->foo6(b) : any +>r10 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo6(b) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >b : new (x: T, y: T) => string diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types index 6c982af9f917e..6b85bbdbbf115 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types @@ -67,8 +67,8 @@ module GenericParameter { } var r10 = foo6((x: T, y: T) => ''); // error ->r10 : any ->foo6((x: T, y: T) => '') : any +>r10 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo6((x: T, y: T) => '') : { (x: {}): string; (x: {}, y?: {}): string; } >foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >(x: T, y: T) => '' : (x: T, y: T) => string >x : T diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types index 3e4c0c1e3a50f..8d163230d1121 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types @@ -220,8 +220,8 @@ module WithCandidates { >u : U var r10 = c.foo2(1, (x: T) => ''); // error ->r10 : any ->c.foo2(1, (x: T) => '') : any +>r10 : string +>c.foo2(1, (x: T) => '') : string >c.foo2 : (x: T, cb: (a: T) => U) => U >c : C >foo2 : (x: T, cb: (a: T) => U) => U @@ -231,7 +231,7 @@ module WithCandidates { >'' : "" var r10 = c.foo2(1, (x) => ''); // string ->r10 : any +>r10 : string >c.foo2(1, (x) => '') : string >c.foo2 : (x: T, cb: (a: T) => U) => U >c : C @@ -242,8 +242,8 @@ module WithCandidates { >'' : "" var r11 = c3.foo3(1, (x: T) => '', ''); // error ->r11 : any ->c3.foo3(1, (x: T) => '', '') : any +>r11 : string +>c3.foo3(1, (x: T) => '', '') : string >c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U >c3 : C3 >foo3 : (x: T, cb: (a: T) => U, y: U) => U @@ -254,8 +254,8 @@ module WithCandidates { >'' : "" var r11b = c3.foo3(1, (x: T) => '', 1); // error ->r11b : any ->c3.foo3(1, (x: T) => '', 1) : any +>r11b : string +>c3.foo3(1, (x: T) => '', 1) : string >c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U >c3 : C3 >foo3 : (x: T, cb: (a: T) => U, y: U) => U @@ -266,8 +266,8 @@ module WithCandidates { >1 : 1 var r12 = c3.foo3(1, function (a) { return '' }, 1); // error ->r12 : any ->c3.foo3(1, function (a) { return '' }, 1) : any +>r12 : number +>c3.foo3(1, function (a) { return '' }, 1) : 1 >c3.foo3 : (x: T, cb: (a: T) => U, y: U) => U >c3 : C3 >foo3 : (x: T, cb: (a: T) => U, y: U) => U diff --git a/tests/baselines/reference/genericCombinators2.types b/tests/baselines/reference/genericCombinators2.types index 1d76958d23bbc..4935b2a8c403f 100644 --- a/tests/baselines/reference/genericCombinators2.types +++ b/tests/baselines/reference/genericCombinators2.types @@ -47,8 +47,8 @@ var rf1 = (x: number, y: string) => { return x.toFixed() }; >toFixed : (fractionDigits?: number) => string var r5a = _.map(c2, (x, y) => { return x.toFixed() }); ->r5a : any ->_.map(c2, (x, y) => { return x.toFixed() }) : any +>r5a : Collection +>_.map(c2, (x, y) => { return x.toFixed() }) : Collection >_.map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } @@ -62,8 +62,8 @@ var r5a = _.map(c2, (x, y) => { return x.toFixed() }); >toFixed : (fractionDigits?: number) => string var r5b = _.map(c2, rf1); ->r5b : any ->_.map(c2, rf1) : any +>r5b : Collection +>_.map(c2, rf1) : Collection >_.map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } diff --git a/tests/baselines/reference/genericConstraint1.types b/tests/baselines/reference/genericConstraint1.types index 2aedad33876ca..ae005eb07c57b 100644 --- a/tests/baselines/reference/genericConstraint1.types +++ b/tests/baselines/reference/genericConstraint1.types @@ -18,7 +18,7 @@ var x = new C(); >C : typeof C x.bar2(2, ""); ->x.bar2(2, "") : any +>x.bar2(2, "") : number >x.bar2 : (x: number, y: U) => number >x : C >bar2 : (x: number, y: U) => number diff --git a/tests/baselines/reference/genericConstraint2.types b/tests/baselines/reference/genericConstraint2.types index 2bdd415ea1bb8..2f168704deb44 100644 --- a/tests/baselines/reference/genericConstraint2.types +++ b/tests/baselines/reference/genericConstraint2.types @@ -64,8 +64,8 @@ var b = new ComparableString("b"); >"b" : "b" var c = compare(a, b); ->c : any ->compare(a, b) : any +>c : number +>compare(a, b) : number >compare : >(x: T, y: T) => number >a : ComparableString >b : ComparableString diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.types b/tests/baselines/reference/genericConstraintSatisfaction1.types index aad6f0fe72850..8c7558e1d372a 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.types +++ b/tests/baselines/reference/genericConstraintSatisfaction1.types @@ -10,7 +10,7 @@ var x: I<{s: string}> >s : string x.f({s: 1}) ->x.f({s: 1}) : any +>x.f({s: 1}) : void >x.f : (x: T) => void >x : I<{ s: string; }> >f : (x: T) => void diff --git a/tests/baselines/reference/genericDefaultsErrors.types b/tests/baselines/reference/genericDefaultsErrors.types index 51b819f9d0193..1ed3eef2d91eb 100644 --- a/tests/baselines/reference/genericDefaultsErrors.types +++ b/tests/baselines/reference/genericDefaultsErrors.types @@ -22,7 +22,7 @@ f11(); // ok >f11 : () => void f11<1>(); // error ->f11<1>() : any +>f11<1>() : void >f11 : () => void f11<1, 2>(); // ok @@ -34,7 +34,7 @@ f11<1, 2, 3>(); // ok >f11 : () => void f11<1, 2, 3, 4>(); // error ->f11<1, 2, 3, 4>() : any +>f11<1, 2, 3, 4>() : void >f11 : () => void declare function f12(a?: U): void; @@ -46,7 +46,7 @@ f12(); // ok >f12 : (a?: U) => void f12("a"); // error ->f12("a") : any +>f12("a") : void >f12 : (a?: U) => void >"a" : "a" diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types index 345ec740a86ff..e87a454ab1871 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters2.types @@ -13,7 +13,7 @@ var utils: Utils; >utils : Utils utils.fold(); // error ->utils.fold() : any +>utils.fold() : {} >utils.fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c: T[], folder?: (s: S, t: T) => T, init?: S) => T diff --git a/tests/baselines/reference/genericNewInterface.types b/tests/baselines/reference/genericNewInterface.types index ccfd13ec1b0f2..089e927923e19 100644 --- a/tests/baselines/reference/genericNewInterface.types +++ b/tests/baselines/reference/genericNewInterface.types @@ -5,7 +5,7 @@ function createInstance(ctor: new (s: string) => T): T { >s : string return new ctor(42); //should be an error ->new ctor(42) : any +>new ctor(42) : T >ctor : new (s: string) => T >42 : 42 } @@ -20,7 +20,7 @@ function createInstance2(ctor: INewable): T { >ctor : INewable return new ctor(1024); //should be an error ->new ctor(1024) : any +>new ctor(1024) : T >ctor : INewable >1024 : 1024 } diff --git a/tests/baselines/reference/genericRestArgs.types b/tests/baselines/reference/genericRestArgs.types index be5182e5d312d..6fb079cd5dedb 100644 --- a/tests/baselines/reference/genericRestArgs.types +++ b/tests/baselines/reference/genericRestArgs.types @@ -5,8 +5,8 @@ function makeArrayG(...items: T[]): T[] { return items; } >items : T[] var a1Ga = makeArrayG(1, ""); // no error ->a1Ga : any ->makeArrayG(1, "") : any +>a1Ga : number[] +>makeArrayG(1, "") : number[] >makeArrayG : (...items: T[]) => T[] >1 : 1 >"" : "" @@ -26,8 +26,8 @@ var a1Gc = makeArrayG(1, ""); >"" : "" var a1Gd = makeArrayG(1, ""); // error ->a1Gd : any ->makeArrayG(1, "") : any +>a1Gd : number[] +>makeArrayG(1, "") : number[] >makeArrayG : (...items: T[]) => T[] >1 : 1 >"" : "" @@ -45,8 +45,8 @@ function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { >item3 : T } var a2Ga = makeArrayGOpt(1, ""); ->a2Ga : any ->makeArrayGOpt(1, "") : any +>a2Ga : number[] +>makeArrayGOpt(1, "") : number[] >makeArrayGOpt : (item1?: T, item2?: T, item3?: T) => T[] >1 : 1 >"" : "" @@ -59,8 +59,8 @@ var a2Gb = makeArrayG(1, ""); >"" : "" var a2Gc = makeArrayG(1, ""); // error ->a2Gc : any ->makeArrayG(1, "") : any +>a2Gc : any[][] +>makeArrayG(1, "") : any[][] >makeArrayG : (...items: T[]) => T[] >1 : 1 >"" : "" diff --git a/tests/baselines/reference/genericRestArity.types b/tests/baselines/reference/genericRestArity.types index 74ce565c9d3d5..d3947499b7d90 100644 --- a/tests/baselines/reference/genericRestArity.types +++ b/tests/baselines/reference/genericRestArity.types @@ -12,7 +12,7 @@ declare function call( >args : TS call((x: number, y: number) => x + y); ->call((x: number, y: number) => x + y) : any +>call((x: number, y: number) => x + y) : void >call : (handler: (...args: TS) => void, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number @@ -22,7 +22,7 @@ call((x: number, y: number) => x + y); >y : number call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); ->call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : any +>call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : void >call : (handler: (...args: TS) => void, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number diff --git a/tests/baselines/reference/genericRestArityStrict.types b/tests/baselines/reference/genericRestArityStrict.types index 0bdf6d0e96dc8..d74a957605a40 100644 --- a/tests/baselines/reference/genericRestArityStrict.types +++ b/tests/baselines/reference/genericRestArityStrict.types @@ -12,7 +12,7 @@ declare function call( >args : TS call((x: number, y: number) => x + y); ->call((x: number, y: number) => x + y) : any +>call((x: number, y: number) => x + y) : void >call : (handler: (...args: TS) => void, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number @@ -22,7 +22,7 @@ call((x: number, y: number) => x + y); >y : number call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); ->call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : any +>call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : void >call : (handler: (...args: TS) => void, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number diff --git a/tests/baselines/reference/genericRestParameters3.js b/tests/baselines/reference/genericRestParameters3.js index 132edcbefb686..be75561572a16 100644 --- a/tests/baselines/reference/genericRestParameters3.js +++ b/tests/baselines/reference/genericRestParameters3.js @@ -100,7 +100,7 @@ interface CoolArray extends Array { declare function foo(cb: (...args: T) => void): void; declare function bar(...args: T): T; declare let a: [number, number]; -declare let b: any; +declare let b: CoolArray; declare function baz(...args: CoolArray): void; declare const ca: CoolArray; declare function hmm(...args: A): void; diff --git a/tests/baselines/reference/genericRestParameters3.types b/tests/baselines/reference/genericRestParameters3.types index 8d8d145a44fe0..d3eabad49a828 100644 --- a/tests/baselines/reference/genericRestParameters3.types +++ b/tests/baselines/reference/genericRestParameters3.types @@ -96,16 +96,16 @@ declare function foo(cb: (...args: T) => void): void; >args : T foo>(); // Error ->foo>() : any +>foo>() : void >foo : (cb: (...args: T) => void) => void foo>(100); // Error ->foo>(100) : any +>foo>(100) : void >foo : (cb: (...args: T) => void) => void >100 : 100 foo>(foo); // Error ->foo>(foo) : any +>foo>(foo) : void >foo : (cb: (...args: T) => void) => void >foo : (cb: (...args: T) => void) => void @@ -125,8 +125,8 @@ let a = bar(10, 20); >20 : 20 let b = bar>(10, 20); // Error ->b : any ->bar>(10, 20) : any +>b : CoolArray +>bar>(10, 20) : CoolArray >bar : (...args: T) => T >10 : 10 >20 : 20 @@ -139,22 +139,22 @@ declare const ca: CoolArray; >ca : CoolArray baz(); // Error ->baz() : any +>baz() : void >baz : (...args: CoolArray) => void baz(1); // Error ->baz(1) : any +>baz(1) : void >baz : (...args: CoolArray) => void >1 : 1 baz(1, 2); // Error ->baz(1, 2) : any +>baz(1, 2) : void >baz : (...args: CoolArray) => void >1 : 1 >2 : 2 baz(...ca); // Error ->baz(...ca) : any +>baz(...ca) : void >baz : (...args: CoolArray) => void >...ca : number >ca : CoolArray @@ -176,7 +176,7 @@ hmm(1, "s"); // okay, A = [1, "s"] >"s" : "s" hmm("what"); // no error? A = [] | [number, string] ? ->hmm("what") : any +>hmm("what") : void >hmm : (...args: A) => void >"what" : "what" diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index 76c768abea8dd..dd3ab70adac30 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -23,12 +23,12 @@ declare var _: Underscore.Static; >Underscore : any var r = _.all([true, 1, null, 'yes'], _.identity); ->r : any ->_.all([true, 1, null, 'yes'], _.identity) : any +>r : string | number | boolean +>_.all([true, 1, null, 'yes'], _.identity) : string | number | boolean >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true, 1, null, 'yes'] : (string | number | boolean)[] +>[true, 1, null, 'yes'] : (string | number | true)[] >true : true >1 : 1 >null : null diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.types b/tests/baselines/reference/genericWithOpenTypeParameters1.types index 5abde36756ee5..8530281578789 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.types +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.types @@ -19,8 +19,8 @@ x.foo(1); // no error >1 : 1 var f = (x: B) => { return x.foo(1); } // error ->f : (x: B) => any ->(x: B) => { return x.foo(1); } : (x: B) => any +>f : (x: B) => T +>(x: B) => { return x.foo(1); } : (x: B) => T >x : B >x.foo(1) : T >x.foo : (x: T) => T @@ -29,8 +29,8 @@ var f = (x: B) => { return x.foo(1); } // error >1 : 1 var f2 = (x: B) => { return x.foo(1); } // error ->f2 : (x: B) => any ->(x: B) => { return x.foo(1); } : (x: B) => any +>f2 : (x: B) => T +>(x: B) => { return x.foo(1); } : (x: B) => T >x : B >x.foo(1) : T >x.foo : (x: T) => T @@ -39,8 +39,8 @@ var f2 = (x: B) => { return x.foo(1); } // error >1 : 1 var f3 = (x: B) => { return x.foo(1); } // error ->f3 : (x: B) => any ->(x: B) => { return x.foo(1); } : (x: B) => any +>f3 : (x: B) => T +>(x: B) => { return x.foo(1); } : (x: B) => T >x : B >x.foo(1) : T >x.foo : (x: T) => T diff --git a/tests/baselines/reference/grammarAmbiguities1.errors.txt b/tests/baselines/reference/grammarAmbiguities1.errors.txt index 22467d7ee77e8..35fbf0a8ba696 100644 --- a/tests/baselines/reference/grammarAmbiguities1.errors.txt +++ b/tests/baselines/reference/grammarAmbiguities1.errors.txt @@ -1,12 +1,8 @@ tests/cases/compiler/grammarAmbiguities1.ts(8,1): error TS2554: Expected 1 arguments, but got 2. -tests/cases/compiler/grammarAmbiguities1.ts(8,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. -tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. tests/cases/compiler/grammarAmbiguities1.ts(9,1): error TS2554: Expected 1 arguments, but got 2. -tests/cases/compiler/grammarAmbiguities1.ts(9,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. -tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. -==== tests/cases/compiler/grammarAmbiguities1.ts (6 errors) ==== +==== tests/cases/compiler/grammarAmbiguities1.ts (2 errors) ==== class A { foo() { } } class B { bar() { }} function f(x) { return x; } @@ -17,15 +13,7 @@ tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' ca f(g < A, B > 7); ~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. f(g < A, B > +(7)); ~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 2. - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. - ~~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.types b/tests/baselines/reference/incompatibleTypes.types index df1f158831a15..3aa380bded154 100644 --- a/tests/baselines/reference/incompatibleTypes.types +++ b/tests/baselines/reference/incompatibleTypes.types @@ -82,7 +82,7 @@ var c2: C2; >c2 : C2 if1(c1); ->if1(c1) : any +>if1(c1) : void >if1 : { (i: IFoo1): void; (i: IFoo2): void; } >c1 : C1 @@ -107,7 +107,7 @@ function of1(a: any) { return null; } >null : null of1({ e: 0, f: 0 }); ->of1({ e: 0, f: 0 }) : any +>of1({ e: 0, f: 0 }) : number & string >of1 : { (n: { a: { a: string; }; b: string; }): number; (s: { c: { b: string; }; d: string; }): string; } >{ e: 0, f: 0 } : { e: number; f: number; } >e : number diff --git a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types index 9d1f10ebb8254..184025a07fdf7 100644 --- a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types +++ b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types @@ -27,7 +27,7 @@ interface MyObjA { } fn({ ->fn({ a: {x: 'X', y: 'Y'}, b: {},}) : any +>fn({ a: {x: 'X', y: 'Y'}, b: {},}) : string >fn : (opts: Opts) => string >{ a: {x: 'X', y: 'Y'}, b: {},} : { a: { x: string; y: string; }; b: {}; } diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt index f93bfc6ce40d2..63434f118bc33 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ b/tests/baselines/reference/indexSignatureTypeInference.errors.txt @@ -1,8 +1,9 @@ +tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type '{}[]'. tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts(18,27): error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. Index signature is missing in type 'NumberMap'. -==== tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts (1 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureTypeInference.ts (2 errors) ==== interface NumberMap { [index: number]: T; } @@ -21,6 +22,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/indexSignatureType var v1 = numberMapToArray(numberMap); // Ok var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v1' must be of type 'Function[]', but here has type '{}[]'. ~~~~~~~~~ !!! error TS2345: Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. !!! error TS2345: Index signature is missing in type 'NumberMap'. diff --git a/tests/baselines/reference/indexSignatureTypeInference.types b/tests/baselines/reference/indexSignatureTypeInference.types index b29a1d002dd1f..16076b23474db 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.types +++ b/tests/baselines/reference/indexSignatureTypeInference.types @@ -40,7 +40,7 @@ var v1 = numberMapToArray(stringMap); // Ok var v1 = stringMapToArray(numberMap); // Error expected here >v1 : Function[] ->stringMapToArray(numberMap) : any +>stringMapToArray(numberMap) : {}[] >stringMapToArray : (object: StringMap) => T[] >numberMap : NumberMap diff --git a/tests/baselines/reference/indexedAccessRelation.types b/tests/baselines/reference/indexedAccessRelation.types index 180cff338ccc9..6d2ee19dda240 100644 --- a/tests/baselines/reference/indexedAccessRelation.types +++ b/tests/baselines/reference/indexedAccessRelation.types @@ -26,7 +26,7 @@ class Comp extends Component> >a : T this.setState({ a: a }); ->this.setState({ a: a }) : any +>this.setState({ a: a }) : void >this.setState : (state: Pick, K>) => void >this : this >setState : (state: Pick, K>) => void diff --git a/tests/baselines/reference/inferenceShouldFailOnEvolvingArrays.types b/tests/baselines/reference/inferenceShouldFailOnEvolvingArrays.types index 2d7876aefe986..1d40e6b5a820f 100644 --- a/tests/baselines/reference/inferenceShouldFailOnEvolvingArrays.types +++ b/tests/baselines/reference/inferenceShouldFailOnEvolvingArrays.types @@ -18,7 +18,7 @@ function logLength(arg: { [K in U]: T }[U]): >arg : { [K in U]: T; }[U] } logLength(42); // error ->logLength(42) : any +>logLength(42) : string >logLength : (arg: { [K in U]: T; }[U]) => T >42 : 42 @@ -26,9 +26,9 @@ let z; >z : any z = logLength(42); // no error; T is inferred as `any` ->z = logLength(42) : any +>z = logLength(42) : string >z : any ->logLength(42) : any +>logLength(42) : string >logLength : (arg: { [K in U]: T; }[U]) => T >42 : 42 @@ -51,7 +51,7 @@ function logFirstLength(arg: { [K in U]: T >arg : { [K in U]: T; }[U] } logFirstLength([42]); // error ->logFirstLength([42]) : any +>logFirstLength([42]) : string[] >logFirstLength : (arg: { [K in U]: T; }[U]) => T >[42] : number[] >42 : 42 @@ -65,14 +65,14 @@ zz.push(logLength(42)); // no error; T is inferred as `any` >zz.push : (...items: any[]) => number >zz : any[] >push : (...items: any[]) => number ->logLength(42) : any +>logLength(42) : string >logLength : (arg: { [K in U]: T; }[U]) => T >42 : 42 zz = logFirstLength([42]); // no error; T is inferred as `any[]` ->zz = logFirstLength([42]) : any +>zz = logFirstLength([42]) : string[] >zz : any[] ->logFirstLength([42]) : any +>logFirstLength([42]) : string[] >logFirstLength : (arg: { [K in U]: T; }[U]) => T >[42] : number[] >42 : 42 diff --git a/tests/baselines/reference/infiniteConstraints.types b/tests/baselines/reference/infiniteConstraints.types index e23e138c820d6..1477f5fe09a85 100644 --- a/tests/baselines/reference/infiniteConstraints.types +++ b/tests/baselines/reference/infiniteConstraints.types @@ -74,8 +74,8 @@ const shouldBeNoError = ensureNoDuplicates({main: value("test")}); >"test" : "test" const shouldBeError = ensureNoDuplicates({main: value("dup"), alternate: value("dup")}); ->shouldBeError : any ->ensureNoDuplicates({main: value("dup"), alternate: value("dup")}) : any +>shouldBeError : void +>ensureNoDuplicates({main: value("dup"), alternate: value("dup")}) : void >ensureNoDuplicates : >["val"] extends Extract], Record<"val", string>>["val"] ? never : any; }>(vals: T) => void >{main: value("dup"), alternate: value("dup")} : { main: Record<"val", "dup">; alternate: Record<"val", "dup">; } >main : Record<"val", "dup"> diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.types b/tests/baselines/reference/inheritedConstructorWithRestParams.types index 8089742b7a58b..62b76f7927382 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.types +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.types @@ -28,13 +28,13 @@ new Derived(); // Errors new Derived("", 3); ->new Derived("", 3) : any +>new Derived("", 3) : Derived >Derived : typeof Derived >"" : "" >3 : 3 new Derived(3); ->new Derived(3) : any +>new Derived(3) : Derived >Derived : typeof Derived >3 : 3 diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.types b/tests/baselines/reference/inheritedConstructorWithRestParams2.types index 511114298c69b..006bb8b306c10 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.types +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.types @@ -95,12 +95,12 @@ new Derived("", "", 3, 3); // Errors new Derived(3); ->new Derived(3) : any +>new Derived(3) : Derived >Derived : typeof Derived >3 : 3 new Derived("", 3, "", 3); ->new Derived("", 3, "", 3) : any +>new Derived("", 3, "", 3) : Derived >Derived : typeof Derived >"" : "" >3 : 3 @@ -108,7 +108,7 @@ new Derived("", 3, "", 3); >3 : 3 new Derived("", 3, "", ""); ->new Derived("", 3, "", "") : any +>new Derived("", 3, "", "") : Derived >Derived : typeof Derived >"" : "" >3 : 3 diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt index e61cef4c822a8..b8a1a4adbdca2 100644 --- a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt +++ b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt @@ -1,4 +1,6 @@ tests/cases/conformance/jsx/inline/index.tsx(5,1): error TS2741: Property '__predomBrand' is missing in type 'Element' but required in type 'Element'. +tests/cases/conformance/jsx/inline/index.tsx(21,21): error TS2605: JSX element type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element' is not a constructor function for JSX elements. + Property '__domBrand' is missing in type 'Element' but required in type 'Element'. tests/cases/conformance/jsx/inline/index.tsx(21,22): error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. Types of property 'children' are incompatible. Type 'import("tests/cases/conformance/jsx/inline/renderer").dom.JSX.Element[]' is not assignable to type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element[]'. @@ -9,7 +11,7 @@ tests/cases/conformance/jsx/inline/index.tsx(21,63): error TS2605: JSX element t tests/cases/conformance/jsx/inline/index.tsx(24,23): error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. Types of property 'children' are incompatible. Type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element[]' is not assignable to type 'import("tests/cases/conformance/jsx/inline/renderer").dom.JSX.Element[]'. - Property '__domBrand' is missing in type 'Element' but required in type 'Element'. + Type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element' is not assignable to type 'import("tests/cases/conformance/jsx/inline/renderer").dom.JSX.Element'. ==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ==== @@ -72,7 +74,7 @@ tests/cases/conformance/jsx/inline/index.tsx(24,23): error TS2322: Type '{ child export default -==== tests/cases/conformance/jsx/inline/index.tsx (5 errors) ==== +==== tests/cases/conformance/jsx/inline/index.tsx (6 errors) ==== /** @jsx dom */ import { dom } from "./renderer" import prerendered, {MySFC, MyClass, tree} from "./component"; @@ -97,6 +99,10 @@ tests/cases/conformance/jsx/inline/index.tsx(24,23): error TS2322: Type '{ child // Should fail, no dom elements const _brokenTree = + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element' is not a constructor function for JSX elements. +!!! error TS2605: Property '__domBrand' is missing in type 'Element' but required in type 'Element'. +!!! related TS2728 tests/cases/conformance/jsx/inline/renderer.d.ts:7:13: '__domBrand' is declared here. ~~~~~ !!! error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. !!! error TS2322: Types of property 'children' are incompatible. @@ -115,6 +121,5 @@ tests/cases/conformance/jsx/inline/index.tsx(24,23): error TS2322: Type '{ child !!! error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element[]' is not assignable to type 'import("tests/cases/conformance/jsx/inline/renderer").dom.JSX.Element[]'. -!!! error TS2322: Property '__domBrand' is missing in type 'Element' but required in type 'Element'. -!!! related TS2728 tests/cases/conformance/jsx/inline/renderer.d.ts:7:13: '__domBrand' is declared here. +!!! error TS2322: Type 'import("tests/cases/conformance/jsx/inline/renderer2").predom.JSX.Element' is not assignable to type 'import("tests/cases/conformance/jsx/inline/renderer").dom.JSX.Element'. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.types b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.types index ecf0704d0158c..1130c4f0b2d49 100644 --- a/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.types +++ b/tests/baselines/reference/instantiateGenericClassWithWrongNumberOfTypeArguments.types @@ -10,8 +10,8 @@ class C { } var c = new C(); ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C class D { @@ -26,7 +26,7 @@ class D { // BUG 794238 var d = new D(); ->d : any ->new D() : any +>d : D +>new D() : D >D : typeof D diff --git a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.types b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.types index 451cd75380fc0..cbcdceb660051 100644 --- a/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.types +++ b/tests/baselines/reference/instantiateNonGenericTypeWithTypeArguments.types @@ -10,8 +10,8 @@ class C { } var c = new C(); ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C function Foo(): void { } diff --git a/tests/baselines/reference/interfaceAssignmentCompat.types b/tests/baselines/reference/interfaceAssignmentCompat.types index 31d667048b918..b1135f1d27ae3 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.types +++ b/tests/baselines/reference/interfaceAssignmentCompat.types @@ -100,7 +100,7 @@ module M { >Green : Color.Green x=x.sort(CompareYeux); // parameter mismatch ->x=x.sort(CompareYeux) : any +>x=x.sort(CompareYeux) : IEye[] >x : IEye[] >x.sort(CompareYeux) : IEye[] >x.sort : (compareFn?: (a: IEye, b: IEye) => number) => IEye[] diff --git a/tests/baselines/reference/invariantGenericErrorElaboration.types b/tests/baselines/reference/invariantGenericErrorElaboration.types index 7c4bdd46d037f..e13a70f81e0ed 100644 --- a/tests/baselines/reference/invariantGenericErrorElaboration.types +++ b/tests/baselines/reference/invariantGenericErrorElaboration.types @@ -6,8 +6,8 @@ const wat: Runtype = Num; >Num : Num const Foo = Obj({ foo: Num }) ->Foo : any ->Obj({ foo: Num }) : any +>Foo : Obj<{ [_: string]: Runtype; }> +>Obj({ foo: Num }) : Obj<{ [_: string]: Runtype; }> >Obj : ; }>(fields: O) => Obj >{ foo: Num } : { foo: Num; } >foo : Num diff --git a/tests/baselines/reference/iterableArrayPattern28.types b/tests/baselines/reference/iterableArrayPattern28.types index 97b1f809b01e4..063bf10e0db6c 100644 --- a/tests/baselines/reference/iterableArrayPattern28.types +++ b/tests/baselines/reference/iterableArrayPattern28.types @@ -9,14 +9,14 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); >takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])) : void >takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void ->...new Map([["", 0], ["hello", true]]) : any ->new Map([["", 0], ["hello", true]]) : any +>...new Map([["", 0], ["hello", true]]) : [string, number] +>new Map([["", 0], ["hello", true]]) : Map >Map : MapConstructor ->[["", 0], ["hello", true]] : ((string | number)[] | (string | boolean)[])[] ->["", 0] : (string | number)[] +>[["", 0], ["hello", true]] : ([string, number] | [string, boolean])[] +>["", 0] : [string, number] >"" : "" >0 : 0 ->["hello", true] : (string | boolean)[] +>["hello", true] : [string, boolean] >"hello" : "hello" >true : true diff --git a/tests/baselines/reference/iteratorSpreadInArray6.types b/tests/baselines/reference/iteratorSpreadInArray6.types index b964fdbca1304..60d3401b1a781 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.types +++ b/tests/baselines/reference/iteratorSpreadInArray6.types @@ -38,7 +38,7 @@ var array: number[] = [0, 1]; >1 : 1 array.concat([...new SymbolIterator]); ->array.concat([...new SymbolIterator]) : any +>array.concat([...new SymbolIterator]) : number[] >array.concat : { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; } >array : number[] >concat : { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; } diff --git a/tests/baselines/reference/iteratorSpreadInCall10.types b/tests/baselines/reference/iteratorSpreadInCall10.types index 9ff1f78dccfff..2d1ab0a500502 100644 --- a/tests/baselines/reference/iteratorSpreadInCall10.types +++ b/tests/baselines/reference/iteratorSpreadInCall10.types @@ -39,7 +39,7 @@ class SymbolIterator { } foo(...new SymbolIterator); ->foo(...new SymbolIterator) : any +>foo(...new SymbolIterator) : {} >foo : (s: T[]) => T >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall7.types b/tests/baselines/reference/iteratorSpreadInCall7.types index 2f6f0ff06dbc8..39ced32883e9c 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.types +++ b/tests/baselines/reference/iteratorSpreadInCall7.types @@ -70,7 +70,7 @@ class StringIterator { } foo(...new SymbolIterator, ...new StringIterator); ->foo(...new SymbolIterator, ...new StringIterator) : any +>foo(...new SymbolIterator, ...new StringIterator) : symbol >foo : (...s: T[]) => T >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall8.types b/tests/baselines/reference/iteratorSpreadInCall8.types index 58f3ea70809ee..2d5f16c9c3df9 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.types +++ b/tests/baselines/reference/iteratorSpreadInCall8.types @@ -70,7 +70,7 @@ class StringIterator { } new Foo(...new SymbolIterator, ...new StringIterator); ->new Foo(...new SymbolIterator, ...new StringIterator) : any +>new Foo(...new SymbolIterator, ...new StringIterator) : Foo >Foo : typeof Foo >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/iteratorSpreadInCall9.types b/tests/baselines/reference/iteratorSpreadInCall9.types index 1118a394bc4e8..f53ef79ed5397 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.types +++ b/tests/baselines/reference/iteratorSpreadInCall9.types @@ -70,7 +70,7 @@ class StringIterator { } new Foo(...new SymbolIterator, ...[...new StringIterator]); ->new Foo(...new SymbolIterator, ...[...new StringIterator]) : any +>new Foo(...new SymbolIterator, ...[...new StringIterator]) : Foo >Foo : typeof Foo >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/jsdocDisallowedInTypescript.types b/tests/baselines/reference/jsdocDisallowedInTypescript.types index f16e3d3c9f19d..76e595d8127ba 100644 --- a/tests/baselines/reference/jsdocDisallowedInTypescript.types +++ b/tests/baselines/reference/jsdocDisallowedInTypescript.types @@ -35,7 +35,7 @@ function hof(ctor: function(new: number, string)) { >'hi' : "hi" } function hof2(f: function(this: number, string): string) { ->hof2 : (f: (this: number, arg1: string) => string) => any +>hof2 : (f: (this: number, arg1: string) => string) => string >f : (this: number, arg1: string) => string >this : number diff --git a/tests/baselines/reference/jsdocTemplateTag3.types b/tests/baselines/reference/jsdocTemplateTag3.types index e26b847519e2b..631b65703b115 100644 --- a/tests/baselines/reference/jsdocTemplateTag3.types +++ b/tests/baselines/reference/jsdocTemplateTag3.types @@ -73,7 +73,7 @@ f({ a: 12, b: 'hi', c: null }, undefined, { c: false, d: 12, b: undefined }, 101 >'nope' : "nope" f({ a: 12 }, undefined, undefined, 101, 'nope'); ->f({ a: 12 }, undefined, undefined, 101, 'nope') : any +>f({ a: 12 }, undefined, undefined, 101, 'nope') : string | number >f : (t: T, u: U, v: V, w: W, x: X) => W | X >{ a: 12 } : { a: number; } >a : number diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.types b/tests/baselines/reference/jsxChildrenGenericContextualTypes.types index a43611dafc3ed..9287a8a02deed 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.types +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.types @@ -116,7 +116,7 @@ const arg = "y"} /> >arg : JSX.Element > "y"} /> : JSX.Element >ElemLit : (p: LitProps) => JSX.Element ->prop : string +>prop : "x" >children : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y" >p => "y" : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y" >p : JSX.IntrinsicAttributes & LitProps<"x"> @@ -126,7 +126,7 @@ const argchild = {p => "y"} >argchild : JSX.Element >{p => "y"} : JSX.Element >ElemLit : (p: LitProps) => JSX.Element ->prop : string +>prop : "x" >p => "y" : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y" >p : JSX.IntrinsicAttributes & LitProps<"x"> >"y" : "y" @@ -136,7 +136,7 @@ const mismatched = {() => 12} >mismatched : JSX.Element >{() => 12} : JSX.Element >ElemLit : (p: LitProps) => JSX.Element ->prop : string +>prop : "x" >() => 12 : () => number >12 : 12 >ElemLit : (p: LitProps) => JSX.Element diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index cbf56e6f67107..a49e97944bb67 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -162,15 +162,15 @@ function f10(shape: Shape) { >"name" : "name" let x2 = getProperty(shape, "size"); // Error ->x2 : any ->getProperty(shape, "size") : any +>x2 : string | number | boolean +>getProperty(shape, "size") : string | number | boolean >getProperty : (obj: T, key: K) => T[K] >shape : Shape >"size" : "size" let x3 = getProperty(shape, cond ? "name" : "size"); // Error ->x3 : any ->getProperty(shape, cond ? "name" : "size") : any +>x3 : string | number | boolean +>getProperty(shape, cond ? "name" : "size") : string | number | boolean >getProperty : (obj: T, key: K) => T[K] >shape : Shape >cond ? "name" : "size" : "name" | "size" @@ -186,14 +186,14 @@ function f10(shape: Shape) { >"rectangle" : "rectangle" setProperty(shape, "size", 10); // Error ->setProperty(shape, "size", 10) : any +>setProperty(shape, "size", 10) : void >setProperty : (obj: T, key: K, value: T[K]) => void >shape : Shape >"size" : "size" >10 : 10 setProperty(shape, cond ? "name" : "size", 10); // Error ->setProperty(shape, cond ? "name" : "size", 10) : any +>setProperty(shape, cond ? "name" : "size", 10) : void >setProperty : (obj: T, key: K, value: T[K]) => void >shape : Shape >cond ? "name" : "size" : "name" | "size" diff --git a/tests/baselines/reference/keyofDoesntContainSymbols.types b/tests/baselines/reference/keyofDoesntContainSymbols.types index ce1ffc9fda9ba..6f412a9e49140 100644 --- a/tests/baselines/reference/keyofDoesntContainSymbols.types +++ b/tests/baselines/reference/keyofDoesntContainSymbols.types @@ -47,8 +47,8 @@ const val = set(obj, 'str', ''); // string const valB = set(obj, 'num', ''); ->valB : any ->set(obj, 'num', '') : any +>valB : number +>set(obj, 'num', '') : number >set : (obj: T, key: K, value: T[K]) => T[K] >obj : { num: number; str: string; [num]: 0; [sym]: symbol; } >'num' : "num" @@ -57,8 +57,8 @@ const valB = set(obj, 'num', ''); // Expect type error // Argument of type '""' is not assignable to parameter of type 'number'. const valC = set(obj, sym, sym); ->valC : any ->set(obj, sym, sym) : any +>valC : string | number +>set(obj, sym, sym) : string | number >set : (obj: T, key: K, value: T[K]) => T[K] >obj : { num: number; str: string; [num]: 0; [sym]: symbol; } >sym : unique symbol @@ -67,8 +67,8 @@ const valC = set(obj, sym, sym); // Expect type error // Argument of type 'unique symbol' is not assignable to parameter of type "str" | "num" const valD = set(obj, num, num); ->valD : any ->set(obj, num, num) : any +>valD : string | number +>set(obj, num, num) : string | number >set : (obj: T, key: K, value: T[K]) => T[K] >obj : { num: number; str: string; [num]: 0; [sym]: symbol; } >num : 0 diff --git a/tests/baselines/reference/literalTypeNameAssertionNotTriggered.types b/tests/baselines/reference/literalTypeNameAssertionNotTriggered.types index 91854449abc5c..25730fe99b951 100644 --- a/tests/baselines/reference/literalTypeNameAssertionNotTriggered.types +++ b/tests/baselines/reference/literalTypeNameAssertionNotTriggered.types @@ -8,7 +8,7 @@ declare function f(obj: T, key: keyof T): void; >key : keyof T f(a, ""); ->f(a, "") : any +>f(a, "") : void >f : (obj: T, key: keyof T) => void >a : typeof a >"" : "" diff --git a/tests/baselines/reference/mappedTypeErrors.types b/tests/baselines/reference/mappedTypeErrors.types index cfa0df3cd586e..f8468ca0aad69 100644 --- a/tests/baselines/reference/mappedTypeErrors.types +++ b/tests/baselines/reference/mappedTypeErrors.types @@ -153,8 +153,8 @@ function f20() { >f20 : () => void let x1 = objAndReadonly({ x: 0, y: 0 }, { x: 1 }); // Error ->x1 : any ->objAndReadonly({ x: 0, y: 0 }, { x: 1 }) : any +>x1 : { x: number; y: number; } +>objAndReadonly({ x: 0, y: 0 }, { x: 1 }) : { x: number; y: number; } >objAndReadonly : (primary: T, secondary: Readonly) => T >{ x: 0, y: 0 } : { x: number; y: number; } >x : number @@ -181,8 +181,8 @@ function f20() { >1 : 1 let x3 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ->x3 : any ->objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }) : any +>x3 : { x: number; y: number; } +>objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }) : { x: number; y: number; } >objAndReadonly : (primary: T, secondary: Readonly) => T >{ x: 0, y: 0 } : { x: number; y: number; } >x : number @@ -230,8 +230,8 @@ function f21() { >1 : 1 let x3 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ->x3 : any ->objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }) : any +>x3 : { x: number; y: number; } +>objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }) : { x: number; y: number; } >objAndPartial : (primary: T, secondary: Partial) => T >{ x: 0, y: 0 } : { x: number; y: number; } >x : number @@ -324,7 +324,7 @@ setState(foo, foo); >foo : Foo setState(foo, { a: undefined }); // Error ->setState(foo, { a: undefined }) : any +>setState(foo, { a: undefined }) : void >setState : (obj: T, props: Pick) => void >foo : Foo >{ a: undefined } : { a: undefined; } @@ -332,7 +332,7 @@ setState(foo, { a: undefined }); // Error >undefined : undefined setState(foo, { c: true }); // Error ->setState(foo, { c: true }) : any +>setState(foo, { c: true }) : void >setState : (obj: T, props: Pick) => void >foo : Foo >{ c: true } : { c: boolean; } @@ -416,7 +416,7 @@ c.setState(foo); >foo : Foo c.setState({ a: undefined }); // Error ->c.setState({ a: undefined }) : any +>c.setState({ a: undefined }) : void >c.setState : (props: Pick) => void >c : C >setState : (props: Pick) => void @@ -425,7 +425,7 @@ c.setState({ a: undefined }); // Error >undefined : undefined c.setState({ c: true }); // Error ->c.setState({ c: true }) : any +>c.setState({ c: true }) : void >c.setState : (props: Pick) => void >c : C >setState : (props: Pick) => void diff --git a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt index 41edb0f692407..d028d8b0c99f1 100644 --- a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt @@ -1,7 +1,8 @@ +tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(13,26): error TS2339: Property 'bar' does not exist on type '{ x: number; y: number; }'. tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(16,9): error TS2322: Type 'number' is not assignable to type '() => {}'. -==== tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts (1 errors) ==== +==== tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts (2 errors) ==== // Repro from #19316 type ComputedOf = { @@ -15,6 +16,8 @@ tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(16,9): error T computed: { bar(): number { let z = this.bar; + ~~~ +!!! error TS2339: Property 'bar' does not exist on type '{ x: number; y: number; }'. return 42; }, baz: 42 diff --git a/tests/baselines/reference/mappedTypeInferenceErrors.symbols b/tests/baselines/reference/mappedTypeInferenceErrors.symbols index 577ddd443837b..371a84fc683a1 100644 --- a/tests/baselines/reference/mappedTypeInferenceErrors.symbols +++ b/tests/baselines/reference/mappedTypeInferenceErrors.symbols @@ -42,9 +42,7 @@ foo({ let z = this.bar; >z : Symbol(z, Decl(mappedTypeInferenceErrors.ts, 12, 15)) ->this.bar : Symbol(bar, Decl(mappedTypeInferenceErrors.ts, 10, 15)) ->this : Symbol(__object, Decl(mappedTypeInferenceErrors.ts, 10, 13)) ->bar : Symbol(bar, Decl(mappedTypeInferenceErrors.ts, 10, 15)) +>this : Symbol(__object, Decl(mappedTypeInferenceErrors.ts, 9, 10)) return 42; }, diff --git a/tests/baselines/reference/mappedTypeInferenceErrors.types b/tests/baselines/reference/mappedTypeInferenceErrors.types index b6a0c3a8f2598..a911214af10ef 100644 --- a/tests/baselines/reference/mappedTypeInferenceErrors.types +++ b/tests/baselines/reference/mappedTypeInferenceErrors.types @@ -14,7 +14,7 @@ declare function foo(options: { props: P, computed: ComputedOf } & This >computed : ComputedOf foo({ ->foo({ props: { x: 10, y: 20 }, computed: { bar(): number { let z = this.bar; return 42; }, baz: 42 }}) : any +>foo({ props: { x: 10, y: 20 }, computed: { bar(): number { let z = this.bar; return 42; }, baz: 42 }}) : void >foo : (options: { props: P; computed: ComputedOf; } & ThisType

) => void >{ props: { x: 10, y: 20 }, computed: { bar(): number { let z = this.bar; return 42; }, baz: 42 }} : { props: { x: number; y: number; }; computed: { bar(): number; baz: number; }; } @@ -34,10 +34,10 @@ foo({ >bar : () => number let z = this.bar; ->z : () => number ->this.bar : () => number ->this : { bar(): number; baz: number; } ->bar : () => number +>z : any +>this.bar : any +>this : { x: number; y: number; } +>bar : any return 42; >42 : 42 diff --git a/tests/baselines/reference/maxConstraints.types b/tests/baselines/reference/maxConstraints.types index 3b46c115eec23..ad71dc20d5e89 100644 --- a/tests/baselines/reference/maxConstraints.types +++ b/tests/baselines/reference/maxConstraints.types @@ -27,8 +27,8 @@ var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; >y : T var maxResult = max2(1, 2); ->maxResult : any ->max2(1, 2) : any +>maxResult : Comparable<1 | 2> +>max2(1, 2) : Comparable<1 | 2> >max2 : Comparer >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.symbols b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.symbols index ff8312a0e716b..76e53d7485959 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.symbols +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.symbols @@ -57,13 +57,17 @@ var r7 = map([1, ""], (x) => x.toString()); // error >r7 : Symbol(r7, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 9, 3)) >map : Symbol(map, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 0, 0)) >x : Symbol(x, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 9, 39)) +>x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 9, 39)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var r7b = map([1, ""], (x) => x.toString()); // error >r7b : Symbol(r7b, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 10, 3)) >map : Symbol(map, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 0, 0)) >x : Symbol(x, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 10, 32)) +>x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 10, 32)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var r8 = map([1, ""], (x) => x.toString()); >r8 : Symbol(r8, Decl(mismatchedExplicitTypeParameterAndArgumentType.ts, 11, 3)) diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types index 1278c61d6951c..981f3db1d3489 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types @@ -71,32 +71,32 @@ var r6 = map([1, ""], (x) => x.toString()); >toString : () => string var r7 = map([1, ""], (x) => x.toString()); // error ->r7 : any ->map([1, ""], (x) => x.toString()) : any +>r7 : string[] +>map([1, ""], (x) => x.toString()) : string[] >map : (xs: T[], f: (x: T) => U) => U[] >[1, ""] : (string | number)[] >1 : 1 >"" : "" ->(x) => x.toString() : (x: any) => any ->x : any ->x.toString() : any ->x.toString : any ->x : any ->toString : any +>(x) => x.toString() : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string var r7b = map([1, ""], (x) => x.toString()); // error ->r7b : any ->map([1, ""], (x) => x.toString()) : any +>r7b : {}[] +>map([1, ""], (x) => x.toString()) : {}[] >map : (xs: T[], f: (x: T) => U) => U[] >[1, ""] : (string | number)[] >1 : 1 >"" : "" ->(x) => x.toString() : (x: any) => any ->x : any ->x.toString() : any ->x.toString : any ->x : any ->toString : any +>(x) => x.toString() : (x: number) => string +>x : number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string var r8 = map([1, ""], (x) => x.toString()); >r8 : string[] diff --git a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.types b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.types index adf17b70d099a..24182276bb3e3 100644 --- a/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.types +++ b/tests/baselines/reference/narrowingGenericTypeFromInstanceof01.types @@ -28,7 +28,7 @@ function test(x: A | B) { >B : typeof B acceptA(x); ->acceptA(x) : any +>acceptA(x) : void >acceptA : (a: A) => void >x : B } diff --git a/tests/baselines/reference/newMap.types b/tests/baselines/reference/newMap.types index d3fab45ccc0fd..fddf0cb56ccf4 100644 --- a/tests/baselines/reference/newMap.types +++ b/tests/baselines/reference/newMap.types @@ -1,5 +1,5 @@ === tests/cases/compiler/newMap.ts === new Map(); ->new Map() : any +>new Map() : Map >Map : MapConstructor diff --git a/tests/baselines/reference/noErrorsInCallback.types b/tests/baselines/reference/noErrorsInCallback.types index 8e25379209327..b31417da11bd5 100644 --- a/tests/baselines/reference/noErrorsInCallback.types +++ b/tests/baselines/reference/noErrorsInCallback.types @@ -6,8 +6,8 @@ class Bar { >foo : string } var one = new Bar({}); // Error ->one : any ->new Bar({}) : any +>one : Bar +>new Bar({}) : Bar >Bar : typeof Bar >{} : {} @@ -19,8 +19,8 @@ var one = new Bar({}); // Error >() => { var two = new Bar({}); // No error?} : () => void var two = new Bar({}); // No error? ->two : any ->new Bar({}) : any +>two : Bar +>new Bar({}) : Bar >Bar : typeof Bar >{} : {} diff --git a/tests/baselines/reference/nonPrimitiveInGeneric.types b/tests/baselines/reference/nonPrimitiveInGeneric.types index a57c41abde286..f46f0e0e7ef02 100644 --- a/tests/baselines/reference/nonPrimitiveInGeneric.types +++ b/tests/baselines/reference/nonPrimitiveInGeneric.types @@ -26,12 +26,12 @@ generic(a); >a : {} generic(123); // expect error ->generic(123) : any +>generic(123) : void >generic : (t: T) => void >123 : 123 generic(b); // expect error ->generic(b) : any +>generic(b) : void >generic : (t: T) => void >b : string @@ -55,12 +55,12 @@ bound(a); >a : {} bound(123); // expect error ->bound(123) : any +>bound(123) : void >bound : (t: T) => void >123 : 123 bound(b); // expect error ->bound(b) : any +>bound(b) : void >bound : (t: T) => void >b : string @@ -76,11 +76,11 @@ bound2(); >bound2 : () => void bound2(); // expect error ->bound2() : any +>bound2() : void >bound2 : () => void bound2(); // expect error ->bound2() : any +>bound2() : void >bound2 : () => void function bound3(t: T) { diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.types b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.types index 910c28d9e93b2..842bfdabb7bff 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.types +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.types @@ -7,9 +7,9 @@ class A { } } function foo(x = new A(123)) { //should error, 123 is not string ->foo : (x?: any) => void ->x : any ->new A(123) : any +>foo : (x?: A) => void +>x : A +>new A(123) : A >A : typeof A >123 : 123 diff --git a/tests/baselines/reference/optionalBindingParameters1.types b/tests/baselines/reference/optionalBindingParameters1.types index 74b255325132e..6bbd8669a32db 100644 --- a/tests/baselines/reference/optionalBindingParameters1.types +++ b/tests/baselines/reference/optionalBindingParameters1.types @@ -18,7 +18,7 @@ foo(["", 0, false]); foo([false, 0, ""]); >foo([false, 0, ""]) : void >foo : ([x, y, z]?: [string, number, boolean]) => void ->[false, 0, ""] : (string | number | boolean)[] +>[false, 0, ""] : [boolean, number, string] >false : false >0 : 0 >"" : "" diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.types b/tests/baselines/reference/optionalBindingParametersInOverloads1.types index 01d1756a6ac7e..04905ae8ca820 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.types +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.types @@ -22,7 +22,7 @@ foo(["", 0, false]); foo([false, 0, ""]); >foo([false, 0, ""]) : any >foo : ([x, y, z]?: [string, number, boolean]) => any ->[false, 0, ""] : (string | number | boolean)[] +>[false, 0, ""] : [boolean, number, string] >false : false >0 : 0 >"" : "" diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.symbols b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.symbols index f7187b81d6798..de6bc84dbf7cd 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.symbols +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.symbols @@ -44,9 +44,11 @@ var v: B; >B : Symbol(B, Decl(orderMattersForSignatureGroupIdentity.ts, 3, 1)) v({ s: "", n: 0 }).toLowerCase(); +>v({ s: "", n: 0 }).toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) >v : Symbol(v, Decl(orderMattersForSignatureGroupIdentity.ts, 15, 3), Decl(orderMattersForSignatureGroupIdentity.ts, 16, 3)) >s : Symbol(s, Decl(orderMattersForSignatureGroupIdentity.ts, 18, 3)) >n : Symbol(n, Decl(orderMattersForSignatureGroupIdentity.ts, 18, 10)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) var w: A; >w : Symbol(w, Decl(orderMattersForSignatureGroupIdentity.ts, 20, 3), Decl(orderMattersForSignatureGroupIdentity.ts, 21, 3)) @@ -57,7 +59,9 @@ var w: C; >C : Symbol(C, Decl(orderMattersForSignatureGroupIdentity.ts, 8, 1)) w({ s: "", n: 0 }).toLowerCase(); +>w({ s: "", n: 0 }).toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) >w : Symbol(w, Decl(orderMattersForSignatureGroupIdentity.ts, 20, 3), Decl(orderMattersForSignatureGroupIdentity.ts, 21, 3)) >s : Symbol(s, Decl(orderMattersForSignatureGroupIdentity.ts, 23, 3)) >n : Symbol(n, Decl(orderMattersForSignatureGroupIdentity.ts, 23, 10)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.types b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.types index 0ab7ac3eab284..05f675d8ab1f6 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.types +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.types @@ -36,16 +36,16 @@ var v: B; >v : A v({ s: "", n: 0 }).toLowerCase(); ->v({ s: "", n: 0 }).toLowerCase() : any ->v({ s: "", n: 0 }).toLowerCase : any ->v({ s: "", n: 0 }) : any +>v({ s: "", n: 0 }).toLowerCase() : string +>v({ s: "", n: 0 }).toLowerCase : () => string +>v({ s: "", n: 0 }) : string & number >v : A >{ s: "", n: 0 } : { s: string; n: number; } >s : string >"" : "" >n : number >0 : 0 ->toLowerCase : any +>toLowerCase : () => string var w: A; >w : A @@ -54,14 +54,14 @@ var w: C; >w : A w({ s: "", n: 0 }).toLowerCase(); ->w({ s: "", n: 0 }).toLowerCase() : any ->w({ s: "", n: 0 }).toLowerCase : any ->w({ s: "", n: 0 }) : any +>w({ s: "", n: 0 }).toLowerCase() : string +>w({ s: "", n: 0 }).toLowerCase : () => string +>w({ s: "", n: 0 }) : string & number >w : A >{ s: "", n: 0 } : { s: string; n: number; } >s : string >"" : "" >n : number >0 : 0 ->toLowerCase : any +>toLowerCase : () => string diff --git a/tests/baselines/reference/overload1.types b/tests/baselines/reference/overload1.types index 0641529e632d0..0220ec1ddb43d 100644 --- a/tests/baselines/reference/overload1.types +++ b/tests/baselines/reference/overload1.types @@ -102,9 +102,9 @@ var z:string=x.g(x.g(3,3)); // good >3 : 3 z=x.g(2,2,2); // no match ->z=x.g(2,2,2) : any +>z=x.g(2,2,2) : number & string & O.C >z : string ->x.g(2,2,2) : any +>x.g(2,2,2) : number & string & O.C >x.g : { (n1: number, n2: number): number; (n: number): string; (a: O.A): O.C; (c: O.C): string; } >x : O.I >g : { (n1: number, n2: number): number; (n: number): string; (a: O.A): O.C; (c: O.C): string; } @@ -113,9 +113,9 @@ z=x.g(2,2,2); // no match >2 : 2 z=x.g(); // no match ->z=x.g() : any +>z=x.g() : number & string & O.C >z : string ->x.g() : any +>x.g() : number & string & O.C >x.g : { (n1: number, n2: number): number; (n: number): string; (a: O.A): O.C; (c: O.C): string; } >x : O.I >g : { (n1: number, n2: number): number; (n: number): string; (a: O.A): O.C; (c: O.C): string; } @@ -133,9 +133,9 @@ z=x.g(new O.B()); // ambiguous (up and down conversion) >B : typeof O.B z=x.h(2,2); // no match ->z=x.h(2,2) : any +>z=x.h(2,2) : string & number >z : string ->x.h(2,2) : any +>x.h(2,2) : string & number >x.h : { (s1: string, s2: number): string; (s1: number, s2: string): number; } >x : O.I >h : { (s1: string, s2: number): string; (s1: number, s2: string): number; } diff --git a/tests/baselines/reference/overloadResolution.types b/tests/baselines/reference/overloadResolution.types index 3461a4d56d079..383de74ee8092 100644 --- a/tests/baselines/reference/overloadResolution.types +++ b/tests/baselines/reference/overloadResolution.types @@ -56,7 +56,7 @@ var s: string; // No candidate overloads found fn1({}); // Error ->fn1({}) : any +>fn1({}) : string & number >fn1 : { (s: string): string; (s: number): number; } >{} : {} @@ -95,7 +95,7 @@ var s = fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error ->fn2('', 0) : any +>fn2('', 0) : number >fn2 : { (s: string, n: number): number; (n: number, t: T): T; } >'' : "" >0 : 0 @@ -178,7 +178,7 @@ var n = fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ->fn3() : any +>fn3() : string >fn3 : { (n: T): string; (s: string, t: T, u: U): U; (v: V, u: U, t: T): number; } // Generic overloads with constraints called with type arguments that satisfy the constraints diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.types b/tests/baselines/reference/overloadResolutionClassConstructors.types index 65adbe6c669dd..c845d5520885b 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.types +++ b/tests/baselines/reference/overloadResolutionClassConstructors.types @@ -51,7 +51,7 @@ new fn1(undefined); // No candidate overloads found new fn1({}); // Error ->new fn1({}) : any +>new fn1({}) : fn1 >fn1 : typeof fn1 >{} : {} @@ -140,12 +140,12 @@ new fn3(5, 5, 5); // Generic overloads with differing arity called with type arguments matching each overload type parameter count new fn3(4); // Error ->new fn3(4) : any +>new fn3(4) : fn3 >fn3 : typeof fn3 >4 : 4 new fn3('', '', ''); // Error ->new fn3('', '', '') : any +>new fn3('', '', '') : fn3 >fn3 : typeof fn3 >'' : "" >'' : "" @@ -160,7 +160,7 @@ new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ->new fn3() : any +>new fn3() : fn3 >fn3 : typeof fn3 // Generic overloads with constraints called with type arguments that satisfy the constraints @@ -180,19 +180,19 @@ new fn4('', 3); >3 : 3 new fn4(3, ''); // Error ->new fn4(3, '') : any +>new fn4(3, '') : fn4 >fn4 : typeof fn4 >3 : 3 >'' : "" new fn4('', 3); // Error ->new fn4('', 3) : any +>new fn4('', 3) : fn4 >fn4 : typeof fn4 >'' : "" >3 : 3 new fn4(3, ''); // Error ->new fn4(3, '') : any +>new fn4(3, '') : fn4 >fn4 : typeof fn4 >3 : 3 >'' : "" @@ -205,13 +205,13 @@ new fn4('', 3); >3 : 3 new fn4(3, ''); // Error ->new fn4(3, '') : any +>new fn4(3, '') : fn4 >fn4 : typeof fn4 >3 : 3 >'' : "" new fn4(3, undefined); // Error ->new fn4(3, undefined) : any +>new fn4(3, undefined) : fn4 >fn4 : typeof fn4 >3 : 3 >undefined : undefined @@ -224,20 +224,20 @@ new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error ->new fn4(null, null) : any +>new fn4(null, null) : fn4 >fn4 : typeof fn4 >null : null >null : null // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ->new fn4(true, null) : any +>new fn4(true, null) : fn4 >fn4 : typeof fn4 >true : true >null : null new fn4(null, true); // Error ->new fn4(null, true) : any +>new fn4(null, true) : fn4 >fn4 : typeof fn4 >null : null >true : true diff --git a/tests/baselines/reference/overloadResolutionConstructors.types b/tests/baselines/reference/overloadResolutionConstructors.types index fd7c426b714ea..84eaa117ef109 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.types +++ b/tests/baselines/reference/overloadResolutionConstructors.types @@ -52,7 +52,7 @@ var s: string; // No candidate overloads found new fn1({}); // Error ->new fn1({}) : any +>new fn1({}) : string & number >fn1 : fn1 >{} : {} @@ -89,7 +89,7 @@ var s = new fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error ->new fn2('', 0) : any +>new fn2('', 0) : number >fn2 : fn2 >'' : "" >0 : 0 @@ -169,7 +169,7 @@ var n = new fn3('', '', 3); // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ->new fn3() : any +>new fn3() : string >fn3 : fn3 // Generic overloads with constraints called with type arguments that satisfy the constraints diff --git a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.types b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.types index ef2d9d90b3303..a51ba0429ef61 100644 --- a/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.types +++ b/tests/baselines/reference/overloadResolutionOnDefaultConstructor1.types @@ -3,10 +3,10 @@ class Bar { >Bar : Bar public clone() { ->clone : () => any +>clone : () => Bar return new Bar(0); ->new Bar(0) : any +>new Bar(0) : Bar >Bar : typeof Bar >0 : 0 } diff --git a/tests/baselines/reference/overloadResolutionTest1.types b/tests/baselines/reference/overloadResolutionTest1.types index 0268a4d17f6c0..15ceb25a9412d 100644 --- a/tests/baselines/reference/overloadResolutionTest1.types +++ b/tests/baselines/reference/overloadResolutionTest1.types @@ -34,8 +34,8 @@ var x11 = foo([{a:0}]); // works >0 : 0 var x111 = foo([{a:"s"}]); // error - does not match any signature ->x111 : any ->foo([{a:"s"}]) : any +>x111 : string & number +>foo([{a:"s"}]) : string & number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } >[{a:"s"}] : { a: string; }[] >{a:"s"} : { a: string; } @@ -86,8 +86,8 @@ var x3 = foo2({a:true}); // works >true : true var x4 = foo2({a:"s"}); // error ->x4 : any ->foo2({a:"s"}) : any +>x4 : string & number +>foo2({a:"s"}) : string & number >foo2 : { (bar: { a: number; }): string; (bar: { a: boolean; }): number; } >{a:"s"} : { a: string; } >a : string @@ -111,8 +111,8 @@ function foo4(bar:{a:any;}):any{ return bar }; >bar : { a: any; } var x = foo4({a:true}); // error ->x : any ->foo4({a:true}) : any +>x : number & string +>foo4({a:true}) : number & string >foo4 : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:true} : { a: boolean; } >a : boolean diff --git a/tests/baselines/reference/overloadingOnConstants2.types b/tests/baselines/reference/overloadingOnConstants2.types index a8d3254a4c37e..4c2dfe0204562 100644 --- a/tests/baselines/reference/overloadingOnConstants2.types +++ b/tests/baselines/reference/overloadingOnConstants2.types @@ -50,8 +50,8 @@ var b: E = foo("bye", []); // E >[] : undefined[] var c = foo("um", []); // error ->c : any ->foo("um", []) : any +>c : D & E +>foo("um", []) : D & E >foo : { (x: "hi", items: string[]): D; (x: "bye", items: string[]): E; } >"um" : "um" >[] : undefined[] diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 24476ecafd272..c1cd80a9658bb 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -1,11 +1,15 @@ -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,26): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'B' but required in type 'D'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. Property 'x' is missing in type 'D' but required in type 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + Types of parameters 'x' and 'x' are incompatible. + Type 'B' is not assignable to type 'D'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. - Property 'q' is missing in type 'B' but required in type 'D'. + Type 'B' is not assignable to type 'D'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -24,16 +28,21 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): declare function foo(arg: (x: B) => any): number; var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. - ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Property 'q' is missing in type 'B' but required in type 'D'. +!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. ~ !!! error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. !!! error TS2345: Property 'x' is missing in type 'D' but required in type 'A'. !!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here. var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. - ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +!!! error TS2345: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2345: Type 'B' is not assignable to type 'D'. ~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -41,8 +50,7 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2345: Property 'q' is missing in type 'B' but required in type 'D'. -!!! related TS2728 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. +!!! error TS2345: Type 'B' is not assignable to type 'D'. var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error ~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.types b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.types index 751032d5abaf5..6283b1bc72ebb 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.types +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.types @@ -36,28 +36,28 @@ declare function foo(arg: (x: B) => any): number; var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. >result : number ->foo(x => new G(x)) : string +>foo(x => new G(x)) : string & number >foo : { (arg: (x: D) => number): string; (arg: (x: C) => any): string; (arg: (x: B) => any): number; } ->x => new G(x) : (x: D) => any +>x => new G(x) : (x: D) => G >x : D ->new G(x) : any +>new G(x) : G >G : typeof G >x : D var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. >result2 : number ->foo(x => new G(x)) : string +>foo(x => new G(x)) : string & number >foo : { (arg: (x: D) => number): string; (arg: (x: C) => any): string; (arg: (x: B) => any): number; } ->x => new G(x) : (x: D) => any +>x => new G(x) : (x: D) => G >x : D ->new G(x) : any +>new G(x) : G >G : typeof G >x : D >x : D var result3: string = foo(x => { // x has type D >result3 : string ->foo(x => { // x has type D var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y;}) : any +>foo(x => { // x has type D var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y;}) : string & number >foo : { (arg: (x: D) => number): string; (arg: (x: C) => any): string; (arg: (x: B) => any): number; } >x => { // x has type D var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y;} : (x: D) => G >x : D diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.types b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.types index d438d4356680b..1c20591475373 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.types @@ -12,7 +12,7 @@ declare function Callbacks(flags?: string): void; >flags : string Callbacks('s'); // wrong number of type arguments ->Callbacks('s') : any +>Callbacks('s') : void >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; } >'s' : "s" @@ -26,6 +26,6 @@ declare function f(arg: number): void; >arg : number f(); // wrong number of arguments (#25683) ->f() : any +>f() : void >f : (arg: number) => void diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.types b/tests/baselines/reference/overloadsWithProvisionalErrors.types index c655f22c05070..bdd34905749ec 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.types +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.types @@ -14,7 +14,7 @@ var func: { }; func(s => ({})); // Error for no applicable overload (object type is missing a and b) ->func(s => ({})) : any +>func(s => ({})) : number & string >func : { (s: string): number; (lambda: (s: string) => { a: number; b: number; }): string; } >s => ({}) : (s: string) => {} >s : string @@ -34,7 +34,7 @@ func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outsi >3 : 3 func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway ->func(s => ({ a: blah })) : any +>func(s => ({ a: blah })) : number & string >func : { (s: string): number; (lambda: (s: string) => { a: number; b: number; }): string; } >s => ({ a: blah }) : (s: string) => { a: any; } >s : string diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt index 925bb07d9f9bc..db526dd3e1522 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -1,8 +1,12 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,42): error TS2345: Argument of type '"0"' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(17,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(18,17): error TS2345: Argument of type '0' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(19,17): error TS2345: Argument of type '0' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(20,17): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. -==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (6 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -22,9 +26,17 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T ~~~ !!! error TS2345: Argument of type '"0"' is not assignable to parameter of type 'boolean'. if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) + ~~~~~~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. a.indexOf(0) === 7 && // a[7] = +0, 0===+0 + ~ +!!! error TS2345: Argument of type '0' is not assignable to parameter of type 'boolean'. a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 + ~~ +!!! error TS2345: Argument of type '0' is not assignable to parameter of type 'boolean'. a.indexOf(1) === 10 ) // a[10] =one=== 1 + ~ +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. { return true; } diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.symbols b/tests/baselines/reference/parser15.4.4.14-9-2.symbols index ecad25d79596a..dde1f273812ae 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.symbols +++ b/tests/baselines/reference/parser15.4.4.14-9-2.symbols @@ -32,16 +32,24 @@ function testcase() { >_float : Symbol(_float, Decl(parser15.4.4.14-9-2.ts, 14, 5)) if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) +>a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(parser15.4.4.14-9-2.ts, 15, 5)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 +>a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(parser15.4.4.14-9-2.ts, 15, 5)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 +>a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(parser15.4.4.14-9-2.ts, 15, 5)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) a.indexOf(1) === 10 ) // a[10] =one=== 1 +>a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(parser15.4.4.14-9-2.ts, 15, 5)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) { return true; } diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.types b/tests/baselines/reference/parser15.4.4.14-9-2.types index f69a61989e309..13f2bcf533bbd 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.types +++ b/tests/baselines/reference/parser15.4.4.14-9-2.types @@ -33,8 +33,8 @@ function testcase() { >3 : 3 var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); ->a : any ->new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)) : any +>a : boolean[] +>new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)) : boolean[] >Array : ArrayConstructor >false : false >undefined : undefined @@ -65,10 +65,10 @@ function testcase() { >a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 a.indexOf(-0) === 7 : boolean >a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 : boolean >a.indexOf(-(4/3)) === 14 : boolean ->a.indexOf(-(4/3)) : any ->a.indexOf : any ->a : any ->indexOf : any +>a.indexOf(-(4/3)) : number +>a.indexOf : (searchElement: boolean, fromIndex?: number) => number +>a : boolean[] +>indexOf : (searchElement: boolean, fromIndex?: number) => number >-(4/3) : number >(4/3) : number >4/3 : number @@ -78,29 +78,29 @@ function testcase() { a.indexOf(0) === 7 && // a[7] = +0, 0===+0 >a.indexOf(0) === 7 : boolean ->a.indexOf(0) : any ->a.indexOf : any ->a : any ->indexOf : any +>a.indexOf(0) : number +>a.indexOf : (searchElement: boolean, fromIndex?: number) => number +>a : boolean[] +>indexOf : (searchElement: boolean, fromIndex?: number) => number >0 : 0 >7 : 7 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 >a.indexOf(-0) === 7 : boolean ->a.indexOf(-0) : any ->a.indexOf : any ->a : any ->indexOf : any +>a.indexOf(-0) : number +>a.indexOf : (searchElement: boolean, fromIndex?: number) => number +>a : boolean[] +>indexOf : (searchElement: boolean, fromIndex?: number) => number >-0 : 0 >0 : 0 >7 : 7 a.indexOf(1) === 10 ) // a[10] =one=== 1 >a.indexOf(1) === 10 : boolean ->a.indexOf(1) : any ->a.indexOf : any ->a : any ->indexOf : any +>a.indexOf(1) : number +>a.indexOf : (searchElement: boolean, fromIndex?: number) => number +>a : boolean[] +>indexOf : (searchElement: boolean, fromIndex?: number) => number >1 : 1 >10 : 10 { diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.types b/tests/baselines/reference/parserConstructorAmbiguity3.types index bdd4972ce19e1..0fa91785da0ad 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.types +++ b/tests/baselines/reference/parserConstructorAmbiguity3.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts === new Date ->new Date : any +>new Date : Date >Date : DateConstructor diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt index f2d0117732013..783a258a5ff91 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(1,9): error TS2554: Expected 0 arguments, but got 1. +tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(2,15): error TS2339: Property 'foo' does not exist on type 'void'. -==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (2 errors) ==== var x = function () { } ~~~~~~~~~~~~~~~ (window).foo; ~~~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types index 87932ff9ae1bb..c7143d2c049ad 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types @@ -22,7 +22,7 @@ declare function testError(a: (t: T, t1: T) => void): T // more args testError((t1: D, t2, t3) => {}) ->testError((t1: D, t2, t3) => {}) : any +>testError((t1: D, t2, t3) => {}) : C >testError : (a: (t: T, t1: T) => void) => T >(t1: D, t2, t3) => {} : (t1: D, t2: any, t3: any) => void >t1 : D @@ -30,7 +30,7 @@ testError((t1: D, t2, t3) => {}) >t3 : any testError((t1, t2: D, t3) => {}) ->testError((t1, t2: D, t3) => {}) : any +>testError((t1, t2: D, t3) => {}) : C >testError : (a: (t: T, t1: T) => void) => T >(t1, t2: D, t3) => {} : (t1: any, t2: D, t3: any) => void >t1 : any @@ -38,7 +38,7 @@ testError((t1, t2: D, t3) => {}) >t3 : any testError((t1, t2, t3: D) => {}) ->testError((t1, t2, t3: D) => {}) : any +>testError((t1, t2, t3: D) => {}) : C >testError : (a: (t: T, t1: T) => void) => T >(t1, t2, t3: D) => {} : (t1: any, t2: any, t3: D) => void >t1 : any diff --git a/tests/baselines/reference/primitiveConstraints1.types b/tests/baselines/reference/primitiveConstraints1.types index 9ca17bb9ef245..1edc2597ec178 100644 --- a/tests/baselines/reference/primitiveConstraints1.types +++ b/tests/baselines/reference/primitiveConstraints1.types @@ -5,7 +5,7 @@ function foo1(t: T, u: U) { } >u : U foo1('hm', 1); // no error ->foo1('hm', 1) : any +>foo1('hm', 1) : void >foo1 : (t: T, u: U) => void >'hm' : "hm" >1 : 1 @@ -16,7 +16,7 @@ function foo2(t: T, u: U) { } >u : U foo2(1, 'hm'); // error ->foo2(1, 'hm') : any +>foo2(1, 'hm') : void >foo2 : (t: T, u: U) => void >1 : 1 >'hm' : "hm" diff --git a/tests/baselines/reference/primitiveConstraints2.types b/tests/baselines/reference/primitiveConstraints2.types index 81b867c8a93d6..6e8e7b725d48f 100644 --- a/tests/baselines/reference/primitiveConstraints2.types +++ b/tests/baselines/reference/primitiveConstraints2.types @@ -18,7 +18,7 @@ var x = new C(); >C : typeof C x.bar2(2, ""); // should error ->x.bar2(2, "") : any +>x.bar2(2, "") : number >x.bar2 : (x: number, y: U) => number >x : C >bar2 : (x: number, y: U) => number @@ -26,7 +26,7 @@ x.bar2(2, ""); // should error >"" : "" x.bar2(2, ""); // should error ->x.bar2(2, "") : any +>x.bar2(2, "") : number >x.bar2 : (x: number, y: U) => number >x : C >bar2 : (x: number, y: U) => number diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index 95f421b36f02b..9ce81ee4d5d34 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/promiseChaining1.ts(7,55): error TS2322: Type 'string' is not assignable to type 'Function'. +tests/cases/compiler/promiseChaining1.ts(7,84): error TS2322: Type 'number' is not assignable to type 'Function'. -==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== +==== tests/cases/compiler/promiseChaining1.ts (2 errors) ==== // same example but with constraints on each type parameter class Chain2 { constructor(public value: T) { } @@ -11,6 +12,9 @@ tests/cases/compiler/promiseChaining1.ts(7,55): error TS2322: Type 'string' is n var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function ~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'Function'. +!!! related TS6502 tests/cases/compiler/promiseChaining1.ts:4:34: The expected type comes from the return type of this signature. + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'Function'. !!! related TS6502 tests/cases/compiler/promiseChaining1.ts:4:34: The expected type comes from the return type of this signature. return new Chain2(result); } diff --git a/tests/baselines/reference/promiseChaining1.symbols b/tests/baselines/reference/promiseChaining1.symbols index 17213839f0a0a..c19ce3afb03c8 100644 --- a/tests/baselines/reference/promiseChaining1.symbols +++ b/tests/baselines/reference/promiseChaining1.symbols @@ -30,6 +30,7 @@ class Chain2 { // should get a fresh type parameter which each then call var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function >z : Symbol(z, Decl(promiseChaining1.ts, 6, 11)) +>this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then : Symbol(Chain2.then, Decl(promiseChaining1.ts, 2, 36)) >this.then(x => result)/*S*/.then : Symbol(Chain2.then, Decl(promiseChaining1.ts, 2, 36)) >this.then : Symbol(Chain2.then, Decl(promiseChaining1.ts, 2, 36)) >this : Symbol(Chain2, Decl(promiseChaining1.ts, 0, 0)) @@ -38,8 +39,11 @@ class Chain2 { >result : Symbol(result, Decl(promiseChaining1.ts, 4, 11)) >then : Symbol(Chain2.then, Decl(promiseChaining1.ts, 2, 36)) >x : Symbol(x, Decl(promiseChaining1.ts, 6, 49)) +>then : Symbol(Chain2.then, Decl(promiseChaining1.ts, 2, 36)) >x : Symbol(x, Decl(promiseChaining1.ts, 6, 78)) +>x.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(promiseChaining1.ts, 6, 78)) +>length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) return new Chain2(result); >Chain2 : Symbol(Chain2, Decl(promiseChaining1.ts, 0, 0)) diff --git a/tests/baselines/reference/promiseChaining1.types b/tests/baselines/reference/promiseChaining1.types index 6ef34ff7e784b..48c16cd64a1dd 100644 --- a/tests/baselines/reference/promiseChaining1.types +++ b/tests/baselines/reference/promiseChaining1.types @@ -22,10 +22,10 @@ class Chain2 { // should get a fresh type parameter which each then call var z = this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length)/*number*/; // Should error on "abc" because it is not a Function ->z : any ->this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length) : any ->this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then : any ->this.then(x => result)/*S*/.then(x => "abc") : any +>z : Chain2 +>this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then(x => x.length) : Chain2 +>this.then(x => result)/*S*/.then(x => "abc")/*Function*/.then : (cb: (x: Function) => S) => Chain2 +>this.then(x => result)/*S*/.then(x => "abc") : Chain2 >this.then(x => result)/*S*/.then : (cb: (x: S) => S) => Chain2 >this.then(x => result) : Chain2 >this.then : (cb: (x: T) => S) => Chain2 @@ -38,12 +38,12 @@ class Chain2 { >x => "abc" : (x: S) => string >x : S >"abc" : "abc" ->then : any ->x => x.length : (x: any) => any ->x : any ->x.length : any ->x : any ->length : any +>then : (cb: (x: Function) => S) => Chain2 +>x => x.length : (x: Function) => number +>x : Function +>x.length : number +>x : Function +>length : number return new Chain2(result); >new Chain2(result) : Chain2 diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt index f7326ec8cbd9d..98dee5cfe9384 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,7 +1,8 @@ tests/cases/compiler/promiseChaining2.ts(7,50): error TS2322: Type 'string' is not assignable to type 'Function'. +tests/cases/compiler/promiseChaining2.ts(7,67): error TS2322: Type 'number' is not assignable to type 'Function'. -==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== +==== tests/cases/compiler/promiseChaining2.ts (2 errors) ==== // same example but with constraints on each type parameter class Chain2 { constructor(public value: T) { } @@ -11,6 +12,9 @@ tests/cases/compiler/promiseChaining2.ts(7,50): error TS2322: Type 'string' is n var z = this.then(x => result).then(x => "abc").then(x => x.length); ~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'Function'. +!!! related TS6502 tests/cases/compiler/promiseChaining2.ts:4:34: The expected type comes from the return type of this signature. + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'Function'. !!! related TS6502 tests/cases/compiler/promiseChaining2.ts:4:34: The expected type comes from the return type of this signature. return new Chain2(result); } diff --git a/tests/baselines/reference/promiseChaining2.symbols b/tests/baselines/reference/promiseChaining2.symbols index ae1f85581e2d2..d63694ad77608 100644 --- a/tests/baselines/reference/promiseChaining2.symbols +++ b/tests/baselines/reference/promiseChaining2.symbols @@ -30,6 +30,7 @@ class Chain2 { // should get a fresh type parameter which each then call var z = this.then(x => result).then(x => "abc").then(x => x.length); >z : Symbol(z, Decl(promiseChaining2.ts, 6, 11)) +>this.then(x => result).then(x => "abc").then : Symbol(Chain2.then, Decl(promiseChaining2.ts, 2, 36)) >this.then(x => result).then : Symbol(Chain2.then, Decl(promiseChaining2.ts, 2, 36)) >this.then : Symbol(Chain2.then, Decl(promiseChaining2.ts, 2, 36)) >this : Symbol(Chain2, Decl(promiseChaining2.ts, 0, 0)) @@ -38,8 +39,11 @@ class Chain2 { >result : Symbol(result, Decl(promiseChaining2.ts, 4, 11)) >then : Symbol(Chain2.then, Decl(promiseChaining2.ts, 2, 36)) >x : Symbol(x, Decl(promiseChaining2.ts, 6, 44)) +>then : Symbol(Chain2.then, Decl(promiseChaining2.ts, 2, 36)) >x : Symbol(x, Decl(promiseChaining2.ts, 6, 61)) +>x.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(promiseChaining2.ts, 6, 61)) +>length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) return new Chain2(result); >Chain2 : Symbol(Chain2, Decl(promiseChaining2.ts, 0, 0)) diff --git a/tests/baselines/reference/promiseChaining2.types b/tests/baselines/reference/promiseChaining2.types index 7088244ee0146..c980627c5b2e9 100644 --- a/tests/baselines/reference/promiseChaining2.types +++ b/tests/baselines/reference/promiseChaining2.types @@ -22,10 +22,10 @@ class Chain2 { // should get a fresh type parameter which each then call var z = this.then(x => result).then(x => "abc").then(x => x.length); ->z : any ->this.then(x => result).then(x => "abc").then(x => x.length) : any ->this.then(x => result).then(x => "abc").then : any ->this.then(x => result).then(x => "abc") : any +>z : Chain2 +>this.then(x => result).then(x => "abc").then(x => x.length) : Chain2 +>this.then(x => result).then(x => "abc").then : (cb: (x: Function) => S) => Chain2 +>this.then(x => result).then(x => "abc") : Chain2 >this.then(x => result).then : (cb: (x: S) => S) => Chain2 >this.then(x => result) : Chain2 >this.then : (cb: (x: T) => S) => Chain2 @@ -38,12 +38,12 @@ class Chain2 { >x => "abc" : (x: S) => string >x : S >"abc" : "abc" ->then : any ->x => x.length : (x: any) => any ->x : any ->x.length : any ->x : any ->length : any +>then : (cb: (x: Function) => S) => Chain2 +>x => x.length : (x: Function) => number +>x : Function +>x.length : number +>x : Function +>length : number return new Chain2(result); >new Chain2(result) : Chain2 diff --git a/tests/baselines/reference/promisePermutations.types b/tests/baselines/reference/promisePermutations.types index 8020dba47a882..93ccd110ad463 100644 --- a/tests/baselines/reference/promisePermutations.types +++ b/tests/baselines/reference/promisePermutations.types @@ -458,8 +458,8 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >testFunction3 : (x: number) => IPromise var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // error ->s3d : any ->s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : any +>s3d : Promise +>s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise >s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> >s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -485,8 +485,8 @@ var sPromise: (x: any) => Promise; >x : any var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ->r4a : any ->r4.then(testFunction4, testFunction4, testFunction4) : any +>r4a : IPromise +>r4.then(testFunction4, testFunction4, testFunction4) : IPromise >r4.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r4 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -514,8 +514,8 @@ var s4: Promise; >s4 : Promise var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ->s4a : any ->s4.then(testFunction4, testFunction4, testFunction4) : any +>s4a : Promise +>s4.then(testFunction4, testFunction4, testFunction4) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -524,8 +524,8 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >testFunction4 : (x: number, y?: string) => IPromise var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ->s4b : any ->s4.then(testFunction4P, testFunction4P, testFunction4P) : any +>s4b : Promise +>s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -534,8 +534,8 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >testFunction4P : (x: number, y?: string) => Promise var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ->s4c : any ->s4.then(testFunction4P, testFunction4, testFunction4) : any +>s4c : Promise +>s4.then(testFunction4P, testFunction4, testFunction4) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -563,8 +563,8 @@ var r5: IPromise; >r5 : IPromise var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ->r5a : any ->r5.then(testFunction5, testFunction5, testFunction5) : any +>r5a : IPromise +>r5.then(testFunction5, testFunction5, testFunction5) : IPromise >r5.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r5 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -592,8 +592,8 @@ var s5: Promise; >s5 : Promise var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ->s5a : any ->s5.then(testFunction5, testFunction5, testFunction5) : any +>s5a : Promise +>s5.then(testFunction5, testFunction5, testFunction5) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -602,8 +602,8 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >testFunction5 : (x: number, cb: (a: string) => string) => IPromise var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ->s5b : any ->s5.then(testFunction5P, testFunction5P, testFunction5P) : any +>s5b : Promise +>s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -612,8 +612,8 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >testFunction5P : (x: number, cb: (a: string) => string) => Promise var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ->s5c : any ->s5.then(testFunction5P, testFunction5, testFunction5) : any +>s5c : Promise +>s5.then(testFunction5P, testFunction5, testFunction5) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -641,8 +641,8 @@ var r6: IPromise; >r6 : IPromise var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ->r6a : any ->r6.then(testFunction6, testFunction6, testFunction6) : any +>r6a : IPromise +>r6.then(testFunction6, testFunction6, testFunction6) : IPromise >r6.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r6 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -670,8 +670,8 @@ var s6: Promise; >s6 : Promise var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ->s6a : any ->s6.then(testFunction6, testFunction6, testFunction6) : any +>s6a : Promise +>s6.then(testFunction6, testFunction6, testFunction6) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -680,8 +680,8 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >testFunction6 : (x: number, cb: (a: T) => T) => IPromise var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ->s6b : any ->s6.then(testFunction6P, testFunction6P, testFunction6P) : any +>s6b : Promise +>s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -690,8 +690,8 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >testFunction6P : (x: number, cb: (a: T) => T) => Promise var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ->s6c : any ->s6.then(testFunction6P, testFunction6, testFunction6) : any +>s6c : Promise +>s6.then(testFunction6P, testFunction6, testFunction6) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -719,8 +719,8 @@ var r7: IPromise; >r7 : IPromise var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->r7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>r7a : IPromise +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -748,8 +748,8 @@ var s7: Promise; >s7 : Promise var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->s7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>s7a : IPromise +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -758,8 +758,8 @@ var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error >testFunction7 : (cb: (a: T) => T) => IPromise var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ->s7b : any ->r7.then(testFunction7P, testFunction7P, testFunction7P) : any +>s7b : IPromise +>r7.then(testFunction7P, testFunction7P, testFunction7P) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -768,8 +768,8 @@ var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error >testFunction7P : (cb: (a: T) => T) => Promise var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ->s7c : any ->r7.then(testFunction7P, testFunction7, testFunction7) : any +>s7c : IPromise +>r7.then(testFunction7P, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -805,8 +805,8 @@ var nPromise: (x: any) => Promise; >x : any var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ->r8a : any ->r8.then(testFunction8, testFunction8, testFunction8) : any +>r8a : IPromise +>r8.then(testFunction8, testFunction8, testFunction8) : IPromise >r8.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r8 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -834,8 +834,8 @@ var s8: Promise; >s8 : Promise var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ->s8a : any ->s8.then(testFunction8, testFunction8, testFunction8) : any +>s8a : Promise +>s8.then(testFunction8, testFunction8, testFunction8) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -844,8 +844,8 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >testFunction8 : (x: T, cb: (a: T) => T) => IPromise var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ->s8b : any ->s8.then(testFunction8P, testFunction8P, testFunction8P) : any +>s8b : Promise +>s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -854,8 +854,8 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >testFunction8P : (x: T, cb: (a: T) => T) => Promise var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ->s8c : any ->s8.then(testFunction8P, testFunction8, testFunction8) : any +>s8c : Promise +>s8.then(testFunction8P, testFunction8, testFunction8) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -883,8 +883,8 @@ var r9: IPromise; >r9 : IPromise var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ->r9a : any ->r9.then(testFunction9, testFunction9, testFunction9) : any +>r9a : IPromise +>r9.then(testFunction9, testFunction9, testFunction9) : IPromise >r9.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r9 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -913,8 +913,8 @@ var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok ->r9d : any ->r9.then(testFunction, sIPromise, nIPromise) : any +>r9d : IPromise +>r9.then(testFunction, sIPromise, nIPromise) : IPromise >r9.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r9 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -942,8 +942,8 @@ var s9: Promise; >s9 : Promise var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ->s9a : any ->s9.then(testFunction9, testFunction9, testFunction9) : any +>s9a : Promise +>s9.then(testFunction9, testFunction9, testFunction9) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -952,8 +952,8 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >testFunction9 : (x: T, cb: (a: U) => U) => IPromise var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ->s9b : any ->s9.then(testFunction9P, testFunction9P, testFunction9P) : any +>s9b : Promise +>s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -962,8 +962,8 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >testFunction9P : (x: T, cb: (a: U) => U) => Promise var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ->s9c : any ->s9.then(testFunction9P, testFunction9, testFunction9) : any +>s9c : Promise +>s9.then(testFunction9P, testFunction9, testFunction9) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -992,8 +992,8 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok >nPromise : (x: any) => Promise var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ->s9f : any ->s9.then(testFunction, sIPromise, nIPromise) : any +>s9f : Promise +>s9.then(testFunction, sIPromise, nIPromise) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1056,8 +1056,8 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok ->r10d : any ->r10.then(testFunction, sIPromise, nIPromise) : any +>r10d : IPromise +>r10.then(testFunction, sIPromise, nIPromise) : IPromise >r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r10 : IPromise<{}> >then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1140,8 +1140,8 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ->s10f : any ->s10.then(testFunctionP, sIPromise, nIPromise) : any +>s10f : Promise +>s10.then(testFunctionP, sIPromise, nIPromise) : Promise >s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise<{}> >then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1169,8 +1169,8 @@ var r11: IPromise; >r11 : IPromise var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ->r11a : any ->r11.then(testFunction11, testFunction11, testFunction11) : any +>r11a : IPromise +>r11.then(testFunction11, testFunction11, testFunction11) : IPromise >r11.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r11 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1182,8 +1182,8 @@ var s11: Promise; >s11 : Promise var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ->s11a : any ->s11.then(testFunction11, testFunction11, testFunction11) : any +>s11a : Promise +>s11.then(testFunction11, testFunction11, testFunction11) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1192,8 +1192,8 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ->s11b : any ->s11.then(testFunction11P, testFunction11P, testFunction11P) : any +>s11b : Promise +>s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1202,8 +1202,8 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error >testFunction11P : { (x: number): Promise; (x: string): Promise; } var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ->s11c : any ->s11.then(testFunction11P, testFunction11, testFunction11) : any +>s11c : Promise +>s11.then(testFunction11P, testFunction11, testFunction11) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } diff --git a/tests/baselines/reference/promisePermutations2.types b/tests/baselines/reference/promisePermutations2.types index 743565a600b81..67d3ee8413a0d 100644 --- a/tests/baselines/reference/promisePermutations2.types +++ b/tests/baselines/reference/promisePermutations2.types @@ -433,8 +433,8 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >testFunction3 : (x: number) => IPromise var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); // Should error ->s3d : any ->s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : any +>s3d : Promise> +>s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise> >s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> >s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -460,8 +460,8 @@ var sPromise: (x: any) => Promise; >x : any var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ->r4a : any ->r4.then(testFunction4, testFunction4, testFunction4) : any +>r4a : IPromise +>r4.then(testFunction4, testFunction4, testFunction4) : IPromise >r4.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r4 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -489,8 +489,8 @@ var s4: Promise; >s4 : Promise var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ->s4a : any ->s4.then(testFunction4, testFunction4, testFunction4) : any +>s4a : Promise> +>s4.then(testFunction4, testFunction4, testFunction4) : Promise> >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -499,8 +499,8 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >testFunction4 : (x: number, y?: string) => IPromise var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ->s4b : any ->s4.then(testFunction4P, testFunction4P, testFunction4P) : any +>s4b : Promise> +>s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise> >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -509,8 +509,8 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >testFunction4P : (x: number, y?: string) => Promise var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ->s4c : any ->s4.then(testFunction4P, testFunction4, testFunction4) : any +>s4c : Promise> +>s4.then(testFunction4P, testFunction4, testFunction4) : Promise> >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -538,8 +538,8 @@ var r5: IPromise; >r5 : IPromise var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ->r5a : any ->r5.then(testFunction5, testFunction5, testFunction5) : any +>r5a : IPromise +>r5.then(testFunction5, testFunction5, testFunction5) : IPromise >r5.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r5 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -567,8 +567,8 @@ var s5: Promise; >s5 : Promise var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ->s5a : any ->s5.then(testFunction5, testFunction5, testFunction5) : any +>s5a : Promise> +>s5.then(testFunction5, testFunction5, testFunction5) : Promise> >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -577,8 +577,8 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >testFunction5 : (x: number, cb: (a: string) => string) => IPromise var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ->s5b : any ->s5.then(testFunction5P, testFunction5P, testFunction5P) : any +>s5b : Promise> +>s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise> >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -587,8 +587,8 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >testFunction5P : (x: number, cb: (a: string) => string) => Promise var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ->s5c : any ->s5.then(testFunction5P, testFunction5, testFunction5) : any +>s5c : Promise> +>s5.then(testFunction5P, testFunction5, testFunction5) : Promise> >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -616,8 +616,8 @@ var r6: IPromise; >r6 : IPromise var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ->r6a : any ->r6.then(testFunction6, testFunction6, testFunction6) : any +>r6a : IPromise +>r6.then(testFunction6, testFunction6, testFunction6) : IPromise >r6.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r6 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -645,8 +645,8 @@ var s6: Promise; >s6 : Promise var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ->s6a : any ->s6.then(testFunction6, testFunction6, testFunction6) : any +>s6a : Promise> +>s6.then(testFunction6, testFunction6, testFunction6) : Promise> >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -655,8 +655,8 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >testFunction6 : (x: number, cb: (a: T) => T) => IPromise var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ->s6b : any ->s6.then(testFunction6P, testFunction6P, testFunction6P) : any +>s6b : Promise> +>s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise> >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -665,8 +665,8 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >testFunction6P : (x: number, cb: (a: T) => T) => Promise var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ->s6c : any ->s6.then(testFunction6P, testFunction6, testFunction6) : any +>s6c : Promise> +>s6.then(testFunction6P, testFunction6, testFunction6) : Promise> >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -694,8 +694,8 @@ var r7: IPromise; >r7 : IPromise var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->r7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>r7a : IPromise +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -723,8 +723,8 @@ var s7: Promise; >s7 : Promise var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->s7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>s7a : IPromise +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -733,8 +733,8 @@ var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error >testFunction7 : (cb: (a: T) => T) => IPromise var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ->s7b : any ->r7.then(testFunction7P, testFunction7P, testFunction7P) : any +>s7b : IPromise +>r7.then(testFunction7P, testFunction7P, testFunction7P) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -743,8 +743,8 @@ var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error >testFunction7P : (cb: (a: T) => T) => Promise var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ->s7c : any ->r7.then(testFunction7P, testFunction7, testFunction7) : any +>s7c : IPromise +>r7.then(testFunction7P, testFunction7, testFunction7) : IPromise >r7.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r7 : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -780,8 +780,8 @@ var nPromise: (x: any) => Promise; >x : any var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ->r8a : any ->r8.then(testFunction8, testFunction8, testFunction8) : any +>r8a : IPromise +>r8.then(testFunction8, testFunction8, testFunction8) : IPromise >r8.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r8 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -809,8 +809,8 @@ var s8: Promise; >s8 : Promise var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ->s8a : any ->s8.then(testFunction8, testFunction8, testFunction8) : any +>s8a : Promise> +>s8.then(testFunction8, testFunction8, testFunction8) : Promise> >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -819,8 +819,8 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >testFunction8 : (x: T, cb: (a: T) => T) => IPromise var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ->s8b : any ->s8.then(testFunction8P, testFunction8P, testFunction8P) : any +>s8b : Promise> +>s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise> >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -829,8 +829,8 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >testFunction8P : (x: T, cb: (a: T) => T) => Promise var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ->s8c : any ->s8.then(testFunction8P, testFunction8, testFunction8) : any +>s8c : Promise> +>s8.then(testFunction8P, testFunction8, testFunction8) : Promise> >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -858,8 +858,8 @@ var r9: IPromise; >r9 : IPromise var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ->r9a : any ->r9.then(testFunction9, testFunction9, testFunction9) : any +>r9a : IPromise +>r9.then(testFunction9, testFunction9, testFunction9) : IPromise >r9.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r9 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -888,8 +888,8 @@ var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ->r9d : any ->r9.then(testFunction, sIPromise, nIPromise) : any +>r9d : IPromise +>r9.then(testFunction, sIPromise, nIPromise) : IPromise >r9.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r9 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -917,8 +917,8 @@ var s9: Promise; >s9 : Promise var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ->s9a : any ->s9.then(testFunction9, testFunction9, testFunction9) : any +>s9a : Promise> +>s9.then(testFunction9, testFunction9, testFunction9) : Promise> >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -927,8 +927,8 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >testFunction9 : (x: T, cb: (a: U) => U) => IPromise var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ->s9b : any ->s9.then(testFunction9P, testFunction9P, testFunction9P) : any +>s9b : Promise> +>s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise> >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -937,8 +937,8 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >testFunction9P : (x: T, cb: (a: U) => U) => Promise var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ->s9c : any ->s9.then(testFunction9P, testFunction9, testFunction9) : any +>s9c : Promise> +>s9.then(testFunction9P, testFunction9, testFunction9) : Promise> >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -967,8 +967,8 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok >nPromise : (x: any) => Promise var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ->s9f : any ->s9.then(testFunction, sIPromise, nIPromise) : any +>s9f : Promise> +>s9.then(testFunction, sIPromise, nIPromise) : Promise> >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1031,8 +1031,8 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r10d = r10.then(testFunction, sIPromise, nIPromise); // error ->r10d : any ->r10.then(testFunction, sIPromise, nIPromise) : any +>r10d : IPromise +>r10.then(testFunction, sIPromise, nIPromise) : IPromise >r10.then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r10 : IPromise<{}> >then : { (success?: (value: {}) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1115,8 +1115,8 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ->s10f : any ->s10.then(testFunctionP, sIPromise, nIPromise) : any +>s10f : Promise> +>s10.then(testFunctionP, sIPromise, nIPromise) : Promise> >s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise<{}> >then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1144,8 +1144,8 @@ var r11: IPromise; >r11 : IPromise var r11a = r11.then(testFunction11, testFunction11, testFunction11); // error ->r11a : any ->r11.then(testFunction11, testFunction11, testFunction11) : any +>r11a : IPromise +>r11.then(testFunction11, testFunction11, testFunction11) : IPromise >r11.then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r11 : IPromise >then : { (success?: (value: number) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1157,8 +1157,8 @@ var s11: Promise; >s11 : Promise var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ->s11a : any ->s11.then(testFunction11, testFunction11, testFunction11) : any +>s11a : Promise> +>s11.then(testFunction11, testFunction11, testFunction11) : Promise> >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1167,8 +1167,8 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok ->s11b : any ->s11.then(testFunction11P, testFunction11P, testFunction11P) : any +>s11b : Promise> +>s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise> >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1177,8 +1177,8 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // ok >testFunction11P : { (x: number): Promise; (x: string): Promise; } var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // ok ->s11c : any ->s11.then(testFunction11P, testFunction11, testFunction11) : any +>s11c : Promise> +>s11.then(testFunction11P, testFunction11, testFunction11) : Promise> >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } diff --git a/tests/baselines/reference/promisePermutations3.types b/tests/baselines/reference/promisePermutations3.types index f8bf272e552d8..b1df2bce9a3f5 100644 --- a/tests/baselines/reference/promisePermutations3.types +++ b/tests/baselines/reference/promisePermutations3.types @@ -384,8 +384,8 @@ var r3a = r3.then(testFunction3, testFunction3, testFunction3); >testFunction3 : (x: number) => IPromise var r3b = r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ->r3b : any ->r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : any +>r3b : IPromise> +>r3.then(testFunction3, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : IPromise> >r3.then(testFunction3, testFunction3, testFunction3).then : (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r3.then(testFunction3, testFunction3, testFunction3) : IPromise> >r3.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -433,8 +433,8 @@ var s3c = s3.then(testFunction3P, testFunction3, testFunction3); >testFunction3 : (x: number) => IPromise var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); ->s3d : any ->s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : any +>s3d : Promise +>s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3) : Promise >s3.then(testFunction3P, testFunction3, testFunction3).then : { , TResult2 = never>(onfulfilled?: (value: IPromise) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: IPromise) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s3.then(testFunction3P, testFunction3, testFunction3) : Promise> >s3.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -460,8 +460,8 @@ var sPromise: (x: any) => Promise; >x : any var r4a = r4.then(testFunction4, testFunction4, testFunction4); // error ->r4a : any ->r4.then(testFunction4, testFunction4, testFunction4) : any +>r4a : IPromise> +>r4.then(testFunction4, testFunction4, testFunction4) : IPromise> >r4.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r4 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -489,8 +489,8 @@ var s4: Promise; >s4 : Promise var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error ->s4a : any ->s4.then(testFunction4, testFunction4, testFunction4) : any +>s4a : Promise +>s4.then(testFunction4, testFunction4, testFunction4) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -499,8 +499,8 @@ var s4a = s4.then(testFunction4, testFunction4, testFunction4); // error >testFunction4 : (x: number, y?: string) => IPromise var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error ->s4b : any ->s4.then(testFunction4P, testFunction4P, testFunction4P) : any +>s4b : Promise +>s4.then(testFunction4P, testFunction4P, testFunction4P) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -509,8 +509,8 @@ var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); // error >testFunction4P : (x: number, y?: string) => Promise var s4c = s4.then(testFunction4P, testFunction4, testFunction4); // error ->s4c : any ->s4.then(testFunction4P, testFunction4, testFunction4) : any +>s4c : Promise +>s4.then(testFunction4P, testFunction4, testFunction4) : Promise >s4.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s4 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -538,8 +538,8 @@ var r5: IPromise; >r5 : IPromise var r5a = r5.then(testFunction5, testFunction5, testFunction5); // error ->r5a : any ->r5.then(testFunction5, testFunction5, testFunction5) : any +>r5a : IPromise> +>r5.then(testFunction5, testFunction5, testFunction5) : IPromise> >r5.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r5 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -567,8 +567,8 @@ var s5: Promise; >s5 : Promise var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error ->s5a : any ->s5.then(testFunction5, testFunction5, testFunction5) : any +>s5a : Promise +>s5.then(testFunction5, testFunction5, testFunction5) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -577,8 +577,8 @@ var s5a = s5.then(testFunction5, testFunction5, testFunction5); // error >testFunction5 : (x: number, cb: (a: string) => string) => IPromise var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error ->s5b : any ->s5.then(testFunction5P, testFunction5P, testFunction5P) : any +>s5b : Promise +>s5.then(testFunction5P, testFunction5P, testFunction5P) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -587,8 +587,8 @@ var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); // error >testFunction5P : (x: number, cb: (a: string) => string) => Promise var s5c = s5.then(testFunction5P, testFunction5, testFunction5); // error ->s5c : any ->s5.then(testFunction5P, testFunction5, testFunction5) : any +>s5c : Promise +>s5.then(testFunction5P, testFunction5, testFunction5) : Promise >s5.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s5 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -616,8 +616,8 @@ var r6: IPromise; >r6 : IPromise var r6a = r6.then(testFunction6, testFunction6, testFunction6); // error ->r6a : any ->r6.then(testFunction6, testFunction6, testFunction6) : any +>r6a : IPromise> +>r6.then(testFunction6, testFunction6, testFunction6) : IPromise> >r6.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r6 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -645,8 +645,8 @@ var s6: Promise; >s6 : Promise var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error ->s6a : any ->s6.then(testFunction6, testFunction6, testFunction6) : any +>s6a : Promise +>s6.then(testFunction6, testFunction6, testFunction6) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -655,8 +655,8 @@ var s6a = s6.then(testFunction6, testFunction6, testFunction6); // error >testFunction6 : (x: number, cb: (a: T) => T) => IPromise var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error ->s6b : any ->s6.then(testFunction6P, testFunction6P, testFunction6P) : any +>s6b : Promise +>s6.then(testFunction6P, testFunction6P, testFunction6P) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -665,8 +665,8 @@ var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); // error >testFunction6P : (x: number, cb: (a: T) => T) => Promise var s6c = s6.then(testFunction6P, testFunction6, testFunction6); // error ->s6c : any ->s6.then(testFunction6P, testFunction6, testFunction6) : any +>s6c : Promise +>s6.then(testFunction6P, testFunction6, testFunction6) : Promise >s6.then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s6 : Promise >then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -694,8 +694,8 @@ var r7: IPromise; >r7 : IPromise var r7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->r7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>r7a : IPromise> +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise> >r7.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r7 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -723,8 +723,8 @@ var s7: Promise; >s7 : Promise var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error ->s7a : any ->r7.then(testFunction7, testFunction7, testFunction7) : any +>s7a : IPromise> +>r7.then(testFunction7, testFunction7, testFunction7) : IPromise> >r7.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r7 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -733,8 +733,8 @@ var s7a = r7.then(testFunction7, testFunction7, testFunction7); // error >testFunction7 : (cb: (a: T) => T) => IPromise var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error ->s7b : any ->r7.then(testFunction7P, testFunction7P, testFunction7P) : any +>s7b : IPromise> +>r7.then(testFunction7P, testFunction7P, testFunction7P) : IPromise> >r7.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r7 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -743,8 +743,8 @@ var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); // error >testFunction7P : (cb: (a: T) => T) => Promise var s7c = r7.then(testFunction7P, testFunction7, testFunction7); // error ->s7c : any ->r7.then(testFunction7P, testFunction7, testFunction7) : any +>s7c : IPromise> +>r7.then(testFunction7P, testFunction7, testFunction7) : IPromise> >r7.then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r7 : IPromise >then : (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -780,8 +780,8 @@ var nPromise: (x: any) => Promise; >x : any var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ->r8a : any ->r8.then(testFunction8, testFunction8, testFunction8) : any +>r8a : IPromise> +>r8.then(testFunction8, testFunction8, testFunction8) : IPromise> >r8.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r8 : IPromise >then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -809,8 +809,8 @@ var s8: Promise; >s8 : Promise var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ->s8a : any ->s8.then(testFunction8, testFunction8, testFunction8) : any +>s8a : Promise +>s8.then(testFunction8, testFunction8, testFunction8) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -819,8 +819,8 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error >testFunction8 : (x: T, cb: (a: T) => T) => IPromise var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ->s8b : any ->s8.then(testFunction8P, testFunction8P, testFunction8P) : any +>s8b : Promise +>s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -829,8 +829,8 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error >testFunction8P : (x: T, cb: (a: T) => T) => Promise var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ->s8c : any ->s8.then(testFunction8P, testFunction8, testFunction8) : any +>s8c : Promise +>s8.then(testFunction8P, testFunction8, testFunction8) : Promise >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s8 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -858,8 +858,8 @@ var r9: IPromise; >r9 : IPromise var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ->r9a : any ->r9.then(testFunction9, testFunction9, testFunction9) : any +>r9a : IPromise> +>r9.then(testFunction9, testFunction9, testFunction9) : IPromise> >r9.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r9 : IPromise >then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -888,8 +888,8 @@ var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r9d = r9.then(testFunction, sIPromise, nIPromise); // error ->r9d : any ->r9.then(testFunction, sIPromise, nIPromise) : any +>r9d : IPromise> +>r9.then(testFunction, sIPromise, nIPromise) : IPromise> >r9.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r9 : IPromise >then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -917,8 +917,8 @@ var s9: Promise; >s9 : Promise var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ->s9a : any ->s9.then(testFunction9, testFunction9, testFunction9) : any +>s9a : Promise +>s9.then(testFunction9, testFunction9, testFunction9) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -927,8 +927,8 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error >testFunction9 : (x: T, cb: (a: U) => U) => IPromise var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ->s9b : any ->s9.then(testFunction9P, testFunction9P, testFunction9P) : any +>s9b : Promise +>s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -937,8 +937,8 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error >testFunction9P : (x: T, cb: (a: U) => U) => Promise var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ->s9c : any ->s9.then(testFunction9P, testFunction9, testFunction9) : any +>s9c : Promise +>s9.then(testFunction9P, testFunction9, testFunction9) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -967,8 +967,8 @@ var s9e = s9.then(nPromise, nPromise, nPromise); // ok >nPromise : (x: any) => Promise var s9f = s9.then(testFunction, sIPromise, nIPromise); // error ->s9f : any ->s9.then(testFunction, sIPromise, nIPromise) : any +>s9f : Promise +>s9.then(testFunction, sIPromise, nIPromise) : Promise >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s9 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1031,8 +1031,8 @@ var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var r10d = r10.then(testFunction, sIPromise, nIPromise); // error ->r10d : any ->r10.then(testFunction, sIPromise, nIPromise) : any +>r10d : IPromise> +>r10.then(testFunction, sIPromise, nIPromise) : IPromise> >r10.then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r10 : IPromise<{}> >then : (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -1115,8 +1115,8 @@ var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok >nIPromise : (x: any) => IPromise var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error ->s10f : any ->s10.then(testFunctionP, sIPromise, nIPromise) : any +>s10f : Promise +>s10.then(testFunctionP, sIPromise, nIPromise) : Promise >s10.then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s10 : Promise<{}> >then : { (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: {}) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: {}) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1144,8 +1144,8 @@ var r11: IPromise; >r11 : IPromise var r11a = r11.then(testFunction11, testFunction11, testFunction11); // ok ->r11a : any ->r11.then(testFunction11, testFunction11, testFunction11) : any +>r11a : IPromise> +>r11.then(testFunction11, testFunction11, testFunction11) : IPromise> >r11.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r11 : IPromise >then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -1157,8 +1157,8 @@ var s11: Promise; >s11 : Promise var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok ->s11a : any ->s11.then(testFunction11, testFunction11, testFunction11) : any +>s11a : Promise +>s11.then(testFunction11, testFunction11, testFunction11) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1167,8 +1167,8 @@ var s11a = s11.then(testFunction11, testFunction11, testFunction11); // ok >testFunction11 : { (x: number): IPromise; (x: string): IPromise; } var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error ->s11b : any ->s11.then(testFunction11P, testFunction11P, testFunction11P) : any +>s11b : Promise +>s11.then(testFunction11P, testFunction11P, testFunction11P) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1177,8 +1177,8 @@ var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); // error >testFunction11P : { (x: number): Promise; (x: string): Promise; } var s11c = s11.then(testFunction11P, testFunction11, testFunction11); // error ->s11c : any ->s11.then(testFunction11P, testFunction11, testFunction11) : any +>s11c : Promise +>s11.then(testFunction11P, testFunction11, testFunction11) : Promise >s11.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } >s11 : Promise >then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } @@ -1223,8 +1223,8 @@ var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok >testFunction12 : { (x: T): IPromise; (x: T, y: T): IPromise; } var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ->s12b : any ->s12.then(testFunction12P, testFunction12P, testFunction12P) : any +>s12b : IPromise> +>s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise> >s12.then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >s12 : IPromise<(x: any) => any> >then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise diff --git a/tests/baselines/reference/promiseTypeInference.types b/tests/baselines/reference/promiseTypeInference.types index 36b3bdadd28ce..245a9e842e584 100644 --- a/tests/baselines/reference/promiseTypeInference.types +++ b/tests/baselines/reference/promiseTypeInference.types @@ -22,8 +22,8 @@ declare function convert(s: string): IPromise; >s : string var $$x = load("something").then(s => convert(s)); ->$$x : any ->load("something").then(s => convert(s)) : any +>$$x : Promise<{}> +>load("something").then(s => convert(s)) : Promise<{}> >load("something").then : { (onfulfilled?: (value: string) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: string) => Promise): Promise; } >load("something") : Promise >load : (name: string) => Promise diff --git a/tests/baselines/reference/recursiveClassReferenceTest.types b/tests/baselines/reference/recursiveClassReferenceTest.types index 6b617a0a2f59a..bd79dc181f3a3 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.types +++ b/tests/baselines/reference/recursiveClassReferenceTest.types @@ -192,7 +192,7 @@ module Sample.Thing.Languages.PlainText { >getInitialState : () => IState return new State(self); ->new State(self) : any +>new State(self) : State >State : typeof State >self : Window } diff --git a/tests/baselines/reference/recursiveFunctionTypes.types b/tests/baselines/reference/recursiveFunctionTypes.types index 72ba77b48f6f9..09a9116391328 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.types +++ b/tests/baselines/reference/recursiveFunctionTypes.types @@ -88,13 +88,13 @@ function f6(a?: any) { return f6; } >f6 : { (): typeof f6; (a: typeof f6): () => number; } f6("", 3); // error (arity mismatch) ->f6("", 3) : any +>f6("", 3) : { (): typeof f6; (a: typeof f6): () => number; } & (() => number) >f6 : { (): typeof f6; (a: typeof f6): () => number; } >"" : "" >3 : 3 f6(""); // ok (function takes an any param) ->f6("") : any +>f6("") : { (): typeof f6; (a: typeof f6): () => number; } & (() => number) >f6 : { (): typeof f6; (a: typeof f6): () => number; } >"" : "" @@ -122,13 +122,13 @@ declare function f7(a?: typeof f7): typeof f7; >f7 : { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; } f7("", 3); // error (arity mismatch) ->f7("", 3) : any +>f7("", 3) : { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; } & (() => number) & number >f7 : { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; } >"" : "" >3 : 3 f7(""); // ok (function takes an any param) ->f7("") : any +>f7("") : { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; } & (() => number) & number >f7 : { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; } >"" : "" diff --git a/tests/baselines/reference/recursiveTypeRelations.types b/tests/baselines/reference/recursiveTypeRelations.types index cb0baef7919d6..7d4473e9d8cfa 100644 --- a/tests/baselines/reference/recursiveTypeRelations.types +++ b/tests/baselines/reference/recursiveTypeRelations.types @@ -35,12 +35,12 @@ export function css(styles: S, ...classNam >classNames : ClassNameArg[] const args = classNames.map(arg => { ->args : any[] ->classNames.map(arg => { if (arg == null) { return null; } if (typeof arg == "string") { return styles[arg]; } if (typeof arg == "object") { return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}); } }) : any[] +>args : string[] +>classNames.map(arg => { if (arg == null) { return null; } if (typeof arg == "string") { return styles[arg]; } if (typeof arg == "object") { return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}); } }) : string[] >classNames.map : (callbackfn: (value: ClassNameArg, index: number, array: ClassNameArg[]) => U, thisArg?: any) => U[] >classNames : ClassNameArg[] >map : (callbackfn: (value: ClassNameArg, index: number, array: ClassNameArg[]) => U, thisArg?: any) => U[] ->arg => { if (arg == null) { return null; } if (typeof arg == "string") { return styles[arg]; } if (typeof arg == "object") { return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}); } } : (arg: ClassNameArg) => any +>arg => { if (arg == null) { return null; } if (typeof arg == "string") { return styles[arg]; } if (typeof arg == "object") { return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}); } } : (arg: ClassNameArg) => string >arg : ClassNameArg if (arg == null) { @@ -69,7 +69,7 @@ export function css(styles: S, ...classNam >"object" : "object" return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { ->Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}) : any +>Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}) : string >Object.keys(arg).reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >Object.keys(arg) : string[] >Object.keys : (o: {}) => string[] diff --git a/tests/baselines/reference/restTupleElements1.types b/tests/baselines/reference/restTupleElements1.types index 9a8b3aaeb7ef1..e209f18e5ab67 100644 --- a/tests/baselines/reference/restTupleElements1.types +++ b/tests/baselines/reference/restTupleElements1.types @@ -57,11 +57,11 @@ assign<[...number[]], number[]>(); >assign : () => void assign<[number, ...number[]], number[]>(); // Error ->assign<[number, ...number[]], number[]>() : any +>assign<[number, ...number[]], number[]>() : void >assign : () => void assign<[number, ...number[]], []>(); // Error ->assign<[number, ...number[]], []>() : any +>assign<[number, ...number[]], []>() : void >assign : () => void assign<[number, ...number[]], [number]>(); @@ -77,27 +77,27 @@ assign<[number, ...number[]], [number, number, ...number[]]>(); >assign : () => void assign<[number], [...number[]]>(); // Error ->assign<[number], [...number[]]>() : any +>assign<[number], [...number[]]>() : void >assign : () => void assign<[number], [number, ...number[]]>(); // Error ->assign<[number], [number, ...number[]]>() : any +>assign<[number], [number, ...number[]]>() : void >assign : () => void assign<[number, ...number[]], [number, ...string[]]>(); // Error ->assign<[number, ...number[]], [number, ...string[]]>() : any +>assign<[number, ...number[]], [number, ...string[]]>() : void >assign : () => void assign<[number, ...number[]], [string, ...number[]]>(); // Error ->assign<[number, ...number[]], [string, ...number[]]>() : any +>assign<[number, ...number[]], [string, ...number[]]>() : void >assign : () => void assign<[number, ...number[]], [number, number, string]>(); // Error ->assign<[number, ...number[]], [number, number, string]>() : any +>assign<[number, ...number[]], [number, number, string]>() : void >assign : () => void assign<[number, ...number[]], [number, number, number, string]>(); // Error ->assign<[number, ...number[]], [number, number, number, string]>() : any +>assign<[number, ...number[]], [number, number, number, string]>() : void >assign : () => void type T20 = [number, string, ...boolean[]]; @@ -168,9 +168,9 @@ declare function f0(x: [T, ...U[]]): [T, U]; >x : [T, ...U[]] f0([]); // Error ->f0([]) : any +>f0([]) : [{}, {}] >f0 : (x: [T, ...U[]]) => [T, U] ->[] : never[] +>[] : [] f0([1]); >f0([1]) : [number, {}] diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types index a895447e18232..522eb02ad42b2 100644 --- a/tests/baselines/reference/strictBindCallApply1.types +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -32,8 +32,8 @@ let f02 = foo.bind(undefined, 10, "hello"); >"hello" : "hello" let f03 = foo.bind(undefined, 10, 20); // Error ->f03 : any ->foo.bind(undefined, 10, 20) : any +>f03 : () => string +>foo.bind(undefined, 10, 20) : () => string >foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string >bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } @@ -52,8 +52,8 @@ let c00 = foo.call(undefined, 10, "hello"); >"hello" : "hello" let c01 = foo.call(undefined, 10); // Error ->c01 : any ->foo.call(undefined, 10) : any +>c01 : string +>foo.call(undefined, 10) : string >foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >foo : (a: number, b: string) => string >call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R @@ -61,8 +61,8 @@ let c01 = foo.call(undefined, 10); // Error >10 : 10 let c02 = foo.call(undefined, 10, 20); // Error ->c02 : any ->foo.call(undefined, 10, 20) : any +>c02 : string +>foo.call(undefined, 10, 20) : string >foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >foo : (a: number, b: string) => string >call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R @@ -71,8 +71,8 @@ let c02 = foo.call(undefined, 10, 20); // Error >20 : 20 let c03 = foo.call(undefined, 10, "hello", 30); // Error ->c03 : any ->foo.call(undefined, 10, "hello", 30) : any +>c03 : string +>foo.call(undefined, 10, "hello", 30) : string >foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >foo : (a: number, b: string) => string >call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R @@ -93,34 +93,34 @@ let a00 = foo.apply(undefined, [10, "hello"]); >"hello" : "hello" let a01 = foo.apply(undefined, [10]); // Error ->a01 : any ->foo.apply(undefined, [10]) : any +>a01 : string +>foo.apply(undefined, [10]) : string >foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >foo : (a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >undefined : undefined ->[10] : number[] +>[10] : [number] >10 : 10 let a02 = foo.apply(undefined, [10, 20]); // Error ->a02 : any ->foo.apply(undefined, [10, 20]) : any +>a02 : string +>foo.apply(undefined, [10, 20]) : string >foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >foo : (a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >undefined : undefined ->[10, 20] : number[] +>[10, 20] : [number, number] >10 : 10 >20 : 20 let a03 = foo.apply(undefined, [10, "hello", 30]); // Error ->a03 : any ->foo.apply(undefined, [10, "hello", 30]) : any +>a03 : string +>foo.apply(undefined, [10, "hello", 30]) : string >foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >foo : (a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >undefined : undefined ->[10, "hello", 30] : (string | number)[] +>[10, "hello", 30] : [number, string, number] >10 : 10 >"hello" : "hello" >30 : 30 @@ -180,8 +180,8 @@ let f12 = c.foo.bind(c, 10, "hello"); >"hello" : "hello" let f13 = c.foo.bind(c, 10, 20); // Error ->f13 : any ->c.foo.bind(c, 10, 20) : any +>f13 : () => string +>c.foo.bind(c, 10, 20) : () => string >c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C @@ -192,8 +192,8 @@ let f13 = c.foo.bind(c, 10, 20); // Error >20 : 20 let f14 = c.foo.bind(undefined); // Error ->f14 : any ->c.foo.bind(undefined) : any +>f14 : (a: number, b: string) => string +>c.foo.bind(undefined) : (a: number, b: string) => string >c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C @@ -214,8 +214,8 @@ let c10 = c.foo.call(c, 10, "hello"); >"hello" : "hello" let c11 = c.foo.call(c, 10); // Error ->c11 : any ->c.foo.call(c, 10) : any +>c11 : string +>c.foo.call(c, 10) : string >c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >c.foo : (this: C, a: number, b: string) => string >c : C @@ -225,8 +225,8 @@ let c11 = c.foo.call(c, 10); // Error >10 : 10 let c12 = c.foo.call(c, 10, 20); // Error ->c12 : any ->c.foo.call(c, 10, 20) : any +>c12 : string +>c.foo.call(c, 10, 20) : string >c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >c.foo : (this: C, a: number, b: string) => string >c : C @@ -237,8 +237,8 @@ let c12 = c.foo.call(c, 10, 20); // Error >20 : 20 let c13 = c.foo.call(c, 10, "hello", 30); // Error ->c13 : any ->c.foo.call(c, 10, "hello", 30) : any +>c13 : string +>c.foo.call(c, 10, "hello", 30) : string >c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >c.foo : (this: C, a: number, b: string) => string >c : C @@ -250,8 +250,8 @@ let c13 = c.foo.call(c, 10, "hello", 30); // Error >30 : 30 let c14 = c.foo.call(undefined, 10, "hello"); // Error ->c14 : any ->c.foo.call(undefined, 10, "hello") : any +>c14 : string +>c.foo.call(undefined, 10, "hello") : string >c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R >c.foo : (this: C, a: number, b: string) => string >c : C @@ -275,54 +275,54 @@ let a10 = c.foo.apply(c, [10, "hello"]); >"hello" : "hello" let a11 = c.foo.apply(c, [10]); // Error ->a11 : any ->c.foo.apply(c, [10]) : any +>a11 : string +>c.foo.apply(c, [10]) : string >c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c : C ->[10] : number[] +>[10] : [number] >10 : 10 let a12 = c.foo.apply(c, [10, 20]); // Error ->a12 : any ->c.foo.apply(c, [10, 20]) : any +>a12 : string +>c.foo.apply(c, [10, 20]) : string >c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c : C ->[10, 20] : number[] +>[10, 20] : [number, number] >10 : 10 >20 : 20 let a13 = c.foo.apply(c, [10, "hello", 30]); // Error ->a13 : any ->c.foo.apply(c, [10, "hello", 30]) : any +>a13 : string +>c.foo.apply(c, [10, "hello", 30]) : string >c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c : C ->[10, "hello", 30] : (string | number)[] +>[10, "hello", 30] : [number, string, number] >10 : 10 >"hello" : "hello" >30 : 30 let a14 = c.foo.apply(undefined, [10, "hello"]); // Error ->a14 : any ->c.foo.apply(undefined, [10, "hello"]) : any +>a14 : string +>c.foo.apply(undefined, [10, "hello"]) : string >c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string >apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } >undefined : undefined ->[10, "hello"] : (string | number)[] +>[10, "hello"] : [number, string] >10 : 10 >"hello" : "hello" @@ -354,8 +354,8 @@ let f22 = C.bind(undefined, 10, "hello"); >"hello" : "hello" let f23 = C.bind(undefined, 10, 20); // Error ->f23 : any ->C.bind(undefined, 10, 20) : any +>f23 : new () => C +>C.bind(undefined, 10, 20) : new () => C >C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C >bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } @@ -373,7 +373,7 @@ C.call(c, 10, "hello"); >"hello" : "hello" C.call(c, 10); // Error ->C.call(c, 10) : any +>C.call(c, 10) : void >C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void >C : typeof C >call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void @@ -381,7 +381,7 @@ C.call(c, 10); // Error >10 : 10 C.call(c, 10, 20); // Error ->C.call(c, 10, 20) : any +>C.call(c, 10, 20) : void >C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void >C : typeof C >call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void @@ -390,7 +390,7 @@ C.call(c, 10, 20); // Error >20 : 20 C.call(c, 10, "hello", 30); // Error ->C.call(c, 10, "hello", 30) : any +>C.call(c, 10, "hello", 30) : void >C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void >C : typeof C >call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void @@ -410,31 +410,31 @@ C.apply(c, [10, "hello"]); >"hello" : "hello" C.apply(c, [10]); // Error ->C.apply(c, [10]) : any +>C.apply(c, [10]) : void >C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >C : typeof C >apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >c : C ->[10] : number[] +>[10] : [number] >10 : 10 C.apply(c, [10, 20]); // Error ->C.apply(c, [10, 20]) : any +>C.apply(c, [10, 20]) : void >C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >C : typeof C >apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >c : C ->[10, 20] : number[] +>[10, 20] : [number, number] >10 : 10 >20 : 20 C.apply(c, [10, "hello", 30]); // Error ->C.apply(c, [10, "hello", 30]) : any +>C.apply(c, [10, "hello", 30]) : void >C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >C : typeof C >apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } >c : C ->[10, "hello", 30] : (string | number)[] +>[10, "hello", 30] : [number, string, number] >10 : 10 >"hello" : "hello" >30 : 30 diff --git a/tests/baselines/reference/symbolProperty21.types b/tests/baselines/reference/symbolProperty21.types index 7791191833385..5906f52453514 100644 --- a/tests/baselines/reference/symbolProperty21.types +++ b/tests/baselines/reference/symbolProperty21.types @@ -20,9 +20,9 @@ declare function foo(p: I): { t: T; u: U }; >u : U foo({ ->foo({ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true}) : any +>foo({ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true}) : { t: boolean; u: string; } >foo : (p: I) => { t: T; u: U; } ->{ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; } +>{ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; } [Symbol.isConcatSpreadable]: "", >[Symbol.isConcatSpreadable] : string @@ -39,7 +39,7 @@ foo({ >0 : 0 [Symbol.unscopables]: true ->[Symbol.unscopables] : boolean +>[Symbol.unscopables] : true >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index b7018031a69a1..a6957fab2e5db 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(63,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts (2 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts (3 errors) ==== // Generic tag with one parameter function noParams(n: T) { } noParams ``; @@ -68,6 +69,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '""'. var a9a: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with multiple best common types interface A91 { diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types index b08dc02df77a4..61b882ad61e75 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types @@ -302,8 +302,8 @@ function someGenerics9(strs: TemplateStringsArray, a: T, b: T, c: T): T { >null : null } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ->a9a : any ->someGenerics9 `${ '' }${ 0 }${ [] }` : any +>a9a : string +>someGenerics9 `${ '' }${ 0 }${ [] }` : "" >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ '' }${ 0 }${ [] }` : string >'' : "" @@ -311,7 +311,7 @@ var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; >[] : undefined[] var a9a: {}; ->a9a : any +>a9a : string // Generic tag with multiple parameters of generic type passed arguments with multiple best common types interface A91 { diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index ae63e6fd04df0..d112edb8430a6 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(62,36): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(63,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts (2 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts (3 errors) ==== // Generic tag with one parameter function noParams(n: T) { } noParams ``; @@ -68,6 +69,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '""'. var a9a: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. // Generic tag with multiple parameters of generic type passed arguments with multiple best common types interface A91 { diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types index 88657a6ac0f04..195092f381374 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types @@ -302,8 +302,8 @@ function someGenerics9(strs: TemplateStringsArray, a: T, b: T, c: T): T { >null : null } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ->a9a : any ->someGenerics9 `${ '' }${ 0 }${ [] }` : any +>a9a : string +>someGenerics9 `${ '' }${ 0 }${ [] }` : "" >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ '' }${ 0 }${ [] }` : string >'' : "" @@ -311,7 +311,7 @@ var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; >[] : undefined[] var a9a: {}; ->a9a : any +>a9a : string // Generic tag with multiple parameters of generic type passed arguments with multiple best common types interface A91 { diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index 0634338986850..215e5998a399f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -3,10 +3,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,46): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (7 errors) ==== interface I { (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; @@ -43,6 +44,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. + ~ +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.symbols b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.symbols index e207a8971bb81..fb7117dc6dadb 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.symbols @@ -45,7 +45,9 @@ f `abc`.member >member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) f `abc${1}def${2}ghi`.member; +>f `abc${1}def${2}ghi`.member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 9, 3)) +>member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) f `abc`["member"]; >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 9, 3)) @@ -53,6 +55,7 @@ f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 9, 3)) +>"member" : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) @@ -60,7 +63,10 @@ f `abc`[0].member `abc${1}def${2}ghi`; >member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; +>f `abc${1}def${2}ghi`["member"].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 9, 3)) +>"member" : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) +>member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; >f `abc${ true }def${ true }ghi`["member"].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTags.ts, 3, 9)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types index ef1cb731a2e60..1e0acac274aec 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types @@ -30,7 +30,7 @@ f `abc` >`abc` : "abc" f `abc${1}def${2}ghi`; ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 @@ -44,13 +44,13 @@ f `abc`.member >member : I f `abc${1}def${2}ghi`.member; ->f `abc${1}def${2}ghi`.member : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`.member : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 ->member : any +>member : I f `abc`["member"]; >f `abc`["member"] : I @@ -60,8 +60,8 @@ f `abc`["member"]; >"member" : "member" f `abc${1}def${2}ghi`["member"]; ->f `abc${1}def${2}ghi`["member"] : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`["member"] : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 @@ -69,7 +69,7 @@ f `abc${1}def${2}ghi`["member"]; >"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; ->f `abc`[0].member `abc${1}def${2}ghi` : any +>f `abc`[0].member `abc${1}def${2}ghi` : I >f `abc`[0].member : I >f `abc`[0] : I >f `abc` : I @@ -82,22 +82,22 @@ f `abc`[0].member `abc${1}def${2}ghi`; >2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ->f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : any ->f `abc${1}def${2}ghi`["member"].member : any ->f `abc${1}def${2}ghi`["member"] : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I +>f `abc${1}def${2}ghi`["member"].member : I +>f `abc${1}def${2}ghi`["member"] : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 >"member" : "member" ->member : any +>member : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ->f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi` : any +>f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi` : I >f `abc${ true }def${ true }ghi`["member"].member : I >f `abc${ true }def${ true }ghi`["member"] : I >f `abc${ true }def${ true }ghi` : I diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt index 9d1ee541e4f2b..00d0f276dc9e0 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt @@ -3,10 +3,11 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,46): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (7 errors) ==== interface I { (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; @@ -43,6 +44,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ !!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. + ~ +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols index 5ec23bae79a3a..bc03851173c03 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols @@ -45,7 +45,9 @@ f `abc`.member >member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) f `abc${1}def${2}ghi`.member; +>f `abc${1}def${2}ghi`.member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 9, 3)) +>member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) f `abc`["member"]; >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 9, 3)) @@ -53,6 +55,7 @@ f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 9, 3)) +>"member" : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) @@ -60,7 +63,10 @@ f `abc`[0].member `abc${1}def${2}ghi`; >member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; +>f `abc${1}def${2}ghi`["member"].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) >f : Symbol(f, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 9, 3)) +>"member" : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) +>member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; >f `abc${ true }def${ true }ghi`["member"].member : Symbol(I.member, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 3, 9)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types index 7eca6e57845d0..39993e1367b6f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types @@ -30,7 +30,7 @@ f `abc` >`abc` : "abc" f `abc${1}def${2}ghi`; ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 @@ -44,13 +44,13 @@ f `abc`.member >member : I f `abc${1}def${2}ghi`.member; ->f `abc${1}def${2}ghi`.member : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`.member : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 ->member : any +>member : I f `abc`["member"]; >f `abc`["member"] : I @@ -60,8 +60,8 @@ f `abc`["member"]; >"member" : "member" f `abc${1}def${2}ghi`["member"]; ->f `abc${1}def${2}ghi`["member"] : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`["member"] : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 @@ -69,7 +69,7 @@ f `abc${1}def${2}ghi`["member"]; >"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; ->f `abc`[0].member `abc${1}def${2}ghi` : any +>f `abc`[0].member `abc${1}def${2}ghi` : I >f `abc`[0].member : I >f `abc`[0] : I >f `abc` : I @@ -82,22 +82,22 @@ f `abc`[0].member `abc${1}def${2}ghi`; >2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ->f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : any ->f `abc${1}def${2}ghi`["member"].member : any ->f `abc${1}def${2}ghi`["member"] : any ->f `abc${1}def${2}ghi` : any +>f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I +>f `abc${1}def${2}ghi`["member"].member : I +>f `abc${1}def${2}ghi`["member"] : I +>f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 >"member" : "member" ->member : any +>member : I >`abc${1}def${2}ghi` : string >1 : 1 >2 : 2 f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ->f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi` : any +>f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi` : I >f `abc${ true }def${ true }ghi`["member"].member : I >f `abc${ true }def${ true }ghi`["member"] : I >f `abc${ true }def${ true }ghi` : I diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types index d37fc6e81d5c5..e809c1c274578 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types @@ -29,45 +29,45 @@ function foo(...stuff: any[]): any { } var a = foo([]); // number ->a : any ->foo([]) : any +>a : never +>foo([]) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] var b = foo([], 1); // string ->b : any ->foo([], 1) : any +>b : never +>foo([], 1) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 var c = foo([], 1, 2); // boolean ->c : any ->foo([], 1, 2) : any +>c : never +>foo([], 1, 2) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >2 : 2 var d = foo([], 1, true); // boolean (with error) ->d : any ->foo([], 1, true) : any +>d : never +>foo([], 1, true) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >true : true var e = foo([], 1, "2"); // {} ->e : any ->foo([], 1, "2") : any +>e : never +>foo([], 1, "2") : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >"2" : "2" var f = foo([], 1, 2, 3); // any (with error) ->f : any ->foo([], 1, 2, 3) : any +>f : never +>foo([], 1, 2, 3) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 @@ -96,8 +96,8 @@ var w = foo `${1}${2}`; // boolean >2 : 2 var x = foo `${1}${true}`; // boolean (with error) ->x : any ->foo `${1}${true}` : any +>x : never +>foo `${1}${true}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >`${1}${true}` : string >1 : 1 @@ -112,8 +112,8 @@ var y = foo `${1}${"2"}`; // {} >"2" : "2" var z = foo `${1}${2}${3}`; // any (with error) ->z : any ->foo `${1}${2}${3}` : any +>z : never +>foo `${1}${2}${3}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >`${1}${2}${3}` : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types index b3b0d9d2aecf5..d9cb80eb05c80 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types @@ -29,45 +29,45 @@ function foo(...stuff: any[]): any { } var a = foo([]); // number ->a : any ->foo([]) : any +>a : never +>foo([]) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] var b = foo([], 1); // string ->b : any ->foo([], 1) : any +>b : never +>foo([], 1) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 var c = foo([], 1, 2); // boolean ->c : any ->foo([], 1, 2) : any +>c : never +>foo([], 1, 2) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >2 : 2 var d = foo([], 1, true); // boolean (with error) ->d : any ->foo([], 1, true) : any +>d : never +>foo([], 1, true) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >true : true var e = foo([], 1, "2"); // {} ->e : any ->foo([], 1, "2") : any +>e : never +>foo([], 1, "2") : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 >"2" : "2" var f = foo([], 1, 2, 3); // any (with error) ->f : any ->foo([], 1, 2, 3) : any +>f : never +>foo([], 1, 2, 3) : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >[] : undefined[] >1 : 1 @@ -96,8 +96,8 @@ var w = foo `${1}${2}`; // boolean >2 : 2 var x = foo `${1}${true}`; // boolean (with error) ->x : any ->foo `${1}${true}` : any +>x : never +>foo `${1}${true}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >`${1}${true}` : string >1 : 1 @@ -112,8 +112,8 @@ var y = foo `${1}${"2"}`; // {} >"2" : "2" var z = foo `${1}${2}${3}`; // any (with error) ->z : any ->foo `${1}${2}${3}` : any +>z : never +>foo `${1}${2}${3}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } >`${1}${2}${3}` : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types index d4e86cfee6174..3c8d93edf82e1 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types @@ -23,7 +23,7 @@ var s: string = fn1 `${ undefined }`; // No candidate overloads found fn1 `${ {} }`; // Error ->fn1 `${ {} }` : any +>fn1 `${ {} }` : string & number >fn1 : { (strs: TemplateStringsArray, s: string): string; (strs: TemplateStringsArray, n: number): number; } >`${ {} }` : string >{} : {} @@ -166,7 +166,7 @@ var n = fn3 `${ '' }${ '' }${ 3 }`; // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error ->fn3 `` : any +>fn3 `` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } >`` : "" diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types index ced51d0eb3039..b07383ec1c18d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types @@ -23,7 +23,7 @@ var s: string = fn1 `${ undefined }`; // No candidate overloads found fn1 `${ {} }`; // Error ->fn1 `${ {} }` : any +>fn1 `${ {} }` : string & number >fn1 : { (strs: TemplateStringsArray, s: string): string; (strs: TemplateStringsArray, n: number): number; } >`${ {} }` : string >{} : {} @@ -166,7 +166,7 @@ var n = fn3 `${ '' }${ '' }${ 3 }`; // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error ->fn3 `` : any +>fn3 `` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } >`` : "" diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types index 459c6a48777e0..dd512edab241f 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types @@ -8,7 +8,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { // Incomplete call, not enough parameters. f `123qdawdrqw${ 1 }${ ->f `123qdawdrqw${ 1 }${ : any +>f `123qdawdrqw${ 1 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void >`123qdawdrqw${ 1 }${ : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types index 748280c6b6f6b..8fb37587be28d 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types @@ -8,7 +8,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { // Incomplete call, but too many parameters. f `123qdawdrqw${ 1 }${ }${ ->f `123qdawdrqw${ 1 }${ }${ : any +>f `123qdawdrqw${ 1 }${ }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void >`123qdawdrqw${ 1 }${ }${ : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types index db4ebe00d376c..b83f6fd5770ed 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types @@ -8,7 +8,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { // Incomplete call, but too many parameters. f `123qdawdrqw${ 1 }${ 2 }${ ->f `123qdawdrqw${ 1 }${ 2 }${ : any +>f `123qdawdrqw${ 1 }${ 2 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void >`123qdawdrqw${ 1 }${ 2 }${ : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types index 3f2c09341c7bf..6c73c0e59a093 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types @@ -8,7 +8,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { // Incomplete call, not enough parameters, at EOF. f `123qdawdrqw${ 1 }${ ->f `123qdawdrqw${ 1 }${ : any +>f `123qdawdrqw${ 1 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void >`123qdawdrqw${ 1 }${ : string >1 : 1 diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt index 4460743303153..2aa18700d7396 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.errors.txt @@ -1,12 +1,13 @@ tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(13,30): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(15,11): error TS2347: Untyped function calls may not accept type arguments. +tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(17,11): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(17,30): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(35,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class. tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14): error TS1034: 'super' must be followed by an argument list or member access. -==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (7 errors) ==== export interface SomethingTaggable { (t: TemplateStringsArray, ...args: T[]): SomethingNewable; } @@ -28,6 +29,8 @@ tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14 !!! error TS2347: Untyped function calls may not accept type arguments. const d = new tag `${"hello"} ${"world"}`(100, 200); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2347: Untyped function calls may not accept type arguments. ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types index ee7661d84eb7d..f05e59314257c 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types @@ -27,7 +27,7 @@ const a = new tag `${100} ${200}`("hello", "world"); const b = new tag `${"hello"} ${"world"}`(100, 200); >b : any >new tag `${"hello"} ${"world"}`(100, 200) : any ->tag `${"hello"} ${"world"}` : any +>tag `${"hello"} ${"world"}` : SomethingNewable >tag : SomethingTaggable >`${"hello"} ${"world"}` : string >"hello" : "hello" @@ -51,7 +51,7 @@ const d = new tag `${"hello"} ${"world"}`(100, 200); >d : any >new tag `${"hello"} ${"world"}`(100, 200) : any >new tag `${"hello"} ${"world"}` : any ->tag `${"hello"} ${"world"}` : any +>tag `${"hello"} ${"world"}` : SomethingNewable >tag : SomethingTaggable >`${"hello"} ${"world"}` : string >"hello" : "hello" diff --git a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.types b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.types index 0ec0230668dac..2d807f4ec7d33 100644 --- a/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.types +++ b/tests/baselines/reference/thisExpressionInCallExpressionWithTypeArguments.types @@ -4,15 +4,15 @@ class C { public foo() { [1,2,3].map((x) => { return this; })} >foo : () => void ->[1,2,3].map((x) => { return this; }) : any +>[1,2,3].map((x) => { return this; }) : any[] >[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1,2,3] : number[] >1 : 1 >2 : 2 >3 : 3 >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->(x) => { return this; } : (x: any) => this ->x : any +>(x) => { return this; } : (x: number) => this +>x : number >this : this } diff --git a/tests/baselines/reference/tooManyTypeParameters1.types b/tests/baselines/reference/tooManyTypeParameters1.types index c14b3c2158c8a..4b2f743e4eb70 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.types +++ b/tests/baselines/reference/tooManyTypeParameters1.types @@ -3,7 +3,7 @@ function f() { } >f : () => void f(); ->f() : any +>f() : void >f : () => void var x = () => {}; @@ -11,15 +11,15 @@ var x = () => {}; >() => {} : () => void x(); ->x() : any +>x() : void >x : () => void class C {} >C : C var c = new C(); ->c : any ->new C() : any +>c : C +>new C() : C >C : typeof C interface I {} diff --git a/tests/baselines/reference/tsxElementResolution10.errors.txt b/tests/baselines/reference/tsxElementResolution10.errors.txt index edb0f30d51ea0..3a2802c2ac053 100644 --- a/tests/baselines/reference/tsxElementResolution10.errors.txt +++ b/tests/baselines/reference/tsxElementResolution10.errors.txt @@ -1,8 +1,10 @@ +tests/cases/conformance/jsx/file.tsx(13,1): error TS2605: JSX element type '{ x: number; }' is not a constructor function for JSX elements. + Property 'render' is missing in type '{ x: number; }' but required in type 'ElementClass'. tests/cases/conformance/jsx/file.tsx(13,2): error TS2322: Type '{ x: number; }' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(19,2): error TS2322: Type '{ x: number; render: number; }' is not assignable to type 'string'. -==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== declare module JSX { interface Element { } interface ElementClass { @@ -16,6 +18,10 @@ tests/cases/conformance/jsx/file.tsx(19,2): error TS2322: Type '{ x: number; ren } var Obj1: Obj1type; ; // Error, no render member + ~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type '{ x: number; }' is not a constructor function for JSX elements. +!!! error TS2605: Property 'render' is missing in type '{ x: number; }' but required in type 'ElementClass'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:3: 'render' is declared here. ~~~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type 'string'. diff --git a/tests/baselines/reference/tsxElementResolution9.errors.txt b/tests/baselines/reference/tsxElementResolution9.errors.txt index acfe7ce9cca97..d6f2922a818a5 100644 --- a/tests/baselines/reference/tsxElementResolution9.errors.txt +++ b/tests/baselines/reference/tsxElementResolution9.errors.txt @@ -1,9 +1,13 @@ tests/cases/conformance/jsx/file.tsx(11,2): error TS2322: Type '{}' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(18,1): error TS2605: JSX element type '{ x: number; } & { y: string; }' is not a constructor function for JSX elements. + Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. tests/cases/conformance/jsx/file.tsx(18,2): error TS2322: Type '{}' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(25,1): error TS2605: JSX element type '{ x: number; } & { x: number; y: string; }' is not a constructor function for JSX elements. + Property 'something' is missing in type '{ x: number; } & { x: number; y: string; }' but required in type 'Element'. tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' is not assignable to type 'number'. -==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (5 errors) ==== declare module JSX { interface Element { something; } interface IntrinsicElements { } @@ -24,6 +28,10 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' } var Obj2: Obj2; ; // Error, return type is not an object type + ~~~~~~~~ +!!! error TS2605: JSX element type '{ x: number; } & { y: string; }' is not a constructor function for JSX elements. +!!! error TS2605: Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:2:22: 'something' is declared here. ~~~~ !!! error TS2322: Type '{}' is not assignable to type 'number'. @@ -33,6 +41,10 @@ tests/cases/conformance/jsx/file.tsx(25,2): error TS2322: Type '{ x: number; }' } var Obj3: Obj3; ; // OK + ~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type '{ x: number; } & { x: number; y: string; }' is not a constructor function for JSX elements. +!!! error TS2605: Property 'something' is missing in type '{ x: number; } & { x: number; y: string; }' but required in type 'Element'. +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:2:22: 'something' is declared here. ~~~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.types b/tests/baselines/reference/tsxSpreadAttributesResolution10.types index cf202fd6588ef..9341e9674d5d3 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution10.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.types @@ -42,7 +42,7 @@ let y = ; > : JSX.Element >Opt : typeof Opt >obj : OptionProp ->x : number +>x : 3 >3 : 3 let y1 = ; @@ -57,7 +57,7 @@ let y2 = ; > : JSX.Element >Opt : typeof Opt >obj1 : OptionProp ->x : number +>x : 3 >3 : 3 let y3 = ; diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.types b/tests/baselines/reference/tsxSpreadAttributesResolution12.types index e973dbc3dff99..a6197e7d3db69 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.types @@ -78,10 +78,10 @@ let x1 = >OverWriteAttr : typeof OverWriteAttr >overwrite : string >obj1 : { x: 2; } ->x : number +>x : 3 >3 : 3 ->{y: true} : { y: boolean; } ->y : boolean +>{y: true} : { y: true; } +>y : true >true : true let x2 = @@ -98,8 +98,8 @@ let x3 = >OverWriteAttr : typeof OverWriteAttr >overwrite : string >obj1 : { x: 2; } ->{y: true} : { y: boolean; } ->y : boolean +>{y: true} : { y: true; } +>y : true >true : true diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.types b/tests/baselines/reference/tsxSpreadAttributesResolution2.types index bccbbcdc7fc73..bd9a3e17c38a3 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution2.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.types @@ -63,20 +63,20 @@ let w = ; >w : JSX.Element > : JSX.Element >Poisoned : typeof Poisoned ->{x: 5, y: "2"} : { x: number; y: string; } +>{x: 5, y: "2"} : { x: number; y: "2"; } >x : number >5 : 5 ->y : string +>y : "2" >"2" : "2" let w1 = ; >w1 : JSX.Element > : JSX.Element >Poisoned : typeof Poisoned ->{x: 5, y: "2"} : { x: number; y: string; } +>{x: 5, y: "2"} : { x: number; y: "2"; } >x : number >5 : 5 ->y : string +>y : "2" >"2" : "2" >X : string diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.types b/tests/baselines/reference/tsxSpreadAttributesResolution6.types index dc6364b6306da..f8abfc34b2301 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution6.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.types @@ -34,7 +34,7 @@ let x = >x : JSX.Element > : JSX.Element >TextComponent : typeof TextComponent ->editable : boolean +>editable : true >true : true const textProps: TextProps = { diff --git a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt index 565485f03b70b..25d62a07fa514 100644 --- a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt @@ -1,7 +1,8 @@ +tests/cases/compiler/file.tsx(11,1): error TS2605: JSX element type 'string' is not a constructor function for JSX elements. tests/cases/compiler/file.tsx(11,14): error TS2322: Type 'number' is not assignable to type 'string'. -==== tests/cases/compiler/file.tsx (1 errors) ==== +==== tests/cases/compiler/file.tsx (2 errors) ==== declare namespace JSX { interface Element { render(): Element | string | false; @@ -13,6 +14,8 @@ tests/cases/compiler/file.tsx(11,14): error TS2322: Type 'number' is not assigna } prop={1}>; // should error + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'string' is not a constructor function for JSX elements. ~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2WithError.types b/tests/baselines/reference/typeArgInference2WithError.types index 66e2800f7ffb0..e7b3ad5e20d2f 100644 --- a/tests/baselines/reference/typeArgInference2WithError.types +++ b/tests/baselines/reference/typeArgInference2WithError.types @@ -10,8 +10,8 @@ declare function foo(x?: T, y?: T): T; >y : T var z7 = foo("abc", 5); // Error ->z7 : any ->foo("abc", 5) : any +>z7 : Item +>foo("abc", 5) : Item >foo : (x?: T, y?: T) => T >"abc" : "abc" >5 : 5 diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.types b/tests/baselines/reference/typeArgumentConstraintResolution1.types index f23ae0179b77a..78dae7cbb6dbf 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.types +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.types @@ -32,7 +32,7 @@ function foo2(test: any): any { return null; } >null : null foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' ->foo2("") : any +>foo2("") : Date >foo2 : { (test: T): T; (test: string): T; } >"" : "" diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 95e47ab583f22..ef0f716e0ef48 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,10 +1,11 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(69,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts (3 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts (4 errors) ==== // Generic call with no parameters function noParams() { } noParams(); @@ -76,6 +77,8 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '""'. var a9a: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInference.types b/tests/baselines/reference/typeArgumentInference.types index 8e92373f74599..e31658dea1ad0 100644 --- a/tests/baselines/reference/typeArgumentInference.types +++ b/tests/baselines/reference/typeArgumentInference.types @@ -325,15 +325,15 @@ function someGenerics9(a: T, b: T, c: T): T { >null : null } var a9a = someGenerics9('', 0, []); ->a9a : any ->someGenerics9('', 0, []) : any +>a9a : string +>someGenerics9('', 0, []) : "" >someGenerics9 : (a: T, b: T, c: T) => T >'' : "" >0 : 0 >[] : undefined[] var a9a: {}; ->a9a : any +>a9a : string var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); >a9b : { a?: number; b?: string; } @@ -390,8 +390,8 @@ var a9e: {}; >a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ->a9f : any ->someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }) : any +>a9f : A92 +>someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }) : A92 >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined >{ x: 6, z: new Date() } : { x: number; z: Date; } @@ -407,7 +407,7 @@ var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' } >'' : "" var a9f: A92; ->a9f : any +>a9f : A92 // Generic call with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index 8707ff26ef052..5e036b2aaa133 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -9,12 +9,13 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,33): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(107,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts (7 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts (8 errors) ==== // Generic call with no parameters interface NoParams { new (); @@ -138,6 +139,8 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '""'. var a9a: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types index af5f3f0c445a8..9bac46b88561a 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types @@ -392,15 +392,15 @@ var someGenerics9: someGenerics9; >someGenerics9 : someGenerics9 var a9a = new someGenerics9('', 0, []); ->a9a : any ->new someGenerics9('', 0, []) : any +>a9a : string +>new someGenerics9('', 0, []) : "" >someGenerics9 : someGenerics9 >'' : "" >0 : 0 >[] : undefined[] var a9a: {}; ->a9a : any +>a9a : string var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); >a9b : { a?: number; b?: string; } @@ -456,8 +456,8 @@ var a9e: {}; >a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9f : any ->new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : any +>a9f : A92 +>new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : A92 >someGenerics9 : someGenerics9 >undefined : undefined >{ x: 6, z: window } : { x: number; z: Window; } @@ -472,7 +472,7 @@ var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' } >'' : "" var a9f: A92; ->a9f : any +>a9f : A92 // Generic call with multiple parameters of generic type passed arguments with a single best common type var a9d = new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.types b/tests/baselines/reference/typeArgumentInferenceErrors.types index a334cbbe66f83..8e90b86a5c920 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.types +++ b/tests/baselines/reference/typeArgumentInferenceErrors.types @@ -6,7 +6,7 @@ function someGenerics1(n: T, m: number) { } >m : number someGenerics1(3, 4); // Error ->someGenerics1(3, 4) : any +>someGenerics1(3, 4) : void >someGenerics1 : (n: T, m: number) => void >3 : 3 >4 : 4 @@ -19,7 +19,7 @@ function someGenerics4(n: T, f: (x: U) => void) { } >x : U someGenerics4('', (x: string) => ''); // Error ->someGenerics4('', (x: string) => '') : any +>someGenerics4('', (x: string) => '') : void >someGenerics4 : (n: T, f: (x: U) => void) => void >'' : "" >(x: string) => '' : (x: string) => string @@ -34,7 +34,7 @@ function someGenerics5(n: T, f: (x: U) => void) { } >x : U someGenerics5('', (x: string) => ''); // Error ->someGenerics5('', (x: string) => '') : any +>someGenerics5('', (x: string) => '') : void >someGenerics5 : (n: T, f: (x: U) => void) => void >'' : "" >(x: string) => '' : (x: string) => string @@ -52,7 +52,7 @@ function someGenerics6(a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } >c : A someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error ->someGenerics6((n: number) => n, (n: string) => n, (n: number) => n) : any +>someGenerics6((n: number) => n, (n: string) => n, (n: number) => n) : void >someGenerics6 : (a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >(n: number) => n : (n: number) => number >n : number diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt index 6a691c2045a8e..0d279d7027020 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts(6,5): error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'. +tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts(6,38): error TS2339: Property 'length' does not exist on type '{}'. -==== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts (1 errors) ==== +==== tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts (2 errors) ==== function foo(x = class { prop: T }): T { return undefined; } @@ -12,4 +13,6 @@ tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpre ~~~~~ !!! error TS2345: Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'typeof (Anonymous class)'. !!! error TS2345: Property 'prop' is missing in type '(Anonymous class)' but required in type 'foo<{}>.(Anonymous class)'. -!!! related TS2728 tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts:1:29: 'prop' is declared here. \ No newline at end of file +!!! related TS2728 tests/cases/conformance/es6/classExpressions/typeArgumentInferenceWithClassExpression2.ts:1:29: 'prop' is declared here. + ~~~~~~ +!!! error TS2339: Property 'length' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.types b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.types index 413cc6462333e..61f6d8a792e79 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.types +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression2.types @@ -12,7 +12,7 @@ function foo(x = class { prop: T }): T { // Should not infer string because it is a static property foo(class { static prop = "hello" }).length; >foo(class { static prop = "hello" }).length : any ->foo(class { static prop = "hello" }) : any +>foo(class { static prop = "hello" }) : {} >foo : (x?: typeof (Anonymous class)) => T >class { static prop = "hello" } : typeof (Anonymous class) >prop : string diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.types b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.types index 4eb209cd1c090..e22a0566c0733 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.types @@ -21,7 +21,7 @@ var e: Elephant; >e : Elephant f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal ->f(g, e) : any +>f(g, e) : Giraffe >f : (x: T, y: T) => T >g : Giraffe >e : Elephant diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 3b7750f23f009..633b73da4b4c0 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -14,13 +14,15 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(67,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(74,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts (13 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts (15 errors) ==== // Generic call with no parameters function noParams() { } noParams(); @@ -115,6 +117,8 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst ~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. x(null, null, null); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. // Generic call with multiple parameters of generic type passed arguments with no best common type function someGenerics9(a: T, b: T, c: T): T { @@ -124,6 +128,8 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '""'. var a9a: {}; + ~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9a' must be of type 'string', but here has type '{}'. var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types index d6d745e7bc4e4..ff89e45e22877 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types @@ -31,7 +31,7 @@ noGenericParams(''); >'' : "" noGenericParams<{}>(''); // Error ->noGenericParams<{}>('') : any +>noGenericParams<{}>('') : void >noGenericParams : (n: string) => void >'' : "" @@ -48,13 +48,13 @@ someGenerics1(3, 4); // Valid >4 : 4 someGenerics1(3, 4); // Error ->someGenerics1(3, 4) : any +>someGenerics1(3, 4) : void >someGenerics1 : (n: T, m: number) => void >3 : 3 >4 : 4 someGenerics1(3, 4); // Error ->someGenerics1(3, 4) : any +>someGenerics1(3, 4) : void >someGenerics1 : (n: T, m: number) => void >3 : 3 >4 : 4 @@ -138,7 +138,7 @@ function someGenerics3(producer: () => T) { } >producer : () => T someGenerics3(() => ''); // Error ->someGenerics3(() => '') : any +>someGenerics3(() => '') : void >someGenerics3 : (producer: () => T) => void >() => '' : () => string >'' : "" @@ -150,7 +150,7 @@ someGenerics3(() => undefined); >undefined : undefined someGenerics3(() => 3); // Error ->someGenerics3(() => 3) : any +>someGenerics3(() => 3) : void >someGenerics3 : (producer: () => T) => void >() => 3 : () => number >3 : 3 @@ -177,7 +177,7 @@ someGenerics4('', () => 3); >3 : 3 someGenerics4('', (x: string) => ''); // Error ->someGenerics4('', (x: string) => '') : any +>someGenerics4('', (x: string) => '') : void >someGenerics4 : (n: T, f: (x: U) => void) => void >'' : "" >(x: string) => '' : (x: string) => string @@ -212,7 +212,7 @@ someGenerics5('', () => 3); >3 : 3 someGenerics5('', (x: string) => ''); // Error ->someGenerics5('', (x: string) => '') : any +>someGenerics5('', (x: string) => '') : void >someGenerics5 : (n: T, f: (x: U) => void) => void >'' : "" >(x: string) => '' : (x: string) => string @@ -220,7 +220,7 @@ someGenerics5('', (x: string) => ''); // Error >'' : "" someGenerics5(null, null); // Error ->someGenerics5(null, null) : any +>someGenerics5(null, null) : void >someGenerics5 : (n: T, f: (x: U) => void) => void >null : null >null : null @@ -262,7 +262,7 @@ someGenerics6(n => n, n => n, n => n); >n : number someGenerics6((n: number) => n, (n: string) => n, (n: number) => n); // Error ->someGenerics6((n: number) => n, (n: string) => n, (n: number) => n) : any +>someGenerics6((n: number) => n, (n: string) => n, (n: number) => n) : void >someGenerics6 : (a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) => void >(n: number) => n : (n: number) => number >n : number @@ -343,14 +343,14 @@ function someGenerics8(n: T): T { return n; } >n : T var x = someGenerics8(someGenerics7); // Error ->x : any ->someGenerics8(someGenerics7) : any +>x : string +>someGenerics8(someGenerics7) : string >someGenerics8 : (n: T) => T >someGenerics7 : (a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void x(null, null, null); // Error >x(null, null, null) : any ->x : any +>x : string >null : null >null : null >null : null @@ -366,15 +366,15 @@ function someGenerics9(a: T, b: T, c: T): T { >null : null } var a9a = someGenerics9('', 0, []); ->a9a : any ->someGenerics9('', 0, []) : any +>a9a : string +>someGenerics9('', 0, []) : "" >someGenerics9 : (a: T, b: T, c: T) => T >'' : "" >0 : 0 >[] : undefined[] var a9a: {}; ->a9a : any +>a9a : string var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); >a9b : { a?: number; b?: string; } @@ -430,8 +430,8 @@ var a9e: {}; >a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9f : any ->someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : any +>a9f : A92 +>someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : A92 >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined >{ x: 6, z: window } : { x: number; z: Window; } @@ -446,7 +446,7 @@ var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >'' : "" var a9f: A92; ->a9f : any +>a9f : A92 // Generic call with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); diff --git a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.types b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.types index 380e1eb686b18..62cc1ecaf280c 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.types +++ b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.types @@ -144,8 +144,8 @@ var v2 = f1({ w: x => x, r: () => E1.X }, E1.X); >X : E1 var v3 = f1({ w: x => x, r: () => E1.X }, E2.X); // Error ->v3 : any ->f1({ w: x => x, r: () => E1.X }, E2.X) : any +>v3 : {} +>f1({ w: x => x, r: () => E1.X }, E2.X) : {} >f1 : (a: { w: (x: T) => U; r: () => T; }, b: T) => U >{ w: x => x, r: () => E1.X } : { w: (x: E1) => E1; r: () => E1; } >w : (x: E1) => E1 diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt index fa9231635e435..ccef9264b10d2 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt @@ -12,23 +12,41 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(56,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(57,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(60,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(61,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(62,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(63,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(64,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(74,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(76,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(78,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(86,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(87,43): error TS2345: Argument of type '"Hello"' is not assignable to parameter of type '"World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(88,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(92,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(93,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(94,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(95,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(96,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(99,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(101,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(102,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. + Type '"World"' is not assignable to type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(103,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. Type '"World"' is not assignable to type '"Hello"'. -==== tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts (24 errors) ==== +==== tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts (36 errors) ==== declare function randBool(): boolean; declare function takeReturnString(str: string): string; declare function takeReturnHello(str: "Hello"): "Hello"; @@ -118,11 +136,17 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 ~ !!! error TS2322: Type 'string' is not assignable to type '"Hello"'. b = takeReturnString(b); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. c = takeReturnString(c); ~ !!! error TS2322: Type 'string' is not assignable to type '"Hello"'. d = takeReturnString(d); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. e = takeReturnString(e); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. // Should be valid a = takeReturnHello(a); @@ -137,12 +161,21 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 !!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. !!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. b = takeReturnHelloWorld(b); + ~ +!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. +!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. c = takeReturnHelloWorld(c); ~ !!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. !!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. d = takeReturnHelloWorld(d); + ~ +!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. +!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. e = takeReturnHelloWorld(e); + ~ +!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. +!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. } @@ -166,8 +199,14 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 ~ !!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. b = takeReturnString(b); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. c = takeReturnString(c); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. d = takeReturnString(d); + ~ +!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. e = takeReturnString(e); ~ !!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. @@ -178,8 +217,17 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 !!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. !!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. b = takeReturnHello(b); + ~ +!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. +!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. c = takeReturnHello(c); + ~ +!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. +!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. d = takeReturnHello(d); + ~ +!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. +!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. e = takeReturnHello(e); ~ !!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js index 0e59e208b810f..d011a9db44237 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js @@ -229,15 +229,15 @@ declare namespace n1 { } declare namespace n2 { let a: "Hello"; - let b: any; + let b: "Hello"; let c: "Hello"; - let d: any; - let e: any; + let d: "Hello"; + let e: "Hello"; } declare namespace n3 { let a: "Hello" | "World"; - let b: any; - let c: any; - let d: any; + let b: "Hello" | "World"; + let c: "Hello" | "World"; + let d: "Hello" | "World"; let e: "Hello" | "World"; } diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.types b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.types index 7812e98aa16f9..f97d6c3abd2b8 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.types +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.types @@ -133,35 +133,35 @@ namespace n1 { // Passing these as arguments should cause an error. a = takeReturnHello(a); ->a = takeReturnHello(a) : any +>a = takeReturnHello(a) : "Hello" >a : string >takeReturnHello(a) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" >a : string b = takeReturnHello(b); ->b = takeReturnHello(b) : any +>b = takeReturnHello(b) : "Hello" >b : string >takeReturnHello(b) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" >b : string c = takeReturnHello(c); ->c = takeReturnHello(c) : any +>c = takeReturnHello(c) : "Hello" >c : string >takeReturnHello(c) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" >c : string d = takeReturnHello(d); ->d = takeReturnHello(d) : any +>d = takeReturnHello(d) : "Hello" >d : string >takeReturnHello(d) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" >d : string e = takeReturnHello(e); ->e = takeReturnHello(e) : any +>e = takeReturnHello(e) : "Hello" >e : string >takeReturnHello(e) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" @@ -169,35 +169,35 @@ namespace n1 { // Passing these as arguments should cause an error. a = takeReturnHelloWorld(a); ->a = takeReturnHelloWorld(a) : any +>a = takeReturnHelloWorld(a) : "Hello" | "World" >a : string >takeReturnHelloWorld(a) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" >a : string b = takeReturnHelloWorld(b); ->b = takeReturnHelloWorld(b) : any +>b = takeReturnHelloWorld(b) : "Hello" | "World" >b : string >takeReturnHelloWorld(b) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" >b : string c = takeReturnHelloWorld(c); ->c = takeReturnHelloWorld(c) : any +>c = takeReturnHelloWorld(c) : "Hello" | "World" >c : string >takeReturnHelloWorld(c) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" >c : string d = takeReturnHelloWorld(d); ->d = takeReturnHelloWorld(d) : any +>d = takeReturnHelloWorld(d) : "Hello" | "World" >d : string >takeReturnHelloWorld(d) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" >d : string e = takeReturnHelloWorld(e); ->e = takeReturnHelloWorld(e) : any +>e = takeReturnHelloWorld(e) : "Hello" | "World" >e : string >takeReturnHelloWorld(e) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" @@ -217,8 +217,8 @@ namespace n2 { >"Hello" : "Hello" export let b = fun1<"Hello">("Hello", "World"); ->b : any ->fun1<"Hello">("Hello", "World") : any +>b : "Hello" +>fun1<"Hello">("Hello", "World") : "Hello" >fun1 : (x: T, y: T) => T >"Hello" : "Hello" >"World" : "World" @@ -231,15 +231,15 @@ namespace n2 { >"Hello" : "Hello" export let d = fun2<"Hello", "Hello">("Hello", "World"); ->d : any ->fun2<"Hello", "Hello">("Hello", "World") : any +>d : "Hello" +>fun2<"Hello", "Hello">("Hello", "World") : "Hello" >fun2 : (x: T, y: U) => T | U >"Hello" : "Hello" >"World" : "World" export let e = fun3<"Hello">("Hello", "World"); ->e : any ->fun3<"Hello">("Hello", "World") : any +>e : "Hello" +>fun3<"Hello">("Hello", "World") : "Hello" >fun3 : (...args: T[]) => T >"Hello" : "Hello" >"World" : "World" @@ -254,10 +254,10 @@ namespace n2 { b = takeReturnString(b); >b = takeReturnString(b) : string ->b : any +>b : "Hello" >takeReturnString(b) : string >takeReturnString : (str: string) => string ->b : any +>b : "Hello" c = takeReturnString(c); >c = takeReturnString(c) : string @@ -268,17 +268,17 @@ namespace n2 { d = takeReturnString(d); >d = takeReturnString(d) : string ->d : any +>d : "Hello" >takeReturnString(d) : string >takeReturnString : (str: string) => string ->d : any +>d : "Hello" e = takeReturnString(e); >e = takeReturnString(e) : string ->e : any +>e : "Hello" >takeReturnString(e) : string >takeReturnString : (str: string) => string ->e : any +>e : "Hello" // Should be valid a = takeReturnHello(a); @@ -290,10 +290,10 @@ namespace n2 { b = takeReturnHello(b); >b = takeReturnHello(b) : "Hello" ->b : any +>b : "Hello" >takeReturnHello(b) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->b : any +>b : "Hello" c = takeReturnHello(c); >c = takeReturnHello(c) : "Hello" @@ -304,17 +304,17 @@ namespace n2 { d = takeReturnHello(d); >d = takeReturnHello(d) : "Hello" ->d : any +>d : "Hello" >takeReturnHello(d) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->d : any +>d : "Hello" e = takeReturnHello(e); >e = takeReturnHello(e) : "Hello" ->e : any +>e : "Hello" >takeReturnHello(e) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->e : any +>e : "Hello" // Assignment from the returned value should cause an error. a = takeReturnHelloWorld(a); @@ -326,10 +326,10 @@ namespace n2 { b = takeReturnHelloWorld(b); >b = takeReturnHelloWorld(b) : "Hello" | "World" ->b : any +>b : "Hello" >takeReturnHelloWorld(b) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->b : any +>b : "Hello" c = takeReturnHelloWorld(c); >c = takeReturnHelloWorld(c) : "Hello" | "World" @@ -340,17 +340,17 @@ namespace n2 { d = takeReturnHelloWorld(d); >d = takeReturnHelloWorld(d) : "Hello" | "World" ->d : any +>d : "Hello" >takeReturnHelloWorld(d) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->d : any +>d : "Hello" e = takeReturnHelloWorld(e); >e = takeReturnHelloWorld(e) : "Hello" | "World" ->e : any +>e : "Hello" >takeReturnHelloWorld(e) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->e : any +>e : "Hello" } @@ -367,22 +367,22 @@ namespace n3 { >"World" : "World" export let b = fun2<"Hello", "World">("World", "Hello"); ->b : any ->fun2<"Hello", "World">("World", "Hello") : any +>b : "Hello" | "World" +>fun2<"Hello", "World">("World", "Hello") : "Hello" | "World" >fun2 : (x: T, y: U) => T | U >"World" : "World" >"Hello" : "Hello" export let c = fun2<"World", "Hello">("Hello", "Hello"); ->c : any ->fun2<"World", "Hello">("Hello", "Hello") : any +>c : "Hello" | "World" +>fun2<"World", "Hello">("Hello", "Hello") : "Hello" | "World" >fun2 : (x: T, y: U) => T | U >"Hello" : "Hello" >"Hello" : "Hello" export let d = fun2<"World", "Hello">("World", "World"); ->d : any ->fun2<"World", "Hello">("World", "World") : any +>d : "Hello" | "World" +>fun2<"World", "Hello">("World", "World") : "Hello" | "World" >fun2 : (x: T, y: U) => T | U >"World" : "World" >"World" : "World" @@ -404,24 +404,24 @@ namespace n3 { b = takeReturnString(b); >b = takeReturnString(b) : string ->b : any +>b : "Hello" | "World" >takeReturnString(b) : string >takeReturnString : (str: string) => string ->b : any +>b : "Hello" | "World" c = takeReturnString(c); >c = takeReturnString(c) : string ->c : any +>c : "Hello" | "World" >takeReturnString(c) : string >takeReturnString : (str: string) => string ->c : any +>c : "Hello" | "World" d = takeReturnString(d); >d = takeReturnString(d) : string ->d : any +>d : "Hello" | "World" >takeReturnString(d) : string >takeReturnString : (str: string) => string ->d : any +>d : "Hello" | "World" e = takeReturnString(e); >e = takeReturnString(e) : string @@ -432,7 +432,7 @@ namespace n3 { // Passing these as arguments should cause an error. a = takeReturnHello(a); ->a = takeReturnHello(a) : any +>a = takeReturnHello(a) : "Hello" >a : "Hello" | "World" >takeReturnHello(a) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" @@ -440,27 +440,27 @@ namespace n3 { b = takeReturnHello(b); >b = takeReturnHello(b) : "Hello" ->b : any +>b : "Hello" | "World" >takeReturnHello(b) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->b : any +>b : "Hello" | "World" c = takeReturnHello(c); >c = takeReturnHello(c) : "Hello" ->c : any +>c : "Hello" | "World" >takeReturnHello(c) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->c : any +>c : "Hello" | "World" d = takeReturnHello(d); >d = takeReturnHello(d) : "Hello" ->d : any +>d : "Hello" | "World" >takeReturnHello(d) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" ->d : any +>d : "Hello" | "World" e = takeReturnHello(e); ->e = takeReturnHello(e) : any +>e = takeReturnHello(e) : "Hello" >e : "Hello" | "World" >takeReturnHello(e) : "Hello" >takeReturnHello : (str: "Hello") => "Hello" @@ -476,24 +476,24 @@ namespace n3 { b = takeReturnHelloWorld(b); >b = takeReturnHelloWorld(b) : "Hello" | "World" ->b : any +>b : "Hello" | "World" >takeReturnHelloWorld(b) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->b : any +>b : "Hello" c = takeReturnHelloWorld(c); >c = takeReturnHelloWorld(c) : "Hello" | "World" ->c : any +>c : "Hello" | "World" >takeReturnHelloWorld(c) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->c : any +>c : "Hello" d = takeReturnHelloWorld(d); >d = takeReturnHelloWorld(d) : "Hello" | "World" ->d : any +>d : "Hello" | "World" >takeReturnHelloWorld(d) : "Hello" | "World" >takeReturnHelloWorld : (str: "Hello" | "World") => "Hello" | "World" ->d : any +>d : "Hello" e = takeReturnHelloWorld(e); >e = takeReturnHelloWorld(e) : "Hello" | "World" diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.types b/tests/baselines/reference/typeAssertionToGenericFunctionType.types index 6bf02c87e9aab..718660a59301a 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.types +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.types @@ -19,14 +19,14 @@ var x = { >x : T } x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition ->x.a(1) : any +>x.a(1) : string >x.a : (x: T) => T >x : { a: (x: T) => T; b: (x: T) => void; } >a : (x: T) => T >1 : 1 x.b(); // error ->x.b() : any +>x.b() : void >x.b : (x: T) => void >x : { a: (x: T) => T; b: (x: T) => void; } >b : (x: T) => void diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.types b/tests/baselines/reference/typeInferenceConflictingCandidates.types index dea7c49732042..27044d6e1d8b1 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.types +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.types @@ -7,11 +7,11 @@ declare function g(a: T, b: T, c: (t: T) => T): T; >t : T g("", 3, a => a); ->g("", 3, a => a) : any +>g("", 3, a => a) : "" >g : (a: T, b: T, c: (t: T) => T) => T >"" : "" >3 : 3 ->a => a : (a: any) => any ->a : any ->a : any +>a => a : (a: "") => "" +>a : "" +>a : "" diff --git a/tests/baselines/reference/typeOfOnTypeArg.types b/tests/baselines/reference/typeOfOnTypeArg.types index de3202e49724c..d2575b3164a96 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.types +++ b/tests/baselines/reference/typeOfOnTypeArg.types @@ -13,7 +13,7 @@ function fill(f: B) { } fill(32); ->fill(32) : any +>fill(32) : void >fill : (f: B) => void >32 : 32 diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.types index b93b43c454eb2..9dafa8925f0b1 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.types @@ -9,13 +9,13 @@ function foo(x: T, y: U): U { return y; } // this is now an erro >y : U foo(1, ''); ->foo(1, '') : any +>foo(1, '') : number >foo : (x: T, y: U) => U >1 : 1 >'' : "" foo(1, {}); ->foo(1, {}) : any +>foo(1, {}) : number >foo : (x: T, y: U) => U >1 : 1 >{} : {} @@ -28,8 +28,8 @@ var n: NumberVariant; >n : NumberVariant var r3 = foo(1, n); ->r3 : any ->foo(1, n) : any +>r3 : number +>foo(1, n) : number >foo : (x: T, y: U) => U >1 : 1 >n : NumberVariant @@ -42,7 +42,7 @@ function foo2(x: T, y: U) { return y; } // this is n >y : U foo2(1, { length: '' }); ->foo2(1, { length: '' }) : any +>foo2(1, { length: '' }) : { length: number; } >foo2 : (x: T, y: U) => U >1 : 1 >{ length: '' } : { length: string; } @@ -50,7 +50,7 @@ foo2(1, { length: '' }); >'' : "" foo2(1, { length: {} }); ->foo2(1, { length: {} }) : any +>foo2(1, { length: {} }) : { length: number; } >foo2 : (x: T, y: U) => U >1 : 1 >{ length: {} } : { length: {}; } @@ -58,7 +58,7 @@ foo2(1, { length: {} }); >{} : {} foo2([], ['']); ->foo2([], ['']) : any +>foo2([], ['']) : { length: any[]; } >foo2 : (x: T, y: U) => U >[] : undefined[] >[''] : string[] diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.types b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.types index 84269305da341..9e255a470574e 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.types +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments2.types @@ -24,8 +24,8 @@ var a: A, b: B; >b : B var d = f(a, b, x => x, x => x); // A => A not assignable to A => B ->d : any ->f(a, b, x => x, x => x) : any +>d : [A, B] +>f(a, b, x => x, x => x) : [A, B] >f : (y: T, y1: U, p: (z: U) => T, p1: (x: T) => U) => [T, U] >a : A >b : B diff --git a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.types b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.types index 9b71839c4fcc8..1eaee8388807f 100644 --- a/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.types +++ b/tests/baselines/reference/typeParameterFixingWithContextSensitiveArguments3.types @@ -24,8 +24,8 @@ var a: A, b: B; >b : B var d = f(a, b, u2 => u2.b, t2 => t2); ->d : any ->f(a, b, u2 => u2.b, t2 => t2) : any +>d : [A, B] +>f(a, b, u2 => u2.b, t2 => t2) : [A, B] >f : (t1: T, u1: U, pf1: (u2: U) => T, pf2: (t2: T) => U) => [T, U] >a : A >b : B diff --git a/tests/baselines/reference/typesWithPublicConstructor.errors.txt b/tests/baselines/reference/typesWithPublicConstructor.errors.txt index 9aa44dea89da5..b62ccf63b9d45 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPublicConstructor.errors.txt @@ -1,9 +1,11 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. Type 'Function' provides no match for the signature '(): void'. tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/members/typesWithPublicConstructor.ts(16,5): error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. + Type 'Function' provides no match for the signature '(x: number): void'. -==== tests/cases/conformance/types/members/typesWithPublicConstructor.ts (2 errors) ==== +==== tests/cases/conformance/types/members/typesWithPublicConstructor.ts (3 errors) ==== // public is allowed on a constructor but is not meaningful class C { @@ -25,4 +27,7 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): erro ~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. !!! related TS6210 tests/cases/conformance/types/members/typesWithPublicConstructor.ts:11:24: An argument for 'x' was not provided. - var r2: (x: number) => void = c2.constructor; \ No newline at end of file + var r2: (x: number) => void = c2.constructor; + ~~ +!!! error TS2322: Type 'Function' is not assignable to type '(x: number) => void'. +!!! error TS2322: Type 'Function' provides no match for the signature '(x: number): void'. \ No newline at end of file diff --git a/tests/baselines/reference/typesWithPublicConstructor.symbols b/tests/baselines/reference/typesWithPublicConstructor.symbols index eb284064f7b07..b429e86d1732a 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.symbols +++ b/tests/baselines/reference/typesWithPublicConstructor.symbols @@ -34,5 +34,7 @@ var c2 = new C2(); var r2: (x: number) => void = c2.constructor; >r2 : Symbol(r2, Decl(typesWithPublicConstructor.ts, 15, 3)) >x : Symbol(x, Decl(typesWithPublicConstructor.ts, 15, 9)) +>c2.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) >c2 : Symbol(c2, Decl(typesWithPublicConstructor.ts, 14, 3)) +>constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/typesWithPublicConstructor.types b/tests/baselines/reference/typesWithPublicConstructor.types index 74a8e5065ad71..bb08dbdabace1 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.types +++ b/tests/baselines/reference/typesWithPublicConstructor.types @@ -29,14 +29,14 @@ class C2 { } var c2 = new C2(); ->c2 : any ->new C2() : any +>c2 : C2 +>new C2() : C2 >C2 : typeof C2 var r2: (x: number) => void = c2.constructor; >r2 : (x: number) => void >x : number ->c2.constructor : any ->c2 : any ->constructor : any +>c2.constructor : Function +>c2 : C2 +>constructor : Function diff --git a/tests/baselines/reference/undeclaredModuleError.errors.txt b/tests/baselines/reference/undeclaredModuleError.errors.txt index 4a8248bfd6c96..4d18d7e78cd0e 100644 --- a/tests/baselines/reference/undeclaredModuleError.errors.txt +++ b/tests/baselines/reference/undeclaredModuleError.errors.txt @@ -1,10 +1,9 @@ tests/cases/compiler/undeclaredModuleError.ts(1,21): error TS2307: Cannot find module 'fs'. tests/cases/compiler/undeclaredModuleError.ts(8,29): error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: any, name: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. -==== tests/cases/compiler/undeclaredModuleError.ts (3 errors) ==== +==== tests/cases/compiler/undeclaredModuleError.ts (2 errors) ==== import fs = require('fs'); ~~~~ !!! error TS2307: Cannot find module 'fs'. @@ -21,8 +20,6 @@ tests/cases/compiler/undeclaredModuleError.ts(11,41): error TS2304: Cannot find } , (error: Error, files: {}[]) => { files.forEach((file) => { var fullPath = join(IDoNotExist); - ~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'IDoNotExist'. } ); } ); } ); diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index c247c40cd1d89..b801556aa47ff 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -231,11 +231,11 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >0 : 0 _.all([true, 1, null, 'yes'], _.identity); ->_.all([true, 1, null, 'yes'], _.identity) : any +>_.all([true, 1, null, 'yes'], _.identity) : boolean >_.all : { (list: T[], iterator?: Iterator_, context?: any): boolean; (list: Dictionary, iterator?: Iterator_, context?: any): boolean; } >_ : Underscore.Static >all : { (list: T[], iterator?: Iterator_, context?: any): boolean; (list: Dictionary, iterator?: Iterator_, context?: any): boolean; } ->[true, 1, null, 'yes'] : (string | number | boolean)[] +>[true, 1, null, 'yes'] : (string | number | true)[] >true : true >1 : 1 >null : null diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 3f0ac662013ae..4def3af16f824 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -1,3 +1,5 @@ +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,1): error TS2322: Type 'number | Date' is not assignable to type 'string | boolean'. + Type 'number' is not assignable to type 'string | boolean'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. @@ -31,7 +33,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(70,12): error TS2 tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1. -==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (31 errors) ==== +==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (32 errors) ==== var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; @@ -41,6 +43,9 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 var unionOfDifferentReturnType: { (a: number): number; } | { (a: number): Date; }; numOrDate = unionOfDifferentReturnType(10); strOrBoolean = unionOfDifferentReturnType("hello"); // error + ~~~~~~~~~~~~ +!!! error TS2322: Type 'number | Date' is not assignable to type 'string | boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'string | boolean'. ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. unionOfDifferentReturnType1(true); // error in type of parameter diff --git a/tests/baselines/reference/unionTypeCallSignatures.types b/tests/baselines/reference/unionTypeCallSignatures.types index e08d815478e0d..e18f9cd0e0bfb 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.types +++ b/tests/baselines/reference/unionTypeCallSignatures.types @@ -23,14 +23,14 @@ numOrDate = unionOfDifferentReturnType(10); >10 : 10 strOrBoolean = unionOfDifferentReturnType("hello"); // error ->strOrBoolean = unionOfDifferentReturnType("hello") : any +>strOrBoolean = unionOfDifferentReturnType("hello") : number | Date >strOrBoolean : string | boolean ->unionOfDifferentReturnType("hello") : any +>unionOfDifferentReturnType("hello") : number | Date >unionOfDifferentReturnType : ((a: number) => number) | ((a: number) => Date) >"hello" : "hello" unionOfDifferentReturnType1(true); // error in type of parameter ->unionOfDifferentReturnType1(true) : any +>unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } >true : true @@ -56,12 +56,12 @@ strOrBoolean = unionOfDifferentReturnType1("hello"); >"hello" : "hello" unionOfDifferentReturnType1(true); // error in type of parameter ->unionOfDifferentReturnType1(true) : any +>unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } >true : true unionOfDifferentReturnType1(); // error missing parameter ->unionOfDifferentReturnType1() : any +>unionOfDifferentReturnType1() : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; } var unionOfDifferentParameterTypes: { (a: number): number; } | { (a: string): Date; }; @@ -90,7 +90,7 @@ var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number) >a : string unionOfDifferentNumberOfSignatures(); // error - no call signatures ->unionOfDifferentNumberOfSignatures() : any +>unionOfDifferentNumberOfSignatures() : number | Date >unionOfDifferentNumberOfSignatures : ((a: number) => number) | { (a: number): Date; (a: string): boolean; } unionOfDifferentNumberOfSignatures(10); // error - no call signatures @@ -99,7 +99,7 @@ unionOfDifferentNumberOfSignatures(10); // error - no call signatures >10 : 10 unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures ->unionOfDifferentNumberOfSignatures("hello") : any +>unionOfDifferentNumberOfSignatures("hello") : number | Date >unionOfDifferentNumberOfSignatures : ((a: number) => number) | { (a: number): Date; (a: string): boolean; } >"hello" : "hello" @@ -147,17 +147,17 @@ strOrNum = unionWithOptionalParameter1('hello', 10); >10 : 10 strOrNum = unionWithOptionalParameter1('hello', "hello"); // error in parameter type ->strOrNum = unionWithOptionalParameter1('hello', "hello") : any +>strOrNum = unionWithOptionalParameter1('hello', "hello") : string | number >strOrNum : string | number ->unionWithOptionalParameter1('hello', "hello") : any +>unionWithOptionalParameter1('hello', "hello") : string | number >unionWithOptionalParameter1 : ((a: string, b?: number) => string) | ((a: string, b?: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithOptionalParameter1(); // error ->strOrNum = unionWithOptionalParameter1() : any +>strOrNum = unionWithOptionalParameter1() : string | number >strOrNum : string | number ->unionWithOptionalParameter1() : any +>unionWithOptionalParameter1() : string | number >unionWithOptionalParameter1 : ((a: string, b?: number) => string) | ((a: string, b?: number) => number) var unionWithOptionalParameter2: { (a: string, b?: number): string; } | { (a: string, b: number): number }; @@ -168,9 +168,9 @@ var unionWithOptionalParameter2: { (a: string, b?: number): string; } | { (a: st >b : number strOrNum = unionWithOptionalParameter2('hello'); // error no call signature ->strOrNum = unionWithOptionalParameter2('hello') : any +>strOrNum = unionWithOptionalParameter2('hello') : string | number >strOrNum : string | number ->unionWithOptionalParameter2('hello') : any +>unionWithOptionalParameter2('hello') : string | number >unionWithOptionalParameter2 : ((a: string, b?: number) => string) | ((a: string, b: number) => number) >'hello' : "hello" @@ -183,17 +183,17 @@ strOrNum = unionWithOptionalParameter2('hello', 10); // error no call signature >10 : 10 strOrNum = unionWithOptionalParameter2('hello', "hello"); // error no call signature ->strOrNum = unionWithOptionalParameter2('hello', "hello") : any +>strOrNum = unionWithOptionalParameter2('hello', "hello") : string | number >strOrNum : string | number ->unionWithOptionalParameter2('hello', "hello") : any +>unionWithOptionalParameter2('hello', "hello") : string | number >unionWithOptionalParameter2 : ((a: string, b?: number) => string) | ((a: string, b: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithOptionalParameter2(); // error no call signature ->strOrNum = unionWithOptionalParameter2() : any +>strOrNum = unionWithOptionalParameter2() : string | number >strOrNum : string | number ->unionWithOptionalParameter2() : any +>unionWithOptionalParameter2() : string | number >unionWithOptionalParameter2 : ((a: string, b?: number) => string) | ((a: string, b: number) => number) var unionWithOptionalParameter3: { (a: string, b?: number): string; } | { (a: string): number; }; @@ -210,25 +210,25 @@ strOrNum = unionWithOptionalParameter3('hello'); >'hello' : "hello" strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature ->strOrNum = unionWithOptionalParameter3('hello', 10) : any +>strOrNum = unionWithOptionalParameter3('hello', 10) : string | number >strOrNum : string | number ->unionWithOptionalParameter3('hello', 10) : any +>unionWithOptionalParameter3('hello', 10) : string | number >unionWithOptionalParameter3 : ((a: string, b?: number) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature ->strOrNum = unionWithOptionalParameter3('hello', "hello") : any +>strOrNum = unionWithOptionalParameter3('hello', "hello") : string | number >strOrNum : string | number ->unionWithOptionalParameter3('hello', "hello") : any +>unionWithOptionalParameter3('hello', "hello") : string | number >unionWithOptionalParameter3 : ((a: string, b?: number) => string) | ((a: string) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithOptionalParameter3(); // error no call signature ->strOrNum = unionWithOptionalParameter3() : any +>strOrNum = unionWithOptionalParameter3() : string | number >strOrNum : string | number ->unionWithOptionalParameter3() : any +>unionWithOptionalParameter3() : string | number >unionWithOptionalParameter3 : ((a: string, b?: number) => string) | ((a: string) => number) var unionWithRestParameter1: { (a: string, ...b: number[]): string; } | { (a: string, ...b: number[]): number }; @@ -263,17 +263,17 @@ strOrNum = unionWithRestParameter1('hello', 10, 11); >11 : 11 strOrNum = unionWithRestParameter1('hello', "hello"); // error in parameter type ->strOrNum = unionWithRestParameter1('hello', "hello") : any +>strOrNum = unionWithRestParameter1('hello', "hello") : string | number >strOrNum : string | number ->unionWithRestParameter1('hello', "hello") : any +>unionWithRestParameter1('hello', "hello") : string | number >unionWithRestParameter1 : ((a: string, ...b: number[]) => string) | ((a: string, ...b: number[]) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithRestParameter1(); // error ->strOrNum = unionWithRestParameter1() : any +>strOrNum = unionWithRestParameter1() : string | number >strOrNum : string | number ->unionWithRestParameter1() : any +>unionWithRestParameter1() : string | number >unionWithRestParameter1 : ((a: string, ...b: number[]) => string) | ((a: string, ...b: number[]) => number) var unionWithRestParameter2: { (a: string, ...b: number[]): string; } | { (a: string, b: number): number }; @@ -284,9 +284,9 @@ var unionWithRestParameter2: { (a: string, ...b: number[]): string; } | { (a: st >b : number strOrNum = unionWithRestParameter2('hello'); // error no call signature ->strOrNum = unionWithRestParameter2('hello') : any +>strOrNum = unionWithRestParameter2('hello') : string | number >strOrNum : string | number ->unionWithRestParameter2('hello') : any +>unionWithRestParameter2('hello') : string | number >unionWithRestParameter2 : ((a: string, ...b: number[]) => string) | ((a: string, b: number) => number) >'hello' : "hello" @@ -299,26 +299,26 @@ strOrNum = unionWithRestParameter2('hello', 10); // error no call signature >10 : 10 strOrNum = unionWithRestParameter2('hello', 10, 11); // error no call signature ->strOrNum = unionWithRestParameter2('hello', 10, 11) : any +>strOrNum = unionWithRestParameter2('hello', 10, 11) : string | number >strOrNum : string | number ->unionWithRestParameter2('hello', 10, 11) : any +>unionWithRestParameter2('hello', 10, 11) : string | number >unionWithRestParameter2 : ((a: string, ...b: number[]) => string) | ((a: string, b: number) => number) >'hello' : "hello" >10 : 10 >11 : 11 strOrNum = unionWithRestParameter2('hello', "hello"); // error no call signature ->strOrNum = unionWithRestParameter2('hello', "hello") : any +>strOrNum = unionWithRestParameter2('hello', "hello") : string | number >strOrNum : string | number ->unionWithRestParameter2('hello', "hello") : any +>unionWithRestParameter2('hello', "hello") : string | number >unionWithRestParameter2 : ((a: string, ...b: number[]) => string) | ((a: string, b: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithRestParameter2(); // error no call signature ->strOrNum = unionWithRestParameter2() : any +>strOrNum = unionWithRestParameter2() : string | number >strOrNum : string | number ->unionWithRestParameter2() : any +>unionWithRestParameter2() : string | number >unionWithRestParameter2 : ((a: string, ...b: number[]) => string) | ((a: string, b: number) => number) var unionWithRestParameter3: { (a: string, ...b: number[]): string; } | { (a: string): number }; @@ -335,34 +335,34 @@ strOrNum = unionWithRestParameter3('hello'); >'hello' : "hello" strOrNum = unionWithRestParameter3('hello', 10); // error no call signature ->strOrNum = unionWithRestParameter3('hello', 10) : any +>strOrNum = unionWithRestParameter3('hello', 10) : string | number >strOrNum : string | number ->unionWithRestParameter3('hello', 10) : any +>unionWithRestParameter3('hello', 10) : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature ->strOrNum = unionWithRestParameter3('hello', 10, 11) : any +>strOrNum = unionWithRestParameter3('hello', 10, 11) : string | number >strOrNum : string | number ->unionWithRestParameter3('hello', 10, 11) : any +>unionWithRestParameter3('hello', 10, 11) : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 >11 : 11 strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature ->strOrNum = unionWithRestParameter3('hello', "hello") : any +>strOrNum = unionWithRestParameter3('hello', "hello") : string | number >strOrNum : string | number ->unionWithRestParameter3('hello', "hello") : any +>unionWithRestParameter3('hello', "hello") : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = unionWithRestParameter3(); // error no call signature ->strOrNum = unionWithRestParameter3() : any +>strOrNum = unionWithRestParameter3() : string | number >strOrNum : string | number ->unionWithRestParameter3() : any +>unionWithRestParameter3() : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; @@ -372,9 +372,9 @@ var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: st >b : string strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature ->strOrNum = unionWithRestParameter4("hello") : any +>strOrNum = unionWithRestParameter4("hello") : string | number >strOrNum : string | number ->unionWithRestParameter4("hello") : any +>unionWithRestParameter4("hello") : string | number >unionWithRestParameter4 : ((...a: string[]) => string) | ((a: string, b: string) => number) >"hello" : "hello" diff --git a/tests/baselines/reference/unionTypeCallSignatures4.types b/tests/baselines/reference/unionTypeCallSignatures4.types index 12deb1fba3752..d000deda06a90 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.types +++ b/tests/baselines/reference/unionTypeCallSignatures4.types @@ -41,7 +41,7 @@ f12("a", "b"); >"b" : "b" f12("a", "b", "c"); // error ->f12("a", "b", "c") : any +>f12("a", "b", "c") : void >f12 : F1 | F2 >"a" : "a" >"b" : "b" @@ -83,7 +83,7 @@ f1234("a", "b"); >"b" : "b" f1234("a", "b", "c"); // error ->f1234("a", "b", "c") : any +>f1234("a", "b", "c") : void >f1234 : F1 | F2 | F3 | F4 >"a" : "a" >"b" : "b" @@ -93,7 +93,7 @@ var f12345: F1 | F2 | F3 | F4 | F5; >f12345 : F1 | F2 | F3 | F4 | F5 f12345("a"); // error ->f12345("a") : any +>f12345("a") : void >f12345 : F1 | F2 | F3 | F4 | F5 >"a" : "a" @@ -104,7 +104,7 @@ f12345("a", "b"); >"b" : "b" f12345("a", "b", "c"); // error ->f12345("a", "b", "c") : any +>f12345("a", "b", "c") : void >f12345 : F1 | F2 | F3 | F4 | F5 >"a" : "a" >"b" : "b" diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index 67973c3c206ac..34f855ace6651 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -1,3 +1,5 @@ +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,1): error TS2322: Type 'number | Date' is not assignable to type 'string | boolean'. + Type 'number' is not assignable to type 'string | boolean'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. @@ -30,7 +32,7 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(69,12): erro tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): error TS2554: Expected 1 arguments, but got 0. -==== tests/cases/conformance/types/union/unionTypeConstructSignatures.ts (30 errors) ==== +==== tests/cases/conformance/types/union/unionTypeConstructSignatures.ts (31 errors) ==== var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; @@ -40,6 +42,9 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro var unionOfDifferentReturnType: { new (a: number): number; } | { new (a: number): Date; }; numOrDate = new unionOfDifferentReturnType(10); strOrBoolean = new unionOfDifferentReturnType("hello"); // error + ~~~~~~~~~~~~ +!!! error TS2322: Type 'number | Date' is not assignable to type 'string | boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'string | boolean'. ~~~~~~~ !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. new unionOfDifferentReturnType1(true); // error in type of parameter diff --git a/tests/baselines/reference/unionTypeConstructSignatures.types b/tests/baselines/reference/unionTypeConstructSignatures.types index 1a0c077fb56e9..58a491a730b16 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.types +++ b/tests/baselines/reference/unionTypeConstructSignatures.types @@ -23,14 +23,14 @@ numOrDate = new unionOfDifferentReturnType(10); >10 : 10 strOrBoolean = new unionOfDifferentReturnType("hello"); // error ->strOrBoolean = new unionOfDifferentReturnType("hello") : any +>strOrBoolean = new unionOfDifferentReturnType("hello") : number | Date >strOrBoolean : string | boolean ->new unionOfDifferentReturnType("hello") : any +>new unionOfDifferentReturnType("hello") : number | Date >unionOfDifferentReturnType : (new (a: number) => number) | (new (a: number) => Date) >"hello" : "hello" new unionOfDifferentReturnType1(true); // error in type of parameter ->new unionOfDifferentReturnType1(true) : any +>new unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } >true : true @@ -56,12 +56,12 @@ strOrBoolean = new unionOfDifferentReturnType1("hello"); >"hello" : "hello" new unionOfDifferentReturnType1(true); // error in type of parameter ->new unionOfDifferentReturnType1(true) : any +>new unionOfDifferentReturnType1(true) : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } >true : true new unionOfDifferentReturnType1(); // error missing parameter ->new unionOfDifferentReturnType1() : any +>new unionOfDifferentReturnType1() : (Date & string) | (Date & false) | (Date & true) >unionOfDifferentReturnType1 : { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; } var unionOfDifferentParameterTypes: { new (a: number): number; } | { new (a: string): Date; }; @@ -90,7 +90,7 @@ var unionOfDifferentNumberOfSignatures: { new (a: number): number; } | { new (a: >a : string new unionOfDifferentNumberOfSignatures(); // error - no call signatures ->new unionOfDifferentNumberOfSignatures() : any +>new unionOfDifferentNumberOfSignatures() : number | Date >unionOfDifferentNumberOfSignatures : (new (a: number) => number) | { new (a: number): Date; new (a: string): boolean; } new unionOfDifferentNumberOfSignatures(10); // error - no call signatures @@ -99,7 +99,7 @@ new unionOfDifferentNumberOfSignatures(10); // error - no call signatures >10 : 10 new unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures ->new unionOfDifferentNumberOfSignatures("hello") : any +>new unionOfDifferentNumberOfSignatures("hello") : number | Date >unionOfDifferentNumberOfSignatures : (new (a: number) => number) | { new (a: number): Date; new (a: string): boolean; } >"hello" : "hello" @@ -147,17 +147,17 @@ strOrNum = new unionWithOptionalParameter1('hello', 10); >10 : 10 strOrNum = new unionWithOptionalParameter1('hello', "hello"); // error in parameter type ->strOrNum = new unionWithOptionalParameter1('hello', "hello") : any +>strOrNum = new unionWithOptionalParameter1('hello', "hello") : string | number >strOrNum : string | number ->new unionWithOptionalParameter1('hello', "hello") : any +>new unionWithOptionalParameter1('hello', "hello") : string | number >unionWithOptionalParameter1 : (new (a: string, b?: number) => string) | (new (a: string, b?: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithOptionalParameter1(); // error ->strOrNum = new unionWithOptionalParameter1() : any +>strOrNum = new unionWithOptionalParameter1() : string | number >strOrNum : string | number ->new unionWithOptionalParameter1() : any +>new unionWithOptionalParameter1() : string | number >unionWithOptionalParameter1 : (new (a: string, b?: number) => string) | (new (a: string, b?: number) => number) var unionWithOptionalParameter2: { new (a: string, b?: number): string; } | { new (a: string, b: number): number }; @@ -168,9 +168,9 @@ var unionWithOptionalParameter2: { new (a: string, b?: number): string; } | { ne >b : number strOrNum = new unionWithOptionalParameter2('hello'); // error no call signature ->strOrNum = new unionWithOptionalParameter2('hello') : any +>strOrNum = new unionWithOptionalParameter2('hello') : string | number >strOrNum : string | number ->new unionWithOptionalParameter2('hello') : any +>new unionWithOptionalParameter2('hello') : string | number >unionWithOptionalParameter2 : (new (a: string, b?: number) => string) | (new (a: string, b: number) => number) >'hello' : "hello" @@ -183,17 +183,17 @@ strOrNum = new unionWithOptionalParameter2('hello', 10); // error no call signat >10 : 10 strOrNum = new unionWithOptionalParameter2('hello', "hello"); // error no call signature ->strOrNum = new unionWithOptionalParameter2('hello', "hello") : any +>strOrNum = new unionWithOptionalParameter2('hello', "hello") : string | number >strOrNum : string | number ->new unionWithOptionalParameter2('hello', "hello") : any +>new unionWithOptionalParameter2('hello', "hello") : string | number >unionWithOptionalParameter2 : (new (a: string, b?: number) => string) | (new (a: string, b: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithOptionalParameter2(); // error no call signature ->strOrNum = new unionWithOptionalParameter2() : any +>strOrNum = new unionWithOptionalParameter2() : string | number >strOrNum : string | number ->new unionWithOptionalParameter2() : any +>new unionWithOptionalParameter2() : string | number >unionWithOptionalParameter2 : (new (a: string, b?: number) => string) | (new (a: string, b: number) => number) var unionWithOptionalParameter3: { new (a: string, b?: number): string; } | { new (a: string): number; }; @@ -210,25 +210,25 @@ strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature >'hello' : "hello" strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature ->strOrNum = new unionWithOptionalParameter3('hello', 10) : any +>strOrNum = new unionWithOptionalParameter3('hello', 10) : string | number >strOrNum : string | number ->new unionWithOptionalParameter3('hello', 10) : any +>new unionWithOptionalParameter3('hello', 10) : string | number >unionWithOptionalParameter3 : (new (a: string, b?: number) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature ->strOrNum = new unionWithOptionalParameter3('hello', "hello") : any +>strOrNum = new unionWithOptionalParameter3('hello', "hello") : string | number >strOrNum : string | number ->new unionWithOptionalParameter3('hello', "hello") : any +>new unionWithOptionalParameter3('hello', "hello") : string | number >unionWithOptionalParameter3 : (new (a: string, b?: number) => string) | (new (a: string) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithOptionalParameter3(); // error no call signature ->strOrNum = new unionWithOptionalParameter3() : any +>strOrNum = new unionWithOptionalParameter3() : string | number >strOrNum : string | number ->new unionWithOptionalParameter3() : any +>new unionWithOptionalParameter3() : string | number >unionWithOptionalParameter3 : (new (a: string, b?: number) => string) | (new (a: string) => number) var unionWithRestParameter1: { new (a: string, ...b: number[]): string; } | { new (a: string, ...b: number[]): number }; @@ -263,17 +263,17 @@ strOrNum = new unionWithRestParameter1('hello', 10, 11); >11 : 11 strOrNum = new unionWithRestParameter1('hello', "hello"); // error in parameter type ->strOrNum = new unionWithRestParameter1('hello', "hello") : any +>strOrNum = new unionWithRestParameter1('hello', "hello") : string | number >strOrNum : string | number ->new unionWithRestParameter1('hello', "hello") : any +>new unionWithRestParameter1('hello', "hello") : string | number >unionWithRestParameter1 : (new (a: string, ...b: number[]) => string) | (new (a: string, ...b: number[]) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithRestParameter1(); // error ->strOrNum = new unionWithRestParameter1() : any +>strOrNum = new unionWithRestParameter1() : string | number >strOrNum : string | number ->new unionWithRestParameter1() : any +>new unionWithRestParameter1() : string | number >unionWithRestParameter1 : (new (a: string, ...b: number[]) => string) | (new (a: string, ...b: number[]) => number) var unionWithRestParameter2: { new (a: string, ...b: number[]): string; } | { new (a: string, b: number): number }; @@ -284,9 +284,9 @@ var unionWithRestParameter2: { new (a: string, ...b: number[]): string; } | { ne >b : number strOrNum = new unionWithRestParameter2('hello'); // error no call signature ->strOrNum = new unionWithRestParameter2('hello') : any +>strOrNum = new unionWithRestParameter2('hello') : string | number >strOrNum : string | number ->new unionWithRestParameter2('hello') : any +>new unionWithRestParameter2('hello') : string | number >unionWithRestParameter2 : (new (a: string, ...b: number[]) => string) | (new (a: string, b: number) => number) >'hello' : "hello" @@ -299,26 +299,26 @@ strOrNum = new unionWithRestParameter2('hello', 10); // error no call signature >10 : 10 strOrNum = new unionWithRestParameter2('hello', 10, 11); // error no call signature ->strOrNum = new unionWithRestParameter2('hello', 10, 11) : any +>strOrNum = new unionWithRestParameter2('hello', 10, 11) : string | number >strOrNum : string | number ->new unionWithRestParameter2('hello', 10, 11) : any +>new unionWithRestParameter2('hello', 10, 11) : string | number >unionWithRestParameter2 : (new (a: string, ...b: number[]) => string) | (new (a: string, b: number) => number) >'hello' : "hello" >10 : 10 >11 : 11 strOrNum = new unionWithRestParameter2('hello', "hello"); // error no call signature ->strOrNum = new unionWithRestParameter2('hello', "hello") : any +>strOrNum = new unionWithRestParameter2('hello', "hello") : string | number >strOrNum : string | number ->new unionWithRestParameter2('hello', "hello") : any +>new unionWithRestParameter2('hello', "hello") : string | number >unionWithRestParameter2 : (new (a: string, ...b: number[]) => string) | (new (a: string, b: number) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithRestParameter2(); // error no call signature ->strOrNum = new unionWithRestParameter2() : any +>strOrNum = new unionWithRestParameter2() : string | number >strOrNum : string | number ->new unionWithRestParameter2() : any +>new unionWithRestParameter2() : string | number >unionWithRestParameter2 : (new (a: string, ...b: number[]) => string) | (new (a: string, b: number) => number) var unionWithRestParameter3: { new (a: string, ...b: number[]): string; } | { new (a: string): number }; @@ -335,33 +335,33 @@ strOrNum = new unionWithRestParameter3('hello'); // error no call signature >'hello' : "hello" strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature ->strOrNum = new unionWithRestParameter3('hello', 10) : any +>strOrNum = new unionWithRestParameter3('hello', 10) : string | number >strOrNum : string | number ->new unionWithRestParameter3('hello', 10) : any +>new unionWithRestParameter3('hello', 10) : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature ->strOrNum = new unionWithRestParameter3('hello', 10, 11) : any +>strOrNum = new unionWithRestParameter3('hello', 10, 11) : string | number >strOrNum : string | number ->new unionWithRestParameter3('hello', 10, 11) : any +>new unionWithRestParameter3('hello', 10, 11) : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 >11 : 11 strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature ->strOrNum = new unionWithRestParameter3('hello', "hello") : any +>strOrNum = new unionWithRestParameter3('hello', "hello") : string | number >strOrNum : string | number ->new unionWithRestParameter3('hello', "hello") : any +>new unionWithRestParameter3('hello', "hello") : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" >"hello" : "hello" strOrNum = new unionWithRestParameter3(); // error no call signature ->strOrNum = new unionWithRestParameter3() : any +>strOrNum = new unionWithRestParameter3() : string | number >strOrNum : string | number ->new unionWithRestParameter3() : any +>new unionWithRestParameter3() : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index e712916c2ff55..51465c5f23800 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -16,7 +16,7 @@ var a1: number; var a1 = f(1, 2); >a1 : number ->f(1, 2) : any +>f(1, 2) : 1 >f : (x: T, y: string | T) => T >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.types b/tests/baselines/reference/wrappedAndRecursiveConstraints4.types index 7f129898206a7..38282d76645ae 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.types +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.types @@ -39,8 +39,8 @@ var r = c.foo(''); >'' : "" var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error ->r2 : any ->r({ length: 3, charAt: (x: number) => { '' } }) : any +>r2 : string +>r({ length: 3, charAt: (x: number) => { '' } }) : string >r : (x: V) => V >{ length: 3, charAt: (x: number) => { '' } } : { length: number; charAt: (x: number) => void; } >length : number