fix(stdlib/E4): qualified generic alias head a.Box(..) selects the namespace author
The const-decl alias-registration path treated a qualified generic head (`ABox :: a.Box(s64)`) only as a gate exemption, then read the bare last-wins `struct_template_map` — so `ABox` and `BBox` both instantiated whichever same-name template won globally (both size 16). attempt-9 routed the annotation head sites through `qualifiedStructTemplate`; this applies the same selection to the two alias-registration branches (.call and .parameterized_type_expr) before the bare fallback, and extracts the shared instantiate-and-register logic into `registerGenericStructAlias`. ABox :: a.Box(s64) now resolves to a's template (size 8); BBox :: b.Box(s64) to b's (size 16). Regression 0773 pins it (fail-before alias a=16 b=16, after a=8 b=16).
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
// Author A's generic `Box` — one s64 field (size 8).
|
||||
Box :: struct($T: Type) { x: T; }
|
||||
@@ -0,0 +1,3 @@
|
||||
// Author B's generic `Box` — two s64 fields (size 16). Same template NAME as
|
||||
// A's, different layout: the qualified alias head must select by namespace author.
|
||||
Box :: struct($T: Type) { x: T; y: T; }
|
||||
Reference in New Issue
Block a user