Split BadCrossModuleTypeRef into two diagnostics #11

Open
opened 2026-05-20 13:21:57 +02:00 by Brummel · 1 comment
Owner

The current single shape collapses unknown-owner and known-owner / unknown-type-in-owner into one message. The two cases suggest different fixes (add (import <owner>) vs. fix the type name). In the known-owner branch, list the owner's available type defs as candidates the way bare-cross-module-type-ref lists candidates from imports.

context: fieldtest 2026-05-11 — examples/ct_3*.ail exhibits both branches with identical-shape diagnostics.

The current single shape collapses unknown-owner and known-owner / unknown-type-in-owner into one message. The two cases suggest different fixes (add `(import <owner>)` vs. fix the type name). In the known-owner branch, list the owner's available type defs as candidates the way `bare-cross-module-type-ref` lists candidates from imports. **context:** fieldtest 2026-05-11 — `examples/ct_3*.ail` exhibits both branches with identical-shape diagnostics.
Author
Owner

Verified still VALID 2026-06-02. Note: the existing BareCrossModuleTypeRef / BadCrossModuleTypeRef split is a different axis (bare vs qualified reference), not the split this issue asks for. BadCrossModuleTypeRef still collapses the two qualified sub-cases into one { module, name } shape: unknown-owner (crates/ailang-core/src/workspace.rs:1101, prefix not in local_types) and known-owner/unknown-type (workspace.rs:1106, owner exists but lacks the suffix). Neither lists the owner's available TypeDefs as candidates the way the bare path does. The ask stands.

Verified still VALID 2026-06-02. Note: the existing `BareCrossModuleTypeRef` / `BadCrossModuleTypeRef` split is a *different* axis (bare vs qualified reference), not the split this issue asks for. `BadCrossModuleTypeRef` still collapses the two qualified sub-cases into one `{ module, name }` shape: unknown-owner (`crates/ailang-core/src/workspace.rs:1101`, prefix not in `local_types`) and known-owner/unknown-type (`workspace.rs:1106`, owner exists but lacks the suffix). Neither lists the owner's available TypeDefs as candidates the way the bare path does. The ask stands.
Sign in to join this conversation.