Bad code gen for `((not empty?) "foo")` when compiled with no optimizations

Description

Using a ClojureScript (1.9.946) REPL If I run:

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 apply not to empty?, which returns false

Interestingly if I run this code in a Clojure (not a ClojureScript) REPL, I get an error that I would expect:

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:

So when compiled under non-optimization, ((not empty?) "foo") seems to produce unexpected results.

Environment

macOS Sierra (10.12.6).
ClojureScript 1.9.946

Assignee

Mike Fikes

Reporter

import

Labels

Approval

Accepted

Patch

Code and Test

Affects versions

Priority

Minor
Configure