Skip to content

lib.es2015.iterable.d.ts exports the Promise interface #12868

@LucasSloan

Description

@LucasSloan

TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)

lib.es2015.iterable.d.ts exports the Promise interface, which is only used in lib.es2015.iterable.d.ts to help define the PromiseConstructor interface which isn't further used in lib.es2015.iterable.d.ts. Since both Promise and PromiseConstructor are declared in lib.es2015.promise.d.ts and the declaration for Promise in lib.es2015.iterable.d.ts is empty and the declaration for PromiseConstructor is incomplete and not linked to Promise, it seems like both should be removed from the lib.es2015.iterable.d.ts file.

As a result, I got a the compliler error
error TS2339: Property 'then' does not exist on type 'Promise<any>'
when I referenced Promise while importing iterable, and not promise instead of the expected
error TS2304: Cannot find name '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