def follows

bend-lint-rules@0.2.0.0 · performance/missed_fork.bend:420

import bend-lint-rules@0.2.0.0/performance/missed_fork.bend as MissedFork
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists

420# Whether a let below `path` goes on a run from the let above it: it is that let's rest of block, and that let binds
421# one name to a call.
422def follows(path: List<&2, Lint.Above>, owner: Owner) -> Bool:
423  match path:
424    case Con{Lint.Above{Lint.Node{Lint.Destructure{q}, n, s, +kids, f}, at}, rest}:
425      U32.is_eq(
426        (at + 1: U32),
427        U32.from_nat(Lists.length(&2, Lint.Node, kids))
428      )
429        && Maybe.is_some(&2, Bound, bound(Lint.Node{Lint.Destructure{q}, n, s, kids, f}, owner))
430    case _:
431      False{}

Uses (15)

Used by (1)