lang 2.3: pack spread into call args (f(..xs) / f(..xs.value))

A pack spread in call-arg position now expands to N positional args:
`add2(..xs.get)` ≈ `add2(xs[0].get(), xs[1].get())` — the canonical's
`mapper(..sources.value)` shape. The call-arg loop detects a spread whose
operand is a pack (`..xs`) or a pack projection (`..xs.method`) and splices the
per-element Refs in; a runtime-slice spread (`..arr`) is still left to the
slice-variadic path.

Factored the per-element synthesis out of lowerPackValueProjection into
`lowerPackElems` (used by both projection-to-tuple and spread-to-args), plus a
`packSpreadRefs` helper. examples/197-pack-spread-call.sx (2- and 3-arg, mixed
element types).
This commit is contained in:
agra
2026-05-29 19:53:04 +03:00
parent c03db7938c
commit d7ecf02d7a
4 changed files with 89 additions and 23 deletions

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,2 @@
two=20
three=10