emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird non-caught error in ERT (was: Zero byte-compiler warnings in t


From: Philipp Stephani
Subject: Re: Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite)
Date: Thu, 23 Dec 2021 11:04:22 +0100

Am Do., 23. Dez. 2021 um 01:07 Uhr schrieb Stefan Monnier
<monnier@iro.umontreal.ca>:
>
> >> 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?
>

Maybe because `should' installs a signal hook function?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]