Welcome! Please see the About page for a little more info on how this works.

0 votes
in Compiler by

For example:

`
user=> (proxy [java.util.BitSet] []
(flip [bitIndex]

(proxy-super flip bitIndex)))

Reflection warning, NO_SOURCE_PATH:73:5 - call to method flip can't be resolved (target class is unknown).
`

I believe this issue might be fixed by simply adding type-hint metadata to the 'this symbol emitted by the proxy macro. I have not tried this change, but this macro seems to indicate it should work:

`
(defmacro proxy-super-cls [cls meth & args]
(let [thissym (with-meta (gensym) {:tag cls})]

`(let [~thissym ~'this]
  (proxy-call-with-super (fn [] (. ~thissym ~meth ~@args)) ~thissym ~(name meth))
)))

;;;;;;;;;;;;;;;;;;;;;;
user=> (proxy [java.util.BitSet] []
(flip [bitIndex]

(proxy-super-cls java.util.BitSet flip bitIndex)))

<BitSet$ff19274a {}>

`

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1433 (reported by glchapman)
...