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

0 votes
in ClojureScript by

If the test of an {{if}} has a tag of {{clj-nil}} then the else branch will always be taken so we can replace such code with the else branch.

Likewise if the test of an {{if}} has a tag that cannot yield a falsey value (for example 1. }}), then the then branch will always be taken and we can replace such code with the then branch.

We already have dead code elimination for constants, this ticket asks that we extend it to cases where we can definitely determine a branch will be taken based on inferred types.

1 Answer

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