typeck-semantics
Goal
Type the block as the unified exit-path type; bare break is loop-only; continue:block is an error; loop transparency.
Implementation Sketch
Unify all break:label values + final expr; thread label namespace (no-shadowing); pass-through semantics for bare break + loop-label control flow.
Spec References
labeled-block-early-exit-proposal.md Semantics + Unlabeled-break + continue:block-error + Loop-Control-Transparency.
Work Items
- Type the block as the unified type of ALL
break:label valueexit paths AND the final expression (per proposal Semantics) incompiler/ori_types/;break:label valuebinds value to the named block. - Bare
break(no label) inside a labeled block is LOOP-ONLY — passes THROUGH the block to the innermost enclosing loop (per proposal).break:loop_label/continue:loop_labelare transparent through blocks (liketry { }). No-shadowing: block labels share the loop-label namespace. -
continue:block_labeltargeting a labeled block is a COMPILE-TIME ERROR (blocks do not iterate) — emit a structured diagnostic (allocate a new E-code); negative#compile_failtest pins it.continue:loop_labelthrough a block stays valid.