summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2016-12-02 00:03:57 -0500
committerNoam Postavsky <npostavs@gmail.com>2016-12-10 16:00:01 -0500
commite4ac4507968b839569b5ce12a9c4d0374dd46768 (patch)
tree7f2b67fc7634ac47526dfab963d96c1e81a1ff53 /lisp
parent08decbd04b8346323b80f0dea84a462fe1f46b3f (diff)
downloademacs-e4ac4507968b839569b5ce12a9c4d0374dd46768.tar.gz
Define struct predicate before acccesors
The accessor functions use the predicate function, which causes problems when reloading after unload-feature: the compiler-macro property is still present on the predicate symbol, and the compiler fails to find the definition when trying to inline it into the accessor function (Bug#25088). * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Move predicate definition before field accessor definitions.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index c51ed9d8770..b3a60b1b225 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2687,6 +2687,14 @@ non-nil value, that slot cannot be set via `setf'.
(= safety 1))
(cons 'and (cl-cdddr pred-form))
`(,predicate cl-x))))
+ (when pred-form
+ (push `(cl-defsubst ,predicate (cl-x)
+ (declare (side-effect-free error-free))
+ ,(if (eq (car pred-form) 'and)
+ (append pred-form '(t))
+ `(and ,pred-form t)))
+ forms)
+ (push `(put ',name 'cl-deftype-satisfies ',predicate) forms))
(let ((pos 0) (descp descs))
(while descp
(let* ((desc (pop descp))
@@ -2741,14 +2749,6 @@ non-nil value, that slot cannot be set via `setf'.
(setq pos (1+ pos))))
(setq slots (nreverse slots)
defaults (nreverse defaults))
- (when pred-form
- (push `(cl-defsubst ,predicate (cl-x)
- (declare (side-effect-free error-free))
- ,(if (eq (car pred-form) 'and)
- (append pred-form '(t))
- `(and ,pred-form t)))
- forms)
- (push `(put ',name 'cl-deftype-satisfies ',predicate) forms))
(and copier
(push `(defalias ',copier #'copy-sequence) forms))
(if constructor