Class IsSetOperatorRequiredOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.IsSetOperatorRequiredOrError
- All Implemented Interfaces:
Consumer<AggregateSymbol>
final class IsSetOperatorRequiredOrError
extends TypedSymbolAccess
implements Consumer<AggregateSymbol>
Checks that aggregates with properties/fields define their own '?' (isSet) operator.
EK9's tri-state semantics (absent/unset/set) permeate the entire language. Every aggregate with fields must define what "set" means for that specific type by implementing the '?' operator.
Since 'Any' (the implicit base of all types) already has a '?' operator, user-defined aggregates with fields must use 'override operator ?' (or 'default override operator ?').
Without this, the inherited '?' from Any or a super class cannot know about the fields on this specific type, making the set/unset state meaningless for this aggregate.
EK9's tri-state semantics (absent/unset/set) permeate the entire language. Every aggregate with fields must define what "set" means for that specific type by implementing the '?' operator.
Since 'Any' (the implicit base of all types) already has a '?' operator, user-defined aggregates with fields must use 'override operator ?' (or 'default override operator ?').
Without this, the inherited '?' from Any or a super class cannot know about the fields on this specific type, making the set/unset state meaningless for this aggregate.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionIsSetOperatorRequiredOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
IsSetOperatorRequiredOrError
IsSetOperatorRequiredOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<AggregateSymbol>
-