diff --git a/src/main/clojure/cljs/analyzer.cljc b/src/main/clojure/cljs/analyzer.cljc index c684d7a863..972052bade 100644 --- a/src/main/clojure/cljs/analyzer.cljc +++ b/src/main/clojure/cljs/analyzer.cljc @@ -1570,7 +1570,7 @@ (doall (map #(analyze-fn-method menv locals % type true) meths))) (defn analyze-fn-methods-pass2 [menv locals type meths] - (no-warn (analyze-fn-methods-pass2* menv locals type meths))) + (analyze-fn-methods-pass2* menv locals type meths)) (defmethod parse 'fn* [op env [_ & args :as form] name _] diff --git a/src/test/clojure/cljs/analyzer_tests.clj b/src/test/clojure/cljs/analyzer_tests.clj index cad258e3d0..efdff10fa8 100644 --- a/src/test/clojure/cljs/analyzer_tests.clj +++ b/src/test/clojure/cljs/analyzer_tests.clj @@ -733,6 +733,15 @@ ;; The previous def must be analyzed for subsequent var special to succeed (def ~'x33 (var ~'x32)))])))) +(deftest test-cljs-2139 + (let [ws (atom [])] + (try + (a/with-warning-handlers [(collecting-warning-handler ws)] + (a/analyze (a/empty-env) + '(defn foo [] x))) + (catch Exception _)) + (is (= ["Use of undeclared Var cljs.user/x"] @ws)))) + (comment (binding [a/*cljs-ns* a/*cljs-ns*] (a/no-warn