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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when using ternaries + async fat arrow + typecast #541

Closed
arcanis opened this issue Nov 17, 2020 · 2 comments 路 Fixed by #544
Closed

Syntax error when using ternaries + async fat arrow + typecast #541

arcanis opened this issue Nov 17, 2020 · 2 comments 路 Fixed by #544

Comments

@arcanis
Copy link

arcanis commented Nov 17, 2020

I admit the title is very specific 馃槃

The following structure doesn't parse with ESBuild, but seems fine per the TS playground:

_ as any ? async () => _ : _;
@rtsao
Copy link
Contributor

rtsao commented Nov 17, 2020

It appears this is actually a broader issue with typecasted ternary conditions, it's just that this particular case results in a parse error.

For example, esbuild currently transforms a as any ? b : c; into a;

evanw added a commit that referenced this issue Nov 18, 2020
@evanw
Copy link
Owner

evanw commented Nov 18, 2020

The fix for this has been released. Thanks so much for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants