Completed
Details
Assignee
Mike FikesMike FikesReporter
importimportLabels
Approval
AcceptedPatch
Code and TestAffects versions
Priority
Minor
Details
Details
Assignee
Mike Fikes
Mike FikesReporter
import
importLabels
Approval
Accepted
Patch
Code and Test
Affects versions
Priority
Created July 18, 2018 at 12:59 PM
Updated August 3, 2018 at 7:58 PM
Resolved August 3, 2018 at 7:58 PM
Using a ClojureScript (1.9.946) REPL If I run:
[(true? ((comp not empty?) "foo")) (false? ((comp not empty?) "")) (true? ((not empty?) "foo")) (false? ((not empty?) ""))]
I get the result:
[true true true true]
I would have expected this code to raise an exception. The first two expressions are valid, however the last two expressions don't use
comp
and just applynot
toempty?
, which returnsfalse
Interestingly if I run this code in a Clojure (not a ClojureScript) REPL, I get an error that I would expect:
java.lang.Boolean cannot be cast to clojure.lang.IFn
If I compile this code with the ClojureScript compiler using advanced optimizations then I get a runtime error,
which is more like what I would expect:
Uncaught TypeError: b.call is not a function
So when compiled under non-optimization,
((not empty?) "foo")
seems to produce unexpected results.