guardsBoundsForTesting static method

  1. @visibleForTesting
bool guardsBoundsForTesting(
  1. MethodInvocation substringCall
)

Exposed for unit tests: the pure-AST bounds-guard check used by run. It operates entirely on syntax (toSource / AST shape) with no resolved type binding, so it is verifiable on unresolved parseString ASTs — the only place this rule's guard logic can be exercised, since the scan CLI and most test harnesses do not populate staticType.

Implementation

@visibleForTesting
static bool guardsBoundsForTesting(MethodInvocation substringCall) =>
    _isGuardedByLengthCheck(substringCall);