Float-NoInstance diagnostic should branch on method name (compare vs eq/lt/le/gt/ge) #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced by fieldtest 2026-05-21 (operator-routing-eq-ord milestone, commit
505eb84). The Float-aware NoInstance addendum atcrates/ailang-check/src/lib.rs:856-880currently emits the same hint for any Eq/Ord method at Float —use float_eq / float_lt (and siblings) for explicit IEEE-aware comparison.For
(app eq …)/(app lt …)/(app gt …)etc. this is informative. For(app compare …)it is incomplete:comparereturns Ordering (three-way LT/EQ/GT), but nofloat_compareships and the spec deliberately decided not to ship one (docs/specs/2026-05-20-operator-routing-eq-ord.md:433-436). The LLM-author who reached forcomparebecause they need three-way is left guessing whether to reconstruct it fromfloat_lt+float_eqthemselves.Fix: branch the addendum on the called method name. The
eq/ne/lt/le/gt/gearm keeps the current wording. Thecomparearm gets a one-sentence addendum: 'no float_compare ships — build a three-way Ordering from float_lt + float_eq if you need it'.Scope: one diagnostic-text branch in
crates/ailang-check/src/lib.rs:856-880, plus the existingcrates/ail/tests/eq_float_noinstance.rsextended with acompare-at-Float case asserting the new wording.Out of scope: shipping a
float_comparefn (the spec's deliberate non-ship; the friction is the diagnostic doesn't acknowledge the deliberate omission).context: fieldtest spec at
docs/specs/2026-05-21-fieldtest-operator-routing-eq-ord.md(§[friction]).