Class CloseableLocalOrError

java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase5.CloseableLocalOrError
All Implemented Interfaces:
Consumer<ISymbol>

final class CloseableLocalOrError extends RuleSupport implements Consumer<ISymbol>
The NAMED half of the closeable ownership rule (Steve, 2026-10-05): "A closeable value you never NAME is owned by the statement that created it and closed when that statement finishes; a closeable value you NAME must be declared as a try-with-resources resource." (E81056).

Called for every local variable declared OUTSIDE a try-with-resources declaration (the caller excludes those). A local whose type is closeable (CloseableResourceToBeChecked) is an error: nothing would ever close it. Properties (the object owns them), incoming parameters (the caller owns them) and the returning variable (ownership passes to the caller) are not locals and are never reported. An injected local (r as Resource!) is owned by the application that registered it, so it is not reported. The unnamed half is decided in this phase too (StatementOwnedCloseableCalls) and emitted by phase 7 (StatementOwnedCloseables).