The following code triggers an arithmetic warning even though the condition it's warning about is impossible to reach. I tested this code in Clojure and it did not generate a warning. I would guess that the CLJS compiler doesn't take note of the (js/Error) in the same way that the Clojure compiler treats (Error.)
The exact warning triggered is below, followed by the code.
WARNING: cljs.core/+, all arguments must be numbers, got [number clj-nil] instead. at line 22 src\spurious_arithmetic\core.cljs
(def x [0 1 2 3 4 nil])
(def index (atom -1))
(defn take-value []
(->> (swap! index inc)
(nth x)))
(-> (loop [result (take-value)
prev nil]
(if (= nil result prev) (throw (js/Error. "This condition prevents nil arithmetic.")))
(if (some? result)
(recur (take-value) result)
(+ 1 prev))) ; this triggers the [number cljs-nil] warning
(print)) ; 5