Class CopyPresentOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.OperatorTest
org.ek9lang.compiler.phase3.CopyPresentOrError
- All Implemented Interfaces:
BiPredicate<IToken,ISymbol>
Given a symbol, this checks that the type that the symbol has can support the ':=:' (_copy) operator.
Required by FOR-RANGE loops: the user-visible loop variable is a fresh per-iteration object, default-constructed then populated from the loop counter via ':=:'. This decouples the loop variable's object from the mutate-in-place counter so captures/aliases hold the value the developer expects at that iteration (see EK9_LOOP_VARIABLE_PER_ITERATION_SEMANTICS.md).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionCopyPresentOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected MethodSymbolSearchgetMethodSymbolSearch(ISymbol symbolType) Methods inherited from class OperatorTest
getSymbolType, isOperatorPresent, testMethods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbolMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiPredicate
and, negate, or, test
-
Constructor Details
-
CopyPresentOrError
CopyPresentOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
getMethodSymbolSearch
- Specified by:
getMethodSymbolSearchin classOperatorTest
-