Files
sx/examples/0742-modules-namespaced-only-bare-const-not-visible.sx
agra 7cd12b0ed5 feat(resolver): source-aware nominal leaf (Lowering-side) + ns-const tightening [stdlib E1]
Route the Lowering-side bare type leaf through the source-keyed caches (E0):
nominal author via collectVisibleAuthors(.user_bare_flat) + alias via
type_aliases_by_source, instead of the global findByName first-match. The
binding-free resolveAstType path + registration sites stay on the global
compat readers (move later). Single-author resolution byte-identical (no
shadows yet). Folded req #1: a namespaced-only import's const is no longer
bare-visible in array-dim/comptime-scalar position. Adds regression 0742
(ns-only bare const) and 0210 (generics/Vector/type-fn stay legacy).

Salvaged from a worker killed at the wall before commit; manager verified
the gate at ground truth (zig build test exit 0; run_examples 479/0 with
0210+0742 ok, prior 477 byte-identical; m3te ios-sim exit 0; folded fix
confirmed fail-before on master 7ffc0c1 exit 0 / pass-after exit 1).
2026-06-07 15:24:43 +03:00

16 lines
814 B
Plaintext

// Bare module-const visibility under a NAMESPACED-only import — the const
// sibling of 0736 (folded req #1 of the source-aware resolver, Phase E1).
// `dep.sx` is imported only as `dep :: #import`, so its top-level `DEP_LEN`
// is reachable ONLY as `dep.DEP_LEN`. A BARE `DEP_LEN` in a comptime
// array-dimension position must NOT resolve: bare module-const visibility
// joins over the FLAT import edges (`flat_import_graph`), and a namespaced
// alias is not a flat edge. Before the fix the bare const leaked through the
// global `module_const_map` first-match (and its float-fold fallback) straight
// into the `[VAL]s32` dimension, so the array silently got length 3.
dep :: #import "0742-modules-namespaced-only-bare-const-not-visible/dep.sx";
main :: () -> s32 {
arr : [DEP_LEN]s32 = ---;
0
}