-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Cannot await
on interfaces extending Promise<any>
in TypeScript 2.1 RC
#12292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would |
@Kovensky It shouldn't be necessary - ES |
Ran into another library with this issue: |
Same deal with superagent. |
Fixed in #12743 |
Fix should be in typescript@next later tonight. Please give it a try and let us know if you are still running into issues. |
Will it make the final release of 2.1, a patch release, or 2.2?
…On Wed, Dec 7, 2016, 20:55 Mohamed Hegazy ***@***.***> wrote:
Fix should be in ***@***.*** later tonight. Please give it a try and
let us know if you are still running into issues.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12292 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AERrBGXvMQFz7Guc8neVDGdoLaD6sbVRks5rF2OVgaJpZM4Kza4p>
.
|
@mhegazy seems to be fine now, thanks. |
For context: I ran into this bug using Knex and its type definition in TypeScript 2.1 RC. Knex's type definitions use an extended
Promise
interface for every value returned from a query, to allow for further chaining. Unfortunately, it looks like async/await in TypeScript does not support this.I found several references to fixed issues and regressions in prior versions of TypeScript, but could not find an open issue for the current version. Apologies if this is a duplicate issue.
TypeScript Version:
typescript@rc
(2.1.1)Code
main.ts
:tsconfig.json
:Runnable test case: https://github.com/thomasboyt/typescript-await-promise-bug-test-case
Expected behavior: TypeScript allows
await
ing interfaces extendingPromise<any>
.Actual behavior: TypeScript displays the error
Operand for 'await' does not have a valid callable 'then' member.
.My current workaround for this is to just
await (promiseExtendingObject as any)
, so it's not the end of the world. Hopefully can be fixed before 2.1 is released, though :)The text was updated successfully, but these errors were encountered: