When a .cljc file has separate per-platform :refer-clojure forms wrapped in #?, the formatter merges them into a single :refer-clojure with #?@ splicing inside :exclude. This breaks compilation because #?@ splices the vector contents, so :exclude receives bare symbols instead of a vector.
Minimal reproduction
Create repro.cljc:
(ns repro
#?(:cljs (:refer-clojure :exclude [juxt])
:clj (:refer-clojure :exclude [juxt format])))
Run fix:
$ standard-clj fix repro.cljc
standard-clj fix v0.27.0
F /repro.cljc [2.94ms]
1 file formatted with Standard Clojure Style 👍 [9.27ms]
Result in repro.cljc:
(ns repro
(:refer-clojure
:exclude #?@(:clj [format juxt]
:cljs [juxt])))
Fails to compile:
$ clojure -M -e '(load-file "repro.cljc")'
Syntax error macroexpanding clojure.core/ns at (repro.cljc:1:1).
((:refer-clojure :exclude format juxt)) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
#?@ splices the vector contents, so Clojure sees :exclude format juxt instead of :exclude [format juxt].
Expected behavior
Either leave the two separate #?-wrapped :refer-clojure forms as-is, or use #? (without @) to preserve the vector: :exclude #?(:clj [format juxt] :cljs [juxt]).
Version
$ standard-clj --version
v0.27.0 [dc54207]
When a
.cljcfile has separate per-platform:refer-clojureforms wrapped in#?, the formatter merges them into a single:refer-clojurewith#?@splicing inside:exclude. This breaks compilation because#?@splices the vector contents, so:excludereceives bare symbols instead of a vector.Minimal reproduction
Create
repro.cljc:Run fix:
Result in
repro.cljc:Fails to compile:
#?@splices the vector contents, so Clojure sees:exclude format juxtinstead of:exclude [format juxt].Expected behavior
Either leave the two separate
#?-wrapped:refer-clojureforms as-is, or use#?(without@) to preserve the vector::exclude #?(:clj [format juxt] :cljs [juxt]).Version