lang: xx <pack> materializes a comptime pack into a runtime slice (issue 0053)

xx args with a slice target now bridges a comptime pack to a runtime slice:
[]Any boxes each element to Any; []P xx-erases each to the protocol (reusing
the slice-of-protocol erasure from 0052). New lowerPackToSlice; the unary-op
arm intercepts xx <pack> before the pack-as-value diagnostic. This is the
working forward to a runtime []Any/[]P helper -- log_count(xx args) -> 3 --
so the 2.7 pack-as-value diagnostics now suggest xx <name> for the call case.

examples/204-pack-xx-to-slice.sx (both []Any and []P paths); 203 help text
updated. issue 0053 FIXED. 239 examples + unit green.
This commit is contained in:
agra
2026-05-30 02:17:55 +03:00
parent 8a875d354c
commit 82b46bc412
6 changed files with 134 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ error: pack 'xs' has no runtime value — a pack is comptime-only and can't be u
15 | call :: (..xs: Show) -> void { sink(xs); } // B: pass to a call
| ^^
help: materialize a tuple `(..xs)` to store it, or declare `xs` as a slice variadic `..xs: []P` for runtime use instead of a pack `..xs: P`
help: materialize a tuple `(..xs)` to store it, or `xx xs` to convert it to an expected `[]Any`/`[]P` slice
|
15 | call :: (..xs: Show) -> void { sink(xs); } // B: pass to a call
| ^^

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,5 @@
any=3
A
B
A
show=3