diff --git a/examples/154-pack-type-rep.sx b/examples/154-pack-type-rep.sx new file mode 100644 index 0000000..582d84e --- /dev/null +++ b/examples/154-pack-type-rep.sx @@ -0,0 +1,23 @@ +// Variadic heterogeneous type packs — `..$args` — type-system +// representation lock-in. +// +// Step 1c slice for the pack feature (see +// ~/.claude/plans/lets-see-options-for-merry-dijkstra.md). Exercises +// the parser's acceptance of `..$args` inside a `Closure(...)` type +// expression — the pack-shape spelling used by impl headers like +// `impl Into(Block) for Closure(..$args) -> $R`. +// +// Today's parser only accepts `..$args` in fn parameter lists (1b); +// the same syntax inside a `Closure(...)` type expression hits +// `expected type name` at the `..` token. This file pins that +// rejection. The next commit teaches `parseTypeExpr`'s `Closure(...)` +// arm + the type-table representation to carry the pack. + +#import "modules/std.sx"; + +takes_cb :: (cb: Closure(..$args) -> $R) -> void { } + +main :: () -> s32 { + print("pack type rep ok\n"); + return 0; +} diff --git a/tests/expected/154-pack-type-rep.exit b/tests/expected/154-pack-type-rep.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/expected/154-pack-type-rep.exit @@ -0,0 +1 @@ +1 diff --git a/tests/expected/154-pack-type-rep.txt b/tests/expected/154-pack-type-rep.txt new file mode 100644 index 0000000..a324bd9 --- /dev/null +++ b/tests/expected/154-pack-type-rep.txt @@ -0,0 +1 @@ +/Users/agra/projects/sx/examples/154-pack-type-rep.sx:18:26: error: expected type name