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

Incorrect hash when conj-ing onto the value returned by filter/remove etc

Description

The following code produces the correct result in Clojure but incorrect results in ClojureScript:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (let [log (fn [xs] (prn (hash xs) (count xs)) xs)] (-> [] (conj 1) (conj 2) log (->> (remove #{1})) log (->> (remove #{2})) log (conj 3) log (conj 4) log (conj 5) log))

Clojure produces the following output:

1 2 3 4 5 6 156247261 2 829981563 1 -2017569654 0 -1154116787 1 -733651870 2 1036804101 3

ClojureScript produces the following output:

1 2 3 4 5 6 1185709346 2 -1917711765 1 -2017569654 0 -1025653387 1 -1025653387 2 -1025653387 3

I expect the hash code to change as I conj items onto the list. Instead, the hash code stays the same even though we can se that the result of "count" changes.

At the time of writing, I host a leiningen project on my github user that contains the exact setup and a README for how I run the code:

https://github.com/augustl/cljs-issue-filter-conj-hashcode

Environment

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Status

Assignee

Unassigned

Reporter

import

Labels

None

Approval

None

Patch

None

Affects versions

1.7.145

Priority

Major