RepoJournal
Elixir & Phoenix

Elixir & Phoenix

Elixir, Phoenix, LiveView, and Ecto - the BEAM web stack

Keep up with Elixir & Phoenix in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Elixir & Phoenix Full archive →

The Wire · Showcase

MACRO.TO_STRING BUG BREAKS FOR COMPREHENSIONS WITH TRAILING KEYWORDS

By RepoJournal · Filed · About Elixir & Phoenix

Elixir's Macro.to_string/1 silently corrupts for-comprehensions that use do-end blocks with non-block trailing keywords, rendering valid code that no longer compiles.

When Macro.to_string/1 encounters a trailing keyword list starting with do:, it renders the entire expression as a do-end block regardless of what comes after [1]. This breaks code like for(cp <- gc, do: <<cp::utf8>>, into: "") by parsing into as a bare variable instead of a comprehension option [1]. The rendered output looks syntactically valid but fails to compile, turning a silent macro bug into a runtime trap [2]. The fix restricts do-end block rendering to cases where every trailing keyword is actually a block keyword, preserving the semantic meaning of the original quoted expression [2]. This lands as a single commit across the Elixir repo over the last 24 hours.

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Only use do-end blocks when every trailing keyword is a block keyword ↗ elixir-lang/elixir
  2. [2] Only use do-end blocks when every trailing keyword is a block keyword (#15725) elixir-lang/elixir

Quick answers

What shipped in Elixir & Phoenix on August 9, 2026?
Elixir's Macro.to_string/1 silently corrupts for-comprehensions that use do-end blocks with non-block trailing keywords, rendering valid code that no longer compiles. In total, 1 commits and 1 pull requests landed.
Who contributed to Elixir & Phoenix on August 9, 2026?
1 developer shipped this update, including makoto-developer.
What were the notable Elixir & Phoenix updates?
Only use do-end blocks when every trailing keyword is a block keyword and Only use do-end blocks when every trailing keyword is a block keyword (#15725).

More from Elixir & Phoenix

Daily updates, in your inbox

Follow Elixir & Phoenix

Keep up with Elixir & Phoenix in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?