Skip to content

Commit

Permalink
CLJS-3163: Skip analyzing specials in type-check-induced-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mfikes committed Oct 3, 2019
1 parent 9158e59 commit d79eda3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/clojure/cljs/analyzer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1600,14 +1600,17 @@
(get-in env [:locals sym]))
[sym tag])))))))

(declare specials)

(defn- type-check-induced-tag
"Look for a type-check-induced tag when the test expression is the use of
instance? on a local, as in (instance? UUID x) or implements? on a local, as
in (implements? ICounted x)."
[env test]
(when (and (list? test)
(== 3 (count test))
(every? symbol? test))
(every? symbol? test)
(not (contains? specials (first test))))
(let [analyzed-fn (no-warn (analyze (assoc env :context :expr) (first test)))]
(when (= :var (:op analyzed-fn))
(when ('#{cljs.core/instance? cljs.core/implements?} (:name analyzed-fn))
Expand Down

0 comments on commit d79eda3

Please sign in to comment.