-
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
Mapping over same objects and overwriting values #6942
Comments
What I find strange is that
..., i.e. just adding a type that is already there according to how the type of Does Flow have some invisible hard-coded logic for |
It has, for reference #6927 |
@goodmind Could it be declared using a generic (object) type of the keys of the object? There are similar discussions and issues in TypeScript, and TS's ahejlsberg wrote that's not possible (but I don't buy the argument he gives, his example just looks to me like somebody used the wrong type and not a fundamental issue). |
I think it should work like this, but without two generics |
This pattern will not be supported as it's too dynamic |
When mapping over the same objects, flow doesn't allow to overwrite the values of the objects even though they are the same.
I'm assuming that flow checks merely all of the values of an object and checks if there is only one type as the value and if it's the same.
I guess this is a particular case. I think flow should only compare the types of the same keys and the structure of the object.
Try Flow
The text was updated successfully, but these errors were encountered: