Macroexpanded case statement throws `java.lang.NegativeArraySizeException`

Description

The result of the following macroexpansion cannot be evaluated throwing `java.lang.NegativeArraySizeException`

If you remove any of the options in the case above the macroexpansion can be evaluated correctly.

The reason behind this is that `case*` chokes on `clojure.lang.PersistentArrayMap` which `{...}` produces at the REPL. The original type is `clojure.lang.PersistentTreeMap`

The consequence of this is that the macro-expanded lists cannot be freely manipulated in code without checking explicitly for the concrete types of the maps. Particularly, `clojure.walk/walk` will produce un-evaluable results.

Original issue: https://github.com/clojure-emacs/cider/issues/2335

Environment

Java 11.0.2, ubuntu linux

Assignee

Unassigned

Reporter

Vitalie Spinu

Labels

None

Approval

None

Patch

None

Affects versions

Priority

Major
Configure