def value.visit

bend-lint-rules@0.2.0.0 · language/unneeded_plus.bend:23

import bend-lint-rules@0.2.0.0/language/unneeded_plus.bend as UnneededPlus
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

23# The definition a reference below `path` names, if it is used as a value: not as the function of an application.
24def value.visit(+u: Unit, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, String>:
25  match path node:
26    case Con{
27      Lint.Above{Lint.Node{Lint.Application{}, n, s, k, f}, at},
28      up
29    } Lint.Node{Lint.Reference{t}, rn, rs, rk, rf}:
30      Bool.pick(List<&2, String>, U32.is_eq(at, 0), [], [t])
31    case _ Lint.Node{Lint.Reference{t}, rn, rs, rk, rf}:
32      [t]
33    case _ _:
34      []

Uses (8)

Used by (1)