From 3f00197fce37b9771b2fab78463d8ea43e2e28e8 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 13 Feb 2017 14:29:46 -0800 Subject: [PATCH] Accept baselines --- .../asyncFunctionNoReturnType.errors.txt | 16 +++------- .../reference/bluebirdStaticThis.errors.txt | 31 +++++++++---------- .../baselines/reference/bluebirdStaticThis.js | 9 +++--- tests/baselines/reference/promiseIdentity.js | 4 ++- .../reference/promiseIdentity.symbols | 8 ++--- .../baselines/reference/promiseIdentity.types | 2 +- .../reference/promiseIdentity2.errors.txt | 4 +-- tests/baselines/reference/promiseIdentity2.js | 6 ++-- .../reference/promiseIdentityWithAny.js | 6 ++-- .../reference/promiseIdentityWithAny.symbols | 20 ++++++------ .../reference/promiseIdentityWithAny.types | 4 +-- .../promiseIdentityWithAny2.errors.txt | 2 +- .../reference/promiseIdentityWithAny2.js | 4 ++- .../promiseIdentityWithConstraints.js | 6 ++-- .../promiseIdentityWithConstraints.symbols | 28 ++++++++--------- .../promiseIdentityWithConstraints.types | 4 +-- .../reference/promisePermutations.errors.txt | 24 +++++++------- .../reference/promisePermutations2.errors.txt | 24 +++++++------- .../reference/promisePermutations3.errors.txt | 28 ++++++++--------- 19 files changed, 115 insertions(+), 115 deletions(-) diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt b/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt index 89a61ff648f..5d4a87a186c 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt +++ b/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt @@ -1,22 +1,16 @@ -error TS2318: Cannot find global type 'Promise'. -tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS2697: An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option. -tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS7030: Not all code paths return a value. +error TS2468: Cannot find global value 'Promise'. +tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. tests/cases/compiler/asyncFunctionNoReturnType.ts(2,9): error TS2304: Cannot find name 'window'. -tests/cases/compiler/asyncFunctionNoReturnType.ts(3,9): error TS7030: Not all code paths return a value. -!!! error TS2318: Cannot find global type 'Promise'. -==== tests/cases/compiler/asyncFunctionNoReturnType.ts (4 errors) ==== +!!! error TS2468: Cannot find global value 'Promise'. +==== tests/cases/compiler/asyncFunctionNoReturnType.ts (2 errors) ==== async () => { ~~~~~~~~~~~~~ -!!! error TS2697: An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option. - ~~~~~~~~~~~~~ -!!! error TS7030: Not all code paths return a value. +!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. if (window) ~~~~~~ !!! error TS2304: Cannot find name 'window'. return; - ~~~~~~~ -!!! error TS7030: Not all code paths return a value. } \ No newline at end of file diff --git a/tests/baselines/reference/bluebirdStaticThis.errors.txt b/tests/baselines/reference/bluebirdStaticThis.errors.txt index 1c22a12c341..b9e28711715 100644 --- a/tests/baselines/reference/bluebirdStaticThis.errors.txt +++ b/tests/baselines/reference/bluebirdStaticThis.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/bluebirdStaticThis.ts(5,15): error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. +tests/cases/compiler/bluebirdStaticThis.ts(5,22): error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. Property 'then' is missing in type 'Promise'. -tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace 'Promise' has no exported member 'Resolver'. -tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Resolver'. +tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. ==== tests/cases/compiler/bluebirdStaticThis.ts (6 errors) ==== @@ -12,8 +12,8 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Prom // and all the comments. // Then it adds explicit `this` arguments to the static members. // Tests by: Bart van der Schoor - declare class Promise implements Promise.Thenable { - ~~~~~~~ + export declare class Promise implements Promise.Thenable { + ~~~~~~~ !!! error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. !!! error TS2420: Property 'then' is missing in type 'Promise'. constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); @@ -34,7 +34,7 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Prom static defer(dit: typeof Promise): Promise.Resolver; ~~~~~~~~ -!!! error TS2694: Namespace 'Promise' has no exported member 'Resolver'. +!!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Resolver'. static cast(dit: typeof Promise, value: Promise.Thenable): Promise; static cast(dit: typeof Promise, value: R): Promise; @@ -71,16 +71,16 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Prom static settle(dit: typeof Promise, values: Promise.Thenable[]>): Promise[]>; ~~~~~~~~~~ -!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable): Promise[]>; ~~~~~~~~~~ -!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable[]): Promise[]>; ~~~~~~~~~~ -!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: R[]): Promise[]>; ~~~~~~~~~~ -!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static any(dit: typeof Promise, values: Promise.Thenable[]>): Promise; static any(dit: typeof Promise, values: Promise.Thenable): Promise; @@ -131,7 +131,7 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Prom static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } - declare module Promise { + export declare module Promise { export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; @@ -141,9 +141,6 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Prom } - declare module 'bluebird' { - export = Promise; - } interface Foo { a: number; b: string; diff --git a/tests/baselines/reference/bluebirdStaticThis.js b/tests/baselines/reference/bluebirdStaticThis.js index 606f778323f..1d8d8f2ec43 100644 --- a/tests/baselines/reference/bluebirdStaticThis.js +++ b/tests/baselines/reference/bluebirdStaticThis.js @@ -3,7 +3,7 @@ // and all the comments. // Then it adds explicit `this` arguments to the static members. // Tests by: Bart van der Schoor -declare class Promise implements Promise.Thenable { +export declare class Promise implements Promise.Thenable { constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); static try(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; static try(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; @@ -109,7 +109,7 @@ declare class Promise implements Promise.Thenable { static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } -declare module Promise { +export declare module Promise { export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; @@ -119,9 +119,6 @@ declare module Promise { } -declare module 'bluebird' { - export = Promise; -} interface Foo { a: number; b: string; @@ -142,6 +139,8 @@ fooProm = Promise.try(Promise, () => { }, arr, x); //// [bluebirdStaticThis.js] +"use strict"; +exports.__esModule = true; var x; var arr; var foo; diff --git a/tests/baselines/reference/promiseIdentity.js b/tests/baselines/reference/promiseIdentity.js index 5b57709e991..526bae62c08 100644 --- a/tests/baselines/reference/promiseIdentity.js +++ b/tests/baselines/reference/promiseIdentity.js @@ -1,5 +1,5 @@ //// [promiseIdentity.ts] -interface IPromise { +export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } interface Promise { @@ -22,6 +22,8 @@ var y: IPromise2; var y: Promise2; //// [promiseIdentity.js] +"use strict"; +exports.__esModule = true; var x; var x; // Ok because T in this particular Promise2 is any, as are all the U and W references. diff --git a/tests/baselines/reference/promiseIdentity.symbols b/tests/baselines/reference/promiseIdentity.symbols index f1404eaf7b1..f103f5b4199 100644 --- a/tests/baselines/reference/promiseIdentity.symbols +++ b/tests/baselines/reference/promiseIdentity.symbols @@ -1,14 +1,14 @@ === tests/cases/compiler/promiseIdentity.ts === -interface IPromise { +export interface IPromise { >IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0)) ->T : Symbol(T, Decl(promiseIdentity.ts, 0, 19)) +>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26)) then(callback: (x: T) => IPromise): IPromise; ->then : Symbol(IPromise.then, Decl(promiseIdentity.ts, 0, 23)) +>then : Symbol(IPromise.then, Decl(promiseIdentity.ts, 0, 30)) >U : Symbol(U, Decl(promiseIdentity.ts, 1, 9)) >callback : Symbol(callback, Decl(promiseIdentity.ts, 1, 12)) >x : Symbol(x, Decl(promiseIdentity.ts, 1, 23)) ->T : Symbol(T, Decl(promiseIdentity.ts, 0, 19)) +>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26)) >IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0)) >U : Symbol(U, Decl(promiseIdentity.ts, 1, 9)) >IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0)) diff --git a/tests/baselines/reference/promiseIdentity.types b/tests/baselines/reference/promiseIdentity.types index 2be853c9964..af8bc9908bf 100644 --- a/tests/baselines/reference/promiseIdentity.types +++ b/tests/baselines/reference/promiseIdentity.types @@ -1,5 +1,5 @@ === tests/cases/compiler/promiseIdentity.ts === -interface IPromise { +export interface IPromise { >IPromise : IPromise >T : T diff --git a/tests/baselines/reference/promiseIdentity2.errors.txt b/tests/baselines/reference/promiseIdentity2.errors.txt index 6b8223c3bda..edfba2f42bc 100644 --- a/tests/baselines/reference/promiseIdentity2.errors.txt +++ b/tests/baselines/reference/promiseIdentity2.errors.txt @@ -2,10 +2,10 @@ tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variabl ==== tests/cases/compiler/promiseIdentity2.ts (1 errors) ==== - interface IPromise { + export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } - interface Promise { + export interface Promise { then(callback: (x: T) => Promise): Promise; } diff --git a/tests/baselines/reference/promiseIdentity2.js b/tests/baselines/reference/promiseIdentity2.js index 8bb4139a737..81beb44d78a 100644 --- a/tests/baselines/reference/promiseIdentity2.js +++ b/tests/baselines/reference/promiseIdentity2.js @@ -1,8 +1,8 @@ //// [promiseIdentity2.ts] -interface IPromise { +export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } -interface Promise { +export interface Promise { then(callback: (x: T) => Promise): Promise; } @@ -12,6 +12,8 @@ var x: IPromise; var x: Promise; //// [promiseIdentity2.js] +"use strict"; +exports.__esModule = true; // error because T is string in the first declaration, and T is boolean in the second // Return type and callback return type are ok because T is any in this particular Promise var x; diff --git a/tests/baselines/reference/promiseIdentityWithAny.js b/tests/baselines/reference/promiseIdentityWithAny.js index 1a516067c8e..422d00a1312 100644 --- a/tests/baselines/reference/promiseIdentityWithAny.js +++ b/tests/baselines/reference/promiseIdentityWithAny.js @@ -1,8 +1,8 @@ //// [promiseIdentityWithAny.ts] -interface IPromise { +export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } -interface Promise { +export interface Promise { then(callback: (x: T) => Promise): Promise; } @@ -11,6 +11,8 @@ var x: IPromise; var x: Promise; //// [promiseIdentityWithAny.js] +"use strict"; +exports.__esModule = true; // Should be ok because signature type parameters get erased to any var x; var x; diff --git a/tests/baselines/reference/promiseIdentityWithAny.symbols b/tests/baselines/reference/promiseIdentityWithAny.symbols index 8bcf096a0a3..65881f53a32 100644 --- a/tests/baselines/reference/promiseIdentityWithAny.symbols +++ b/tests/baselines/reference/promiseIdentityWithAny.symbols @@ -1,16 +1,16 @@ === tests/cases/compiler/promiseIdentityWithAny.ts === -interface IPromise { +export interface IPromise { >IPromise : Symbol(IPromise, Decl(promiseIdentityWithAny.ts, 0, 0)) ->T : Symbol(T, Decl(promiseIdentityWithAny.ts, 0, 19)) ->V : Symbol(V, Decl(promiseIdentityWithAny.ts, 0, 21)) +>T : Symbol(T, Decl(promiseIdentityWithAny.ts, 0, 26)) +>V : Symbol(V, Decl(promiseIdentityWithAny.ts, 0, 28)) then(callback: (x: T) => IPromise): IPromise; ->then : Symbol(IPromise.then, Decl(promiseIdentityWithAny.ts, 0, 26)) +>then : Symbol(IPromise.then, Decl(promiseIdentityWithAny.ts, 0, 33)) >U : Symbol(U, Decl(promiseIdentityWithAny.ts, 1, 9)) >W : Symbol(W, Decl(promiseIdentityWithAny.ts, 1, 11)) >callback : Symbol(callback, Decl(promiseIdentityWithAny.ts, 1, 15)) >x : Symbol(x, Decl(promiseIdentityWithAny.ts, 1, 26)) ->T : Symbol(T, Decl(promiseIdentityWithAny.ts, 0, 19)) +>T : Symbol(T, Decl(promiseIdentityWithAny.ts, 0, 26)) >IPromise : Symbol(IPromise, Decl(promiseIdentityWithAny.ts, 0, 0)) >U : Symbol(U, Decl(promiseIdentityWithAny.ts, 1, 9)) >W : Symbol(W, Decl(promiseIdentityWithAny.ts, 1, 11)) @@ -18,18 +18,18 @@ interface IPromise { >U : Symbol(U, Decl(promiseIdentityWithAny.ts, 1, 9)) >W : Symbol(W, Decl(promiseIdentityWithAny.ts, 1, 11)) } -interface Promise { +export interface Promise { >Promise : Symbol(Promise, Decl(promiseIdentityWithAny.ts, 2, 1)) ->T : Symbol(T, Decl(promiseIdentityWithAny.ts, 3, 18)) ->V : Symbol(V, Decl(promiseIdentityWithAny.ts, 3, 20)) +>T : Symbol(T, Decl(promiseIdentityWithAny.ts, 3, 25)) +>V : Symbol(V, Decl(promiseIdentityWithAny.ts, 3, 27)) then(callback: (x: T) => Promise): Promise; ->then : Symbol(Promise.then, Decl(promiseIdentityWithAny.ts, 3, 25)) +>then : Symbol(Promise.then, Decl(promiseIdentityWithAny.ts, 3, 32)) >U : Symbol(U, Decl(promiseIdentityWithAny.ts, 4, 9)) >W : Symbol(W, Decl(promiseIdentityWithAny.ts, 4, 11)) >callback : Symbol(callback, Decl(promiseIdentityWithAny.ts, 4, 15)) >x : Symbol(x, Decl(promiseIdentityWithAny.ts, 4, 26)) ->T : Symbol(T, Decl(promiseIdentityWithAny.ts, 3, 18)) +>T : Symbol(T, Decl(promiseIdentityWithAny.ts, 3, 25)) >Promise : Symbol(Promise, Decl(promiseIdentityWithAny.ts, 2, 1)) >Promise : Symbol(Promise, Decl(promiseIdentityWithAny.ts, 2, 1)) } diff --git a/tests/baselines/reference/promiseIdentityWithAny.types b/tests/baselines/reference/promiseIdentityWithAny.types index f96e6d90363..d5efb5a6f8b 100644 --- a/tests/baselines/reference/promiseIdentityWithAny.types +++ b/tests/baselines/reference/promiseIdentityWithAny.types @@ -1,5 +1,5 @@ === tests/cases/compiler/promiseIdentityWithAny.ts === -interface IPromise { +export interface IPromise { >IPromise : IPromise >T : T >V : V @@ -18,7 +18,7 @@ interface IPromise { >U : U >W : W } -interface Promise { +export interface Promise { >Promise : Promise >T : T >V : V diff --git a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt index 36492d3f37a..9d01438b88c 100644 --- a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt +++ b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent ==== tests/cases/compiler/promiseIdentityWithAny2.ts (2 errors) ==== - interface IPromise { + export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } interface Promise { diff --git a/tests/baselines/reference/promiseIdentityWithAny2.js b/tests/baselines/reference/promiseIdentityWithAny2.js index ec98b5ed4d9..a26cfd05084 100644 --- a/tests/baselines/reference/promiseIdentityWithAny2.js +++ b/tests/baselines/reference/promiseIdentityWithAny2.js @@ -1,5 +1,5 @@ //// [promiseIdentityWithAny2.ts] -interface IPromise { +export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } interface Promise { @@ -23,6 +23,8 @@ var y: IPromise2; var y: Promise2; //// [promiseIdentityWithAny2.js] +"use strict"; +exports.__esModule = true; // Error because type parameter arity doesn't match var x; var x; diff --git a/tests/baselines/reference/promiseIdentityWithConstraints.js b/tests/baselines/reference/promiseIdentityWithConstraints.js index 0130d22df8f..5c0549dc99d 100644 --- a/tests/baselines/reference/promiseIdentityWithConstraints.js +++ b/tests/baselines/reference/promiseIdentityWithConstraints.js @@ -1,8 +1,8 @@ //// [promiseIdentityWithConstraints.ts] -interface IPromise { +export interface IPromise { then(callback: (x: T) => IPromise): IPromise; } -interface Promise { +export interface Promise { then(callback: (x: T) => Promise): Promise; } @@ -11,6 +11,8 @@ var x: IPromise; var x: Promise; //// [promiseIdentityWithConstraints.js] +"use strict"; +exports.__esModule = true; // Error because constraint V doesn't match var x; var x; diff --git a/tests/baselines/reference/promiseIdentityWithConstraints.symbols b/tests/baselines/reference/promiseIdentityWithConstraints.symbols index 00308362b18..bcdc3c441bd 100644 --- a/tests/baselines/reference/promiseIdentityWithConstraints.symbols +++ b/tests/baselines/reference/promiseIdentityWithConstraints.symbols @@ -1,18 +1,18 @@ === tests/cases/compiler/promiseIdentityWithConstraints.ts === -interface IPromise { +export interface IPromise { >IPromise : Symbol(IPromise, Decl(promiseIdentityWithConstraints.ts, 0, 0)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 19)) ->V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 0, 21)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 26)) +>V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 0, 28)) then(callback: (x: T) => IPromise): IPromise; ->then : Symbol(IPromise.then, Decl(promiseIdentityWithConstraints.ts, 0, 26)) +>then : Symbol(IPromise.then, Decl(promiseIdentityWithConstraints.ts, 0, 33)) >U : Symbol(U, Decl(promiseIdentityWithConstraints.ts, 1, 9)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 19)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 26)) >W : Symbol(W, Decl(promiseIdentityWithConstraints.ts, 1, 21)) ->V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 0, 21)) +>V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 0, 28)) >callback : Symbol(callback, Decl(promiseIdentityWithConstraints.ts, 1, 35)) >x : Symbol(x, Decl(promiseIdentityWithConstraints.ts, 1, 46)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 19)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 0, 26)) >IPromise : Symbol(IPromise, Decl(promiseIdentityWithConstraints.ts, 0, 0)) >U : Symbol(U, Decl(promiseIdentityWithConstraints.ts, 1, 9)) >W : Symbol(W, Decl(promiseIdentityWithConstraints.ts, 1, 21)) @@ -20,20 +20,20 @@ interface IPromise { >U : Symbol(U, Decl(promiseIdentityWithConstraints.ts, 1, 9)) >W : Symbol(W, Decl(promiseIdentityWithConstraints.ts, 1, 21)) } -interface Promise { +export interface Promise { >Promise : Symbol(Promise, Decl(promiseIdentityWithConstraints.ts, 2, 1)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 18)) ->V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 3, 20)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 25)) +>V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 3, 27)) then(callback: (x: T) => Promise): Promise; ->then : Symbol(Promise.then, Decl(promiseIdentityWithConstraints.ts, 3, 25)) +>then : Symbol(Promise.then, Decl(promiseIdentityWithConstraints.ts, 3, 32)) >U : Symbol(U, Decl(promiseIdentityWithConstraints.ts, 4, 9)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 18)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 25)) >W : Symbol(W, Decl(promiseIdentityWithConstraints.ts, 4, 21)) ->V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 3, 20)) +>V : Symbol(V, Decl(promiseIdentityWithConstraints.ts, 3, 27)) >callback : Symbol(callback, Decl(promiseIdentityWithConstraints.ts, 4, 35)) >x : Symbol(x, Decl(promiseIdentityWithConstraints.ts, 4, 46)) ->T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 18)) +>T : Symbol(T, Decl(promiseIdentityWithConstraints.ts, 3, 25)) >Promise : Symbol(Promise, Decl(promiseIdentityWithConstraints.ts, 2, 1)) >U : Symbol(U, Decl(promiseIdentityWithConstraints.ts, 4, 9)) >W : Symbol(W, Decl(promiseIdentityWithConstraints.ts, 4, 21)) diff --git a/tests/baselines/reference/promiseIdentityWithConstraints.types b/tests/baselines/reference/promiseIdentityWithConstraints.types index 5bc321cbb16..9c52a9581b8 100644 --- a/tests/baselines/reference/promiseIdentityWithConstraints.types +++ b/tests/baselines/reference/promiseIdentityWithConstraints.types @@ -1,5 +1,5 @@ === tests/cases/compiler/promiseIdentityWithConstraints.ts === -interface IPromise { +export interface IPromise { >IPromise : IPromise >T : T >V : V @@ -20,7 +20,7 @@ interface IPromise { >U : U >W : W } -interface Promise { +export interface Promise { >Promise : Promise >T : T >V : V diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 13fc0718596..661d66a4a44 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -51,9 +51,9 @@ tests/cases/compiler/promisePermutations.ts(144,12): error TS2453: The type argu tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. - Type '{ (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; }' is not assignable to type '{ (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; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. + Type '{ (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; }' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => IPromise'. Types of parameters 'value' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -68,9 +68,9 @@ tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of t tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. Types of property 'then' are incompatible. - Type '{ (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; }' is not assignable to type '{ (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; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. + Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }' is not assignable to type '{ (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; }'. + Types of parameters 'onfulfilled' and 'success' are incompatible. + Type '(value: string) => IPromise' is not assignable to type '(value: number) => number | PromiseLike'. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -310,9 +310,9 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. -!!! error TS2453: Type '{ (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; }' is not assignable to type '{ (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; }'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: number) => Promise' is not assignable to type '(value: string) => IPromise'. +!!! error TS2453: Type '{ (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; }' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }'. +!!! error TS2453: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2453: Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => IPromise'. !!! error TS2453: Types of parameters 'value' and 'value' are incompatible. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -339,9 +339,9 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. !!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (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; }' is not assignable to type '{ (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; }'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: string) => IPromise' is not assignable to type '(value: number) => Promise'. +!!! error TS2345: Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }' is not assignable to type '{ (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; }'. +!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2345: Type '(value: string) => IPromise' is not assignable to type '(value: number) => number | PromiseLike'. !!! error TS2345: Types of parameters 'value' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index b21a3a39208..b133801f776 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -51,9 +51,9 @@ tests/cases/compiler/promisePermutations2.ts(143,12): error TS2453: The type arg tests/cases/compiler/promisePermutations2.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. - Type '{ (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; }' is not assignable to type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. + Type '{ (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; }' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => IPromise'. Types of parameters 'value' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -68,9 +68,9 @@ tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. Types of property 'then' are incompatible. - Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (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; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. + Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (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; }'. + Types of parameters 'onfulfilled' and 'success' are incompatible. + Type '(value: string) => IPromise' is not assignable to type '(value: number) => number | PromiseLike'. Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -309,9 +309,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. -!!! error TS2453: Type '{ (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; }' is not assignable to type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: number) => any' is not assignable to type '(value: string) => IPromise'. +!!! error TS2453: Type '{ (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; }' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2453: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2453: Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => IPromise'. !!! error TS2453: Types of parameters 'value' and 'value' are incompatible. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -338,9 +338,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. !!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => Promise' is not assignable to type '{ (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; }'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: string) => IPromise' is not assignable to type '(value: number) => any'. +!!! error TS2345: Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }' is not assignable to type '{ (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; }'. +!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2345: Type '(value: string) => IPromise' is not assignable to type '(value: number) => number | PromiseLike'. !!! error TS2345: Types of parameters 'value' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 1a33d1083aa..b6c2a1cdfc7 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -54,9 +54,9 @@ tests/cases/compiler/promisePermutations3.ts(143,12): error TS2453: The type arg tests/cases/compiler/promisePermutations3.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. Types of property 'then' are incompatible. - Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (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; }'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. + Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }'. + Types of parameters 'success' and 'onfulfilled' are incompatible. + Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => any'. Types of parameters 'value' and 'value' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. @@ -71,15 +71,15 @@ tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of tests/cases/compiler/promisePermutations3.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. Type 'Promise' is not assignable to type 'IPromise'. Types of property 'then' are incompatible. - Type '{ (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; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. - Types of parameters 'success' and 'success' are incompatible. - Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. + Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. + Types of parameters 'onfulfilled' and 'success' are incompatible. + Type '(value: string) => any' is not assignable to type '(value: number) => number | PromiseLike'. 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'. Types of property 'then' are incompatible. - Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. + Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any): Promise; (onfulfilled: (value: any) => any, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: any) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. Type 'IPromise' is not assignable to type 'Promise'. @@ -321,9 +321,9 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. !!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. !!! error TS2453: Types of property 'then' are incompatible. -!!! error TS2453: Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (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; }'. -!!! error TS2453: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2453: Type '(value: number) => Promise' is not assignable to type '(value: string) => any'. +!!! error TS2453: Type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }'. +!!! error TS2453: Types of parameters 'success' and 'onfulfilled' are incompatible. +!!! error TS2453: Type '(value: number) => number | PromiseLike' is not assignable to type '(value: string) => any'. !!! error TS2453: Types of parameters 'value' and 'value' are incompatible. !!! error TS2453: Type 'string' is not assignable to type 'number'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -350,9 +350,9 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => IPromise'. !!! error TS2345: Type 'Promise' is not assignable to type 'IPromise'. !!! error TS2345: Types of property 'then' are incompatible. -!!! error TS2345: Type '{ (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; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. -!!! error TS2345: Types of parameters 'success' and 'success' are incompatible. -!!! error TS2345: Type '(value: string) => any' is not assignable to type '(value: number) => Promise'. +!!! error TS2345: Type '{ (onfulfilled?: (value: number) => number | PromiseLike, onrejected?: (reason: any) => number | PromiseLike): Promise; (onfulfilled: (value: number) => number | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: number) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (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; }' is not assignable to type '(success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise'. +!!! error TS2345: Types of parameters 'onfulfilled' and 'success' are incompatible. +!!! error TS2345: Type '(value: string) => any' is not assignable to type '(value: number) => number | PromiseLike'. !!! error TS2345: Types of parameters 'value' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. @@ -365,6 +365,6 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! 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: Types of property 'then' are incompatible. -!!! error TS2345: Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. +!!! error TS2345: Type '(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise' is not assignable to type '{ (onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any): Promise; (onfulfilled: (value: any) => any, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: any) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: any) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; (success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; }'. !!! error TS2345: Type 'IPromise' is not assignable to type 'Promise'. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file