Skip to content

Commit 5374a89

Browse files
committed
feat: hook into analyze_host_expr
1 parent f2c6747 commit 5374a89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
(defn analyze-host-expr
143143
"Performing some reflection, transforms :host-interop/:host-call/:host-field
144144
nodes in either: :static-field, :static-call, :instance-call, :instance-field
145-
or :host-interop nodes, and a :var or :maybe-class node in a :const :class node,
146-
if necessary (class literals shadow Vars).
145+
or :host-interop nodes, and a :var/:maybe-class/:maybe-host-form node in a
146+
:const :class node, if necessary (class literals shadow Vars).
147147
148148
A :host-interop node represents either an instance-field or a no-arg instance-method. "
149149
{:pass-info {:walk :post :depends #{}}}
@@ -189,4 +189,10 @@
189189
(assoc (ana/analyze-const the-class env :class) :form form)
190190
ast)
191191

192+
:maybe-host-form
193+
(if-let [the-class (maybe-array-class-sym (symbol (str (:class ast))
194+
(str (:field ast))))]
195+
(assoc (ana/analyze-const the-class env :class) :form form)
196+
ast)
197+
192198
ast))

0 commit comments

Comments
 (0)