0%

Spec-test corpus + motivating rewrite

Goal

Positive matrix (tuple-wrapped Option, list destructuring incl. anonymous rest, variant refinement, literal refinement, or-patterns, $-bindings, shadowing, try interaction, loop-body function-exit semantics), negative pins (#compile_fail for every invariant error shape, plain-let E2001 unchanged, warnings), and the flagship rewrite: the double_ended.ori interleave pyramid becomes the flat let? form.

Implementation Sketch

Scope contract: the approved proposal (compiler_repo/docs/ori_lang/proposals/approved/fallible-let-binding-proposal.md) - Design + Semantics + Spec & Grammar Impact sections govern this section verbatim; no scope invention. TDD: the failing test matrix for this section’s shapes lands before implementation; debug AND release verified at close.

Spec References

  • compiler_repo/docs/ori_lang/proposals/approved/fallible-let-binding-proposal.md
  • compiler_repo/docs/ori_lang/v2026/spec/16-control-flow.md (16.0.3, 16.5, 16.6, 16.7)
  • compiler_repo/docs/ori_lang/v2026/spec/15-patterns.md; 13-variables.md; grammar.ebnf

Work Items

  • Positive spec-test matrix across pattern shapes x contexts (fn/try/loop) x executors
  • Negative pins: #compile_fail per invariant-error shape; warning assertions; plain-let E2001 pin
  • Rewrite tests/spec/traits/iterator/double_ended.ori interleave tests to the flat let? form as the motivating flagship (keep one pyramid variant as a regression companion)