The Wire · Showcase
ELIXIR FIXES PATTERN MATCHING OPTIMIZATION AND EXUNIT SPEC BUGS
By RepoJournal · Filed · About Elixir & Phoenix
The Elixir compiler now optimizes `x in []` pattern matching to compile directly to `false` instead of calling lists.member, while ExUnit's capture_log spec finally forbids the crash-inducing `formatter: nil` option that was never actually supported.
The most impactful fix lands in the core compiler [1], where pattern matching against empty lists now inlines during the Erlang pass instead of generating a runtime lists.member call. This closes a long-standing optimization gap and follows the same approach used in earlier compiler work. Meanwhile, ExUnit's capture_log just had its spec corrected [2] to accurately reflect that `formatter: nil` was never a valid option, even though the code would crash if you passed it. The same PR fixes the underlying issue in capture_server.ex so the option now properly rejects nil values. Documentation also got its due diligence: signal handling docs [3] now correctly note that SIGSTOP is untrappable on POSIX systems and SIGTERM is properly trapped, aligning with the actual erl_signal_handler implementation. A minor typo in JSON.Encoder's moduledoc rounds out the batch.
Action items
- → Review your ExUnit tests for any capture_log calls with formatter: nil and remove them before next update elixir-lang/elixir [plan]
- → Monitor next Elixir release for the pattern matching optimization, expect slight compile-time improvements on empty list checks elixir-lang/elixir [monitor]
References
- [1] Inline in empty list in erlang pass ↗ elixir-lang/elixir
- [2] Fix spec of ex_unit capture_log options (#15417) elixir-lang/elixir
- [3] Fix trapped signal documentation (#15415) elixir-lang/elixir
FAQ
- What changed in Elixir & Phoenix on May 24, 2026?
- The Elixir compiler now optimizes `x in []` pattern matching to compile directly to `false` instead of calling lists.member, while ExUnit's capture_log spec finally forbids the crash-inducing `formatter: nil` option that was never actually supported.
- What should Elixir & Phoenix teams do about it?
- Review your ExUnit tests for any capture_log calls with formatter: nil and remove them before next update • Monitor next Elixir release for the pattern matching optimization, expect slight compile-time improvements on empty list checks
- Which Elixir & Phoenix repositories shipped on May 24, 2026?
- elixir-lang/elixir