Class RequiredOperatorPresentOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.RequiredOperatorPresentOrError
- All Implemented Interfaces:
Function<CheckOperatorData, Optional<ISymbol>>
final class RequiredOperatorPresentOrError
extends TypedSymbolAccess
implements Function<CheckOperatorData, Optional<ISymbol>>
To be used with operators on aggregates (except for the is-set ? operator, that has to deal with functions).
This function attempts to locate the method on the aggregate and returns the type of the return variable or empty.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionRequiredOperatorPresentOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionapply(CheckOperatorData checkOperatorData) apply(CheckOperatorData checkOperatorData, CallSymbol callSymbol) Overloaded version that accepts a CallSymbol and sets the resolved method on it.(package private) static voidnoteOperatorAccessedIfConceptualType(IAggregateSymbol aggregate, MethodSymbol operator) We need to know if an operator has been used when employed in a 'T' in the generic type This is needed later so that when a generic type is parameterised we can check each of the types and see which operators have been accessed, then we can ensure the argument to the parameterization has that operator.Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
RequiredOperatorPresentOrError
RequiredOperatorPresentOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<CheckOperatorData, Optional<ISymbol>>
-
apply
Overloaded version that accepts a CallSymbol and sets the resolved method on it. This is used for operator expressions where we need to store the resolved method for later IR generation (particularly for parameter promotion). -
noteOperatorAccessedIfConceptualType
We need to know if an operator has been used when employed in a 'T' in the generic type This is needed later so that when a generic type is parameterised we can check each of the types and see which operators have been accessed, then we can ensure the argument to the parameterization has that operator.THE marking of an operator used on a generic's conceptual T: an operator resolved by any other route (a stream terminal's or tee's '|', resolved in
StreamAssemblyOrError; a mutating or assignment operator such as ':=:', ':~:' or '+=', resolved inLhsAndRhsAssignmentOrError) calls this too, sophase4/ParameterisedTypeOrErrorreports a parameterising type that lacks it (E07620) instead of IR generation failing on a compile-clean program.
-