(hash (symbol "/")) does not match (hash '/)

Description

(== (hash '/) (hash (symbol "/"))) ; returns false
Obviously we would expect the result to be true.

I believe that (symbol "/") is incorrectly treating the slash as the namespace/name separator.
I think that updating the condition at src/main/cljs/cljs/core.cljs:981 as follows might fix the bug:

(let [idx (.indexOf name "/")]

  • (if (== idx -1)
    + (if (> idx 0)
    (symbol nil name)

Alternatively, since this issue seems to be related to (resolved) in the Clojure compiler, a similar patch would probably also solve this issue:

(let [idx (.indexOf name "/")]

  • (if (== idx -1)
    + (if (or (== idx -1) (= name "/"))
    (symbol nil name)

Environment

None

Assignee

Unassigned

Reporter

Nick Vrvilo

Labels

Approval

None

Patch

Code and Test

Affects versions

Priority

Minor
Configure