def params
bend-lint-rules@0.2.0.0 · performance/dead_accumulator.bend:91
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
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists
91
92def params(
93 nodes: List<&2, Lint.Node>,
94 +loop: Lint.Node,
95 +target: String,
96 +name: String,
97 +at: U32,
98 out: List<&2, Lint.Finding>
99) -> List<&2, Lint.Finding>:
100 match nodes:
101 case Nil{}:
102 out
103 case Con{Lint.Node{Lint.Parameter{b, q}, pn, ps, pk, pf}, rest}:
104 params(
105 rest,
106 loop,
107 target,
108 name,
109 (at + 1: U32),
110 Lists.onto(
111 &2,
112 Lint.Finding,
113 Lint.finding(
114 Lint.Information{},
115 is_dead(q, Lint.visit(~Owner, ~U32, ~use.visit, Owner{target, at, b}, [loop])),
116 ps,
117 message(pn, name)
118 ),
119 out
120 )
121 )
122 case Con{node, rest}:
123 params(rest, loop, target, name, at, out)