Class SafeSymbolAccess

Direct Known Subclasses:
ContainerUnwrapObligations, ObjectAccessExpressionValidOrError, SafeAccessRepointOrError

abstract class SafeSymbolAccess extends TypedSymbolAccess
  • Field Details

  • Constructor Details

  • Method Details

    • isAccessUnSafe

      protected boolean isAccessUnSafe(ISymbol calledFromSymbol, String methodName, org.antlr.v4.runtime.tree.ParseTree accessSite)
      True when the access needs a check that neither the enclosing scope nor an earlier and conjunct of the expression at accessSite provides (SafeAccessConjuncts.isProvenEarlier(ParseTree, ISymbol, CommonValues)).
    • requiresSafeAccess

      protected boolean requiresSafeAccess(ISymbol calledFromSymbol, String methodName)
      Whether methodName on calledFromSymbol is a container-unwrap that needs a preceding safety check (Optional.get, Result.ok/error, Iterator.next on a symbol the marker has flagged) — i.e. an unwrap obligation exists here, independent of whether it is discharged. isAccessUnSafe(ISymbol, String, ParseTree) then answers whether that obligation is undischarged (unguarded). Split out so the obligation census can count the obligation and read its discharge from the same source of truth the E08030 checker uses.