bolt/rules/correctness/strings.bend fails
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/correctness/strings.bend as Strings
rule strings: a match whose arms are string literals (case "foo":) with
more than 64 literal characters in all. Each string arm lowers into nested
per-char tests, and the checker's time and memory grow with the characters
(bend 2.0.16: 45 characters take 0.8 s and 0.35 GB, 100 take 2 s and 1 GB,
480 take 12 s and 4.8 GB; pi-bend BEND-001/016 was 16 long event names).
The number of arms barely matters, so only the characters count. Classify
the string once through a lookup table into a sum type, and match on that.
7 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 ../../../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}