Class NoDuplicateOperationsOrError

java.lang.Object
org.ek9lang.compiler.support.NoDuplicateOperationsOrError
All Implemented Interfaces:
BiConsumer<IToken, IAggregateSymbol>

public final class NoDuplicateOperationsOrError extends Object implements BiConsumer<IToken, IAggregateSymbol>
Does a simple check (excluding any inheritance) for duplicated operations (methods, operators) on any sort of Aggregate, i.e. classes, components, traits and just operators on records. This is the first of such checks, in later phases inheritance of methods with invalid return types and also unimplemented abstract methods will be checked (by other checkers).
  • Constructor Details

    • NoDuplicateOperationsOrError

      public NoDuplicateOperationsOrError(SemanticErrorReporter errorListener)
      Create a new operations checker an aggregates.
  • Method Details

    • accept

      public void accept(IToken errorLocationToken, IAggregateSymbol aggregate)
      Specified by:
      accept in interface BiConsumer<IToken, IAggregateSymbol>
    • acceptImplementedOnly

      public void acceptImplementedOnly(IToken errorLocationToken, IAggregateSymbol aggregate)
      The duplicate check over the construct's IMPLEMENTED (non-abstract) methods only - for a text locale variant. A variant declares no abstract methods of its own: every abstract method it can see is the text BASE's clone, which carries the source location of whichever locale declared it first. Running the abstract pass as well therefore reports a duplicate in "es" a second time AT A LINE IN "en" - pointing the user at a locale that is perfectly correct. The implemented pass alone finds every real duplicate.