Class NoNameCollisionOrError
java.lang.Object
org.ek9lang.compiler.support.NoNameCollisionOrError
- All Implemented Interfaces:
BiPredicate<IScope,ISymbol>
Designed to check if variable name and method names collide with Type/Function names.
-
Constructor Summary
ConstructorsConstructorDescriptionNoNameCollisionOrError(ErrorListener errorListener, boolean useQualifiedName) -
Method Summary
Modifier and TypeMethodDescriptionbooleanerrorsIfLocalNamedLikeAMethod(IAggregateSymbol aggregate, ISymbol symbol) A LOCAL variable may not take the name of a method of the type it is declared in (its own - private included - or one it inherits or takes from a trait, unless that one is private and so unreachable here):total <- total()means a value on the left and a call on the right, and with the local in scope a bare 'total()' no longer reaches the method (it surfaced as E50010 'type not resolved', 2026-10-01).booleanerrorsIfResolved(IScope inScope, ISymbol symbol, SymbolSearch search, ErrorListener.SemanticClassification classificationError) If a symbol is resolved then this will emit an error.booleanCheck for exising symbol in the scope.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiPredicate
and, negate, or
-
Constructor Details
-
NoNameCollisionOrError
-
-
Method Details
-
test
-
errorsIfLocalNamedLikeAMethod
A LOCAL variable may not take the name of a method of the type it is declared in (its own - private included - or one it inherits or takes from a trait, unless that one is private and so unreachable here):total <- total()means a value on the left and a call on the right, and with the local in scope a bare 'total()' no longer reaches the method (it surfaced as E50010 'type not resolved', 2026-10-01). Fields and parameters are not locals - a constructor parameter named like its field is the common, intended form - and keep their names. A local holding a FUNCTION (a delegate) is left to its own, more specific E02080 by the caller. Run once the hierarchy is complete (TYPE_HIERARCHY_CHECKS): before that a class's supers and traits are not yet attached. -
errorsIfResolved
public boolean errorsIfResolved(IScope inScope, ISymbol symbol, SymbolSearch search, ErrorListener.SemanticClassification classificationError) If a symbol is resolved then this will emit an error.
-