language/decreasing_call.bend fails
raw source on the hub · import bend-lint-rules@0.1.0.0/language/decreasing_call.bend as Decreasing_call
language/decreasing_call: a call of a definition to itself that Bend cannot prove smaller, so the check
fails ("a decreasing self-call").
Heuristics: as Bend's checker does, it reads the arguments left to right against the parameters:
each must be passed unchanged until one is smaller, a field that a match on that parameter took
apart (p of case 1n+p:). Erased parameters do not count. An argument that is a call, or another
variable, is not smaller. One that is a literal or a constructor is left to the checker: the rule
does not report it. Bend's checker stops at its first error; this rule reports every such call at
once. An @unsafe definition (def f?) may call itself freely, and a call in a type (a pair type
A & B, a type's arguments, an equality) is not checked.
3 imports
import Base import bend-lint-api@0.1.0.0/linter/lint.bend as Lint import bend-lint-api@0.1.0.0/shared/lists.bend as Lists
The reader could not load this file (at 0x2b0a0dcada30f71a8eb4ec2e148b9279/linter/lint.bend:522). What bend.ts says:
Error:
- expected : a fresh constructor name (duplicate declaration: Text)
- observed : 'Text'
Location:
521 | Flag{on: Bool}
522>| Text{text: String}
| ^^^^
523 |