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

0 votes
in ClojureScript by
Trying to build doc on the fly:



cljs.user=> (defn tt {:doc (str "A" "B")} [])
cljs.user=> java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.CharSequence
    at clojure.string$split.invokeStatic(string.clj:219)
    at clojure.string$split_lines.invokeStatic(string.clj:228)
    at cljs.compiler$emit_comment$print_comment_lines__3266.invoke(compiler.cljc:625)
    at cljs.compiler$emit_comment.invokeStatic(compiler.cljc:639)
    at cljs.compiler$fn__3297.invokeStatic(compiler.cljc:665)
    at cljs.compiler$fn__3297.invoke(compiler.cljc:659)
    at clojure.lang.MultiFn.invoke(MultiFn.java:229)
    at cljs.compiler$emit.invokeStatic(compiler.cljc:198)
...



Setting other attributes doesn't evaluate the code:


cljs.user=> (defn tt {:ddd (str "A" "B")} [])
cljs.user=> #'cljs.user/tt
cljs.user=> (:ddd (meta #'tt))
cljs.user=> (str "A" "B")
cljs.user=>

1 Answer

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