1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* Fix union constraint for mixed pos/neg constraints

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix neg
	type shadowing pos values.
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add testcase.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Fix testcase.
This commit is contained in:
Andrea Corallo 2021-02-22 13:58:30 +01:00
parent da4da88c76
commit d6227f6edc
3 changed files with 10 additions and 2 deletions

View file

@ -597,6 +597,12 @@ DST is returned."
(valset pos))) (valset pos)))
;; Pos is a superset of neg. ;; Pos is a superset of neg.
(give-up)) (give-up))
((cl-some (lambda (x)
(cl-some (lambda (y)
(comp-subtype-p y x))
(mapcar #'type-of (valset pos))))
(typeset neg))
(give-up))
(t (t
;; pos is a subset or eq to neg ;; pos is a subset or eq to neg
(setf (valset neg) (setf (valset neg)

View file

@ -211,7 +211,9 @@
;; 85 ;; 85
((or (not string) t) . t) ((or (not string) t) . t)
;; 86 ;; 86
((or (not vector) sequence) . sequence)) ((or (not vector) sequence) . sequence)
;; 87
((or (not symbol) null) . t))
"Alist type specifier -> expected type specifier.")) "Alist type specifier -> expected type specifier."))
(defmacro comp-cstr-synthesize-tests () (defmacro comp-cstr-synthesize-tests ()

View file

@ -1185,7 +1185,7 @@ Return a list of results."
((defun comp-tests-ret-type-spec-f (x) ((defun comp-tests-ret-type-spec-f (x)
(unless (symbolp x) (unless (symbolp x)
x)) x))
(not symbol)) t)
;; 55 ;; 55
((defun comp-tests-ret-type-spec-f (x) ((defun comp-tests-ret-type-spec-f (x)