Fork me on GitHub
#clj-kondo
<
2023-09-24
>
ingesol05:09:06

I’m seeing a warning on some code that mutates in place and returns the value after. I can just ignore it, just wanted to ask if this is expected and wanted.

clj-kondo --lint - <<< "(let [res (transient [])] (conj! res 1) res)"
<stdin>:1:27: warning: Unused value
linting took 22ms, errors: 0, warnings: 1

borkdude05:09:33

yes, this is a very desirable warning since transient operation results should be used, if not, weird things can happen since a transient op can return a different object than you had originally

ingesol06:09:56

Wow, thanks that’s very interesting 🙂

borkdude10:09:33

Thanks for providing that link