You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C#: in a file declaring several namespaces, a namespace-relative type name also binds to a same-named type in a child namespace #1906
A C# type named by a namespace-relative qualified name now also binds to a same-named type in a child namespace that is not in scope, so the call or construction gets an extra, wrong edge.
The compiler binds Models.Report inside namespace P to P.Models.Report only: P.Other is a child of P, and its members are not in scope there. The graph gives two targets, P.Models.Report and P.Other.Models.Report. Control: Z.Models.Report, in an unrelated namespace, is correctly left out.
Expected: a namespace-relative name is looked up in the enclosing namespace and its parents (and the using directives), never in sibling or child namespaces.
Found while verifying #1119 on the 0.1.9 branch, where the fix for the relative name introduced this.
Scope (found on reading the rule): the namespaces a name is read from are collected per FILE (module_namespace_own comes from the types the file declares), not per call site. So the extra target appears only when one file declares types in both P and P.Other; a site in a file that declares only P gets the single correct target. The fix needs the innermost namespace enclosing each site, not the file's set.
changed the title [-]C#: a namespace-relative type name also binds to a same-named type in a child namespace that is not in scope[/-][+]C#: in a file declaring several namespaces, a namespace-relative type name also binds to a same-named type in a child namespace[/+]on Oct 10, 2026
Fix in #1910 (into apps/integration-0.1.10): the relative candidate stays per file, and each site drops what its enclosing type's namespace rules out (innermost matching level wins). Case a-relative-name-is-read-from-the-sites-namespace: 1/6 on base, 6/6 after.
Activity
[-]C#: a namespace-relative type name also binds to a same-named type in a child namespace that is not in scope[/-][+]C#: in a file declaring several namespaces, a namespace-relative type name also binds to a same-named type in a child namespace[/+]swapnilpaliwal-sd commentedon Oct 10, 2026
Fix in #1910 (into apps/integration-0.1.10): the relative candidate stays per file, and each site drops what its enclosing type's namespace rules out (innermost matching level wins). Case a-relative-name-is-read-from-the-sites-namespace: 1/6 on base, 6/6 after.