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
D70: a namespaced type that another visible declaration shadows is refused (shapes.Pt beside a local Pt) #1757
Spec: §18.2 (D70, merged in #1752) — "Every import is also a namespace, so a shadowed name stays reachable."
On branch ruled-fixes (PR #1751) a namespace reaches a module's values, fns and consts by identity: a colliding declaration of another module is displaced to its module-qualified symbol (#1703) and ns.member is rewritten to that symbol. Types are not displaced — they keep their short name and resolve through the D29 tier candidates — so shapes.Pt is rewritten to Pt only when Pt already resolves to shapes' type here. Where it does not (this module or a later import declares its own Pt), Sema refuses it loudly:
use d70.shapes
type Pt { y: str }
fn main:
let q = shapes.Pt.new(5)
error: 'shapes.Pt' names module '…/shapes.w's type, but 'Pt' here resolves to another declaration; a namespaced type that another visible declaration shadows is not reachable yet (D70) (pinned by test/compile_errors/err_d70_namespaced_type_shadowed.w).
Expected:shapes.Pt.new(5) constructs shapes' Pt. Needs a per-module type identity the rewritten node can carry — D70 names #751 (canonical module identity) as the foundation. When it lands, turn the pinned error test into a behavior test.
A namespaced type annotation (let c: shapes.Pt) already resolves through the type-expression path.
Activity
Sema: every import is also a namespace (§18.2, D70)
Sema: every import is also a namespace (§18.2, D70)
Sema: every import is also a namespace (§18.2, D70)
Sema: every import is also a namespace (§18.2, D70)
Sema: every import is also a namespace (§18.2, D70)
Sema: every import is also a namespace (§18.2, D70)
Spec-ruled fixes: Some(place) borrows for Option[&T], module globals …
D70: a namespaced type stays reachable where another declaration shad…
D70: a namespaced type stays reachable where another declaration shad…
D70: a namespaced type stays reachable where another declaration shad…
D70 namespaced types reachable when shadowed (#1757); generator stage…