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: parse a<b>>>c as a<(b>>>c) #14819

Merged
merged 3 commits into from Aug 27, 2022
Merged

fix: parse a<b>>>c as a<(b>>>c) #14819

merged 3 commits into from Aug 27, 2022

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 2, 2022

Q                       A
Fixed Issues? Fixes #14813
Patch: Bug Fix? Y
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Bail out the TSInstantiateExpression try parsing when we see >> immediately after > without whitespaces.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: typescript i: regression labels Aug 2, 2022
@babel-bot
Copy link
Collaborator

babel-bot commented Aug 2, 2022

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

@@ -0,0 +1 @@
a<b> > c;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current TS nightly throws "Expression expected" in this case and the other similar one, which I think is a TS bug. They should be handled as same as a<b> ?? c.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is intentional: microsoft/TypeScript#49353 (cc @ahejlsberg the code above is unambiguous, do you remember why it's disallowed?).

@liuxingbaoyu
Copy link
Member

Let's merge it?

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Aug 27, 2022

I think we should match TS in #14819 (comment), since it's an intentional restriction.

@JLHwung JLHwung merged commit 6c5ebd1 into babel:main Aug 27, 2022
@JLHwung JLHwung deleted the fix-14813 branch August 27, 2022 23:00
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

[Bug]: Regression compiling binary operations in typescript code
4 participants