Class CloseableHolderDeclaresCloseOrError
- All Implemented Interfaces:
Consumer<org.antlr.v4.runtime.tree.ParseTree>
operator close:
default operator close or one it writes. "Declares", not "has": an inherited close cannot see a property
the sub-type adds, so a sub-type relying on its super's close leaked its own property (critic c15), and
Closeable's close is a no-op.
And the converse (E81070): a default operator close with nothing to close - no closeable field and no
super class close - would only make the type closeable, which forces every caller into a try.
The fields counted, the parent close, and what counts as declaring a close are CloseSteps's - THE field
set the generated close chain uses, with its exclusions (injected properties, a by-delegation proxy's
delegate, a bare T, a capture that is only borrowed). The rule promises only that a holder closes what it
holds; it does not claim that every closeable value is closed.
E81067 is reported on the first closeable field, naming them all, so it never competes with the type-level checks
on the type's own name; E81070 on the close of the default operator close.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionCloseableHolderDeclaresCloseOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
CloseableHolderDeclaresCloseOrError
CloseableHolderDeclaresCloseOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
-