Class AssignmentTarget
- All Implemented Interfaces:
BiFunction<SymbolsAndScopes, EK9Parser.AssignmentExpressionContext, Optional<ISymbol>>
assignmentExpression is given to - use it, do not re-derive the walk.
A target exists for a declaration with a type (x as T: value, which includes a returning variable and a
property, whatever its assignment operator), for a plain assignment to an identifier (x := value,
:, =, :=? - the identifier may be a local, a returning variable or a property) and for a
plain assignment to a field reached through an object (this.names := List(),
order.lines : List() - Steve, 2026-10-08, Q6): that field's declared type, resolved (and access-checked)
by phase 3 before the right-hand side, since the left is walked first. Nothing else is a target: <-
declares no type, a mutating operator (+=, :~:) is not a plain assignment, a chain ending in a
call (repo.items() := ...) has no field to store into (E07895), and a ternary arm, a switch or
try returning-value arm and a function argument are not assignment expressions at all - an argument
takes part in choosing an overload, so typing it from the overload would be circular.
Shared by the two rules that let a declared type complete what is written on the right: a List/Dict literal
(phase3/LiteralTargetType) and target-typed generic construction (TargetTypedConstruction).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(SymbolsAndScopes symbolsAndScopes, EK9Parser.AssignmentExpressionContext assignmentExpression) The declared type the assignment expression is given to, if it has one.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
AssignmentTarget
public AssignmentTarget()
-
-
Method Details
-
apply
public Optional<ISymbol> apply(SymbolsAndScopes symbolsAndScopes, EK9Parser.AssignmentExpressionContext assignmentExpression) The declared type the assignment expression is given to, if it has one.- Specified by:
applyin interfaceBiFunction<SymbolsAndScopes, EK9Parser.AssignmentExpressionContext, Optional<ISymbol>>
-