Closed edipofederle closed 5 months ago
First of all, I think the exception is likely a bug in ASM, but I'm not sure.
Anyway, on this line:
[:invokevirtual "my.pkg.Test.Println" "invoke" [java.lang.Object Object]]
Did you mean that to be returning :void
?
21: invokevirtual #18 // Method Println.invoke:(Ljava/lang/Object;)V
E.g.,
user=> (require '[insn.util :as util])
nil
user=> (util/method-desc [java.lang.Object Object])
"(Ljava/lang/Object;)Ljava/lang/Object;"
user=> (util/method-desc [java.lang.Object :void])
"(Ljava/lang/Object;)V"
First of all, I think the exception is likely a bug in ASM, but I'm not sure.
Anyway, on this line:
[:invokevirtual "my.pkg.Test.Println" "invoke" [java.lang.Object Object]]
Did you mean that to be returning
:void
?
Yes, correct.
So, does it work now, or are you still getting the error?
Maybe you misunderstood me. It is currently returning Object
. If you intended it to return :void
, you need to change it to the following:
[:invokevirtual "my.pkg.Test.Println" "invoke" [java.lang.Object :void]] ;; <-- changed
Hi,
First of all, thanks for your work on this library!
I'm facing some issues when trying to invoke static inside a if branch, here be example:
This is the Exception:
I have basically this code in Java and the byte code looks like this, and works as expected:
I'm not not sure if I'm doing some thing wrong on the the Clojure code, or if maybe there is some bug in the library. Maybe someone can provide some direction here?
Thanks!