-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
and Object.values()
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. |
Normal objects should still flow into this
Unfortunately, this is very unsound |
Why is that? |
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 |
Oh, blerg. That is truly unfortunate. |
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. |
No description provided.