~/bend-docscommunity

language/forward_reference.bend fails

raw source on the hub · import bend-lint-rules@0.1.0.0/language/forward_reference.bend as Forward_reference

language/forward_reference: live code that uses a definition of its file defined below it. Heuristics: Bend checks definitions in file order, and one below is still a bodiless claim, so live code cannot use it: the check fails with "a filled definition". So two definitions cannot call each other. Types and equations are dead code, so they may name any definition, and an @unsafe definition (def f?) may use any. Bend's checker stops at its first error; this rule reports every such use at once. A definition used as a type argument of a call is dead too, but the rule cannot tell such an argument from a live one.

4 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
import bend-lint-api@0.1.0.0/shared/names.bend as Names