Skip to content

Commit f463185

Browse files
committed
CLJS-3244: Warnings for clojure.browser.net with :static-fns true
In :invoke emission of the compiler we were resolving the tag to check to see if the type implements a protocol. But this could easily be a type we can't possibly know about - i.e. Google Closure Library ctor, foreign library ctor, etc. Explicit type-hinting is not idiomatic over predicate driven optimization, so just suppress any warnings.
1 parent 610ae65 commit f463185

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/clojure/cljs/compiler.cljc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,11 @@
11411141
;; ignore new type hints for now - David
11421142
(and (not (set? tag))
11431143
(not ('#{any clj clj-or-nil clj-nil number string boolean function object array js} tag))
1144-
(when-let [ps (:protocols (ana/resolve-existing-var env tag))]
1144+
(when-let [ps (:protocols
1145+
(ana/resolve-existing-var env
1146+
;; we're just checking for protocol methods,
1147+
;; an internal optimization, don't emit warnings
1148+
(vary-meta tag assoc ::ana/no-resolve true)))]
11451149
(ps protocol)))))))
11461150
first-arg-tag (ana/infer-tag env (first (:args expr)))
11471151
opt-not? (and (= (:name info) 'cljs.core/not)

0 commit comments

Comments
 (0)