Files
sx/examples/modules/0726-modules-flat-same-name-variadic.sx
agra 66bdc70bf1 test: group examples into per-category folders
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.
2026-06-21 14:41:34 +03:00

24 lines
1.1 KiB
Plaintext

// fix-0102c F1 (issue 0102): two flat FILE imports each author same-name free
// functions whose VARIADIC SHAPE differs. `combine` is fixed-arity in a.sx
// (the first-wins winner) but variadic in b.sx (the shadow); `pick` is the
// reverse. Each module's bare call must pack arguments against ITS OWN
// author's signature — not the first-wins author's. Pre-fix the call path
// re-fetched the first-wins AST by name to drive variadic packing, so b.sx's
// variadic `combine` was packed as if fixed (and its fixed `pick` as if
// variadic) → wrong lowering. Regression for the F1 review finding.
#import "modules/std.sx";
#import "0726-modules-flat-same-name-variadic/a.sx";
#import "0726-modules-flat-same-name-variadic/b.sx";
report :: (label: string, ok: bool) {
if ok { print("{}: ok\n", label); } else { print("{}: FAIL\n", label); }
}
main :: () -> i32 {
report("from_a combine fixed", from_a_combine() == 30);
report("from_b combine variadic", from_b_combine() == 10);
report("from_a pick variadic", from_a_pick() == 6);
report("from_b pick fixed", from_b_pick() == 5);
0
}