Class SamenessOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.SamenessOrError
- All Implemented Interfaces:
Consumer<AggregateSymbol>
B18 - a type defines SAMENESS once (Steve, 2026-09-30). The rule is in
Sameness; this reports breaches:
- E07181 - a comparison with the type itself other than its sameness is written, or requested with an
explicit
default operator: they are always generated (==from<=>, and the rest). - E07182 - sameness declared by a type that already inherits one: it is sealed where it is declared, because any subtype refinement of an ordering is non-transitive once base and subtype values mix.
- E07183 - abstract sameness: sibling implementations would order a mixed collection inconsistently, so the abstraction writes the body over its own abstract accessors.
- E07184 - a
#?that does not go with the sameness (hand-written with hand-written, defaulted with defaulted, inherited with inherited, none without).
default operator are never reported: what the catch-all may produce is
decided by synthesis.-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionSamenessOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
SamenessOrError
SamenessOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<AggregateSymbol>
-