Class HasRealComparator
java.lang.Object
org.ek9lang.compiler.common.HasRealComparator
- All Implemented Interfaces:
Predicate<IAggregateSymbol>
THE shared test for "is this type orderable?" - does it have a REAL
<=> operator, one it
declares itself or inherits from a real (user) super, as opposed to only the degenerate Any._cmp
that EVERY type inherits and which is not value ordering.
It walks the super chain with resolveInThisScopeOnly (declared-at-that-level only) and stops
BEFORE Any. This is exactly why a direct list <=> list is rejected with E07620: List
declares no <=> and Any._cmp does not count. Used to decide whether a default operator
comparison (<=>,<,<=,>,>=) can be produced over a field of this type - reuse this, do not re-derive
the "excludes Any._cmp" walk. Construct once with the resolved Any type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisOrderingOperator(MethodSymbol operator) The ORDERING operator family - each delegates (directly, or via DerivedComparisonGenerator) to<=>, so each needs the receiver AND every field type to be orderable.booleantest(IAggregateSymbol type)
-
Constructor Details
-
HasRealComparator
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<IAggregateSymbol>
-
isOrderingOperator
The ORDERING operator family - each delegates (directly, or via DerivedComparisonGenerator) to<=>, so each needs the receiver AND every field type to be orderable. Deliberately EXCLUDES==/<>, which are equality-only (delegate to_eq) and remain available on non-orderable-field types.
-