Skip to content

Fix superfluous parens for underscore application #7370

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

Merged
merged 3 commits into from
Apr 1, 2025

Conversation

shulhi
Copy link
Member

@shulhi shulhi commented Mar 30, 2025

Fix #7345

}, _))
->(Js.Promise.then_(value => {
}, _)
->Js.Promise.then_(value => {
Js.log(value)
Js.Promise.resolve(value + 3)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the expected output, it removes the unnecessary parens.

@@ -36,7 +36,7 @@ f((a, b) => List.length(_), a, b)
f(a, b, _)(x, y)
-f(a, b, _)
f(a, b, _) + g(x, _, z)
f(a, b, _) + (g(x, _, z)) + h(alpha, beta, _)
f(a, b, _) + g(x, _, z) + h(alpha, beta, _)
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as previous.

Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Nice! Thanks a lot!

Not in the scope of this PR, but wondering whether we couldn't have a better representation than that magic variable name __x in our new AST?

@cknitt cknitt merged commit 93c6bfa into rescript-lang:master Apr 1, 2025
20 checks passed
fhammerschmidt pushed a commit that referenced this pull request Apr 4, 2025
* Fix superfluous parens for underscore application

* Update CHANGELOG

---------

Co-authored-by: Christoph Knittel <[email protected]>
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 this pull request may close these issues.

Formatter adds superfluous parens in pipe chain
2 participants