Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A follow up from my previous PR #81
This PR removes a few cases where inexact object types are used and replaces them with
{ +[string]: mixed }
This is a quirk of how inexact object types work. They do not allow reading any of those additional keys which may or may not exist on the object. They only loosen the constraints for what objects can be given when such a type is used.
This is particularly problematic when
{...}
is used as a stand-in for "any object". According to flow, an exact object type does not satisfy{...}
.Using
{ +[string]: mixed }
fixes all of these problems and works in all scenarios for at least the last 30 versions of Flow.