added a comment - - edited
I attached a patch. Here's the commit message:
Check for invalid varags/destrucuring uses.
Protocol, interface method declarations and implementations don't allow for
varags and destructuring support. Currently, for example
(foo [this & more]))
compiles just fine, and & is interpreted as a usual argument that happens to be
named & without special meaning. But clearly, the user wanted to specify a
varags parameter here. The same applies to definterface.
Similarly, providing method implementations via defrecord, deftype, and reify
don't allow for destructuring and varags (but dynamic extenions via extend do).
So this patch makes defprotocol, definterface, defrecord, deftype, and reify
throw an IllegalArgumentException if any argument vector contains a
destructuring form or varargs argument.