File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 7070 :protocol-multiple-impls true
7171 :single-segment-namespace true
7272 :munged-namespace true
73- :ns-var-clash true })
73+ :ns-var-clash true
74+ :extend-type-invalid-method-shape true })
7475
7576(def js-reserved
7677 #{" abstract" " boolean" " break" " byte" " case"
214215 [warning-type {:keys [ns var] :as info}]
215216 (str " Namespace " ns " clashes with var " var))
216217
218+ (defmethod error-message :extend-type-invalid-method-shape
219+ [warning-type {:keys [protocol method] :as info}]
220+ (str " Bad extend-type method shape for protocol " protocol " method " method
221+ " , method arities must be grouped together" ))
222+
217223(defn ^:private default-warning-handler [warning-type env extra]
218224 (when (warning-type *cljs-warnings*)
219225 (when-let [s (error-message warning-type extra)]
Original file line number Diff line number Diff line change 875875 impls (drop-while seq? (next impls))]
876876 (when (contains? protos proto)
877877 (ana/warning :protocol-multiple-impls env {:protocol proto}))
878- (core/doseq [method methods]
879- (validate-impl-sigs env proto method))
878+ (loop [seen #{} methods methods]
879+ (when (seq methods)
880+ (let [[fname :as method] (first methods)]
881+ (when (contains? seen fname)
882+ (ana/warning :extend-type-invalid-method-shape env
883+ {:protocol proto :method fname}))
884+ (validate-impl-sigs env proto method)
885+ (recur (conj seen fname) (next methods)))))
880886 (recur (conj protos proto) impls)))))
881887
882888(defmacro extend-type
You can’t perform that action at this time.
0 commit comments