stack overflow when comparing sequence results

Description

Comparing sequences created with sequence causes a stack overflow when used as first argument to =.

Consider this transducer:

1 2 user=> (def map-inc (map inc)) #'user/map-inc

When creating a sequence and comparing with expected results, it works fine as the second argument to the comparison:

1 2 user=> (= (range 1 11) (sequence map-inc (range 10))) true

But a stack overflow occurs when the order of arguments is reversed:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 user=> (= (sequence map-inc (range 10)) (range 1 11)) StackOverflowError clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) user=> (clojure.stacktrace/print-stack-trace *e 10) java.lang.StackOverflowError: null at clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185) clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185) clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185) clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185) clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185) clojure.lang.LazyTransformer.equals (LazyTransformer.java:202) nil

The error persists, even if the sequence is forced with doall:

1 2 3 user=> (= (doall (sequence map-inc (range 10))) (doall (range 1 11))) StackOverflowError clojure.lang.LazyTransformer.equiv (LazyTransformer.java:185)

It does work as expected, however, if the sequence is converted to a vector:

1 2 user=> (= (vec (sequence map-inc (range 10))) (range 1 11)) true

Environment

OS X 10.9.4

Status

Assignee

Unassigned

Reporter

import

Labels

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Release 1.7

Priority

Critical
Configure