Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Error w/ generics in return type annots inside JSXExpressionContainers #774

Closed
mroch opened this issue Oct 27, 2017 · 3 comments
Closed

Comments

@mroch
Copy link
Contributor

mroch commented Oct 27, 2017

Input Code

<bar>{function(): string {}}</bar>; // parses
<bar>{function(): Array<string> {}}</bar>; // errors

Babylon/Babel Configuration

jsx, flow

Expected Behavior

Flow parses this as a JSXExpressionStatement containing a FunctionExpression containing a GenericTypeAnnotation returnType.

Current Behavior

Babylon gets into some sort of bad state and errors about unexpected tokens.

Your Environment

software version
Babylon 7.0.0-beta.12
node astexplorer
npm n/a
Operating System Mac

This may be the same as #36. The repro in that issue doesn't seem to work anymore, but there's a test so I'm surprised. Decided to open a new issue since that one is old and closed but happy to move discussion back there.

@hzoo
Copy link
Member

hzoo commented Oct 27, 2017

Hey @mroch! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@nicolo-ribaudo
Copy link
Member

That fix was released in beta.14. Can you try using a more recent version?

@mroch
Copy link
Contributor Author

mroch commented Oct 28, 2017

ah ok. my bad, thanks!

@mroch mroch closed this as completed Oct 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants