The reflection warning tells you that you need to clarify which write
method is to be called in #(.write wrtr (row-fn %))
. So you'll need to type-hint wrtr
and (row-fn %)
:
#(.write ^java.io.Writer wrtr ^String (row-fn %))
Incidentally, adding type hints to fn
forms or function literals has no effect. (Well, adding primitive hints does make the resulting function implement the relevant clojure.lang.IFn$[OLD]+
interface, but those hints would need to be attached to the parameter vector and/or the individual symbols naming the parameters.)
(In contrast, adding type hints to function names in defn
forms does have the effect of placing :tag
metadata on the resulting Vars; this will be used by the compiler to disambiguate Java method calls.)