torstai, 11. joulukuuta 2014 15.06.51 UTC+2 David Nolen kirjoitti:
> I'd like to see specific cases where it does not work as expected. You
> can suppress this warning like anything other warning.
>
> The warning flag is :invalid-arithmetic.
>
> David
>
> On Thu, Dec 11, 2014 at 7:32 AM, Peter Taoussanis <[email protected]>
> wrote:
> > Hi all,
> >
> > Have been seeing `:invalid-arithmetic` compiler warnings recently of the
> > form "WARNING: cljs.core/<=, all arguments must be numbers, got [number
> > #{nil clj-nil}]", etc.
> >
> > This is a handy idea, but it seems the type inference (?) that's going on
> > still has some kinks to work out (?) since I seem to be seeing a
> > significant number of false positives. Has no one else noticed this?
> >
> > In any case, is there any way of turning these warnings off?
> >
> > I don't particularly mind about the warnings myself, but I've got library
> > code that's generating spurious warnings for lib consumers.
> >
> > Thanks a lot, cheers! :-)
> >
> > --
> > 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.
I'm seeing this:
WARNING: cljs.core/>=, all arguments must be numbers, got [#{nil clj-nil}
number] instead. at line 59
file:/Users/kimmoko/.m2/repository/prismatic/dommy/1.0.0/dommy-1.0.0.jar!/dommy/core.cljs
Line 59 from core.cljs is the body of when-let:
(when-let [i (utils/class-index class-name c)]
(>= i 0))))))
utils/class-index is like this:
(defn class-index
"Finds the index of class in a space-delimited class-name
only will be used when Element::classList doesn't exist"
[class-name class]
(loop [start-from 0]
(let [i (.indexOf class-name class start-from)]
(when (>= i 0)
(if (class-match? class-name class i)
i
(recur (+ i (.-length class))))))))
If I read correctly, class-index can return nil. But this is wrapped in
(when-let) in core.cljs. So it seems like a false positive.
--
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.