Name resolution
Platform spec node
Name resolution
Spec standingStandard
No architecture decision records under adr/ for this feature yet. Standard features must
publish at least one ADR or keep a ## Decisions summary on the hub.
- Code style and naming Language-level naming and style conventions that affect readability and tooling consistency.
- extend type Type extension syntax replacing impl blocks; public members only, full type scope access.
- Modules and visibility File layout, `public`/`internal` boundaries, and how packages compose. The driver and package manager use the same module graph the typechecker sees.
- Name resolution Scopes, imports, and shadowing tie syntax to symbols. Diagnostics for unresolved names must cite these rules verbatim.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
scope | yes | yes |
features | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Resolution flow
Section titled “Resolution flow”flowchart TD useDecl[use declaration] scope[Build scope chain] path[Qualify path segments] vis[Check visibility] bind[Bind to symbol] useDecl --> scope --> path --> vis --> bind bind --> value[Value symbol] bind --> type[Type symbol] bind --> mod[Module re-export]
Normative specification
Section titled “Normative specification”Defines how identifiers and paths bind to program items across modules. Module shape is in Modules and visibility.
use declarations
Section titled “use declarations”use Path;imports the final segment into the current scope.use Path as Alias;binds the resolved target toAlias.usebefore declaration in the same module must error (E1106) when forward reference is illegal.- Unknown import paths must error (E1105); ambiguous imports must error (E1104).
Value and type paths
Section titled “Value and type paths”- Value paths resolve to functions, locals, constants, enum constructors, and contract namespaces.
- Type paths resolve to types, generics, and primitive names.
- Unresolved value E1101; unresolved type E1201; unknown module segment E1108.
Locals and shadowing
Section titled “Locals and shadowing”- Inner scopes may shadow outer locals; shadowing should warn (W1103).
- Duplicate definitions in the same scope must error (E1006, E1102).
Static rules
Section titled “Static rules”- Resolution must respect visibility from the importer’s module.
- Generic parameters shadow type names in signature scope only for the declaring signature.
Dynamic semantics
Section titled “Dynamic semantics”Resolution is compile-time; emitted metadata records stable qualifiedName strings for tooling.
Diagnostics
Section titled “Diagnostics”Import band E1104–E1108; resolve duplicates E1102. Registry: Diagnostic code registry.
Conformance
Section titled “Conformance”L1 resolver tests must pass for cross-module use and private item rejection.
Decisions
Section titled “Decisions”- D-LM-NAME-001 — Single resolver graph: Package driver and typechecker share one resolution snapshot per compilation.
- D-LM-NAME-002 — Contract namespaces: Contracts may appear as path prefixes for static methods without a separate
useimport of each method. - D-LM-NAME-003 — Qualified names for tooling: Emitted
qualifiedNamestrings must be stable across compiles for the same source snapshot. - D-LM-NAME-004 — No implicit
nullimports: Resolution must not inject nullable oroptionalaliases.
Platform view
Section titled “Platform view”Scopes, imports, and shadowing tie syntax to symbols. Diagnostics for unresolved names must cite these rules verbatim.