(cons 'and (cdddr pred-form))
`(,predicate cl-x))))
(when pred-form
- (push `(,defsym ,predicate (cl-x)
+ (push `(eval-and-compile
+ ;; Define the predicate to be effective at compile time
+ ;; as native comp relies on `cl-typep' that relies on
+ ;; predicates to be defined as they are registered in
+ ;; cl-deftype-satisfies.
+ (,defsym ,predicate (cl-x)
(declare (side-effect-free error-free) (pure t))
,(if (eq (car pred-form) 'and)
(append pred-form '(t))
`(and ,pred-form t)))
- forms)
- (push `(eval-and-compile
(define-symbol-prop ',name 'cl-deftype-satisfies ',predicate))
forms))
(let ((pos 0) (descp descs))
;;; Code:
+(require 'cl-lib)
+
(defvar comp-tests-var1 3)
(defun comp-tests-varref-f ()
(comp-test-62537-1-f))
t)
+(cl-defstruct comp-test-struct)
+
+(defun comp-test-63674-1-f (x)
+ (or
+ (if (comp-test-struct-p pkg) x)
+ t))
\f
;;;;;;;;;;;;;;;;;;;;