From a87baa2664fa51fd4e8e29c47599aece5ccd45ff Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 23 Oct 2017 12:36:29 -0700 Subject: [PATCH] Accept new baselines --- ...lWithConstructorTypedArguments5.errors.txt | 8 +++---- ...nericCallWithFunctionTypedArguments2.types | 24 +++++++++---------- ...hOverloadedConstructorTypedArguments.types | 20 ++++++++-------- ...oadedConstructorTypedArguments2.errors.txt | 4 ++-- ...OverloadedConstructorTypedArguments2.types | 12 +++++----- ...WithOverloadedFunctionTypedArguments.types | 20 ++++++++-------- ...erloadedFunctionTypedArguments2.errors.txt | 4 ++-- ...ithOverloadedFunctionTypedArguments2.types | 12 +++++----- .../reference/promisePermutations.types | 16 ++++++------- .../reference/promisePermutations2.types | 16 ++++++------- .../reference/promisePermutations3.errors.txt | 8 +++---- .../reference/promisePermutations3.types | 12 +++++----- 12 files changed, 78 insertions(+), 78 deletions(-) diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt index a014ef85b6c..4aa29b1e050 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: {}) => string; }'. Types of property 'cb' are incompatible. - Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: any) => string'. + Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: {}) => string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'. Types of property 'cb' are incompatible. Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'. @@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var arg2: { cb: new (x: T, y: T) => string }; var r2 = foo(arg2); // error ~~~~ -!!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: any) => string; }'. +!!! error TS2345: Argument of type '{ cb: new (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: {}) => string; }'. !!! error TS2345: Types of property 'cb' are incompatible. -!!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: any) => string'. +!!! error TS2345: Type 'new (x: T, y: T) => string' is not assignable to type 'new (t: {}) => string'. var arg3: { cb: new (x: string, y: number) => string }; var r3 = foo(arg3); // error ~~~~ diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types index 16bc5ae774a..967850180d6 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types @@ -53,8 +53,8 @@ var a: { } var r = foo(i); // any ->r : any ->foo(i) : any +>r : {} +>foo(i) : {} >foo : (x: new (a: T) => T) => T >i : I @@ -71,8 +71,8 @@ var r3 = foo(i2); // string >i2 : I2 var r3b = foo(a); // any ->r3b : any ->foo(a) : any +>r3b : {} +>foo(a) : {} >foo : (x: new (a: T) => T) => T >a : new (x: T) => T @@ -101,15 +101,15 @@ var r4 = foo2(1, i2); // error >i2 : I2 var r4b = foo2(1, a); // any ->r4b : any ->foo2(1, a) : any +>r4b : {} +>foo2(1, a) : {} >foo2 : (x: T, cb: new (a: T) => U) => U >1 : 1 >a : new (x: T) => T var r5 = foo2(1, i); // any ->r5 : any ->foo2(1, i) : any +>r5 : {} +>foo2(1, i) : {} >foo2 : (x: T, cb: new (a: T) => U) => U >1 : 1 >i : I @@ -141,16 +141,16 @@ function foo3(x: T, cb: new(a: T) => U, y: U) { } var r7 = foo3(null, i, ''); // any ->r7 : any ->foo3(null, i, '') : any +>r7 : {} +>foo3(null, i, '') : {} >foo3 : (x: T, cb: new (a: T) => U, y: U) => U >null : null >i : I >'' : "" var r7b = foo3(null, a, ''); // any ->r7b : any ->foo3(null, a, '') : any +>r7b : {} +>foo3(null, a, '') : {} >foo3 : (x: T, cb: new (a: T) => U, y: U) => U >null : null >a : new (x: T) => T diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types index 15e746f615a..682910656ff 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types @@ -87,8 +87,8 @@ module GenericParameter { >T : T var r7 = foo5(b); // new any => string; new(x:number) => any ->r7 : { new (x: any): string; new (x: number): any; } ->foo5(b) : { new (x: any): string; new (x: number): any; } +>r7 : { new (x: {}): string; new (x: number): {}; } +>foo5(b) : { new (x: {}): string; new (x: number): {}; } >foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } >b : { new (x: T): string; new (x: number): T; } @@ -114,8 +114,8 @@ module GenericParameter { >a : { new (x: boolean): string; new (x: number): boolean; } var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string ->r9 : { new (x: any): string; new (x: any, y?: any): string; } ->foo6(b) : { new (x: any): string; new (x: any, y?: any): string; } +>r9 : { 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): string; new (x: number): T; } @@ -137,8 +137,8 @@ module GenericParameter { } var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string ->r13 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, b) : { new (x: any): string; new (x: any, y?: any): string; } +>r13 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo7(1, b) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >b : { new (x: T): string; new (x: number): T; } @@ -162,15 +162,15 @@ module GenericParameter { >T : T var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string ->r14 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, c) : { new (x: any): string; new (x: any, y?: any): string; } +>r14 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo7(1, c) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c : { (x: number): T; new (x: T): string; } var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string ->r15 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, c2) : { new (x: any): string; new (x: any, y?: any): string; } +>r15 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo7(1, c2) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c2 : { new (x: T): string; new (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt index 80bcf12494a..cb40b4acb7a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts(31,20): error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: {}): string; new (x: {}, y?: {}): string; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments2.ts (1 errors) ==== @@ -34,7 +34,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var b: { new (x: T, y: T): string }; var r10 = foo6(b); // error ~ -!!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: any): string; new (x: any, y?: any): string; }'. +!!! error TS2345: Argument of type 'new (x: T, y: T) => string' is not assignable to parameter of type '{ new (x: {}): string; new (x: {}, y?: {}): string; }'. function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types index e9b65c6f1da..557c63914fe 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.types @@ -63,8 +63,8 @@ module GenericParameter { >T : T var r6 = foo5(a); // ok ->r6 : { new (x: any): string; new (x: number): any; } ->foo5(a) : { new (x: any): string; new (x: number): any; } +>r6 : { new (x: {}): string; new (x: number): {}; } +>foo5(a) : { new (x: {}): string; new (x: number): {}; } >foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } >a : new (x: T) => T @@ -115,8 +115,8 @@ module GenericParameter { } var r13 = foo7(1, a); // ok ->r13 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, a) : { new (x: any): string; new (x: any, y?: any): string; } +>r13 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo7(1, a) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >a : new (x: T) => T @@ -131,8 +131,8 @@ module GenericParameter { >T : T var r14 = foo7(1, c); // ok ->r14 : { new (x: any): string; new (x: any, y?: any): string; } ->foo7(1, c) : { new (x: any): string; new (x: any, y?: any): string; } +>r14 : { new (x: {}): string; new (x: {}, y?: {}): string; } +>foo7(1, c) : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } >1 : 1 >c : { new (x: T): number; new (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index ab07e9c880a..55bec0c2a9f 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -83,8 +83,8 @@ module GenericParameter { >T : T var r7 = foo5(a); // any => string (+1 overload) ->r7 : { (x: any): string; (x: number): any; } ->foo5(a) : { (x: any): string; (x: number): any; } +>r7 : { (x: {}): string; (x: number): {}; } +>foo5(a) : { (x: {}): string; (x: number): {}; } >foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -112,8 +112,8 @@ module GenericParameter { >x : any var r9 = foo6((x: T) => ''); // any => string (+1 overload) ->r9 : { (x: any): string; (x: any, y?: any): string; } ->foo6((x: T) => '') : { (x: any): string; (x: any, y?: any): string; } +>r9 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo6((x: 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) => '' : (x: T) => string >T : T @@ -122,8 +122,8 @@ module GenericParameter { >'' : "" var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) ->r11 : { (x: any): string; (x: any, y?: any): string; } ->foo6((x: T, y?: T) => '') : { (x: any): string; (x: any, y?: any): string; } +>r11 : { (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 >T : T @@ -160,8 +160,8 @@ module GenericParameter { >x : any var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] ->r13 : { (x: any): string; (x: any, y?: any): string; } ->foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } +>r13 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo7(1, (x: T) => '') : { (x: {}): string; (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >(x: T) => '' : (x: T) => string @@ -180,8 +180,8 @@ module GenericParameter { >T : T var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] ->r14 : { (x: any): string; (x: any, y?: any): string; } ->foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } +>r14 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo7(1, a) : { (x: {}): string; (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >a : { (x: T): string; (x: number): T; } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt index 32fe6a09344..9ee5e6f0cfe 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts(28,20): error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: {}): string; (x: {}, y?: {}): string; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== @@ -31,7 +31,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. +!!! error TS2345: Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: {}): string; (x: {}, y?: {}): string; }'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types index da52da85044..7bc9be99a59 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.types @@ -55,8 +55,8 @@ module GenericParameter { } var r6 = foo5((x: T) => x); // ok ->r6 : { (x: any): string; (x: number): any; } ->foo5((x: T) => x) : { (x: any): string; (x: number): any; } +>r6 : { (x: {}): string; (x: number): {}; } +>foo5((x: T) => x) : { (x: {}): string; (x: number): {}; } >foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } >(x: T) => x : (x: T) => T >T : T @@ -109,8 +109,8 @@ module GenericParameter { } var r13 = foo7(1, (x: T) => x); // ok ->r13 : { (x: any): string; (x: any, y?: any): string; } ->foo7(1, (x: T) => x) : { (x: any): string; (x: any, y?: any): string; } +>r13 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo7(1, (x: T) => x) : { (x: {}): string; (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >(x: T) => x : (x: T) => T @@ -129,8 +129,8 @@ module GenericParameter { >T : T var r14 = foo7(1, a); // ok ->r14 : { (x: any): string; (x: any, y?: any): string; } ->foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } +>r14 : { (x: {}): string; (x: {}, y?: {}): string; } +>foo7(1, a) : { (x: {}): string; (x: {}, y?: {}): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } >1 : 1 >a : { (x: T): number; (x: number): T; } diff --git a/tests/baselines/reference/promisePermutations.types b/tests/baselines/reference/promisePermutations.types index 1b8ec25b639..df057583cc2 100644 --- a/tests/baselines/reference/promisePermutations.types +++ b/tests/baselines/reference/promisePermutations.types @@ -1396,8 +1396,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise +>r12a : IPromise<{}> +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> >r12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1414,8 +1414,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise +>s12a : IPromise<{}> +>s12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1424,8 +1424,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 : IPromise ->s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise +>s12b : IPromise<{}> +>s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1434,8 +1434,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise +>s12c : IPromise<{}> +>s12.then(testFunction12P, testFunction12, testFunction12) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } diff --git a/tests/baselines/reference/promisePermutations2.types b/tests/baselines/reference/promisePermutations2.types index 0e3af43b86f..28a74aa7d77 100644 --- a/tests/baselines/reference/promisePermutations2.types +++ b/tests/baselines/reference/promisePermutations2.types @@ -1349,8 +1349,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise +>r12a : IPromise<{}> +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> >r12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >r12 : IPromise<(x: any) => any> >then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1367,8 +1367,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise +>s12a : IPromise<{}> +>s12.then(testFunction12, testFunction12, testFunction12) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1377,8 +1377,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 : IPromise ->s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise +>s12b : IPromise<{}> +>s12.then(testFunction12P, testFunction12P, testFunction12P) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } @@ -1387,8 +1387,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise +>s12c : IPromise<{}> +>s12.then(testFunction12P, testFunction12, testFunction12) : IPromise<{}> >s12.then : { (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (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) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 8e99b92d53a..e995c4f1d38 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -66,8 +66,8 @@ tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of Types of parameters 'onfulfilled' and 'success' are incompatible. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. - Type 'IPromise' is not assignable to type 'Promise'. +tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'. + Type 'IPromise' is not assignable to type 'Promise<{}>'. Property 'catch' is missing in type 'IPromise'. @@ -340,7 +340,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. -!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. +!!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'. +!!! error TS2345: Type 'IPromise' is not assignable to type 'Promise<{}>'. !!! error TS2345: Property 'catch' is missing in type 'IPromise'. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations3.types b/tests/baselines/reference/promisePermutations3.types index 34eff1806d6..ab6390ae77d 100644 --- a/tests/baselines/reference/promisePermutations3.types +++ b/tests/baselines/reference/promisePermutations3.types @@ -1349,8 +1349,8 @@ var r12 = testFunction12(x => x); >x : any var r12a = r12.then(testFunction12, testFunction12, testFunction12); // ok ->r12a : IPromise> ->r12.then(testFunction12, testFunction12, testFunction12) : IPromise> +>r12a : IPromise> +>r12.then(testFunction12, testFunction12, testFunction12) : IPromise> >r12.then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise >r12 : IPromise<(x: any) => any> >then : (success?: (value: (x: any) => any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise @@ -1367,8 +1367,8 @@ var s12 = testFunction12(x => x); >x : any var s12a = s12.then(testFunction12, testFunction12, testFunction12); // ok ->s12a : IPromise> ->s12.then(testFunction12, testFunction12, testFunction12) : IPromise> +>s12a : IPromise> +>s12.then(testFunction12, testFunction12, testFunction12) : 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 @@ -1387,8 +1387,8 @@ var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); // ok >testFunction12P : { (x: T): IPromise; (x: T, y: T): Promise; } var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok ->s12c : IPromise> ->s12.then(testFunction12P, testFunction12, testFunction12) : IPromise> +>s12c : IPromise> +>s12.then(testFunction12P, testFunction12, testFunction12) : 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