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

Fix generator missing parens on Flow union types #6334

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

existentialism
Copy link
Member

Q                       A
Fixed Issues Fixes #6333
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added/Pass?
Spec Compliancy?
License MIT
Doc PR
Any Dependency Changes?

@babel-bot
Copy link
Collaborator

babel-bot commented Sep 29, 2017

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/5080/

@kassens
Copy link
Contributor

kassens commented Sep 29, 2017

Not clear to me from the code if this also covers ?(A & B). (Sorry, should've included that in the original issue)

@existentialism
Copy link
Member Author

@kassens yep, I just added intersections too.

@kassens
Copy link
Contributor

kassens commented Sep 29, 2017

It's getting more edge casey, but I think you might want to account for this too while you're at it:

type foo = a & (b | c);
type foo = (a | b) & c;

& seems to have higher precedence, at least according to the flow parser at astexplorer.net

@existentialism
Copy link
Member Author

@kassens yep, updated!

@hzoo hzoo added area: flow pkg: generator PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Sep 29, 2017
@hzoo hzoo merged commit 832408e into babel:master Sep 29, 2017
@existentialism existentialism deleted the issue6333 branch September 29, 2017 21:14
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: flow outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: generator PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[babel-generator] Missing parens around some flow types
4 participants