Skip to content

fix(nav): Explicitly type the promise returned - #12235

Closed
RoopeHakulinen wants to merge 2 commits into
ionic-team:masterfrom
RoopeHakulinen:patch-1
Closed

RoopeHakulinen wants to merge 2 commits into
ionic-team:masterfrom
RoopeHakulinen:patch-1

Conversation

@RoopeHakulinen

Copy link
Copy Markdown

Short description of what this resolves:

Explicitly types the promise returned by goToRoot method. Since the type of Promise.reject() is deduced to be of type Promise<never> by TypeScript it fails to compile as the classes extending the class (Nav and Tabs) are typed as Promise<any>.

This problem only happens in TS 2.4 as there were improvements on inference for generics.

Changes proposed in this pull request:

  • Explicitly type the promise returned by goToRoot method as Promise<any> instead of automatically deduced Promise<never>.

Ionic Version: 3.x

Fixes: #12233

@RoopeHakulinen
RoopeHakulinen deleted the patch-1 branch July 11, 2017 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant