Class StatementOwnership

java.lang.Object
org.ek9lang.compiler.support.StatementOwnership

public final class StatementOwnership extends Object
THE mark that a call's closeable result is owned by the block statement that makes it, so that statement closes it when it finishes (the unnamed half of the closeable ownership rule, Steve 2026-10-05). Code in no statement is owned by its returning-variable or property initialiser, or its text string (MustExecutePosition, 2026-10-06); phase 7 closes it in the evaluation it finds the call in (StatementOwnedCloseables).

Phase 5 DECIDES it on the call's own resolved CallSymbol (phase5/StatementOwnedCloseableCalls), phase 7 READS it into the CALL it generates (CallDetails.statementOwned) and only emits the owner and the close. Never re-derive the decision from IR: the IR names a callee by strings, and the overload phase 3 resolved is the one that is called.

  • Method Details

    • mark

      public static void mark(CallSymbol call)
      Record that the result of call is owned, and so closed, by its statement.
    • isOwnedByItsStatement

      public static boolean isOwnedByItsStatement(ISymbol recorded)
      Is recorded a call whose result its statement owns (and closes).