-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Parse async arrows with flow type parameters #6802
Parse async arrows with flow type parameters #6802
Conversation
nicolo-ribaudo
commented
Nov 12, 2017
Q | A |
---|---|
Fixed Issues? | Fixes #6712 |
Patch: Bug Fix? | yes |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR | |
Any Dependency Changes? | |
License | MIT |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/5816/ |
packages/babylon/src/plugins/flow.js
Outdated
): ?N.ArrowFunctionExpression { | ||
const node = this.startNodeAt(startPos, startLoc); | ||
|
||
const oldInFunc = this.state.inFunction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems really hacky, looks like the real problem is in the parseArrow
or parseFunctionBodyAndFinish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you are right.
|
||
// This looks A LOT like an async arrow function, but it isn't because | ||
// T + U isn't a valid type parameter. | ||
(async <T + U>(fn: T): T => fn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I couldn't resist adding a really confusing test 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍