Class MutatedOnlyVariables
java.lang.Object
org.ek9lang.compiler.phase5.MutatedOnlyVariables
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
ReceiverInteriorReturnscan derive whether a method returns (part of) its receiver andCloseableReturnOrErrorcan require a closeable return to be new - both readingReturnSourceKind; - 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).
MutatedOnlyVariables.Collector.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final classOne source's collection.(package private) static final recordA deferred local and the expression it was initialised by.(package private) static final recordA user method, operator, function or dynamic function with a returning variable, and every expression that variable is made to refer to.(package private) static interfaceWhat a local (the returning variable included) is made to refer to - one of its sources. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Collection<MutatedOnlyVariables.Deferred> deferred()(package private) MutatedOnlyVariables.CollectorforSource(ParsedModule parsedModule, SymbolsAndScopes symbolsAndScopes) The collector for one source's walk.(package private) Collection<ScopedSymbol> Every dynamic function with NO body of its own (() is transformValue of Integer as function): its_callforwards to its super function, so it inherits the super's RETAINS by position (MarkInheritedRules, inside both derivation fixpoints - option B slice B, 2026-11-13).(package private) Collection<MutatedOnlyVariables.ReturningCallable>
-
Constructor Details
-
MutatedOnlyVariables
MutatedOnlyVariables()
-
-
Method Details
-
forSource
MutatedOnlyVariables.Collector forSource(ParsedModule parsedModule, SymbolsAndScopes symbolsAndScopes) The collector for one source's walk. -
deferred
Collection<MutatedOnlyVariables.Deferred> deferred() -
returningCallables
Collection<MutatedOnlyVariables.ReturningCallable> returningCallables() -
inheritingBodies
Collection<ScopedSymbol> inheritingBodies()Every dynamic function with NO body of its own (() is transformValue of Integer as function): its_callforwards to its super function, so it inherits the super's RETAINS by position (MarkInheritedRules, inside both derivation fixpoints - option B slice B, 2026-11-13). Collected here, where every walked callable is, for both derivations to read.
-