This an edge case - that's dead code but the inference is correct. I already landed a fix for this in master. There was no inference for method invokes.
On Tue, Dec 30, 2014 at 7:13 AM, Shaun LeBron <[email protected]> wrote: > Seems to be the simplest case for this warning (run against master branch): > > (when-let [x nil] > (+ x 100)) > > WARNING: cljs.core/+, all arguments must be numbers, got [clj-nil number] > instead. at line 4 src/example/core.cljs > > On Tuesday, December 30, 2014 3:22:04 AM UTC-6, Andrew Mcveigh wrote: >> I'm also seeing this in cljs-time in both "0.0-2411" and "0.0-2511". The >> call to cljs.core// can never be reached with a nil 'millis, but the >> compiler still gives the warning. >> >> WARNING: cljs.core//, all arguments must be numbers, got [#{nil clj-nil} >> number] instead. at line 51 src/cljs_time/coerce.cljs >> >> (defn to-epoch >> "Convert `obj` to Unix epoch." >> [obj] >> (let [millis (to-long obj)] >> (and millis (/ millis 1000)))) >> >> OR >> >> (defn to-epoch >> "Convert `obj` to Unix epoch." >> [obj] >> (when-let [millis (to-long obj)] >> (/ millis 1000))) > > -- > Note that posts from new members are moderated - please be patient with your > first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
