-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
An async function or method must have a valid awaitable return type #10805
Comments
Does this happens only in That was discussed in #6007, if I remember correctly, es5 still needs the return type. |
@nippur72 Yes - it only happens with Moreover this example works fine with some other project we have. Old working project is using declare var Promise: PromiseConstructor;
interface PromiseConstructor {
...
interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
.... Latest declare module 'bluebird' {
class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R> {
... and I cannot do |
I think if you are polyfilling |
Another strange thing about this "need for return type" is that, if the async foo() {} // no error
async bar() {} // error TS1057
bar(); |
TypeScript Version: Version 2.1.0-dev.20160908
Code
Expected behavior:
Should compile
Actual behavior:
The text was updated successfully, but these errors were encountered: