unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Stefan Kangas <stefan@marxist.se>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	 emacs-devel@gnu.org, Christian Ohler <ohler@gnu.org>
Subject: Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite)
Date: Wed, 22 Dec 2021 19:07:29 -0500	[thread overview]
Message-ID: <jwvmtkskx0h.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADwFkmmcpeCZVjXXcijKKDx7_0fObPxe2iS9Au9KRxiZD=70Fg@mail.gmail.com> (Stefan Kangas's message of "Wed, 22 Dec 2021 14:11:19 -0800")

>> I'd do something like
>>
>>     (should-error
>>      (macroexpand-all '(pcase ...)))
>
> macroexpand-all didn't work, but I installed this, which seems to have
> fixed it:

Indeed, how odd.  I tried:

    (should
     (condition-case err
         (progn
           (macroexpand-all
            '(pcase 1
               ((cl-type notatype) 'integer)))
           nil)
       (error (string-match "Unknown type notabug" (cadr err))))))

and that gives me:

    Test pcase-tests-cl-type backtrace:
      error("Unknown type %S" notatype)
      cl-typep--inliner((cl-typep 1 'notatype) 1 'notatype)
      apply(cl-typep--inliner (cl-typep 1 'notatype) (1 'notatype))
      macroexp--compiler-macro(cl-typep--inliner (cl-typep 1 'notatype))
      macroexp--expand-all((pcase--flip cl-typep 'notatype 1))
      macroexp--all-forms((if (pcase--flip cl-typep 'notatype 1) (let nil 
      macroexp--expand-all((pcase 1 ((cl-type notatype) 'integer)))
      macroexpand-all((pcase 1 ((cl-type notatype) 'integer)))
      (progn (macroexpand-all '(pcase 1 ((cl-type notatype) 'integer))) ni
      (condition-case err (progn (macroexpand-all '(pcase 1 ((cl-type nota
    [...]

Notice the place where I truncated the stack: we're inside the
`condition-case`!  So why do we get a backtrace instead of letting
`condition-case` catch the error?


        Stefan




  reply	other threads:[~2021-12-23  0:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 12:36 Zero byte-compiler warnings in the test suite Stefan Kangas
2021-12-21 13:09 ` Lars Ingebrigtsen
2021-12-21 13:39   ` Stefan Kangas
2021-12-21 13:49     ` Lars Ingebrigtsen
2021-12-21 15:11       ` Stefan Kangas
2021-12-21 15:41     ` Stefan Monnier
2021-12-22  5:07       ` Stefan Kangas
2021-12-22 17:40         ` Stefan Monnier
2021-12-22 22:11           ` Stefan Kangas
2021-12-23  0:07             ` Stefan Monnier [this message]
2021-12-23 10:04               ` Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite) Philipp Stephani
2021-12-21 14:54 ` Zero byte-compiler warnings in the test suite Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvmtkskx0h.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=ohler@gnu.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).