Files
sx/examples/modules/0706-modules-import-non-transitive.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

19 lines
739 B
Plaintext

// `#import` is non-transitive: when A imports B and B imports C, A
// must NOT see C's top-level names. This file imports `b.sx` (which
// in turn imports `c.sx`) and then deliberately references C's names
// directly — the compiler is expected to reject the references with
// "not visible; #import the module that declares it" diagnostics.
//
// `b.sx` ↔ `c.sx` together still compile: `b_only_fn`'s body sees
// `c_only_fn` / `c_only_const` because b.sx directly imports c.sx.
#import "modules/std.sx";
#import "0706-modules-import-non-transitive/b.sx";
main :: () -> i32 {
print("b_only_fn: {}\n", b_only_fn());
print("c_only_fn direct: {}\n", c_only_fn());
print("c_only_const direct: {}\n", c_only_const);
0
}