Class ReturnSourceOrigins

java.lang.Object
org.ek9lang.compiler.phase5.ReturnSourceOrigins
All Implemented Interfaces:
BiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, Set<String>>

final class ReturnSourceOrigins extends Object implements BiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, Set<String>>
What a source of a callable's returning variable may BE, in terms of the callable's own inputs - THE transitive reading of D61 (Steve, 2026-10-21: follow the inner call back): the names of the incoming parameters it may be (or a view of) and RECEIVER_ORIGIN when it may be the receiver's interior. Hold one; was ReturnSourceKind.origins (no-statics lane P2, 2026-10-29). Which KIND of source it is, is ReturnSourceClassifier.

A parameter or a property is itself; a call is what its callee's RETAINS says it returns, each return <- source mapped back through the call - receiver-interior to whatever the call's receiver is (items.getOrDefault(0, x) is items; a bare call of an own method is the receiver) and a named parameter to the argument given for it (handBack(passed) is passed). A LOCAL is the union of what it was made to refer to (MutatedOnlyVariables.Source: its reference assignments, an arm-shaped value's returning variable, a dynamic class's captures, a stream's sources, a loop's iterated expression), followed recursively - so mine <- items; iter <- mine.iterator(); rtn: iter.next() is the receiver (option B slice D, 2026-11-13; the N-V review's CE-3). A WRAPPER built here holds what it keeps: a constructor call's origins are those of the arguments the constructor keeps (a built-in's by its RETAINS or because it is a container - KeepsArgument; a user constructor's by the front end's own verdict, CloseableArgumentKeeping.fateOf - a copy constructor that copies is a loan and derives nothing), a list or dict literal's those of its elements and values; a dynamic class or function holds what it captures. A value HELD by any of these whose static type is a closed concrete core type (a String, an Integer - MayHoldUserObject) is a value, never a view anything can be kept into, and is skipped (ofCapture(MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext); E1b's own exemption) - a closure over a String property hands back no part of the receiver, where one over a Node does. Anything else - a literal, a call whose callee returns nothing held - is nothing. The callee's marks and the constructors' fates are read as they stand, so the derivation runs this to a fixpoint (RetentionDerivation).