Skip to content

Async / await with Bluebird promises #8331

@jjrv

Description

@jjrv

In TypeScript 1.9.0-dev.20160426 I tried:

import * as Promise from 'bluebird';

async function test() {
    await Promise.delay(1000);
}

test();

The compiler reports:

error TS2529: Duplicate identifier 'Promise'. Compiler reserves name 'Promise' in top level scope of a module containing async functions.

Especially since this is purely for Node.js, I'd like to use Bluebird promises for their debuggability and import them as Promise instead of some other name.

Could I provide my own __awaiter or could the default one use the imported Promise?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions