Subject: bug#51368: 29.0.50; `cl-case' should error on incorrect use

From: Mattias Engdegård <[email-masked]>
Date: Sun, 3 Sep 2023 15:40:03 +0200

>      (cl-case EXP
>        ((a b) FOO)
>        ((a c) BAR))
> 
>  won't warn about the duplicate `a`.

I was curious how common this could be so I locally added a warning to the back-end in bytecomp that generates switches (attached), and bootstrapped Emacs. Results:

----------------
In gnus-cloud-decode-data:
lisp/gnus/gnus-cloud.el:154:6: Warning: Duplicated value in ‘cond’: base64-gzip

In netrc-parse:
lisp/obsolete/netrc.el:106:22: Warning: Duplicated value in ‘cond’: "macdef"

In org-read-date-analyze:
lisp/org/org.el:14041:15: Warning: Duplicated value in ‘cond’: ""

In org-html-latex-fragment:
lisp/org/ox-html.el:3099:8: Warning: Duplicated value in ‘cond’: t
-----------------

None of these are from `cl-case`. (`pcase` doesn't typically warn either but just drops the duplicate silently.)

I probably won't keep the warning because it's in the back-end and was very much a hack.