Class MutatedOnlyVariables

java.lang.Object
org.ek9lang.compiler.phase5.MutatedOnlyVariables

final class MutatedOnlyVariables extends Object
What PRE_IR_CHECKS needs, collected during Walk 1 (by PreIRListener, every source in parallel), to decide the E08090 verdicts FULL_RESOLUTION deferred (item 5):
  • every local marked NOT_REFERENCED_DEFERRED - initialised by a call, afterwards only mutated in place, never read - with the expression it was initialised by (MutatedOnlyVariableOrError);
  • every user method, operator, function, dynamic function and service operation with a returning variable, with each expression that variable is made to REFER to (its initialiser, every pointer assignment (pre-flows included), and through an arm-shaped value the returning variable it yields), so ReceiverInteriorReturns can derive whether a method returns (part of) its receiver and CloseableReturnOrError can require a closeable return to be new - both reading ReturnSourceKind;
  • for each such callable, what every LOCAL of its body is made to refer to (MutatedOnlyVariables.Source: a reference assignment's expression, an arm-shaped value's returning variable, a dynamic class's capture list, a stream's sources, a loop's iterated expression) - so a view of the receiver handed back THROUGH a local (mine <- items; iter <- mine.iterator(); rtn: iter.next()) is followed to its origin (ReturnSourceOrigins; option B slice D, 2026-11-13 - the N-V review's CE-3);
  • every dynamic function with no body of its own (inheritingBodies).
Shared across the parallel walk, so the queues are concurrent; the per-source state is in a MutatedOnlyVariables.Collector.