Files
AILang/crates/ail
Brummel 05c3c018de fix(check): branch Float NoInstance addendum on method name (#25)
The Float-aware `NoInstance` addendum emitted the same hint for every
Eq/Ord method at Float: "use float_eq / float_lt (and siblings ...)".
For `eq`/`ne`/`lt`/`le`/`gt`/`ge` that is correct — each has a drop-in
boolean `float_*` sibling. For `compare` it is incomplete and misleading:
`compare` returns three-way `Ordering`, but no `float_compare` ships (a
deliberate non-ship, docs/specs/2026-05-20-operator-routing-eq-ord.md).
An LLM author who reached for `compare` to get three-way ordering was
pointed at boolean siblings as if a drop-in existed, and left guessing
whether to reconstruct it themselves.

Fix: branch the addendum on the called method. The boolean arm keeps the
existing wording; the `compare` arm instead names the deliberate
`float_compare` omission and points at building a three-way `Ordering`
from `float_lt` + `float_eq`. One added branch on the existing
`method` field (already carried by `CheckError::NoInstance`), no new
machinery; the structured `ctx` is untouched.

Out of scope (the issue's deliberate non-ship): shipping a
`float_compare` fn. The friction was that the diagnostic did not
acknowledge the omission — now it does.

RED-first, inline: a one-branch diagnostic-text change at a single site
whose surrounding code was already loaded while working the adjacent #52
fix this session (CLAUDE.md "context already loaded" carve-out). TDD
discipline preserved by the new RED test
`compare_at_float_names_deliberate_no_float_compare` over a new minimal
fixture `examples/compare_float_noinstance.ail` (`compare` at Float); it
failed RED on the old shared wording and passes GREEN on the branch. The
pre-existing `eq_at_float_fires_float_aware_noinstance` still passes (eq
arm unchanged).

Verification: full ailang-check lib suite (121) + full ail test suite
green; live CLI renders both arms correctly.

closes #25
2026-06-01 20:34:20 +02:00
..