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:
@@ -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
|
||||
| ^^
|
||||
|
||||
1
tests/expected/204-pack-xx-to-slice.exit
Normal file
1
tests/expected/204-pack-xx-to-slice.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
5
tests/expected/204-pack-xx-to-slice.txt
Normal file
5
tests/expected/204-pack-xx-to-slice.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
any=3
|
||||
A
|
||||
B
|
||||
A
|
||||
show=3
|
||||
Reference in New Issue
Block a user