1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 08:10:21 -08:00

* 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.
This commit is contained in:
Stefan Monnier 2021-03-09 11:04:03 -05:00
parent 40d8f83e53
commit 7561c01380
2 changed files with 8 additions and 2 deletions

View file

@ -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: