From: Andrea Corallo Date: Sat, 26 Dec 2020 12:09:24 +0000 (+0100) Subject: Fix missing float handling into `comp-cstr-set-cmp-range' X-Git-Tag: emacs-28.0.90~2727^2~214 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8939520535224ccee663bba5b3da752f1648009;p=emacs.git Fix missing float handling into `comp-cstr-set-cmp-range' * lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range): Add float handling. * test/src/comp-tests.el (comp-tests-type-spec-tests): Update results. --- diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 9d0c67177b2..1927207db63 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -366,7 +366,7 @@ Return them as multiple value." "Support range comparison functions." (with-comp-cstr-accessors (if ext-range - (setf (typeset dst) () + (setf (typeset dst) (and (typeset old-dst) '(float)) (valset dst) () (range dst) (if (range old-dst) (comp-range-intersection (range old-dst) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index e1c13598ad6..446c30666f0 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -953,84 +953,84 @@ Return a list of results." ((defun comp-tests-ret-type-spec-f (x) (when (> x 3) x)) - (or null (integer 4 *))) + (or null float (integer 4 *))) ;; 23 ((defun comp-tests-ret-type-spec-f (x) (when (>= x 3) x)) - (or null (integer 3 *))) + (or null float (integer 3 *))) ;; 24 ((defun comp-tests-ret-type-spec-f (x) (when (< x 3) x)) - (or null (integer * 2))) + (or null float (integer * 2))) ;; 25 ((defun comp-tests-ret-type-spec-f (x) (when (<= x 3) x)) - (or null (integer * 3))) + (or null float (integer * 3))) ;; 26 ((defun comp-tests-ret-type-spec-f (x) (when (> 3 x) x)) - (or null (integer * 2))) + (or null float (integer * 2))) ;; 27 ((defun comp-tests-ret-type-spec-f (x) (when (>= 3 x) x)) - (or null (integer * 3))) + (or null float (integer * 3))) ;; 28 ((defun comp-tests-ret-type-spec-f (x) (when (< 3 x) x)) - (or null (integer 4 *))) + (or null float (integer 4 *))) ;; 29 ((defun comp-tests-ret-type-spec-f (x) (when (<= 3 x) x)) - (or null (integer 3 *))) + (or null float (integer 3 *))) ;; 30 ((defun comp-tests-ret-type-spec-f (x) (let ((y 3)) (when (> x y) x))) - (or null (integer 4 *))) + (or null float (integer 4 *))) ;; 31 ((defun comp-tests-ret-type-spec-f (x) (let ((y 3)) (when (> y x) x))) - (or null (integer * 2))) + (or null float (integer * 2))) ;; 32 ((defun comp-tests-ret-type-spec-f (x) (when (and (> x 3) (< x 10)) x)) - (or null (integer 4 9))) + (or null float (integer 4 9))) ;; 33 ((defun comp-tests-ret-type-spec-f (x) (when (or (> x 3) (< x 10)) x)) - (or null integer)) + (or null float integer)) ;; 34 ((defun comp-tests-ret-type-spec-f (x) (when (or (< x 3) (> x 10)) x)) - (or null (integer * 2) (integer 11 *))) + (or null float (integer * 2) (integer 11 *))) ;; 35 No float range support. ((defun comp-tests-ret-type-spec-f (x)