We're updating the issue view to help you get more done. 

Var being replaced warnings with :refer-clojure :rename

Description

If you rename a core Var, you will get a warning if you redefine it. It is as if the :rename doesn't imply :exclude.

Repro with QuickStart JAR:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 $ java -jar cljs.jar -m cljs.repl.node ClojureScript Node.js REPL server listening on 52319 To quit, type: :cljs/quit cljs.user=> (ns foo.core (:refer-clojure :rename {map clj-map})) nil foo.core=> (map inc [1 2]) (2 3) foo.core=> (def map {:a :b}) WARNING: map already refers to: cljs.core/map being replaced by: foo.core/map at line 1 <cljs repl> #'foo.core/map foo.core=> map {:a :b} foo.core=> (clj-map inc [1 2]) (2 3)

Compare to Clojure:

1 2 3 4 5 6 7 8 9 10 11 user=> (ns foo.core (:refer-clojure :rename {map clj-map})) nil foo.core=> (map inc [1 2]) CompilerException java.lang.RuntimeException: Unable to resolve symbol: map in this context, compiling:(/private/var/folders/gx/nymj3l7x4zq3gxb97v2zwzb40000gn/T/form-init8370940485091648461.clj:1:1) foo.core=> (def map {:a :b}) #'foo.core/map foo.core=> map {:a :b} foo.core=> (clj-map inc [1 2]) (2 3)

Note that you cannot workaround this by simply adding an explicit :exclude for map above. While this works with the current ClojureScript compiler, it breaks in Clojure, making the alias symbol clj-map unresolvable.

Environment

None

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Affects versions

1.9.854

Priority

Major