CAREFUL-SPECIFIER-TYPE isn't careful enough
Bug #1395910 reported by
Douglas Katzman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
Because CAREFUL-blah can end up calling the non-careful version of same, we end up with totally opaque error messages on a mis-stated type declaration. (Even though it certainly looks like the CAREFUL wrapper should trap any nested errors)
Here I meant (simple-vector 3) but I accidentally wrote (simple-array 3)
* (defun foo (a) (declare ((simple-array 3) a)) (foo a))
debugger invoked on a TYPE-ERROR:
The value 3 is not of type (OR CONS SYMBOL SB-KERNEL:
restarts (invokable by number or by possibly-
0: [ABORT] Exit debugger, returning to top level.
(TYPEXPAND 3 NIL) [tl,external]
To post a comment you must log in.
The type-error is from the declaration of TYPEXPAND
(defun typexpand (type-specifier &optional env)
(declare (type type-specifier type-specifier))
...
This patch make VALUES- SPECIFIER- TYPE check the type before calling TYPEXPAND.
About CAREFUL- SPECIFIER- TYPE.. do you think it needs to catch all nested errors?