def visit

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

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

454# The findings at a node of a definition below `path`: about the calls of the expression it starts, and about the runs
455# of lets from it, if it starts one.
456def visit(+owner: Owner, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, Lint.Finding>:
457  match owner node:
458    case Owner{target, name, io, text} Lint.Node{syntax, n, span, k, f}:
459      Lists.append(
460        &2,
461        Lint.Finding,
462        roots(
463          Bool.not(io) && Bool.not(is_boundary(syntax)) && starts(path) && Lint.is_live(path),
464          node,
465          span,
466          owner
467        ),
468        lets(
469          Maybe.is_some(
470            &2,
471            Bound,
472            bound(node, owner)
473          )
474            && Bool.not(follows(path, owner))
475            && Lint.is_live(path),
476          node,
477          owner
478        )
479      )

Uses (17)

Used by (1)