Hi,
I noticed some reflection warning that goes away when removing a hint from fn arguments. I would like to understand the reason for this.
Example, loading this code
(set! *warn-on-reflection* true)
(defn duration-of-seconds
(^java.time.Duration [^long seconds]
(java.time.Duration/ofSeconds seconds)))
(defn sleep
[seconds]
(Thread/sleep (duration-of-seconds seconds)))
Raises a reflection warning:
call to static method sleep on java.lang.Thread can't be resolved (argument types: java.lang.Object).
However, just removing the ^long hint from the duration-of-seconds fn argument, makes the reflection warning go away.
Thanks!