Skip to content

Commit 123643b

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-2023: User supplied type hints stopped working on js/goog.DEBUG
1 parent 957cb87 commit 123643b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@
854854
(merge
855855
{:name sym
856856
:ns 'js
857-
:tag (with-meta (or (js-tag pre) 'js) {:prefix pre})}
857+
:tag (with-meta (or (js-tag pre) (:tag (meta sym)) 'js) {:prefix pre})}
858858
(when-let [ret-tag (js-tag pre :ret-tag)]
859859
{:js-fn-var true
860860
:ret-tag ret-tag}))))

src/test/clojure/cljs/analyzer_tests.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@
694694
z)))))
695695
:tag meta :prefix))))
696696

697+
(deftest test-cljs-2023
698+
(let [form (with-meta 'js/goog.DEBUG {:tag 'boolean})]
699+
(is (= (-> (ana-api/analyze (a/empty-env) form) :tag) 'boolean))))
700+
697701
(comment
698702
(binding [a/*cljs-ns* a/*cljs-ns*]
699703
(a/no-warn

0 commit comments

Comments
 (0)