top-level boolean inference does not work

Description

Problem for using boolean Closure defines

Environment

None

Activity

Show:

David Nolen February 25, 2022 at 4:15 PM

Fixed

Mike Fikes November 21, 2017 at 1:20 AM

It appears this is no longer reproducible:

$ java -jar cljs.jar -m cljs.repl.node ClojureScript Node.js REPL server listening on 51236 To quit, type: :cljs/quit cljs.user=> *clojurescript-version* "1.9.946" cljs.user=> (set! *print-fn-bodies* true) true cljs.user=> (fn [n] (if ^boolean (js/isFinite n) 1 2)) #object[ret__6224__auto__ "function (n){ if(isFinite(n)){ return (1); } else { return (2); } }"] cljs.user=> (fn [n] (if (js/isFinite n) 1 2)) #object[ret__6224__auto__ "function (n){ if(cljs.core.truth_(isFinite(n))){ return (1); } else { return (2); } }"]

Francis Avila March 30, 2015 at 6:02 PM

I am unsure if this is the same issue, but forms like ^boolean (js/isFinite n) also do not seem to analyze correctly: if, and, and or will still emit a call to truth_.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created February 28, 2015 at 6:16 PM
Updated February 25, 2022 at 4:15 PM
Resolved February 25, 2022 at 4:15 PM

Flag notifications