Repository navigation
Keep parens on anonymous function calls with do-end blocks - #16004
Merged
josevalim merged 1 commit intoOct 19, 2026
Merged
Conversation
Anonymous function calls were formatted with :skip_if_do_end, which dropped the parens when the call had a do-end block and produced code that does not parse. Use :required instead, as the parens are part of the anonymous call syntax. Signed-off-by: Mandar Joshi <mandarjoshi1045@gmail.com>
mandar1045
added a commit
to mandar1045/mandarjoshi-portfolio
that referenced
this pull request
Oct 19, 2026
Add elixir-lang/elixir#16004 (parens on anonymous calls with do-end blocks), now merged, to the portfolio and resume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16003.
The formatter printed anonymous function calls with
:skip_if_do_end, so when the call had a do-end block the parens were dropped andcallback.(conn, opts) dobecamecallback. conn, opts do, which doesn't parse. In some cases likefun.(a).(b) do c endthe output even parsed to something different.For anonymous calls the parens are part of the syntax, so this now uses
:required, same as thecall(call)(arguments)clause right below it. Calls without a do-end block format the same as before. This also fixesMacro.to_string/1.Added tests in
calls_test.exsandquoted_ast_test.exs.