Calling .hashCode on a an instance of clojure.lang.LazyTransformer causes a StackOverflowError:
The trace is
Relevant lines:
Cause: Looks like "seq" returns "this":
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazyTransformer.java#L55
This does NOT occur on an empty sequence, as clojure.core/sequence short-circuits.
Proposal: compute and cache hash and hasheq using same algorithm used in other seqs
Patch: CLJ-1600-2.patch
Screened by: Alex Miller
OS X 10.10.1, Macbook Pro,, Java 1.8.0_11, Clojure 1.7.0-alpha4
Patch with hashcode calculation and caching similar to ASeq. Might be worthwhile hoisting that into its own hashSeq method.
What's here looks good. Can we hook into existing tests that verify equals/hashcode and equiv/hasheq equivalence?
Test case added. Verified case was failing with SO prior to patch.