When a non-empty queue is evaluated, the compiler does not attempt to execute it (as it would a Seq), but it is seen as a PersistentList and therefore sent to clojure.lang.Compiler/emitListAsObjectArray. This is an error, since a queue is not a list.
=> (eval (conj clojure.lang.PersistentQueue/EMPTY 1))
Syntax error (ClassCastException) compiling fn* at (REPL:1:1).
class clojure.lang.PersistentQueue cannot be cast to class java.util.List (clojure.lang.PersistentQueue is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
The stack trace is:
`
Syntax error compiling fn* at (1:1).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7119)
at clojure.lang.Compiler.analyze(Compiler.java:6793)
at clojure.lang.Compiler.eval(Compiler.java:7178)
at clojure.lang.Compiler.eval(Compiler.java:7136)
at clojure.core$eval.invokeStatic(core.clj:3202)
at clojure.core$eval.invoke(core.clj:3198)
at user$eval242.invokeStatic(NO_SOURCE_FILE:1)
at user$eval242.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:7181)
at clojure.lang.Compiler.eval(Compiler.java:7136)
at clojure.core$eval.invokeStatic(core.clj:3202)
at clojure.core$eval.invoke(core.clj:3198)
at clojure.main$repl$read_eval_print__9110$fn__9113.invoke(main.clj:437)
at clojure.main$repl$read_eval_print__9110.invoke(main.clj:437)
at clojure.main$repl$fn__9119.invoke(main.clj:458)
at clojure.main$repl.invokeStatic(main.clj:458)
at clojure.main$repl_opt.invokeStatic(main.clj:522)
at clojure.main$main.invokeStatic(main.clj:667)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Caused by: java.lang.ClassCastException: class clojure.lang.PersistentQueue cannot be cast to class java.util.List (clojure.lang.PersistentQueue is in unnamed module of loader "app";
java.util.List is in module java.base of loader "bootstrap")
at clojure.lang.Compiler$ObjExpr.emitListAsObjectArray(Compiler.java:4701)
at clojure.lang.Compiler$ObjExpr.emitValue(Compiler.java:4874)
at clojure.lang.Compiler$ObjExpr.emitConstants(Compiler.java:4938)
at clojure.lang.Compiler$ObjExpr.compile(Compiler.java:4616)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4110)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7109)
... 23 more`