Move examples/*.sx and their expected/ snapshots into per-category subfolders (examples/<category>/...). Folder = leading filename token, with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus runner and LSP sweep now discover each category's expected/ dir, while issues/ stays flat. Example 1058's repo-root-relative companion import is made file-relative. Path strings embedded in 164 snapshots were regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
23 lines
675 B
Plaintext
23 lines
675 B
Plaintext
// Variadic heterogeneous type packs — `..$args` — parse smoke.
|
|
//
|
|
// First positive slice of the pack feature: the parser accepts
|
|
// `..$args` (variadic marker + comptime sigil + name) as a
|
|
// parameter declaration. No semantic effect yet — the function
|
|
// is declared but never instantiated; main exists so the example
|
|
// has runnable output.
|
|
//
|
|
// Next slices: type-system representation of the pack, impl
|
|
// matching for `Closure(..$args) -> $R`, runtime indexing
|
|
// (`args[$i]`), and the `#insert build_x($args, ...)` pattern.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
foo :: (..$args) -> i64 {
|
|
return 0;
|
|
}
|
|
|
|
main :: () -> i32 {
|
|
print("pack parse ok\n");
|
|
return 0;
|
|
}
|