Skip to content

Commit

Permalink
feat: don't desugar array/n into (. array -n)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronsa committed Oct 18, 2024
1 parent f4cdf07 commit 082c814
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/clojure/clojure/tools/analyzer/jvm.clj
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@
(if-let [target (and sym-ns
(not (resolve-ns (symbol sym-ns) env))
(maybe-class-literal sym-ns))] ;; Class/field
(with-meta (list '. target (symbol (str "-" (name form)))) ;; transform to (. Class -field)
(meta form))
(let [opname (name form)]
(if (and (= (count opname) 1)
(Character/isDigit (first opname)))
form ;; Array/<n>
(with-meta (list '. target (symbol (str "-" opname))) ;; transform to (. Class -field)
(meta form))))
form)))

(defn desugar-host-expr [form env]
Expand Down

0 comments on commit 082c814

Please sign in to comment.