Class ReturnSourceClassifier
java.lang.Object
org.ek9lang.compiler.phase5.ReturnSourceClassifier
- All Implemented Interfaces:
BiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, ReturnSourceKind>
final class ReturnSourceClassifier
extends Object
implements BiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, ReturnSourceKind>
THE return-source classifier: which
ReturnSourceKind one source of a callable's returning variable is
(with IsFreshValueExpression, which decides ReturnSourceKind.NEW). Hold one; both consumers -
ReceiverInteriorReturns and CloseableReturnOrError - read it, so they cannot disagree about a
source. Was ReturnSourceKind.of (no-statics lane P2, 2026-10-29).
Classification is purely syntactic over the recorded symbols, and reads other callables' RETAINS marks, so it is evaluated afresh on every pass of the derivation's fixpoint.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(MutatedOnlyVariables.ReturningCallable returning, EK9Parser.ExpressionContext source) Classify one source of a callable's returning variable.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Constructor Details
-
ReturnSourceClassifier
ReturnSourceClassifier()
-
-
Method Details
-
apply
public ReturnSourceKind apply(MutatedOnlyVariables.ReturningCallable returning, EK9Parser.ExpressionContext source) Classify one source of a callable's returning variable.- Specified by:
applyin interfaceBiFunction<MutatedOnlyVariables.ReturningCallable, EK9Parser.ExpressionContext, ReturnSourceKind>- 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
-