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

Provide more helpful values for Object.entries() and Object.values() #4527

Closed
wants to merge 3 commits into from

Conversation

jcready
Copy link
Contributor

@jcready jcready commented Aug 3, 2017

No description provided.

@jcready
Copy link
Contributor Author

jcready commented Aug 5, 2017

I'm not familiar with how the tests work, and I honestly cannot figure out what I broke in the tests from Travis-CI output. If anyone can point me in the right direction I'd be more than happy to adjust any test expectations to get these tests passing.

@vkurchatkin
Copy link
Contributor

Unfortunately, this is very unsound

@jcready
Copy link
Contributor Author

jcready commented Aug 7, 2017

Why is that?

@vkurchatkin
Copy link
Contributor

Here is a simple example:

function test(val: { foo: string }) {
  Object.values(val).forEach(v => {
  	v.toLowerCase();
  });
}

test({ foo: 'x', bar: 123 });

This going to pass typechecking, but fail at runtime

@jcready
Copy link
Contributor Author

jcready commented Aug 7, 2017

Oh, blerg. That is truly unfortunate.

@jcready jcready closed this Aug 7, 2017
@samwgoldman
Copy link
Member

We're slowly getting Flow to a place where we can exploit exact objects to provide more specific types for own- and width-sensitive APIs, like Object.values, object spread properties, etc. Rest assured that this is my primary focus right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants