0034. Reserve seeded option and result names consistently
- Status: Accepted; supersedes ADR-0025's name-reservation rule only
- Date: 2026-10-30
- Plan: M4.5
- Review: M4.5 review findings 2 and 3; owner-requested corrections
Context
The M4.5 review found that struct ok and
fn none could redefine seeded vocabulary despite the
reference's reservation claim. The owner requests consistent E0203
rejection rather than weakening the reference. Bare
ok, some and err also
incorrectly bypassed local-name resolution.
Decision
Reserve option, result,
some, none, ok and
err in both top-level type and function namespaces.
Report E0203 for every such declaration. This deliberately
replaces the agreed implementation plan's E0211 for
enum option and extends ADR-0025
reservation across both namespaces, as requested by the owner.
All six remain identifier tokens and legal local names. Bare
some, ok and err require a
local; otherwise E0201 suggests the constructor call. Bare
none retains its fallback after locals. Qualified
payload variants continue to use E0512 when their payload is
missing.
Alternatives considered
- Weaken the spec to allow cross-namespace redefinitions — permits confusing collisions with fixed seeded vocabulary; owner prefers rejection.
- Keep E0211 for seeded types and E0203 for constructors — inconsistent with the owner's requested single diagnostic for all six reserved names.
- Treat bare payload constructors as variants (E0512) — bypasses normal unknown-local diagnostics when a user mistypes a local name.
Consequences
Diagnostics and the reference agree; valid constructor calls and locals are unchanged. Previously accepted top-level collisions are now rejected. ADR-0025's union representation and propagation semantics remain unchanged.