ClojureScript

#{x y} can produce set with duplicates

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

(def x 1)
(def y 1)
#{x y}
;= #{1 1}

This is because cljs.core.PersistentHashSet/fromArray does not check for duplicates. Clojure performs the check and throws an exception in the presence of duplicates; I'll replicate this behaviour in the forthcoming patch.

Activity

Michał Marczyk made changes -
Field Original Value New Value
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12228 ]
Michał Marczyk made changes -
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12229 ]
Michał Marczyk made changes -
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12228 ]
Michał Marczyk made changes -
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12229 ]
Michał Marczyk made changes -
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12230 ]
Michał Marczyk made changes -
Attachment 0001-CLJS-583-throw-on-duplicates-in-set-literals.patch [ 12230 ]
Michał Marczyk made changes -
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 (1)

Dates

  • Created:
    Updated:
    Resolved: