bolt/rules/suspicious/concat.bend fails
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/suspicious/concat.bend as Concat
rule concat: a def passes itself a parameter grown at the end, p ++ x or
List.append(.., p, ys) (String.append(p, ..) too). A String and a List are
cons lists, so appending copies all of p: the loop is quadratic, with right
output (night-train's text step cost three times the render; rootagi's JSON
stringify). Prepend (x <> acc) and reverse once at the end, build with
h <> go(t), or gather pieces and join them once.
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 ../calls.bend as Calls import ../../../lazy/lazy.bend as Lazy
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}