def check.def

bolt@1.27.0.0 · src/rules/correctness/twice.bend:69

import bolt@1.27.0.0/src/rules/correctness/twice.bend as Twice
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
import bolt@1.27.0.0/src/rules/calls.bend as Calls

69# a def's body, when it calls itself
70def check.def(mm: Maybe<&2, String>, +body: Tree.Node, path: String) -> List<&2, F.Finding>:
71  match mm:
72    case None{}:
73      Nil{}
74    case Some{+name}:
75      Lazy.stop(List<&2, F.Finding>, Bool.not(Calls.calls(body, name)), [], _u => walk(body, path))

Uses (9)

Used by (1)