0073. Import item aliases
- Status: Accepted; partially supersedes ADR-0064's no-aliases rule only
- Date: 2026-10-31
- Plan: M9.2 Step 5
- Review: Making Tenon plugin-first
Context
Selective imports bind a provider item under a local name. Without aliases, providers and local declarations can clash; module aliases would bind no item and qualified use sites are outside the language.
Decision
Allow import util.str { trim as strip }.
as is contextual and remains a valid identifier. Only
imported items may be aliased; module aliases and qualified use
sites remain unsupported. Name resolution and clash checks use the
local name, while missing-item diagnostics identify the provider
spelling.
This partially supersedes ADR-0064: only its sentence-level prohibition on aliases is superseded. Its other import, visibility, module, and no-qualified-use-site rules remain accepted.
Rename behavior follows ADR-0049:
harness rename <provider-file> <old> <new> --root <importer-root>
performs a checked root-graph provider-item rename and preserves
alias spelling. Ordinary
harness rename <importer-file> <alias> <new>
renames only the local alias. Without --root,
existing unaliased cross-file refusal remains.
Alternatives considered
- Make
asa keyword — would break existing identifiers and needlessly reserve a contextual word. - Add module aliases or qualified use sites — module aliases bind nothing; qualified item syntax changes the name model and is unnecessary here.
Consequences
Call sites can use local names without provider collisions. Tooling must keep provider identity distinct from the importing alias. M9.2 Step 5 implements parsing, binding, formatting, and checked rename behavior.