Class CloseableReturnOrError
- All Implemented Interfaces:
Consumer<MutatedOnlyVariables.ReturningCallable>
this's interior), a
parameter (the caller's), a capture, a local (a try resource is closed as the try ends), or a call result that may
be one of those (list.get(0), iterator.next()).
Provably new (ReturnSourceKind.NEW) is a constructor call, or a call of a callable whose declared
return type is closeable - new by this same rule, so the declaration is the proof and no fixpoint is needed.
Every source of the returning variable is checked (MutatedOnlyVariables collects them: the initialiser,
pointer assignments (pre-flows included), and through arm-shaped values). To LEND a held resource, return a
non-closeable view type instead (StringInput, as TCPConnection.input() does).
Reported once per callable, at its definition, naming the first source that is not new. A bare type
parameter T is not a closeable type (CloseableResourceToBeChecked.isManagedCloseableType(ISymbol)), so a
generic returning T is not judged per parameterisation here.
-
Constructor Details
-
CloseableReturnOrError
CloseableReturnOrError()
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<MutatedOnlyVariables.ReturningCallable>
-