lang 2.4: lock protocol-pack access semantics (interface-only)
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.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
count0=0
|
||||
count2=2
|
||||
sum=49
|
||||
describe len=2 first=42 second=cool
|
||||
n0=0
|
||||
n2=2
|
||||
n3=3
|
||||
|
||||
Reference in New Issue
Block a user