prep.1 — Type-scoped namespacing (<TypeName>.<member> resolution) #31

Closed
opened 2026-05-28 13:42:22 +02:00 by Brummel · 0 comments
Owner

First iteration of the kernel-extension-mechanics arc.

Goal. Extend the resolver so <TypeName>.<member> (e.g. Maybe.from_maybe, Series.at) resolves to the <member> definition in <TypeName>'s home module. Type-scoped access becomes the canonical form for type-associated operations; module-scoped form retired for that use case.

Scope (from spec § Iteration prep.1):

  • Resolver change in ailang-check — try type-namespace branch first, then module-namespace fallback.
  • Two new diagnostics: TypeScopedMemberNotFound, TypeScopedReceiverNotAType.
  • Reposition BareCrossModuleTypeRef / BadCrossModuleTypeRef to fire when a type name resolves through none of: type-scoped lookup, explicit import, kernel-tier auto-import.
  • Migrate ~14 std-library example fixtures from std_X.Y-form to type-scoped form. Hash pins refreshed in lockstep across both crates/ailang-core/tests/hash_pin.rs and crates/ailang-surface/tests/prelude_module_hash_pin.rs (full blast-radius walk).
  • Drift-test pin for type-scoped resolution at the schema level.

Spec: docs/specs/2026-05-28-kernel-extension-mechanics.md § Iteration prep.1.

Whitepaper: design/models/kernel-extensions.md § 1. Type-scoped namespacing.

First iteration of the `kernel-extension-mechanics` arc. **Goal.** Extend the resolver so `<TypeName>.<member>` (e.g. `Maybe.from_maybe`, `Series.at`) resolves to the `<member>` definition in `<TypeName>`'s home module. Type-scoped access becomes the canonical form for type-associated operations; module-scoped form retired for that use case. **Scope (from spec § Iteration prep.1):** - Resolver change in `ailang-check` — try type-namespace branch first, then module-namespace fallback. - Two new diagnostics: `TypeScopedMemberNotFound`, `TypeScopedReceiverNotAType`. - Reposition `BareCrossModuleTypeRef` / `BadCrossModuleTypeRef` to fire when a type name resolves through none of: type-scoped lookup, explicit import, kernel-tier auto-import. - Migrate ~14 std-library example fixtures from `std_X.Y`-form to type-scoped form. Hash pins refreshed in lockstep across both `crates/ailang-core/tests/hash_pin.rs` and `crates/ailang-surface/tests/prelude_module_hash_pin.rs` (full blast-radius walk). - Drift-test pin for type-scoped resolution at the schema level. **Spec:** docs/specs/2026-05-28-kernel-extension-mechanics.md § Iteration prep.1. **Whitepaper:** design/models/kernel-extensions.md § 1. Type-scoped namespacing.
Brummel added this to the kernel-extension-mechanics milestone 2026-05-28 13:42:22 +02:00
Brummel added the feature label 2026-05-28 13:42:22 +02:00
Sign in to join this conversation.