]> git.eshelyaron.com Git - emacs.git/commitdiff
* Fix union constraint for mixed pos/neg constraints
authorAndrea Corallo <akrl@sdf.org>
Mon, 22 Feb 2021 12:58:30 +0000 (13:58 +0100)
committerAndrea Corallo <akrl@sdf.org>
Mon, 22 Feb 2021 12:59:56 +0000 (13:59 +0100)
* 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.

lisp/emacs-lisp/comp-cstr.el
test/lisp/emacs-lisp/comp-cstr-tests.el
test/src/comp-tests.el

index 3c00b68d0f646392cb017057d4de6ab2e2f73ca4..c294c53b6b0d4bbe8b7748b55b1fe93474250108 100644 (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)
index b4db54666c7f385740ea62a62c843cdba5b9c922..f2d9bf583e583b75cf859cf0f14128a5e1d1ac21 100644 (file)
       ;; 85
       ((or (not string) t) . t)
       ;; 86
-      ((or (not vector) sequence) . sequence))
+      ((or (not vector) sequence) . sequence)
+      ;; 87
+      ((or (not symbol) null) . t))
     "Alist type specifier -> expected type specifier."))
 
 (defmacro comp-cstr-synthesize-tests ()
index 08c18894419f97f0810b77ef8da9d29b1ecb35f3..f7b5a6bbb4ca69c640f23d489fa2e1fba2b76724 100644 (file)
@@ -1185,7 +1185,7 @@ Return a list of results."
       ((defun comp-tests-ret-type-spec-f (x)
          (unless (symbolp x)
            x))
-       (not symbol))
+       t)
 
       ;; 55
       ((defun comp-tests-ret-type-spec-f (x)