So I have this code
(defn- nanos->ms [elapsed-time]
(double (/ elapsed-time 1000000)))
Even with (set! *warn-on-reflection* true)
this compiles nicely.
But when I use tools.namespace.repl/refresh
I get reflection warnings :
Reflection warning: file:....metrics.clj:6:3 - call to static method doubleCast on clojure.lang.RT cannot be resolved
My hypothesis is that I'm hitting the inlined version of double
and that that is not type-hinted.
Would this be correct, and if so, how do I remove this reflection warning?
(defn double
"Coerce to double"
{:inline (fn [x] `(. clojure.lang.RT (doubleCast ~x)))
:added "1.0"}
[^Number x] (clojure.lang.RT/doubleCast x))