DecreasingCall.message: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/language/decreasing_call.bend as DecreasingCall Lines 204-217 of bend-lint-rules@0.2.0.0/language/decreasing_call.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/language/decreasing_call.bend&start_line=204&end_line=217 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint def message(verdict: Verdict, loop: String, source: String, args: List<&2, Lint.Node>) -> String: match verdict: case Fails{+at, param}: loop ++ " calls itself here, but argument " ++ ordinal(at) ++ " (`" ++ Lint.Span.text(source, Lint.Node.span(List.get(&2, Lint.Node, args, at))) ++ "`) is neither the parameter " ++ param ++ " unchanged nor a part of it that a match took apart, and the arguments before it are unchanged. Bend reads the arguments left to right, so it cannot prove the loop ends, and the check fails (\"a decreasing self-call\"). Put the parameter that shrinks first, pass the ones before it unchanged, and pass a part of it that a match took apart (`p` of `case 1n+p:`)." case _: loop ++ " calls itself here with every argument unchanged, so the loop would never end, and the check fails (\"a decreasing self-call\"). Pass a part of the parameter that shrinks, one that a match took apart (`p` of `case 1n+p:`)." Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node.span https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Span.text https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/language/decreasing_call.bend&name=Verdict https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/language/decreasing_call.bend&name=ordinal