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

0 votes
in ClojureScript by

Currently {{seq}} and {{boolean}} tags are considered "safe" for elimination of checked {{if}}.

Consider this code:

`
(defn foo [x] (if x true nil))

(defn bar [x] (if (foo x) 1 2))
`

In this case {{foo}} is inferred as 1. }}, but {{bar}} will involve a call to {{cljs.core.truth_}}. It is safe to eliminate the checked if in this case as {{clj-nil}} will be interpreted by JavaScript correctly as {{false}}.

Note: CLJS-2869 has some utility code that makes this ticket easier to implement.

1 Answer

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