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:
22
examples/modules/0796-modules-same-name-enum-own-wins.sx
Normal file
22
examples/modules/0796-modules-same-name-enum-own-wins.sx
Normal file
@@ -0,0 +1,22 @@
|
||||
// E6a — own-wins-over-flat for ENUM per-decl nominal identity. `main` flat-imports
|
||||
// `dep.sx` (which authors `Dir { east; west }`) AND authors its OWN `Dir { north;
|
||||
// south }`. A bare `Dir` reference in `main` resolves to `main`'s OWN author, not
|
||||
// the flat-imported one (the querying source's author wins outright — no
|
||||
// ambiguity), so `d : Dir = .north` binds `main`'s enum (whose `.north` variant
|
||||
// dep's `Dir` lacks) while `dep_dir()` returns dep's DISTINCT `Dir`.
|
||||
//
|
||||
// Fail-before (pre-E6a): the stateless `type_bridge.resolveInlineEnum` `findByName`
|
||||
// short-circuit interned ONE global last-wins `Dir`, so `main`'s `Dir` and dep's
|
||||
// `Dir` collapsed to a single nominal — `.north` would resolve against whichever
|
||||
// author won the global slot, silently wrong with no diagnostic.
|
||||
|
||||
#import "modules/std.sx";
|
||||
#import "0796-modules-same-name-enum-own-wins/dep.sx";
|
||||
|
||||
Dir :: enum { north; south; }
|
||||
|
||||
main :: () -> i32 {
|
||||
d : Dir = .north;
|
||||
print("own={} dep={}\n", d, dep_dir());
|
||||
0
|
||||
}
|
||||
Reference in New Issue
Block a user