From 5374a891f0c482afd06a8341eb5d3ed09233ef4f Mon Sep 17 00:00:00 2001 From: Nicola Mometto Date: Fri, 18 Oct 2024 14:25:36 +0100 Subject: [PATCH] feat: hook into analyze_host_expr --- .../tools/analyzer/passes/jvm/analyze_host_expr.clj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/clojure/clojure/tools/analyzer/passes/jvm/analyze_host_expr.clj b/src/main/clojure/clojure/tools/analyzer/passes/jvm/analyze_host_expr.clj index 5391ae8..edc566a 100644 --- a/src/main/clojure/clojure/tools/analyzer/passes/jvm/analyze_host_expr.clj +++ b/src/main/clojure/clojure/tools/analyzer/passes/jvm/analyze_host_expr.clj @@ -142,8 +142,8 @@ (defn analyze-host-expr "Performing some reflection, transforms :host-interop/:host-call/:host-field nodes in either: :static-field, :static-call, :instance-call, :instance-field - or :host-interop nodes, and a :var or :maybe-class node in a :const :class node, - if necessary (class literals shadow Vars). + or :host-interop nodes, and a :var/:maybe-class/:maybe-host-form node in a + :const :class node, if necessary (class literals shadow Vars). A :host-interop node represents either an instance-field or a no-arg instance-method. " {:pass-info {:walk :post :depends #{}}} @@ -189,4 +189,10 @@ (assoc (ana/analyze-const the-class env :class) :form form) ast) + :maybe-host-form + (if-let [the-class (maybe-array-class-sym (symbol (str (:class ast)) + (str (:field ast))))] + (assoc (ana/analyze-const the-class env :class) :form form) + ast) + ast))