ClojureScript

ChunkCons -next doesn't handle nil more

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    {:deps {org.clojure/clojurescript {:mvn/version "1.10.339"}}
  • Patch:
    Code and Test
  • Approval:
    Accepted

Description

Repro:

Evaluate the following in Clojure:

(let [b (chunk-buffer 1)]
 (chunk-append b 0)
 (next (chunk-cons (chunk b) nil)))

and you will get back nil.

In ClojureScript, this will produce an error "No protocol method ISeqable.-seq defined for type null".

The 2nd argument to chunk-cons can be nil, viz: https://github.com/clojure/clojurescript/blob/b1ade48e21f9e7f78d9db74559ce4dd5846d0c94/src/main/clojure/cljs/core.cljc#L2420

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: