ClojureScript

Printing PersistentQueueSeq causes StackOverflowError

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

A cljs.core.PersistentQueueSeq is generated correctly, but printing it causes a java.lang.StackOverflowError. This can be verified in the REPL:

(rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3))  ;; prints stack trace

(map #(* % %) (rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3))) ;; => (4 9)

Cause: PersistentQueueSeq does not implement IPrintWithWriter protocol

Solution: Provide an implementation of IPrintWithWriter for PersistentQueueSeq

Patch: CLJS-800.patch

Activity

Hide
Chad Taylor added a comment -

Added patch with test and code.

Show
Chad Taylor added a comment - Added patch with test and code.
Chad Taylor made changes -
Field Original Value New Value
Attachment CLJS-800.patch [ 12949 ]
Chad Taylor made changes -
Patch Code and Test [ 10002 ]
Description A cljs.core.PersistentQueueSeq is generated correctly, but printing it causes a java.lang.StackOverflowError. This can be verified in the REPL:

{code}
(rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3)) ;; prints stack trace

(map #(* % %) (rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3))) ;; => (4 9)
{code}

*Cause:* PersistentQueueSeq does not implement IPrintWithWriter protocol

*Solution:* Provide an implementation of IPrintWithWriter for PersistentQueueSeq
A cljs.core.PersistentQueueSeq is generated correctly, but printing it causes a java.lang.StackOverflowError. This can be verified in the REPL:

{code}
(rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3)) ;; prints stack trace

(map #(* % %) (rest (conj cljs.core.PersistentQueue.EMPTY 1 2 3))) ;; => (4 9)
{code}

*Cause:* PersistentQueueSeq does not implement IPrintWithWriter protocol

*Solution:* Provide an implementation of IPrintWithWriter for PersistentQueueSeq

*Patch:* CLJS-800.patch
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: