Files
sx/examples/comptime/0635-comptime-compiler-multi-edge-import.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

18 lines
863 B
Plaintext

// A comptime-minting module (0633's `shapes.sx`) reached via TWO import edges in
// one build: directly (bare) here, and indirectly through `indirect.sx` (which
// imports it namespaced as `s`). The minted `Suit` must be ONE type across both
// edges — `name_of` (typed `s.Suit` in indirect.sx) accepts the bare `Suit`
// constructed here. Exercises that re-evaluating the type-fn across import paths
// is idempotent (same TypeId), not a re-mint conflict.
#import "modules/std.sx";
#import "0633-comptime-compiler-namespaced-type/shapes.sx"; // bare edge → `Suit`
#import "0633-comptime-compiler-namespaced-type/indirect.sx"; // edge via `s :: shapes`
main :: () {
a := Suit.spades; // bare Suit
print("{}\n", name_of(a)); // passed where indirect expects s.Suit (same type)
b := Suit.hearts;
print("{}\n", name_of(b));
}