Files
sx/examples/modules/0758-modules-same-name-struct-mutual-ref.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
760 B
Plaintext

// issue 0105 / F1 regression — FORWARD + MUTUAL refs between same-name struct
// shadows. Two flat-imported modules each declare `Box` and `Node`; module B's
// `Box` forward-refs B's `Node` (declared later) and B's `Node` back-refs B's
// `Box`. Every cross-reference must bind to B's OWN nominal identities, proving
// the up-front genuine-shadow reservation: ALL of a genuine shadow's authors are
// reserved in `type_decl_tids` before any field resolves, so a forward / mutual
// ref never falls back to the global findByName first-author (A's `Node`).
#import "modules/std.sx";
#import "0758-modules-same-name-struct-mutual-ref/a.sx";
#import "0758-modules-same-name-struct-mutual-ref/b.sx";
main :: () -> i32 {
print("b={}\n", b_test());
0
}