bolt/rules/correctness/twice.bend fails
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/correctness/twice.bend as Twice
rule twice: a list pattern in a def that calls itself, opening with the
same literal twice (case 10 <> 10 <> _:, case Con{'a', Con{'a', t}}:).
The checker hangs on it (pi-bend BEND-018, b6a83a52; bend 2.0.16 still
does). Only the opening pair was seen to hang: 10 <> 11 <> 10,
_ <> 10 <> 10 and 10 <> 11 <> 11 check at once, and so does the same
pattern in a def that does not recurse. Match one element per step, with a
state.
8 imports
import Base import ../../src.bend as Src import ../../finding.bend as F import ../../../syntax/lex.bend as Lex import ../../../syntax/tree.bend as Tree import ../../../syntax/bind.bend as Bind import ../../../lazy/lazy.bend as Lazy import ../tokens.bend as T
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}