feat(lower): source-aware forward-alias fixpoint [stdlib E1.5]

resolveForwardIdentifierAliases now resolves a forward alias A :: B against
B AS SEEN FROM A's own source via selectNominalLeaf (E1's source-keyed
nominal leaf over type_aliases_by_source / moduleTypeAuthor), never the
global type_alias_map / global findByName. The already-resolved guard is
per-source (aliasResolvedInSource). .pending routes back into the fixpoint;
.undeclared / .not_visible leave A unwritten (no global last-wins leak).

This is the sequencing pin before E2: a global fixpoint binds A to a
same-name B authored by a different module (e.g. a namespaced import that
pollutes the global alias map last-wins), re-opening 0105 one layer down
once shadows register. Writes stay on the unified putTypeAlias helper (E1
no-drift invariant); the single graph-walk in resolver.zig is untouched.

Regression: examples/0750-modules-forward-alias-source-aware — a forward
alias A :: B with main's own B :: u64 and a namespaced same-name B :: u8;
A must bind main's u64 (300), not the global last-wins u8 (44).
This commit is contained in:
agra
2026-06-07 20:43:01 +03:00
parent 4a10c9a291
commit 2d34993586
6 changed files with 88 additions and 16 deletions

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,3 @@
forward A (u64=300): 300
direct B (u64=300): 300
ns.width(): 8