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:
1
tests/expected/197-pack-spread-call.exit
Normal file
1
tests/expected/197-pack-spread-call.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/expected/197-pack-spread-call.txt
Normal file
2
tests/expected/197-pack-spread-call.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
two=20
|
||||
three=10
|
||||
Reference in New Issue
Block a user