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 Summary
ConstructorsConstructorDescriptionNoDuplicateOperationsOrError(SemanticErrorReporter errorListener) Create a new operations checker an aggregates. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IToken errorLocationToken, IAggregateSymbol aggregate) voidacceptImplementedOnly(IToken errorLocationToken, IAggregateSymbol aggregate) The duplicate check over the construct's IMPLEMENTED (non-abstract) methods only - for a text locale variant.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
NoDuplicateOperationsOrError
Create a new operations checker an aggregates.
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<IToken, IAggregateSymbol>
-
acceptImplementedOnly
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.
-