Class CloseCallTarget

java.lang.Object
org.ek9lang.compiler.phase7.calls.CloseCallTarget

public final class CloseCallTarget extends Object
THE target of a compiler-generated 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 (CallTargetResolution.isVirtualCall(ISymbol, ISymbol)): 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 decides that, not this.

  • Method Details

    • ofType

      public static CloseCallTarget.Target ofType(ISymbol staticType, String staticTypeName)
      The owner type name and dispatch flags for closing a value whose static TYPE is known.
      Parameters:
      staticType - the value's static type
      staticTypeName - the IR name of that type (keeps any Scenario-3 substitution)
      Returns:
      the target