Repository navigation
fix(ir): reject variables in record field defaults - #60
Merged
Merged
Conversation
mremond
force-pushed
the
fm/task-3b8ec892
branch
from
November 15, 2026 20:00
80f796d to
5913bfc
Compare
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.
Why
Record field defaults could bind variables even though Erlang rejects those definitions.
What changed
Before and after
Before: Both compiler commands accepted an unused record default that bound and returned a variable.
After: All 24 invalid-default cases now fail as expected, and all eight wildcard-catch controls compile.
This changes compiler diagnostics rather than a graphical view; CLI transcripts verify the results.
Checked
Live validation: Awaiting live validation. This version and evidence need an independent review of coverage and proof.
How it was checked
cargo build --release --locked
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked --no-fail-fast
./target/release/nera test -j 1 --timeout 30
python3 scripts/test-allocator-config.py; python3 scripts/test-stacktrace-order.py
Ten runs each: cargo test --locked -p nera-ir --lib warnings::tests; cargo test --locked -p nera --test record_default_variables
Local validation used macOS arm64. One Rust test was ignored and two external-dependency native cases were skipped.
Erlang rejects bare variable defaults as unbound; Nera uses the record-definition wording consistently for both invalid forms.
Risk
Risk above low: Blast radius, high — The shared variable analyzer runs for every checked module.
Full risk assessment