From 7561c01380aa3347901eeddd2d0a466cb29ebbd8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 9 Mar 2021 11:04:03 -0500 Subject: * lisp/emacs-lisp/cconv.el: Don't confuse a string for a docstring (cconv--convert-funcbody): Check there's something after a docstring. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-string-vs-docstring): New corresponding test. --- test/lisp/emacs-lisp/bytecomp-tests.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el') diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 03c267ccd0f..5147cd26883 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1222,6 +1222,11 @@ compiled correctly." (byte-compile 'counter) (should (equal (counter) 1)))))) +(ert-deftest bytecomp-string-vs-docstring () + ;; Don't confuse a string return value for a docstring. + (let ((lexical-binding t)) + (should (equal (funcall (byte-compile '(lambda (x) "foo")) 'dummy) "foo")))) + ;; Local Variables: ;; no-byte-compile: t ;; End: -- cgit v1.2.3