-
Notifications
You must be signed in to change notification settings - Fork 64
Bad arg-type error shown (but ignored) for Files/write invocation #355
Copy link
Copy link
Closed
Description
Perhaps the code below is incorrect somehow, but if not, I see an error like this
Error: Bad arg-type nil for method named write for class java.nio.file.Files, full arg type li
st (java.lang.Object, [B, nil). ast pprinted below for debugging tools.analyzer:
{:op :static-call,
:children [:args],
:eastwood/path [3 :init :expr :methods 0 :body :ret :statements 0],
:tag java.nio.file.Path,
:form
^{:line 17}
when running eastwood on this code:
(ns eastwood-error.core
(:gen-class)
(:import
(java.nio.file Files OpenOption)))
(defmacro ignore-value
"Suppress eastwood's unused-ret-vals warning:
https://github.com/jonase/eastwood#unused-ret-vals. See
./eastwood.clj for the suppression that makes this work."
[x]
`(do ~x nil))
(defn crash? [path item]
(ignore-value
(Files/write path (byte-array 10) (into-array OpenOption []))))and it's presence doesn't seem to matter, bu the ./eastwood.clj suppression was:
(disable-warning
{:linter :unused-ret-vals
:if-inside-macroexpansion-of #{'some.where/ignore-value}
:within-depth 2
:reason "ignore-value is intended to suppress this linter."})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels