We're updating the issue view to help you get more done. 

Sorted colls with default comparator don't check that first element is Comparable

Description

Like but for ClojureScript.

Repro, with ClojureScript:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $ clj -m cljs.main ClojureScript 1.10.339 cljs.user=> (def s (sorted-set #{1})) #'cljs.user/s cljs.user=> (conj s #{2}) Error: Cannot compare #{2} to #{1} cljs$core$compare (cljs/core.cljs:2380:13) cljs.core/tree-map-add (cljs/core.cljs:28176:3) cljs$core$IAssociative$_assoc$arity$3 (cljs/core.cljs:8734:18) cljs.core/-assoc (cljs/core.cljs:630:17) cljs$core$IFn$_invoke$arity$3 (cljs/core.cljs:1968:8) cljs$core$ICollection$_conj$arity$2 (cljs/core.cljs:9231:31) cljs.core/-conj (cljs/core.cljs:583:16) cljs$core$IFn$_invoke$arity$2 (cljs/core.cljs:1781:8) cljs$core$conj (cljs/core.cljs:1773:1)

If feasible, this ticket asks that ClojureScript be made to align with the solution in (in particular, with making code like (sorted-set #{1}) fail fast.)

Environment

{:deps {org.clojure/clojurescript {:mvn/version "1.10.339"}}}

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major