Skip to content

test(ir): cover case exports inside maybe bodies - #59

Merged
mremond merged 1 commit into
mainfrom
fm/task-636f356a
Nov 15, 2026
Merged

mremond merged 1 commit into
mainfrom
fm/task-636f356a

Conversation

@mremond

@mremond mremond commented Nov 15, 2026

Copy link
Copy Markdown
Member

Why

Protect case-branch bindings read later in a maybe body from false unbound-variable regressions.

What changed

  • Add tests and documentation only; compiler behavior is unchanged.
  • Share one Erlang fixture between diagnostic analysis and native execution.
  • Check both branches, conditional-match success and failure, and explicit completion against BEAM.

Before and after

Before: The compiler already accepted these programs, but zero dedicated fixtures covered case exports read later in a maybe body.

After: One shared fixture checks nine outcomes and completion; a diagnostic regression rejects false semantic errors.

Only tests and documentation change; no screen or visible compiler behavior changes.

Checked

Live validation: Demonstrated for this version. 2 of 2 scenarios driven live in the product.

Scenario Result Evidence
Check and build case exports read later in a maybe body; compare native results with BEAM. ✅ Passed live Both compile successfully, and all nine assertions complete with identical native and BEAM output.
Analyze the shared fixture without false semantic errors for later case-export reads. ✅ Passed live The real warning-analysis regression passes; existing nonfatal false-unused warnings remain outside scope.
  • Workspace and lint: 2,206 tests passed, one ignored; strict workspace clippy passed.
  • Full native suite: 519 passed, zero failed, two external-dependency skips.
  • Edited-test repetition: All 271 warning-analysis tests passed ten consecutive runs; the focused native regression passed ten consecutive runs, without retries.
  • Allocator and stacktrace probes: Both passed.
  • Independent code and proof reviews: No material findings; both required scenarios have accepted evidence at the committed version.
How it was checked

cargo build --release --locked

cargo clippy --workspace --all-targets --locked -- -D warnings

cargo test --workspace --locked --no-fail-fast

cargo test -p nera-ir --locked warnings::tests:: (ten consecutive runs)

./target/release/nera test -j 1 --timeout 30

./target/release/nera test maybe_case_exports -j 1 --timeout 30 (ten consecutive runs)

python3 scripts/test-allocator-config.py; python3 scripts/test-stacktrace-order.py

nera check and nera build with the shared fixture; erlc and erl run the same assertions; native and BEAM stdout match.

Existing false unused-variable warnings remain outside this regression's scope.

Risk

Risk: low in every dimension.

Full risk assessment
Dimension Level Why
Blast radius low Only one diagnostic test, one Erlang fixture, and their documentation change.
Behavior low Compiler behavior is unchanged.
Undo low Reverting the commit removes only tests and documentation.
Evidence low Check, build, and completed native execution match BEAM.
Sensitivity low No saved data, credentials, or release behavior changes.
Novelty low Uses existing diagnostic and native test infrastructure.
Dependencies low No dependencies change.

Pipeline

Updates from git push no-mistakes

Infinitary checked this version: an independent review that also judged the documents, and live validation the review accepted.

@github-actions github-actions Bot added this to the 0.1.1 milestone Nov 15, 2026
@mremond
mremond merged commit 77eb718 into main Nov 15, 2026
22 checks passed
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