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
The reader could not load this file (at 0x729eecea86ea5a2cdba3a2856a313bca/bolt/config.bend:31). What bend.ts says:
Error:
- expected : a fresh name (duplicate declaration: Set)
- observed : 'Set'
Location:
30 | # a name (a group's or a rule's) at a level
31>| type Set is Data:
| ^^^
32 | Set{name: String, level: Level}