Class CallableParameterOccurrences
java.lang.Object
org.ek9lang.compiler.phase5.CallableParameterOccurrences
THE reading of what one callable does with its own parameters (and with each local made to refer to one): every
occurrence of such a variable is judged through
ObjectSharing.all(EK9Parser.IdentifierContext, Function) and handed to
CloseableArgumentKeeping, which decides - after every source is walked - which parameters the callable
KEEPS beyond the call. Extracted (the lane callee-keep, 2026-10-21) from CloseableSlotStoreOrError, where
D78's verifier wrote it for constructors; a method, operator, function or dynamic function is read by exactly the
same step, so what a constructor does with its argument and what a function does with its argument can never be
judged by two readings.
- kept somewhere nothing names (
ESCAPES): kept, inambient; - shared with a property: kept, in the
receiver(inambientwhere there is no receiver - a function's capture); shared with another of the callable's parameters (list += item): kept, in that parameter - it came from the caller and outlives the call; - shared with the returning variable: held by what the callable RETURNS -
return <- item, asReceiverInteriorReturnsderives for a plain return, here also for a wrapper, a capture or a container the returned value holds; it is not kept BEYOND the result; - shared with a local: followed through that local (an alias);
- given whole to a constructor of the program's own: that constructor's verdict (a forward); to a method or function of the program's own: that callee's verdict, derived in the same fixpoint;
- a link of a chain, or a call result, whose value cannot hold a closeable (
BorrowedViewReturn): nothing is kept.
-
Constructor Summary
ConstructorsConstructorDescriptionCallableParameterOccurrences(SymbolsAndScopes symbolsAndScopes, CloseableArgumentKeeping keeping) -
Method Summary
Modifier and TypeMethodDescription(package private) voidOne occurrence of a variable: does the object it refers to outlive the call?(package private) voidA call written with no receiver that runs one of the program's own methods (register(items)): the receiver is the object the calling method runs on, passed on asthis.register(items)would be.(package private) voidOnethisorsuperin a method or operator: does the RECEIVER outlive the call? (D80 follow-up, 2026-10-21.) The object a method runs on is read exactly as a parameter's object is -thisis not an identifier, soObjectSharing.all(EK9Parser.IdentifierContext, Function)never saw it, anditems += thiswas a method that kept nothing.(package private) voidA callable declaration was reached: its parameters are the variables whose occurrences are followed.(package private) Optional<CloseableArgumentKeeping.Holder> The callable whose own variable this is, when it is one that is followed (a parameter, or a local made to refer to one); empty otherwise.
-
Constructor Details
-
CallableParameterOccurrences
CallableParameterOccurrences(SymbolsAndScopes symbolsAndScopes, CloseableArgumentKeeping keeping)
-
-
Method Details
-
declared
A callable declaration was reached: its parameters are the variables whose occurrences are followed. -
holderOf
The callable whose own variable this is, when it is one that is followed (a parameter, or a local made to refer to one); empty otherwise. -
accept
One occurrence of a variable: does the object it refers to outlive the call? -
acceptSelf
Onethisorsuperin a method or operator: does the RECEIVER outlive the call? (D80 follow-up, 2026-10-21.) The object a method runs on is read exactly as a parameter's object is -thisis not an identifier, soObjectSharing.all(EK9Parser.IdentifierContext, Function)never saw it, anditems += thiswas a method that kept nothing. A call of the program's own method on it (this.register(items),super.register(items)) is the receiver passed on: kept when that method keeps ITS receiver. -
acceptImplicitSelfCall
A call written with no receiver that runs one of the program's own methods (register(items)): the receiver is the object the calling method runs on, passed on asthis.register(items)would be.
-