Skip to content

2.x returned promise types #139

Closed
Closed
@downsider

Description

@downsider

I have encountered a type error when calling then() on an ExtendedPromiseInterface

In short, then() states it returns a PromiseInterface as it is inherited from that interface. However, this means that we cannot chain calls to the extended methods such as done() or otherwise() without type casting back to ExtendedPromiseInterface.

I know this is fixed in master, as both interfaces have been merged into one, but there is a trivial fix for the 2.x branch; namely changing PromiseInterface::then() to return static. Could we add this in please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions