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.
This commit is contained in:
20
examples/modules/0831-modules-namespace-alias-carry.sx
Normal file
20
examples/modules/0831-modules-namespace-alias-carry.sx
Normal file
@@ -0,0 +1,20 @@
|
||||
// Namespace aliases are module surface: a `ns :: #import` declared by a
|
||||
// module is usable by that module's DIRECT flat importers (the carry rule —
|
||||
// no `pub` keyword). Covers every qualified shape through BOTH a direct and
|
||||
// a carried alias: plain fn, struct static method + instance method, type
|
||||
// annotation, enum variant, module const, generic struct.
|
||||
|
||||
#import "modules/std.sx";
|
||||
#import "0831-modules-namespace-alias-carry/facade.sx";
|
||||
|
||||
main :: () {
|
||||
print("{} ", r.helper()); // plain fn (carried)
|
||||
t := r.Thing.init(); // static method
|
||||
print("{} ", t.get());
|
||||
x : r.Thing = r.Thing.init(); // type annotation
|
||||
print("{} ", x.v);
|
||||
print("{} ", r.LIMIT); // module const
|
||||
print("{} ", r.Color.green); // enum variant
|
||||
b := r.Box(i64).{ item = 3 }; // generic struct
|
||||
print("{}\n", b.item);
|
||||
}
|
||||
Reference in New Issue
Block a user