fix(0114): gate alias-qualified calls to one-level carry, pin to target
The lowerCall namespace branch routed alias.fn() through the global qualified registration (first-wins) at any import depth, and through the global last-wins bare map for comptime/generic members. Plain-identifier alias roots now resolve via the carry-aware namespaceAliasVerdict: - visible alias (own edge or ONE flat hop): the member dispatches the TARGET module's own fn (namespaceFnMember + fd-keyed bareAuthorFuncId), so two modules' same-named aliases each call their own target. - two direct flat imports carrying the alias to distinct targets: loud ambiguity diagnostic. - alias only reachable beyond one hop: "namespace 'X' is not visible". - foreign / builtin / #compiler members keep the literal-symbol path. Regressions: examples 0832 (two-hop), 0833 (carried collision), 0834 (own-target pin / first-wins repair).
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
# 0114 — namespace aliases leak transitively and collide first-wins, silently
|
||||
|
||||
> **RESOLVED** (2026-06-11). Root cause: `lowerCall`'s namespace branch
|
||||
> consulted the global `fn_ast_map["alias.fn"]` (registered first-wins by
|
||||
> `registerQualifiedFn`) with no per-importer gate, and fell back to the
|
||||
> global LAST-wins bare map for comptime/generic members. Fix: the branch
|
||||
> now routes plain-identifier alias roots through the carry-aware
|
||||
> `namespaceAliasVerdict` — visible targets dispatch the member fd pinned
|
||||
> to the TARGET module (`namespaceFnMember` + fd-keyed `bareAuthorFuncId`),
|
||||
> ambiguous carries diagnose loudly, and an alias that exists only beyond
|
||||
> one flat hop errors "namespace 'X' is not visible". Foreign/builtin/
|
||||
> #compiler members keep the literal-symbol path. Regression tests:
|
||||
> `examples/0832-modules-namespace-alias-two-hop-not-visible.sx`,
|
||||
> `examples/0833-modules-namespace-alias-carried-collision-ambiguous.sx`,
|
||||
> `examples/0834-modules-namespace-alias-own-target-pin.sx`.
|
||||
|
||||
**Symptom.** A namespace alias (`t :: #import "target.sx";`) declared in module
|
||||
B is usable from ANY module whose import closure reaches B — at any depth, flat
|
||||
or not — and when two modules register the same qualified name (`t.helper`),
|
||||
|
||||
Reference in New Issue
Block a user