emacs-devel
[Top][All Lists]
Advanced

[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




reply via email to

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