Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: Release 1.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Clojure 1.4
Description
(defprotocol P (-foo [this]))
This code generates a reflective call to a non-existing foo field instead of the correct -foo method.
I was told by Christophe Grand that changing the line 557 in core_deftype.clj from:
(. ~(with-meta target {:tag on-interface}) ~(or on-method method) ~@(rest gargs))
to
(. ~(with-meta target {:tag on-interface}) (~(or on-method method) ~@(rest gargs)))
is a quick fix. However I don't know too much about the compilation specifics of . to judge whether this is the correct fix.
Issue reproduction:
Clojure user=> (set! *warn-on-reflection* true) true user=> (defprotocol P (-foo [this])) P Reflection warning, REPL:4 - reference to field foo can't be resolved.
CLJ-1202 addresses this exact issue with the same fix and includes tests