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 70
70
:protocol-multiple-impls true
71
71
:single-segment-namespace true
72
72
:munged-namespace true
73
- :ns-var-clash true })
73
+ :ns-var-clash true
74
+ :extend-type-invalid-method-shape true })
74
75
75
76
(def js-reserved
76
77
#{" abstract" " boolean" " break" " byte" " case"
214
215
[warning-type {:keys [ns var] :as info}]
215
216
(str " Namespace " ns " clashes with var " var))
216
217
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
+
217
223
(defn ^:private default-warning-handler [warning-type env extra]
218
224
(when (warning-type *cljs-warnings*)
219
225
(when-let [s (error-message warning-type extra)]
Original file line number Diff line number Diff line change 875
875
impls (drop-while seq? (next impls))]
876
876
(when (contains? protos proto)
877
877
(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)))))
880
886
(recur (conj protos proto) impls)))))
881
887
882
888
(defmacro extend-type
You can’t perform that action at this time.
0 commit comments