* 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)))
;; Pos is a superset of neg.
(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
;; pos is a subset or eq to neg
(setf (valset neg)