Skip to content

Commit 891aba1

Browse files
committed
Fix macroexpansion of methods in deftype* and reify*
It looks like deftype* and reify* no longer accept the multiple-arglist-function syntax, so we can't use expand-fn for expanding methods any more.
1 parent 3a20c1c commit 891aba1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main/clojure/clojure/tools/macro.clj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,19 @@
148148
(cons f bodies)
149149
(cons f (cons name bodies)))))
150150

151-
(defn- expand-method
152-
"Handle a method in a deftype* or reify* form."
153-
[m]
154-
(rest (expand-fn (cons 'fn* m))))
155-
156151
(defn- expand-deftype
157152
"Handle deftype* forms."
158153
[[symbol typename classname fields implements interfaces & methods]]
159154
(assert (= implements :implements))
160-
(let [expanded-methods (map expand-method methods)]
155+
(let [expanded-methods (map #(expand-args % 2) methods)]
161156
(concat
162157
(list symbol typename classname fields implements interfaces)
163158
expanded-methods)))
164159

165160
(defn- expand-reify
166161
"Handle reify* forms."
167162
[[symbol interfaces & methods]]
168-
(let [expanded-methods (map expand-method methods)]
163+
(let [expanded-methods (map #(expand-args % 2) methods)]
169164
(cons symbol (cons interfaces expanded-methods))))
170165

171166
; Handlers for special forms that require special treatment. The default

0 commit comments

Comments
 (0)