diff options
| author | Noam Postavsky | 2017-08-04 19:50:21 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-08-07 18:54:49 -0400 |
| commit | b5c8e9898d9dbd4145c40d08e8eef84a5e32008a (patch) | |
| tree | 55296988e6b39d42ee09395f2fb8078e3fed28c1 | |
| parent | cc30d77ecdd1b9155ade3d0656a84a0839ee2795 (diff) | |
| download | emacs-b5c8e9898d9dbd4145c40d08e8eef84a5e32008a.tar.gz emacs-b5c8e9898d9dbd4145c40d08e8eef84a5e32008a.zip | |
Let the cl-typep effects of defclass work during compilation (Bug#27718)
* lisp/emacs-lisp/eieio.el (defclass): Use `define-symbol-prop'
instead of `put'.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-tests--dummy-function): Remove.
(eieio-test-25-slot-tests, eieio-test-23-inheritance-check): Don't
expect to fail if compiled.
| -rw-r--r-- | lisp/emacs-lisp/eieio.el | 2 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | 12 |
2 files changed, 1 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 1a7de55fcef..8b92d5b7acd 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el | |||
| @@ -246,7 +246,7 @@ This method is obsolete." | |||
| 246 | ;; test, so we can let typep have the CLOS documented behavior | 246 | ;; test, so we can let typep have the CLOS documented behavior |
| 247 | ;; while keeping our above predicate clean. | 247 | ;; while keeping our above predicate clean. |
| 248 | 248 | ||
| 249 | (put ',name 'cl-deftype-satisfies #',testsym2) | 249 | (define-symbol-prop ',name 'cl-deftype-satisfies #',testsym2) |
| 250 | 250 | ||
| 251 | (eieio-defclass-internal ',name ',superclasses ',slots ',options-and-doc) | 251 | (eieio-defclass-internal ',name ',superclasses ',slots ',options-and-doc) |
| 252 | 252 | ||
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index d824bfc1bb4..1a6ab9da085 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | |||
| @@ -529,15 +529,7 @@ METHOD is the method that was attempting to be called." | |||
| 529 | "This class should break.")) | 529 | "This class should break.")) |
| 530 | :type 'invalid-slot-type)) | 530 | :type 'invalid-slot-type)) |
| 531 | 531 | ||
| 532 | (defun eieio-tests--dummy-function () | ||
| 533 | ;; Dummy function to see if the file is compiled. | ||
| 534 | t) | ||
| 535 | |||
| 536 | (ert-deftest eieio-test-23-inheritance-check () | 532 | (ert-deftest eieio-test-23-inheritance-check () |
| 537 | ;; This test fails when compiled, see Bug#27718. | ||
| 538 | :expected-result (if (byte-code-function-p | ||
| 539 | (symbol-function 'eieio-tests--dummy-function)) | ||
| 540 | :failed :passed) | ||
| 541 | (should (child-of-class-p 'class-ab 'class-a)) | 533 | (should (child-of-class-p 'class-ab 'class-a)) |
| 542 | (should (child-of-class-p 'class-ab 'class-b)) | 534 | (should (child-of-class-p 'class-ab 'class-b)) |
| 543 | (should (object-of-class-p eitest-a 'class-a)) | 535 | (should (object-of-class-p eitest-a 'class-a)) |
| @@ -556,10 +548,6 @@ METHOD is the method that was attempting to be called." | |||
| 556 | (should (not (cl-typep "foo" 'class-a)))) | 548 | (should (not (cl-typep "foo" 'class-a)))) |
| 557 | 549 | ||
| 558 | (ert-deftest eieio-test-24-object-predicates () | 550 | (ert-deftest eieio-test-24-object-predicates () |
| 559 | ;; This test fails when compiled, see Bug#27718. | ||
| 560 | :expected-result (if (byte-code-function-p | ||
| 561 | (symbol-function 'eieio-tests--dummy-function)) | ||
| 562 | :failed :passed) | ||
| 563 | (let ((listooa (list (class-ab) (class-a))) | 551 | (let ((listooa (list (class-ab) (class-a))) |
| 564 | (listoob (list (class-ab) (class-b)))) | 552 | (listoob (list (class-ab) (class-b)))) |
| 565 | (should (cl-typep listooa '(list-of class-a))) | 553 | (should (cl-typep listooa '(list-of class-a))) |