def is_recursive
import bend-lint-api@0.2.0.0/linter/lint.bend as Lintimport Base
383# Whether a node is an application of the definition it is in, below `path`: a step of a loop, as Bend repeats work by
384# recursion.
385def is_recursive(path: List<&2, Above>, +node: Node) -> Bool:
386 match node:
387 case Node{Application{}, n, s, Con{Node{Reference{called}, rn, rs, rk, rf}, args}, f}:
388 calls(called, top(path, node))
389 case _:
390 False{}
Uses (7)
Used by (7)
- bend-lint-rules@0.2.0.0/language/decreasing_call:visit
- bend-lint-rules@0.2.0.0/performance/append_in_loop:visit
- bend-lint-rules@0.2.0.0/performance/deep_call_in_fork:deep.visit
- bend-lint-rules@0.2.0.0/performance/list_index_loop:visit
- bend-lint-rules@0.2.0.0/performance/loop_invariant_call:loop.visit
- …