Class MethodOverridesOrError

All Implemented Interfaces:
Consumer<AggregateSymbol>

final class MethodOverridesOrError extends TypedSymbolAccess implements Consumer<AggregateSymbol>
Check overrides on methods.

A method overrides a parent's method only when it has EXACTLY the same signature - the same name and exactly the same parameter types in order (MethodSymbol.hasSameSignatureAs(MethodSymbol); a covariant return is allowed). Then, and only then, 'override' is required, and the parent's contract (access, return covariance, 'pure', 'sanitized') binds it. A method with the same name but other parameter types is a new OVERLOAD, so 'override' on it is E05110 (Steve, 2026-10-02). Until then this matched parents by call COST, so override process(Triangle) beside a parent process(Shape) compiled as an "override" - and a call through a parent-typed reference still ran the parent's body: one object, one argument, two answers (front-end rationalisation N06).

Each parent's declarations come from its getAllEffectiveMethods() - THE collapsed view, where an override further down a parent's own chain replaces what it overrides.