Structure accessor compile-time type mismatch gives uninformative source form.
Bug #1982042 reported by
Charles
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
I believe this a regression, but I'm not sure. Either way:
(defstruct foo
(a 0 :type integer))
(defun x (foo)
(car (foo-a foo)))
gives this unhelpful warning:
; caught WARNING:
; Derived type of
; (SB-KERNEL:
; is
; (VALUES INTEGER &OPTIONAL),
; conflicting with its asserted type
; LIST.
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
; printed 1 note
I would have expected the accessor name to be in the source form rather than an opaque call to %INSTANCE-REF, which makes it hard to figure out which slot is being referred to.
To post a comment you must log in.
This must have regressed with the slew of structure changes done in the past decade. CMU CL gives a much better error:
; In: DEFUN X
; (FOO-A FOO)
; Warning: Result is a INTEGER, not a (VALUES &OPTIONAL LIST &REST T).