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

+3 votes
in Clojure by
retagged by

Reflection warnings, such as for reflective method calls, are printed with the full source path (Compiler/SOURCE_PATH). This is different in case of the warning about loop recur args, printed with the source filename only (Compiler/SOURCE):

(set! *warn-on-reflection* true)

(defn reflective-method-call [] (.substring (try "") 0))

(defn boxed-recur-arg [] (loop [i 0] (recur (try i))))

...which prints:

Reflection warning, /home/pawel/dev/project/src/core.clj:22:33 - call to method substring can't be resolved (target class is unknown).
core.clj:24 recur arg for primitive local: i is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: i

IMHO, the path is useful, especially if the filename is generic and inside a dependency.

1 Answer

+1 vote
by
selected by
...