Prevent name clashes between CL structures and builtin types
commit9a747b3554515135d5acadfcb5c2b1b8240d8f84
authorPhilipp Stephani <phst@google.com>
Thu, 21 Dec 2017 17:25:49 +0000 (21 18:25 +0100)
committerPhilipp Stephani <phst@google.com>
Sun, 28 Jan 2018 18:21:47 +0000 (28 19:21 +0100)
tree3e1511ef5cbef7876e44a4f1ef4f2d7550e772db
parenta718e1593ae7332fafe734f880181e2d8ecc34df
Prevent name clashes between CL structures and builtin types

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't allow
structures with the same names as builtin types.
(cl--typeof-types, cl--all-builtin-types): Move from cl-generic.el and
rename.
(cl--struct-name-p): New helper function.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't allow structures
with the same names as builtin types.

* lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-generalizer)
(cl-generic-generalizers): Adapt to name change.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/builtin-type):
* test/lisp/emacs-lisp/cl-preloaded-tests.el
(cl-struct-define/builtin-type): New unit tests.

* etc/NEWS: Document changed behavior.
etc/NEWS
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/cl-preloaded.el
test/lisp/emacs-lisp/cl-macs-tests.el
test/lisp/emacs-lisp/cl-preloaded-tests.el [new file with mode: 0644]