def use.visit

bend-lint-rules@0.2.0.0 · performance/dead_accumulator.bend:64

import bend-lint-rules@0.2.0.0/performance/dead_accumulator.bend as DeadAccumulator
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

64# How the parameter is used at a node, below `path`, if the node is a use of it in live code.
65def use.visit(+owner: Owner, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, U32>:
66  match owner node:
67    case Owner{target, at, binder} Lint.Node{Lint.Variable{v}, n, s, k, f}:
68      Bool.pick(
69        List<&2, U32>,
70        U32.is_eq(v, binder) && Lint.is_live(path),
71        [kind(path, target, at, False{})],
72        []
73      )
74    case _ _:
75      []

Uses (12)

Used by (1)