frontend: align source grammar and reject empty enum payload lists

This commit is contained in:
dev committed 2026-10-08 14:14:45 +03:00
1 parent 48b9b42fed
commit 4c9c5626c9
44 files changed
+501 -33

No files matched your search

+10
View File
@@ -362,3 +362,13 @@ Audit existing place modes and referents against spec 15 §4/§5 and AIR borrow/
## Q-049 — Immutable Copy bindings and mutable frame content
Read-only Q-048 review reproduced accepted `let p = Pair { a: 0u64 }; p.a = 42u64; return p.a;`, and exclusive borrows of Copy-let frame storage. Spec 15 §4 calls `let` an immutable binding; assignment by name already rejects. Whether this should also prohibit content writes through fields/indices/borrows is unresolved. Owned content through `let` intentionally remains mutable and is used by public std examples. Do not infer a new restriction from `Binding.mutable`: distinguish Copy frame storage from owners, regions, resources and borrow bindings, and settle the normative policy before changing accepted source. This question is independent of Q-048's existing shared/exclusive borrow modes.
## Q-050 — Empty parentheses on qualified enum variants
The parser accepted `E::Empty()` and the corresponding match pattern, although spec 15 §5 requires a bare payload-free variant. Public tests/examples/std contain no such forms. Outcome binding lists such as `closed()` are separate delimiters used by std and remain legal.
**Resolved (DD-022, spec 15 §5–§6):** qualified variant construction and patterns reject empty payload lists with E7001 at `(`, without symbol lookup. This includes payload-bearing variants formerly rejected with E7005; non-empty lists retain their existing arity/type checks. Ordinary calls, grouping and outcome bindings are unaffected. No AIR or runtime rule changes.
## Q-051 — Unknown effects in ordinary source signatures
An ordinary function declaring `effects [bogus.effect]` reaches AIR and reports E7900 with `air_code: E0004`; templates/static contracts reject the same known-invalid effect directly with E0006. Effect membership is determined entirely from source and the registry. A P6-2 task should align ordinary signature validation with the existing template contract, preserving effect/capability semantics and checking diagnostic priority/positions. No implementation is included in DD-022.