From 1a278dccacf6a826f5becfe9bcaf9ed5d7f68cf4 Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Thu, 18 Apr 2024 17:37:42 +0200 Subject: [PATCH] defprotocol: don't error when options are provided --- clj/src/cljd/compiler.cljc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clj/src/cljd/compiler.cljc b/clj/src/cljd/compiler.cljc index ebfa3c6e..d4089890 100644 --- a/clj/src/cljd/compiler.cljc +++ b/clj/src/cljd/compiler.cljc @@ -1051,6 +1051,8 @@ ;; TODO do something with docstrings (let [proto (vary-meta proto assoc :tag 'cljd.core/IProtocol) [doc-string & methods] (if (string? (first methods)) methods (list* nil methods)) + [opts methods] (split-with #(not (list? %)) methods) + opts (zipmap (take-nth 2 opts) (take-nth 2 (rest opts))) method-mapping (into {} (map (fn [[m & arglists]] (let [dart-m (munge m {})