Affects Version/s: Release 1.8
Fix Version/s: None
Patch:Code and Test
It is not possible to use case with a single empty seq of options, or with a single seq of options and a default clause.
I would expect
(case 1 () :a :none)
to return :none, instead it fails with an uninformative exception: "Unhandled clojure.lang.ArityException: Wrong number of args (-2) passed to: core/max"
I would expect (case 1 () :a) to fail with "java.lang.IllegalArgumentException: No matching clause", but instead it also fails with
"Unhandled clojure.lang.ArityException: Wrong number of args (-2) passed to: core/max"
This seems inconsistent, as passing an empty list of options is fine when there are other alternatives:
(case 1 () :a 2 :b :none)
returns :none, as expected
The attached patch removes the test-clause pairs with empty test lists before further conversion to case*, and adds tests.