From d77bc7164bbcd565b794cbb321d567082d58d269 Mon Sep 17 00:00:00 2001 From: dnolen Date: Fri, 12 Aug 2016 15:27:14 -0400 Subject: [PATCH] CLJS-1733: Macro inference issue for macros & runtime vars with the same name :rename pass must also check that found renames may also be macros --- src/main/clojure/cljs/analyzer.cljc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/clojure/cljs/analyzer.cljc b/src/main/clojure/cljs/analyzer.cljc index 4ba357185e..592da80aa4 100644 --- a/src/main/clojure/cljs/analyzer.cljc +++ b/src/main/clojure/cljs/analyzer.cljc @@ -1824,11 +1824,15 @@ (defn check-rename-macros-inferring-missing [{:keys [name renames] :as ast} env] (let [missing-renames (when (and *analyze-deps* (seq renames)) - (missing-renames (:renames ast) env)) + (missing-renames renames env)) + maybe-macros (apply dissoc renames (keys missing-renames)) missing-rename-macros (inferred-rename-macros missing-renames env) remove-missing-renames #(apply dissoc % (keys missing-renames)) ast' (-> ast - (update-in [:rename-macros] merge missing-rename-macros) + (update-in [:rename-macros] + #(-> % + (merge missing-rename-macros) + (merge (inferred-rename-macros maybe-macros env)))) (update-in [:renames] remove-missing-renames))] (swap! env/*compiler* #(-> %