Class SafeAccessConjuncts


final class SafeAccessConjuncts extends AbstractSafeSymbolMarker
THE conjunct walk for Optional/Result/Iterator safe access (Steve, 2026-10-07, decision Q3) - use it, never re-derive a variant. A condition is flattened into its TOP-LEVEL and conjuncts (the root and chain, parenthesised and groups included); each conjunct of the form x? (or the named checks r.isOk(), r.isError(), it.hasNext()) proves its subject set: Fail-closed: a ? under or, xor, not, a ternary or a call argument proves nothing, so (o? and x) or (o? and y) and not not o? make nothing safe. This replaced the earlier rule that the WHOLE condition had to be a "simple" and of checks.
  • Constructor Details

  • Method Details

    • conjunctsOf

      The top-level and conjuncts of condition, left to right, parentheses removed.
    • markProven

      void markProven(EK9Parser.ExpressionContext condition, IScope scopeMadeSafe)
      Mark everything the top-level conjuncts of condition prove as safe in scopeMadeSafe.
    • isProvenEarlier

      boolean isProvenEarlier(org.antlr.v4.runtime.tree.ParseTree accessSite, ISymbol symbol, CommonValues access)
      True when access on symbol at accessSite is protected by an EARLIER conjunct of an enclosing and evaluated as part of the same expression.