--- Begin Message ---
Subject: |
24.3.50; cl-defstruct with :predicate option |
Date: |
Wed, 22 Jan 2014 11:06:34 +0100 |
Compiling this code:
(require 'cl-lib)
(cl-defstruct (foo (:predicate foop)))
(defun bar (x) (cl-check-type x foo))
with with: emacs -Q -batch -f batch-byte-compile foo.el
produces this warning:
foo.el:8:1:Warning: the function `foo-p' is not known to be defined.
and since foo-p is not defined will also lead errors at run-time when
bar is called.
Adding eval-and-compile to the structure definition avoids the problem
but it's a bug that the compiler emits a call to foo-p at all.
In GNU Emacs 24.3.50.2 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
of 2014-01-20 on ix
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#16520: 24.3.50; cl-defstruct with :predicate option |
Date: |
Thu, 23 Jan 2014 10:02:02 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Version: 24.4
> (cl-defstruct (foo (:predicate foop)))
> (defun bar (x) (cl-check-type x foo))
[...]
> foo.el:8:1:Warning: the function `foo-p' is not known to be defined.
Thanks, should be fixed now (more or less: it's an ugly hack).
Stefan
--- End Message ---