Using type-error when need simple-type-error

Issue #4 resolved
Yehouda Harpaz created an issue

In method.lisp, when lookup-methods is called with :stage nil, it calls error with type-error and pass it :format-control. That gives a recursive error, because type-error doesn’t have :format-control. Instead, it should use simple-type-error, which inherits :format-control from simple-condition.

http://www.lispworks.com/documentation/lw71/CLHS/Body/e_smp_tp.htm

The test test-lookup-methods actually catches this.

Comments (3)

  1. Don Morrison repo owner

    Well, this is interesting. Neither SBCL nor in CCL seem to discover this error during the unit test. In both cases the argument mismatch doesn’t signal its own error until it tries to print the original error, which it never tries to do in the unit test.

    Presumably this is a difference in the LispWorks implementation, in this case very much to LispWorks credit. Maybe even a bug in lisp-unit2? Unfortunately I don’t have access to a copy of LispWorks. Do you know if any others of the unit tests fail in LispWorks? Thanks!

  2. Yehouda Harpaz reporter

    I don't know if it is a bug in lisp-unit2.

    I am actually from LispWorks ltd, and in our test-suite I addeds some time ago to the macro that is smilar to assert-error a keyword that gets a list of strings, and then it prints the condition and checks that all the strings appears in the printed string. If lisp-unit2 had that, it would have caught it on SBCL and CCL.

    We try to run all the lisp-unit2 tests in quicklisp, and there are some errors and failures. We haven’t gone through them systematically yet.

  3. Log in to comment