def loops.go

bolt@1.27.0.0 · src/rules/pedantic/rewalk.bend:396

import bolt@1.27.0.0/src/rules/pedantic/rewalk.bend as Rewalk
import Base
import bolt@1.27.0.0/src/rules/calls.bend as Calls

396def loops.go(ds: List<&2, Calls.Def>, +acc: List<&2, String>) -> List<&2, String>:
397  match ds:
398    case Nil{}:
399      acc
400    case Con{Calls.Def{+name, sig, body}, rest}:
401      +cs = called(body)
402      +deep = Bool.or(List.contains(~String, ~String.eq, cs, name), any_of(cs, acc))
403      loops.go(rest, Bool.pick(List<&2, String>, deep, name <> acc, acc))

Uses (9)

Used by (1)