Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find methods defined in Object class for interface types #2

Closed
athos opened this issue Aug 8, 2019 · 1 comment
Closed

Cannot find methods defined in Object class for interface types #2

athos opened this issue Aug 8, 2019 · 1 comment

Comments

@athos
Copy link
Owner

athos commented Aug 8, 2019

user=> (require '[jise.utils :as jise])
nil
user=> (jise/do (let [^java.io.Serializable s "foo"] (.toString s)))
Syntax error macroexpanding jise.core/class at (form-init7183457418990174559.clj:64:4).
Error: cannot find symbol
  symbol: method toString(no arguments)
  location: class java.io.Serializable (/private/var/folders/mr/bf82sldd78g9822yxqgzd12h0000gn/T/form-init7183457418990174559.clj:1:47)
user=>

Whereas:

user=> (jise/do (let [^String s "foo"] (.toString s)))
"foo"
user=>

This is essentially due to the fact that the current implementation of t/get-methods does not consider the Object class as a supertype of any interface type:

user=> (t/get-methods nil nil (t/tag->type 'java.io.Serializable) "toString")
nil
user=> (t/get-methods nil nil (t/tag->type 'String) "toString")
({:class #object[clojure.asm.Type 0x3d7eb9c1 "Ljava/lang/String;"],
  :interface? false,
  :param-types [],
  :return-type #object[clojure.asm.Type 0xbc97527 "Ljava/lang/String;"],
  :access #{:public}})
user=>
@athos
Copy link
Owner Author

athos commented Aug 9, 2019

a4e1467 fixed this.

@athos athos closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant