*warn-on-infer*

varsince v1.9.456Edit

For interop purposes, this is used in conjunction with the compiler option :infer-externs to emit a warning whenever a symbol is in danger of being renamed in advanced :optimizations (i.e. compiler cannot infer an extern). Defaults to false. When set to true, warnings are activated for the rest of the file thereafter.

(set! *warn-on-infer* true)

(defn wrap-baz [x] (.baz x))
;; WARNING: Cannot infer target type in expression (. x baz)

(defn wrap-baz [^js/Foo.Bar x] (.baz x))
;; no more warning after x is annotated

Details:

See externs inference for full details.

Somewhat analogous to *warn-on-reflection* in Clojure.


See Also:


Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(def *warn-on-infer* false)