You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Four parity-safe frontend fixes surfaced by the self-hosting stress test
(findings in docs/ledgers/rss-selfhost-ledger.md). No backend/lowering/runtime
changes — the 6-backend parity holds by construction.
- SH-017 (correctness bug): a statement beginning with `||` was misparsed as a
discarded empty-arg closure, so wrapped boolean chains silently dropped their
continuation. Now a leading-`||` statement emits RS0015 instead of a silent
wrong result. (parser/stmt.rs)
- SH-016: `'` had no lexer handling and mapped to `?`, cascading a misleading
RS0013. Now `'…'` lexes as one token and yields a clear "no character-literal
syntax" RS0015; the RS0013 cascade is gone. (lexer.rs + Program.char_literal_spans
+ analyzer; mirrored in selfhost/lexer.rss for parity)
- SH-024: positional multi-field variant patterns (`V(a, b)`) emitted a
misleading per-binding RS0026. Now a single targeted RS0037 points to the named
form `V { a, b }` (positional records are excluded by spec §20.1). (parser + new
diagnostic code)
- SH-019 (root cause corrected): a `fresh`-returning builder failed RS0601 only
after a loop/branch — the flow merge dropped MANAGED fresh bindings, keeping only
exclusive `local` ones (straight-line always compiled). Fixed by keeping managed
bindings across the merge. (checks/local.rs merge_flow_states + 3 siblings)
Fixtures: fail/{char-literal-unsupported,leading-operator-continuation,
positional-multifield-variant}.rss, pass/fresh-loop-built-list.rss.
Gated: full suite green (CARGO_EXIT=0), self-host parity 550/550 (lexer/parser/
checker), clippy clean on touched files.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
explanation:"Value identifiers must resolve to a visible parameter, local binding, with-bound resource, or pattern binding before Rust lowering.",
552
553
},
554
+
DiagnosticExplanation{
555
+
code: code::POSITIONAL_MULTIFIELD_VARIANT,
556
+
title:"positional multi-field variant pattern",
557
+
explanation:"A sum-type variant with two or more fields must be matched with named fields (`V { a, b }`), not a positional payload (`V(a, b)`). RSScript excludes positional records (spec §20.1): only single-payload positional patterns like `Some(v)` or `Circle(r)` and named field patterns like `V { a, b }` are allowed. The parser keeps the attempted binder names so they still resolve inside the arm — avoiding a misleading per-binding `unknown value binding` (RS0026) — and reports this single targeted diagnostic instead.",
0 commit comments