Class AssignmentTarget
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).
-
Method Summary
Modifier and TypeMethodDescriptionof(SymbolsAndScopes symbolsAndScopes, EK9Parser.AssignmentExpressionContext assignmentExpression) The declared type the assignment expression is given to, if it has one.
-
Method Details
-
of
public static Optional<ISymbol> of(SymbolsAndScopes symbolsAndScopes, EK9Parser.AssignmentExpressionContext assignmentExpression) The declared type the assignment expression is given to, if it has one.
-