~/bend-docscommunity

bolt/rules/correctness/shadow.bend fails

raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/correctness/shadow.bend as Shadow

rule shadow: a let, a do-bind, a lambda or a pattern binds a name that a def above it in the same file already has. When the file is imported, Bend reads such a name as a reference to the def, and the binder fails with an error that points at the pattern: "a pattern (a binder or a constructor)". Parameters and for names are declared, not parsed as terms, and are safe.

5 imports
import Base
import ../../src.bend as Src
import ../../../lazy/lazy.bend as Lazy
import ../../finding.bend as F
import ../../../syntax/bind.bend as Bind