Class NearestOperatorAbove
C2 (Steve, 2026-10-08): the generated operators and their phase-3 check once asked only the IMMEDIATE super
(resolveInThisScopeOnly). A field-less Middle between Base (which declares $) and
Leaf (which defaults it) then gave a false E07190, so the middle had to declare the operator itself and
added an empty layer (Leaf(Middle(Base(id=1)), name=leaf)). Every generated operator now calls the NEAREST
implementation above, and names its OWNER (OperatorOwner) in the IR (CALL (Base)super._string()) so
a back end never re-derives which class that is (Contract 19 in EK9_BACKEND_IR_CONTRACTS.md, the same shape
as the close chain's CloseSteps#parentClose, which is built on this walk).
The walk returns the nearest declaration whatever it is - abstract, hand-written or defaulted - and the caller
decides what that means (an abstract one has nothing to call). The family: NearestAbove (any level test),
NearestSelfComparisonAbove (a sameness operator, by signature), AllOperatorsAbove (every one, for
overriding each inherited signature), OperatorDeclarationSite (where a missing one belongs) and
DeclaredOperator (one level's own).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionof(IAggregateSymbol aggregate, String operatorName, ISymbol ek9Any) The nearest operator calledoperatorNamedeclared ABOVE the aggregate, neverAny's:Anydeclares?$$$#?==<=>for every type, which says nothing about a hierarchy's data.
-
Constructor Details
-
NearestOperatorAbove
public NearestOperatorAbove()
-
-
Method Details
-
of
The nearest operator calledoperatorNamedeclared ABOVE the aggregate, neverAny's:Anydeclares?$$$#?==<=>for every type, which says nothing about a hierarchy's data. Where a level declares several overloads, the one taking that level itself is preferred (its self-comparison or copy).- Parameters:
aggregate- the type whose super chain is walked (the type itself is not consulted)operatorName- the operator, e.g."$"ek9Any- theAnytype, which is never an answer- Returns:
- the nearest declaration, if any
-