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

Parse async arrows with flow type parameters #6802

Merged

Conversation

@nicolo-ribaudo
Copy link
Member

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
@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Nov 12, 2017

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

): ?N.ArrowFunctionExpression {
const node = this.startNodeAt(startPos, startLoc);

const oldInFunc = this.state.inFunction;

This comment has been minimized.

Copy link
@Andarist

Andarist Nov 12, 2017

Member

this seems really hacky, looks like the real problem is in the parseArrow or parseFunctionBodyAndFinish

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Nov 13, 2017

Author Member

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);

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Nov 13, 2017

Author Member

Sorry I couldn't resist adding a really confusing test 😅

Copy link
Member

existentialism left a comment

👍

@nicolo-ribaudo nicolo-ribaudo merged commit 9ae2363 into babel:master Nov 14, 2017
4 checks passed
4 checks passed
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 87.36% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nicolo-ribaudo nicolo-ribaudo deleted the nicolo-ribaudo:async-arrow-type-parameters branch Nov 14, 2017
@lock lock bot added the outdated 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.
Projects
None yet
4 participants
You can’t perform that action at this time.