def called

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

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

259# The call of a let's value, if the value is a call of `target`, typed or not.
260def called(value: Lint.Node, target: String) -> Maybe<&2, Lint.Node>:
261  match value:
262    case Lint.Node{Lint.Application{}, n, s, +kids, f}:
263      Lists.when(Lint.Node, calls.to(kids, target), Lint.Node{Lint.Application{}, n, s, kids, f})
264    case Lint.Node{
265      Lint.Annotation{},
266      n,
267      s,
268      Con{Lint.Node{Lint.Application{}, cn, cs, +kids, cf}, k},
269      f
270    }:
271      Lists.when(Lint.Node, calls.to(kids, target), Lint.Node{Lint.Application{}, cn, cs, kids, cf})
272    case _:
273      None{}

Uses (7)

Used by (1)