lang: inline for element form over packs — multi-iterable parity

This commit is contained in:
agra
2026-06-11 14:42:59 +03:00
parent 03dc10bba3
commit 40805e08ec
15 changed files with 277 additions and 40 deletions

View File

@@ -129,6 +129,12 @@ pub const Binding = struct {
ty: TypeId,
is_alloca: bool, // true if ref is a pointer that needs load
is_ref_capture: bool = false, // `for xs: (*x)` — `ref` is `*elem`; auto-deref in value positions
/// `inline for xs (x)` element capture: `x` is an AST ALIAS for the
/// synthesized `xs[<i>]` of the current unroll iteration (`ref` is
/// `.none`). Identifier consumers substitute this node, so the capture
/// inherits the full pack-element semantics — concrete-arg substitution,
/// typing, and the interface-only constraint check.
pack_elem: ?*ast.Node = null,
};
// `init` / `deinit` / `put` are pub so collaborator unit tests (e.g.