[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird non-caught error in ERT (was: Zero byte-compiler warnings in the t
From: |
Stefan Monnier |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>> 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
- Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Lars Ingebrigtsen, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Monnier, 2021/12/21
- Re: Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/22
- Re: Zero byte-compiler warnings in the test suite, Stefan Monnier, 2021/12/22
- Re: Zero byte-compiler warnings in the test suite, Stefan Kangas, 2021/12/22
- Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite),
Stefan Monnier <=
- Re: Weird non-caught error in ERT (was: Zero byte-compiler warnings in the test suite), Philipp Stephani, 2021/12/23
Re: Zero byte-compiler warnings in the test suite, Eli Zaretskii, 2021/12/21