diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/clojure/core_deftype.clj | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/clj/clojure/core_deftype.clj b/src/clj/clojure/core_deftype.clj index 470535c4..7cf2e318 100644 --- a/src/clj/clojure/core_deftype.clj +++ b/src/clj/clojure/core_deftype.clj @@ -315,6 +315,8 @@ fx (nth s 2 nil) doc (when (string? fx) fx) mopts (apply hash-map (nthnext s (if (string? fx) 3 2)))] + (when (some #{0} (map count arglists)) + (throw (IllegalArgumentException. (str "Protocol fn: " mname " must take at least one arg")))) (assoc m (keyword mname) (merge mopts {:name (vary-meta mname assoc :doc doc :arglists arglists) |