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). Anything else - a local, a
constructor, a literal, a call whose callee returns nothing held - is nothing. The callee's marks are read as
they stand, so ReceiverInteriorReturns runs this to a fixpoint.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringThe origin that stands for the callable's own receiver (itsthis, a property or a capture). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(MutatedOnlyVariables.ReturningCallable returning, EK9Parser.ExpressionContext source) The origins of one source.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Field Details
-
RECEIVER_ORIGIN
The origin that stands for the callable's own receiver (itsthis, a property or a capture).- See Also:
-
-
Constructor Details
-
ReturnSourceOrigins
ReturnSourceOrigins()
-
-
Method Details
-
apply
public Set<String> apply(MutatedOnlyVariables.ReturningCallable returning, EK9Parser.ExpressionContext source) The origins of one source.- Specified by:
applyin interfaceBiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, Set<String>>- Parameters:
returning- the method, operator, function or dynamic function whose returning variable it is, and the module it was parsed insource- the expression the returning variable is made to refer to
-