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 and dynamic function 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.
Shared across the parallel walk, so the queues are concurrent; the per-source state is in a MutatedOnlyVariables.Collector.