Skip to content

Commit ac0601c

Browse files
committed
first pass at propagating return type information from externs
1 parent 1f9fad5 commit ac0601c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/clojure/cljs/analyzer.cljc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,13 @@
26312631
:method method
26322632
:args argexprs
26332633
:children children
2634-
:tag tag}))))
2634+
:tag (if (js-tag? tag)
2635+
(let [pre (-> tag meta :prefix)
2636+
[sym _] (find (get-in @env/*compiler*
2637+
(into [::externs] (butlast pre)))
2638+
(last pre))]
2639+
(:ret-tag (meta sym) tag))
2640+
tag)}))))
26352641

26362642
(defmethod parse '.
26372643
[_ env [_ target & [field & member+] :as form] _ _]

0 commit comments

Comments
 (0)