feat(strictness): merge rejects atomic/wrong-shape args into a map

merge now throws when a non-first arg is a scalar, a set, a list, or a
wrong-length vector (a length-2 vector or a map still merge). Other map-like
tables (records/sorted-maps/host tables, e.g. SCI's namespaces) keep the lenient
conj path so the SCI bootstrap still loads.

merge 29/11/2 -> 35/3/4. clojure-test-suite pass 3874->3880.
spec: 5 merge strictness cases. jpm test green.
This commit is contained in:
Yogthos 2026-06-05 13:57:05 -04:00
parent 2ca3fa4348
commit f644b4b719
3 changed files with 14 additions and 2 deletions

View file

@ -90,4 +90,9 @@
["subvec out of range" :throws "(subvec [0 1 2 3] 1 5)"]
["subvec start>end" :throws "(subvec [0 1 2 3] 3 2)"]
["subvec ok" "[1 2]" "(subvec [0 1 2 3] 1 3)"]
["min-key empty" :throws "(apply min-key identity [])"])
["min-key empty" :throws "(apply min-key identity [])"]
["merge empty vector" :throws "(merge {} [])"]
["merge 1-elem vector" :throws "(merge {} [:foo])"]
["merge atomic arg" :throws "(merge {} :foo)"]
["merge [k v] ok" "{:foo 1}" "(merge {} [:foo 1])"]
["merge maps ok" "{:a 1, :b 2}" "(merge {:a 1} {:b 2})"])