From 548c13e0191bedd8a9084a9cb87adcbc245a5733 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 25 Feb 2019 14:42:36 -0800 Subject: [PATCH] Add an unrelated type parameter and this parameter This returns `call` to its previous level of fidelity. Thanks (?) to @weswigham for this hack. --- types/bluebird/bluebird-tests.ts | 2 +- types/bluebird/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index c7b1112a9e..05ac5cc19c 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -553,7 +553,7 @@ bool = fooProm.isResolved(); strProm = fooProm.call("foo"); strProm = fooProm.call("foo", 1, 2, 3); -// $ExpectType Bluebird +// $ExpectType Bluebird quxProm.call("qux"); strProm = fooProm.get("foo").then(method => method()); diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index efb43450eb..13a11c2e3e 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -350,7 +350,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: U, ...args: any[]): Bluebird; + call(this: Bluebird, propertyName: U, ...args: any[]): Bluebird any ? ReturnType : never>; /** * This is a convenience method for doing: