Class DefaultCopyOfCloseableOrError
default operator :=: - written alone, or by the bare default operator that includes it - copies
each field by reference: a shallow copy, by design (decision 4), so that the generated copy never invents a
deep-copy semantics a type did not ask for. For a closeable field that is a second owner: after a :=: b
both objects hold b's resource, both close it, and a's own resource is never closed. Nothing the
generator could emit makes that right, so it is refused. A type that needs copying writes its own
operator :=:, whose stores are then judged by the fresh-store rule (CloseableSlotStoreOrError).
The fields judged are GeneratedOperatorFields.of(AggregateSymbol) - exactly the set the generated copy walks - filtered by
CloseableResourceToBeChecked.isManagedCloseableType(ISymbol). Inherited fields are the super's own copy's concern.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCopyOfCloseableOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescription(package private) voidThe baredefault operator: it includes:=:when the type did not write one of its own.(package private) voidAn explicitdefault operator :=:.
-
Constructor Details
-
DefaultCopyOfCloseableOrError
DefaultCopyOfCloseableOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
An explicitdefault operator :=:. -
accept
The baredefault operator: it includes:=:when the type did not write one of its own.
-