Skip to content

Conversation

@shulhi
Copy link
Member

@shulhi shulhi commented Mar 30, 2025

Fix #7345

}, _)
->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.

-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 <ck@cca.io>
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