~/bend-docscommunity

bolt/rules/correctness/put.bend fails

raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/rules/correctness/put.bend as Put

rule put: a call to Map.put(. Base's Map.put is an internal helper of Map.set: on a leaf it keeps the old key and replaces the value without comparing keys, so putting a new key silently overwrites another entry (bend-http c91bdf8: "b" into a map of "a" replaced "a"). Use Map.set. A file that defines Map.put itself (Base's source) is exempt.

6 imports
import Base
import ../../src.bend as Src
import ../../../lazy/lazy.bend as Lazy
import ../../finding.bend as F
import ../../../syntax/lex.bend as Lex
import ../tokens.bend as T