Skip to content

Commit b26a8d0

Browse files
bronsastuarthalloway
authored andcommitted
CLJ-1870: don't destroy defmulti metadata on reload
Signed-off-by: Stuart Halloway <stu@cognitect.com>
1 parent 134c299 commit b26a8d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/clj/clojure/core.clj

+3-2
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,8 @@
17571757
m)
17581758
m (if (meta mm-name)
17591759
(conj (meta mm-name) m)
1760-
m)]
1760+
m)
1761+
mm-name (with-meta mm-name m)]
17611762
(when (= (count options) 1)
17621763
(throw (Exception. "The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)")))
17631764
(let [options (apply hash-map options)
@@ -1766,7 +1767,7 @@
17661767
(check-valid-options options :default :hierarchy)
17671768
`(let [v# (def ~mm-name)]
17681769
(when-not (and (.hasRoot v#) (instance? clojure.lang.MultiFn (deref v#)))
1769-
(def ~(with-meta mm-name m)
1770+
(def ~mm-name
17701771
(new clojure.lang.MultiFn ~(name mm-name) ~dispatch-fn ~default ~hierarchy)))))))
17711772

17721773
(defmacro defmethod

0 commit comments

Comments
 (0)