-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
If you have a namespace that does something like :refer-clojure :exclude [instance?] and use def-map-type in it,
(merge instance-of-my-map-type nil)will break because
def-map-type uses the def-abstract-type AbstractMap which defines cons like this:
potemkin/src/potemkin/collections.clj
Lines 68 to 79 in f22d972
| (cons [this o] | |
| (cond | |
| (map? o) | |
| (reduce #(apply assoc %1 %2) this o) | |
| (instance? java.util.Map o) | |
| (reduce #(apply assoc %1 %2) this (into {} o)) | |
| :else | |
| (if-let [[k v] (seq o)] | |
| (assoc this k v) | |
| this))) |
and the ultimate macroexpansion copies that call to instance? directly, rather than qualifying it as clojure.core/instance?.