Skip to content

Commit 082c814

Browse files
committed
feat: don't desugar array/n into (. array -n)
1 parent f4cdf07 commit 082c814

File tree

1 file changed

+6
-2
lines changed
  • src/main/clojure/clojure/tools/analyzer

1 file changed

+6
-2
lines changed

src/main/clojure/clojure/tools/analyzer/jvm.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@
126126
(if-let [target (and sym-ns
127127
(not (resolve-ns (symbol sym-ns) env))
128128
(maybe-class-literal sym-ns))] ;; Class/field
129-
(with-meta (list '. target (symbol (str "-" (name form)))) ;; transform to (. Class -field)
130-
(meta form))
129+
(let [opname (name form)]
130+
(if (and (= (count opname) 1)
131+
(Character/isDigit (first opname)))
132+
form ;; Array/<n>
133+
(with-meta (list '. target (symbol (str "-" opname))) ;; transform to (. Class -field)
134+
(meta form))))
131135
form)))
132136

133137
(defn desugar-host-expr [form env]

0 commit comments

Comments
 (0)