How do you use (Class/forName) for a Java String array?
When I try to use (Class/forName "[Ljava.lang.String;") I get the following error:
error: Function name must be simple symbol but got: "[Ljava.lang.String;"
Or I should simply use? java.lang.String/1?
if you're using 1.12 already, then java.lang.String/1 is preferable, I think
Isn’t this a false error, though?
yes, looks like
user=> (Class/forName "[Ljava.lang.String;")
java.lang.String/1
seems to work fine (EDIT: homerdisappear )Yes, it does work fine, but clj-kondo throws a warning
clj-kondo is correct since the Class/forName hack only works by accident, but luckily we have clojure 1.12 now
error message could be a little clearer though
Yeah, that could have helped
The title reflects that:
(proposal: say that it must be a simple symbol)
so I'll move this to a higher priorityor wait, it shouldn't be a simple symbol, in this case
whatever, I'll make a note
that's not a hack that works by accident, that's how Class/forName works
in extend-protocol calls?
oh, I missed that context at top
I think symbol is certainly now preferred there
PR is up: https://github.com/clj-kondo/clj-kondo/pull/2471
You are a beast, @borkdude!