Add an unrelated type parameter and this parameter

This returns `call` to its previous level of fidelity.
Thanks (?) to @weswigham for this hack.
This commit is contained in:
Nathan Shively-Sanders
2019-02-25 14:42:36 -08:00
parent 1a35aa7ea1
commit 548c13e019
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -553,7 +553,7 @@ bool = fooProm.isResolved();
strProm = fooProm.call("foo");
strProm = fooProm.call("foo", 1, 2, 3);
// $ExpectType Bluebird<any>
// $ExpectType Bluebird<never>
quxProm.call("qux");
strProm = fooProm.get("foo").then(method => method());
+1 -1
View File
@@ -350,7 +350,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
* });
* </code>
*/
call<U extends keyof R>(propertyName: U, ...args: any[]): Bluebird<any>;
call<U extends keyof Q, Q>(this: Bluebird<Q>, propertyName: U, ...args: any[]): Bluebird<Q[U] extends (...args: any[]) => any ? ReturnType<Q[U]> : never>;
/**
* This is a convenience method for doing: