Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing part of an intersection type retroactively strips info from the typing itself? #6217

Open
gausie opened this issue Apr 26, 2018 · 0 comments

Comments

@gausie
Copy link

gausie commented Apr 26, 2018

This is difficult to explain so check the Try example instead. For more information on the Return type utility at the top, check #4002.

Click to check the typing of Props (on line 16 for example) and see the following type info in the status bar
type Props = Return<(state: State) => {|example: State|}> & {|action: () => {|type: string|}|}

Now uncomment line 20 and check the typing of Props again. You will see that it has now become
type Props = Return<(state: State) => any> & {|action: () => any|}

As you can see, most of the typing information has been stripped, which is a problem.

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

No branches or pull requests

1 participant