def loops.go

bolt@1.27.0.0 · src/rules/suspicious/eager.bend:54

import bolt@1.27.0.0/src/rules/suspicious/eager.bend as Eager
import Base
import bolt@1.27.0.0/src/rules/calls.bend as Calls

54def loops.go(ds: List<&2, Calls.Def>, +acc: List<&2, String>) -> List<&2, String>:
55  match ds:
56    case Nil{}:
57      acc
58    case Con{Calls.Def{+name, sig, body}, rest}:
59      +cs = called(body)
60      +deep = Bool.or(List.contains(~String, ~String.eq, cs, name), any_of(cs, acc))
61      loops.go(rest, Bool.pick(List<&2, String>, deep, name <> acc, acc))

Uses (9)

Used by (1)