Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
Observe the warning triggered here:

$ clj -m cljs.main -co '{:infer-externs true}' -r
ClojureScript 1.10.339
cljs.user=> (defn foo? [x y] (< x (or y (.-MAX_VALUE js/Number))))
WARNING: cljs.core/<, all arguments must be numbers, got [nil #{nil js/Number}] instead at line 1 <cljs repl>

This warning doesn't appear if you don't enable {{:infer-externs}} (in which case {{(.-MAX_VALUE js/Number)}} inferred to be of type {{js}}).

1 Answer

0 votes
Reference: https://clojure.atlassian.net/browse/CLJS-2954 (reported by mfikes)