Class CloseCallTarget
close call - try-with-resources, the closeable temporaries a
statement owns and the generated close chain all reach it through ResourceCloser.closeCall, so they
cannot name different owners or dispatch differently.
The call names the type that DECLARES close (CallTargetResolution's invariant), not the resource's
static type: a class that takes close from a trait (the built-in Transaction's default) has
no close of its own, and the native back end resolves by (declaring type, member) - naming the class
linked against a function no module defines (fuzz6 2026-10-04). Trait dispatch follows that declaring type.
Dispatch is decided exactly as for an ordinary call (IsVirtualCall): from the
resolved close and the value's STATIC type. A value typed as an open or abstract class, or a trait, may
at runtime be a subtype that overrides operator close, so its close is virtual; a closed class's is
not. The chain's super close is a super call and is never virtual - the caller asks DispatchFacts.viaSuper().
close is found through OperatorTargetMethodResolver, THE resolve-the-callee step, and a declaring
type other than the static type is named through the generation's resolver-aware namer, as every other owner in
this package is.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CloseCallTarget
public CloseCallTarget()
-
-
Method Details
-
ofType
public DispatchFacts ofType(ISymbol staticType, String staticTypeName, Function<ISymbol, String> resolveTypeName) The dispatch facts for closing a value whose static TYPE is known.- Parameters:
staticType- the value's static typestaticTypeName- the IR name of that type (keeps any Scenario-3 substitution)resolveTypeName- the generation's type namer (IRGenerationContext::resolveTypeName), for a declaring type other than the static type- Returns:
- the facts;
isExternTargetis the declaring type's
-