]> git.eshelyaron.com Git - emacs.git/commitdiff
Make nativecomp don't error when encountering undeclared types (bug#6573)
authorAndrea Corallo <acorallo@gnu.org>
Tue, 17 Jun 2025 07:06:45 +0000 (09:06 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:14:39 +0000 (10:14 +0200)
* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.

(cherry picked from commit f38e969e472284dbe475f6f3dbe6770d87588291)

lisp/emacs-lisp/comp-cstr.el
test/src/comp-resources/comp-test-funcs.el

index 49c2c5d35d1d54545b5f397ab49ba1e7d2a2ddd4..fad54d4cd465ab8b82685bc2d1ad7c014b315838 100644 (file)
@@ -336,9 +336,13 @@ Return them as multiple value."
       (nreverse res))))
 
 (defun comp-supertypes (type)
-  "Return the ordered list of supertypes of TYPE."
-  (or (assq type (comp-cstr-ctxt-typeof-types comp-ctxt))
-      (error "Type %S missing from typeof-types!" type)))
+   "Return the ordered list of supertypes of TYPE."
+   (or (assq type (comp-cstr-ctxt-typeof-types comp-ctxt))
+       (progn
+        (display-warning
+         'native-compiler
+         (format "Unknown type %S" type))
+        '(t))))
 
 (defun comp--union-typesets (&rest typesets)
   "Union types present into TYPESETS."
index 3f7e7d1ab4b7f2e032ad3b744ede2a6569580f31..837ef018efb9377004a32d4512e03d681ae5518c 100644 (file)
     (comp-test-73270-child3 'child3)
     (comp-test-73270-child4 'child4)))
 
+(defun comp-test-76573-1-f ()
+  (record 'undeclared-type))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests ;;