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
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 |