Fix handling of colons on Flow function types #1089
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.
This way is simpler to reason about: it's fewer conditionals, and
less peeking up and down the tree to try to anticipate what other
nodes will do. And it works the same on all existing tests.
It also works correctly on a number of other test cases where the
existing logic breaks. Add a bunch of those, and a few others.
The commit at the tip of this branch is the one that makes the actual changes. It's small. Reading the commits individually will make them easier to read than reading the whole PR's diff at once.
That tip commit doesn't actually require any of the other changes: it works just fine on its own. I'd be happy to see it merged and drop the others. But they came naturally along the way and they seem like useful improvements for the next person working in these parts of the code, so I figured I'd share them.