def visit

bend-lint-rules@0.2.0.0 · performance/gpu_fit.bend:301

import bend-lint-rules@0.2.0.0/performance/gpu_fit.bend as GpuFit
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import bend-lint-api@0.2.0.0/shared/names.bend as Names

301# The finding about an application below `path`, if its function is a definition of the program.
302def visit(
303  +program: Program,
304  +path: List<&2, Lint.Above>,
305  +node: Lint.Node
306) -> List<&2, Lint.Finding>:
307  match program node:
308    case Program{
309      +defs,
310      under,
311      slots,
312      bangs
313    } Lint.Node{
314      Lint.Application{},
315      n,
316      span,
317      Con{Lint.Node{Lint.Reference{t}, callee, Some{Lint.Span{p, beg, end}}, k, f}, args},
318      facts
319    }:
320      judged(
321        List.contains(~U32, ~U32.is_eq, bangs, end),
322        Names.find(Lint.Def, defs, t),
323        is_drop(Names.find(Lint.Def, defs, t), t),
324        callee,
325        Names.find(Lint.Def, defs, Lint.Node.target(Lint.top(path, node))),
326        under,
327        slots,
328        span
329      )
330    case _ _:
331      []

Uses (17)

Used by (1)