Skip to content

fix(compiler): include unmatched values in try_clause errors - #26

Merged
mremond merged 1 commit into
mainfrom
fm/task-55b52329
Nov 13, 2026
Merged

mremond merged 1 commit into
mainfrom
fm/task-55b52329

Conversation

@mremond

@mremond mremond commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Why

Unmatched try-of clauses should report the original value in their error, matching BEAM.

What changed

  • Unmatched try-of failures raise error:{try_clause, Value}.
  • Existing catch routing and after cleanup remain unchanged.
  • A shared regression verifies native and BEAM behavior.

Before and after

Before: An unmatched try-of result raised the bare try_clause atom and discarded the value.

After: Unmatched results now produce a two-element reason tuple containing try_clause and the original value.

This changes compiler-generated exception values, not a graphical view; native and BEAM execution transcripts demonstrate the result.

Checked

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

Scenario Result Evidence
Unmatched try-of results retain their exact value and BEAM error semantics. ✅ Passed live Native and BEAM probes agree; the shared fixture covers eleven unmatched values, failed guards, catch bypass, single cleanup and successful controls.
  • Rust workspace and strict Clippy: 2,146 tests passed, one ignored; no Clippy warnings.
  • Full native suite: 482 tests passed; two fixtures skipped because external OneCached modules are unavailable.
  • New regression stability: Unit, native and BEAM regressions each passed ten consecutive runs without retries.
  • Allocator regression: Native default and override settings matched expected readings.
  • Cross-object smoke checks: Generated macOS x86_64 Mach-O and Linux ARM64 ELF objects successfully.
  • Hosted validation: Linux and macOS builds, Rust checks, all end-to-end shards, integrations and cross-compile checks passed.
How it was checked

cargo build --release --locked -p nera-runtime; cargo build --release --locked

cargo test --locked -p nera-ir

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

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

python3 scripts/test-allocator-config.py

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

bash scripts/test-cross.sh with x86_64-apple-darwin and aarch64-unknown-linux-gnu targets

The added lowering test and native fixture each passed ten consecutive runs; the same fixture compiled with erlc -Werror and completed ten times on BEAM.

All 18 applicable hosted checks succeeded; three unrelated editor and packaging checks were skipped by the change map.

Risk

Risk: low in every dimension.

Full risk assessment
Dimension Level Why
Blast radius low Only the try-of failure reason construction changes.
Behavior low Corrects an exception reason to match BEAM.
Undo low A revert restores the previous behavior without data migration.
Evidence low Native and BEAM execution prove exact reasons and control flow.
Sensitivity low No saved data, sign-ins, keys, payments or release changes.
Novelty low Uses the existing tuple-construction and exception instructions.
Dependencies low No dependency changes.
Not done

Windows native execution and execution on the two cross-compile targets were not verified.

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 13, 2026
@mremond
mremond merged commit c648f5d into main Nov 13, 2026
21 checks passed
@mremond
mremond deleted the fm/task-55b52329 branch November 15, 2026 14:04
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