I think my point is that the message you're quoting is not the whole story.
The full warning message includes the source path, and is:
; file: /tmp/foo.lisp
; in: DEFUN BAR
; (CAR (FOO-A X))
;
; caught WARNING:
; Derived type of (SB-KERNEL:%INSTANCE-REF (THE FOO X) 0) is
; (VALUES INTEGER &OPTIONAL),
; conflicting with its asserted type
; LIST.
; See also:
; The SBCL Manual, Node "Handling of Types"
which includes both the source that the user has written, including the call to FOO-A, and also what it has been transformed into by SBCL. I can live with that, particularly if it consistent with a general principle for interpreting compiler diagnostics.
That said, we're not completely honouring the general principles.
Adding (defmacro baz (y) `(foo-a ,y)) and replacing the explicit call to foo-a with a call to baz does not give the processing path that I might have expected. Is this because the processing path is associated with the BAZ call, but the diagnostic is associated with the call to CAR?
I think my point is that the message you're quoting is not the whole story.
The full warning message includes the source path, and is:
; file: /tmp/foo.lisp %INSTANCE- REF (THE FOO X) 0) is
; in: DEFUN BAR
; (CAR (FOO-A X))
;
; caught WARNING:
; Derived type of (SB-KERNEL:
; (VALUES INTEGER &OPTIONAL),
; conflicting with its asserted type
; LIST.
; See also:
; The SBCL Manual, Node "Handling of Types"
which includes both the source that the user has written, including the call to FOO-A, and also what it has been transformed into by SBCL. I can live with that, particularly if it consistent with a general principle for interpreting compiler diagnostics.
That said, we're not completely honouring the general principles.
Adding (defmacro baz (y) `(foo-a ,y)) and replacing the explicit call to foo-a with a call to baz does not give the processing path that I might have expected. Is this because the processing path is associated with the BAZ call, but the diagnostic is associated with the call to CAR?