Subject: Re: Fwd: cl-typecase broken (was 25.0.50; ert explainer for equal can't handle negative numbers)
From: Stefan Monnier <[email-masked]>
To: Anders Lindgren <[email-masked]>
Cc: [email-masked]
Date: Fri, 04 Dec 2015 08:30:47 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

> I just realised that the underlying problem is a change to `cl-typecase'.
> It treats -50 as a character.
>
> (cl-typecase -50
>   (character "A character")
>   (fixnum "A fixnum")
>   (t "Something else"))
>
> Emacs 25 returns "A character" and emacs 24 "A fixnum".

I installed the patch below which should fix this.

        Stefan

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 09d2d3f..c8aad3a 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2885,7 +2885,7 @@ cl--macroexp-fboundp
 (put 'real 'cl-deftype-satisfies #'numberp)
 (put 'fixnum 'cl-deftype-satisfies #'integerp)
 (put 'base-char 'cl-deftype-satisfies #'characterp)
-(put 'character 'cl-deftype-satisfies #'integerp)
+(put 'character 'cl-deftype-satisfies #'natnump)

 ;;;###autoload