Files
sx/examples/modules/0792-modules-same-name-const-struct-field-dim.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

16 lines
778 B
Plaintext

// issue 0105 / F2 (#6 registration-time reader) — a same-name VALUE const used as
// a STRUCT FIELD array dimension, baked into the layout at REGISTRATION time, is
// source-aware. Two flat-imported modules each declare a same-name `K` and a
// same-name struct `Box { arr: [K]u8 }`. `size_of(Box)` in each module must use
// ITS OWN `K` for the field dimension (own-wins), so the layouts differ:
// a_sz=2, b_sz=7. The registration-time field-type resolution routes through the
// stateful source-aware const reader, not the global last-wins map.
#import "modules/std.sx";
#import "0792-modules-same-name-const-struct-field-dim/a.sx";
#import "0792-modules-same-name-const-struct-field-dim/b.sx";
main :: () -> i32 {
print("a_sz={} b_sz={}\n", a_sz(), b_sz());
0
}