Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Await does not work with interface extending Promise #12737

Copy link
Copy link
@jsedlacek

Description

@jsedlacek
Issue body actions

TypeScript Version: 2.1.4

Code

interface HelloPromise extends Promise<string> {}

function hello() : HelloPromise {
  return Promise.resolve('hello');
}

async function run() {
  await hello();
};

run();

Expected behavior: The code is compiled without errors.

Actual behavior: Following error is reported:

tsc -t es6 --strictNullChecks index.ts
index.ts(8,3): error TS1058: Operand for 'await' does not have a valid callable 'then' member.

You can find the repro code here:
https://github.com/jsedlacek/ts-promise-repro

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.