Class RetractedComparatorUseOrError

All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener, EK9Listener

final class RetractedComparatorUseOrError extends ScopeStackConsistencyListener
PRE_IR_CHECKS use-site check for a RETRACTED bare default comparison operator.

DefaultComparatorRecheckOrError retracts a bare-inferred <=>,<,<=,>,>= when a field's type is not orderable, or the <=> above it is retracted (D55), so the operator is not generated. A use of that operator (holderA <=> holderB) was resolved back in FULL_RESOLUTION (before the retraction), so its bound CallSymbol still points at the now-retracted operator. This listener reports that as OPERATOR_NOT_DEFINED (E07620) - the SAME outcome as a direct list <=> list: a comparison that cannot work is not available, so ordering the wrapper is a compile error. Must run AFTER the retraction pass. Holds no shared state - safe in the phase's parallel per-source walk.

D58 (Steve, 2026-10-21): every use of <=> asks the same rule, including the uses that call it without naming it - the comparison coalescing operators <? >?, a sort stage with no comparator, x in a ... b, a for range and a switch case (case < limit, which calls the operator itself). Phase 3 accepted each against the bare <=> before it was retracted, so each is judged here, on the operands' common type, the stream's element type or the range's type, by OrderingAvailability.withdrawnOrdering(IAggregateSymbol, ISymbol) (built on OrderingAvailability.orderingSurvives(MethodSymbol, ISymbol)). An unconstrained conceptual T has its own conceptual <=>, so it is never judged here but where it is substituted ( phase4/ParameterisedTypeOrError); a T constrain by Base orders by Base's <=>, so where Base's is retracted the use in the generic's body is E07620 here - no parameterisation of it could run, as a binary < on it already reported.