Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

If a function has two arity's where one calls the other, then if that function is marked with ^:deprecated, then compile warnings about deprecations will always be emitted while that function exists. E.g.

`
(defn ^:deprecated test-deprecated
([]

(test-deprecated nil))

([a]

nil))

`

produces these logs:

WARNING: my.test/test-deprecated is deprecated. at line 3 src/my/test/error.cljs

I think that only outside references to a deprecated function should warn here. Otherwise, it's impossible to deprecate a multi-arity function and still get clean compiles.

2 Answers

0 votes
by
_Comment made by: mfikes_

A workaround: You can mark call forms with {{^:deprecation-nowarn}} to suppress deprecation warnings.

Applied to the example in this ticket:


(defn ^:deprecated test-deprecated
  ([]
    ^:deprecation-nowarn (test-deprecated nil))
  ([a]
    nil))
0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2000 (reported by desk@danielcompton.net)
...