emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp d6227f6: * Fix union constraint for mixed pos/neg co


From: Andrea Corallo
Subject: feature/native-comp d6227f6: * Fix union constraint for mixed pos/neg constraints
Date: Mon, 22 Feb 2021 08:07:15 -0500 (EST)

branch: feature/native-comp
commit d6227f6edcff7be05469e99da4ce541bfc474c3d
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * 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.
---
 lisp/emacs-lisp/comp-cstr.el            | 6 ++++++
 test/lisp/emacs-lisp/comp-cstr-tests.el | 4 +++-
 test/src/comp-tests.el                  | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 3c00b68..c294c53 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -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)
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el 
b/test/lisp/emacs-lisp/comp-cstr-tests.el
index b4db546..f2d9bf5 100644
--- a/test/lisp/emacs-lisp/comp-cstr-tests.el
+++ b/test/lisp/emacs-lisp/comp-cstr-tests.el
@@ -211,7 +211,9 @@
       ;; 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 ()
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 08c1889..f7b5a6b 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]