Fork me on GitHub
#shadow-cljs
<
2023-01-21
>
Sam Ritchie21:01:41

hmm, this seems like a bug…

cljs.user> (sort [1  (js/BigInt. 2)])
Execution error (IllegalArgumentException) at shadow.build.cljs-hacks/eval117228$fn (cljs_hacks.cljc:981).
No matching clause: 

hifumi12300:01:42

js/BigInt isnt a constructor, try removing the dot. This will fail anyway since you can't compare BigInts to regular numbers

hifumi12300:01:25

With shadow-cljs 2.20.20 and node.js 18.12.1:

cljs.user> (sort (vector 1 (js/BigInt 2)))

Execution error (Error) at (<cljs repl>:1).
Cannot compare 2 to 1
:repl/exception!

Sam Ritchie01:01:40

Yeah I was trying for the failure, so I could implement a better compare. It does work as a constructor by the way!

Sam Ritchie01:01:01

I’ve upgraded shadow… what was happening was my repl would break with that error and then never recover. So odd.

Sam Ritchie01:01:07

Thanks for looking at it too!

👍 2