Files
sx/examples/modules/0819-modules-qualified-annotation-error-set-own-wins.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

20 lines
826 B
Plaintext

// G1 (non-struct kind = error-set) — a qualified `a.IoErr` annotation selects the
// namespace target's OWN error-set per-decl nominal, distinct from `main`'s
// same-name `IoErr`. `main` authors `IoErr { Disk }` and namespace-imports `a`
// (`IoErr { Net }`). The bare `IoErr` binds main's own (so `error.Disk` is valid);
// the qualified `a.IoErr` binds `a`'s (so `error.Net` is valid). The tag sets are
// disjoint, so a cross-binding (`a.IoErr = error.Disk`) is a hard membership error
// — distinct error-set nominals reached through the qualified annotation surface.
#import "modules/std.sx";
a :: #import "0819-modules-qualified-annotation-error-set-own-wins/dep.sx";
IoErr :: error { Disk }
main :: () -> i32 {
e : IoErr = error.Disk;
q : a.IoErr = error.Net;
print("own={} q={}\n", e, q);
0
}