This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-25
Channels
- # announcements (21)
- # babashka (7)
- # beginners (27)
- # calva (7)
- # chlorine-clover (3)
- # cider (1)
- # clerk (21)
- # clojure (24)
- # clojure-europe (28)
- # clojure-finland (3)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (2)
- # clojurescript (13)
- # clr (2)
- # conjure (1)
- # consulting (1)
- # datahike (1)
- # datomic (13)
- # fulcro (3)
- # graalvm (33)
- # gratitude (7)
- # honeysql (7)
- # humbleui (12)
- # hyperfiddle (26)
- # interop (11)
- # introduce-yourself (4)
- # jobs-discuss (8)
- # lsp (26)
- # malli (6)
- # nbb (11)
- # polylith (26)
- # practicalli (1)
- # rdf (3)
- # re-frame (7)
- # reitit (10)
- # releases (2)
- # shadow-cljs (1)
- # tools-deps (15)
#interop
<
2023-05-25Hi there, Im trying to remove reflection on a ^bytes
type hinted parameter to a java call. If I type hint the byte-array directly, it works, but if I type hint a (when ..)
to enable a null to be passed in, the reflection cant find the call, and thinks its a java.lang.Object, not a bytes! Any idea what is going on here and how to type hint this correctly?
code that works:
(KeyPair/load
^JSch (references/get-instance agent)
^bytes (utils/decode-base64 private-key-bytes)
^bytes (utils/decode-base64 public-key-bytes))
code that doesn't:
(KeyPair/load
^JSch (references/get-instance agent)
^bytes (when private-key-bytes (utils/decode-base64 private-key-bytes))
^bytes (when public-key-bytes (utils/decode-base64 public-key-bytes)))
results in a call to static method load on com.jcraft.jsch.KeyPair can't be resolved (argument types: com.jcraft.jsch.JSch, java.lang.Object, java.lang.Object).
you might want to pull the expr out into a let
thanks @U064X3EF3