Skip to content

[Beam] Fix Erlang.receive<'T>() resolving to timeout overload#4395

Merged
dbrattli merged 2 commits into
mainfrom
dbrattli/beam-receive
Mar 13, 2026
Merged

[Beam] Fix Erlang.receive<'T>() resolving to timeout overload#4395
dbrattli merged 2 commits into
mainfrom
dbrattli/beam-receive

Conversation

@dbrattli
Copy link
Copy Markdown
Collaborator

Summary

  • Fix Erlang.receive<'T>() (blocking, no timeout) incorrectly generating after ok -> undefined in Erlang output, which crashes BEAM with {timeout_value, ...}
  • Root cause: F# passes a unit argument for parameterless calls, matching the [ timeoutArg ] pattern instead of [] in Beam Replacements
  • Added pattern to filter out UnitConstant args before the timeout branch

Test plan

  • Added test test Erlang receive blocking waits for delayed message that spawns a delayed sender — fails without fix (BEAM crashes on after ok), passes with fix
  • All 2261 Beam tests pass

🤖 Generated with Claude Code

dbrattli and others added 2 commits March 13, 2026 08:46
F# passes a unit argument for parameterless receive<'T>(), which matched
the timeout overload pattern `[ timeoutArg ]` instead of `[]`, generating
an invalid `after ok -> undefined` clause that crashes BEAM at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbrattli dbrattli merged commit e19011f into main Mar 13, 2026
18 of 22 checks passed
@dbrattli dbrattli deleted the dbrattli/beam-receive branch March 13, 2026 19:48
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.

1 participant