Design decision: a protocol-constrained pack element is viewed THROUGH the constraint protocol — only the protocol's interface (its methods, and the projections xs.T / xs.value) is accessible, not arbitrary concrete members, exactly like a constrained generic `T: Show`. So `xs[i].v` (a field on the concrete IntBox, not declared on Show) is an error; the constraint is enforced and bounds the body regardless of the concrete arg types at a call site. The previous example 191 demonstrated `xs[i].v` — which only compiled because the constraint is not yet enforced. Trimmed it to the protocol-agnostic part that's correct today (per-shape binding + comptime `xs.len` across arities / heterogeneous shapes); protocol-interface access + projection are the remaining 2.4 work. specs.md records the access rule.
4 lines
15 B
Plaintext
4 lines
15 B
Plaintext
n0=0
|
|
n2=2
|
|
n3=3
|