~/bend-docscommunity

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