On this page

0073. Import item aliases

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

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.