Class CloseableLocalOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase5.CloseableLocalOrError
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).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionCloseableLocalOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
-
Constructor Details
-
CloseableLocalOrError
CloseableLocalOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
-