[CLJ-1165] Forbid varargs defprotocol/definterface method declarations because those cannot be defined anyway Created: 15/Feb/13 Updated: 05/Jun/15 Resolved: 28/Oct/13
|Reporter:||Tassilo Horn||Assignee:||Stuart Halloway|
Protocol, interface method declarations don't allow for varags. Currently, for example
compiles just fine, and & is interpreted as a usual argument that happens to be
Similarly, providing method implementations via defrecord, deftype, and reify
So this patch makes defprotocol and definterface throw an
Similarly, defrecord, deftype, and reify throw an IllegalArgumentException if
This patch is a cut-down variant of my patch to http://dev.clojure.org/jira/browse/CLJ-1024
This has been discussed on the list: https://groups.google.com/d/topic/clojure-dev/qjkW-cv8nog/discussion
|Comment by Stuart Halloway [ 29/Mar/13 5:27 AM ]|
I think that this patch would be much more helpful to users if it reported the problem form (both name and params).
(And I wonder if we should be using ex-info for all errors going forward.)
|Comment by Tassilo Horn [ 31/Mar/13 5:17 AM ]|
New version of the patch that mentions both method name and argument vector, and uses ex-info as Stu suggested.
|Comment by Andy Fingerhut [ 04/Apr/13 7:24 PM ]|
Presumuptuously changing Approval from Incomplete back to None, since the reason for marking it Incomplete seems to have been addressed with a new patch.
|Comment by Andy Fingerhut [ 25/Oct/13 6:29 PM ]|
I have not investigated the reason yet, but patch 0001-Protocol-interface-method-declarations-don-t-allow-f.patch no longer applies cleanly after the latest commits to Clojure master on Oct 25 2013.
|Comment by Tassilo Horn [ 28/Oct/13 2:18 AM ]|
I'm closing this issue in favor of CLJ-888 which is about the very same issue and contains a more recent patch that also contains test cases.
|Comment by Nicola Mometto [ 05/Jun/15 9:56 AM ]|
Ticket was marked as a duplicate and resolved but not closed. I'm closing it.