1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 22:41:06 -08:00

Couple of `comp-cstr-union-1-no-mem' improvements for mixed neg pos union

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem):
	Generalize disjoint pos types vs neg values conditions.
	(comp-cstr-union-1-no-mem): Do not propagate ranges when we are
	already returning integer as generic type.
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add corresponding tests.
This commit is contained in:
Andrea Corallo 2020-12-05 23:42:25 +01:00
parent 09ec39e352
commit ac40a60696
2 changed files with 28 additions and 11 deletions

View file

@ -81,7 +81,7 @@
((not symbol) . (not symbol))
((or (member foo) (not (member foo bar))) . (not (member bar)))
((or (member foo bar) (not (member foo))) . t)
;; Intentionally conservative, see `comp-cstr-union'.
;; Intentionally conservative, see `comp-cstr-union-1-no-mem'.
((or symbol (not sequence)) . t)
((or symbol (not symbol)) . t)
;; Conservative.
@ -98,7 +98,10 @@
((or (member foo) (not string)) . (not string))
((or (not (integer 1 2)) integer) . integer)
((or (not (integer 1 2)) (not integer)) . (not integer))
((or (integer 1 2) (not integer)) . (not (or integer (integer * 0) (integer 3 *)))))
((or (integer 1 2) (not integer)) . (not (or integer (integer * 0) (integer 3 *))))
((or number (not (integer 1 2))) . t)
((or atom (not (integer 1 2))) . t)
((or atom (not (member foo))) . t))
"Alist type specifier -> expected type specifier.")
(defmacro comp-cstr-synthesize-tests ()