On Aug 20, 4:06 pm, Chas Emerick <[EMAIL PROTECTED]> wrote: > I'm back to wading in unfamiliar waters (java bytecode). In the > process of using some bytecode verification tools on a couple of > classes emitted by genclass (we're using r994 at the moment), I > stumbled across a couple of errors related to references in the > genclass classfiles to IFn.invoke with nonexistent arities > (specifically, it looks like the genclass class is attempting to call > 21- and 22-argument overloads of IFn.invoke). > > Here's a simple testcase; the gen-class specification is this: > > (gen-and-save-class "/" 'Test :implements clojure.lang.IFn) > > And the errors I'm getting include: > > --------- > Warning: Test: can't find referenced method 'java.lang.Object > invoke(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object)' > in class clojure.lang.IFn > > Warning: Test: can't find referenced method 'java.lang.Object > invoke(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object)' > in class clojure.lang.IFn > --------- > > Looking at the bytecode (in jclasslib, which is very helpful with this > sort of thing), it looks like the 19- and 20-arg overloads of > IFn.invoke are attempting to call 21- and 22-arg clojure > implementations of invoke. (One of the extra arguments being the > object being called -- not sure what the other extra argument is, > though.) To confirm this, I did this in the REPL: > > com=> (in-ns 'com) > #<Namespace: com> > com=> (gen-and-load-class 'com.Test :implements [clojure.lang.IFn]) > com=> (.invoke (com.Test.) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1) ; > 20-arg invocation > java.lang.NoSuchMethodError: clojure.lang.IFn.invoke(Ljava/lang/ I've fixed genclass method handling to max of 18 parameters. Thanks for the report! Rich --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---