https://github.com/technomancy/leiningen/blob/4d8ee78018158c05d69b250e7851f9d7c3a44fac/leiningen-core/src/leiningen/core/eval.clj#L369-L370 uses set!
. Seems to work in my REPL.
I happen to know there's reflection in bidi, so example of doing this:
~ 1m 18s
❯ clj -Sdeps '{:deps {bidi/bidi {:mvn/version "2.1.6"}}}' -M -e '(set! *warn-on-reflection* true)' -r
true
user=> (require 'bidi.bidi)
Reflection warning, bidi/bidi.cljc:20:31 - call to static method decode on java.net.URLDecoder can't be resolved (argument types: java.lang.String, unknown).
nil
user=>
ok, I think:
$ clj -M -e "(set! *warn-on-reflection* true)" -e '(fn [x] (.length x))'
true
Reflection warning, NO_SOURCE_PATH:1:9 - reference to field length can't be resolved.
#object[user$eval138$fn__139 0x73eb8672 "user$eval138$fn__139@73eb8672"]
will do fine then. As long as you do the set!
before any other namespaces are loadedconfirmed:
$ clj -M -e "(set! *warn-on-reflection* true)" -e "(require 'asami.core)"
true
Reflection warning, asami/graph.cljc:43:58 - reference to field id on java.lang.Object can't be resolved.
Reflection warning, asami/graph.cljc:68:21 - reference to field id can't be resolved.
Reflection warning, zuko/logging.clj:14:36 - reference to field getClassName can't be resolved.
Reflection warning, zuko/logging.clj:13:30 - reference to field getStackTrace can't be resolved.
Reflection warning, zuko/logging.clj:78:5 - call to method append on java.io.Writer can't be resolved (argument types: unknown).
planner.cljc:107 recur arg for primitive local: mcount is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: mcount
Reflection warning, asami/durable/block/file/voodoo.clj:18:14 - reference to field clean on java.lang.Object can't be resolved.
$ ./asami
(["Explorers"] ["Demolition Man"] ["Johnny Mnemonic"] ["Toy Story"])
yes, works fine