Next: The Processing Path, Previous: The Parts of a Compiler Diagnostic, Up: Understanding Compiler Diagnostics

##### 4.1.3.2 The Original and Actual Source

The original source displayed will almost always be a list. If the actual source for an message is a symbol, the original source will be the immediately enclosing evaluated list form. So even if the offending symbol does appear in the original source, the compiler will print the enclosing list and then print the symbol as the actual source (as though the symbol were introduced by a macro.)

When the actual source is displayed (and is not a symbol), it will always be code that resulted from the expansion of a macro or a source-to-source compiler optimization. This is code that did not appear in the original source program; it was introduced by the compiler.

Keep in mind that when the compiler displays a source form in an diagnostic message, it always displays the most specific (innermost) responsible form. For example, compiling this function

         (defun bar (x)
           (let (a)
             (declare (fixnum a))
             (setq a (foo x))
             a))

gives this error message

         ; file: /tmp/foo.lisp
         ; in: DEFUN BAR
         ;     (LET (A)
         ;     (DECLARE (FIXNUM A))
         ;     (SETQ A (FOO X))
         ;     A)
         ;
         ; caught WARNING:
         ;   Asserted type FIXNUM conflicts with derived type (VALUES NULL &OPTIONAL).

This message is not saying “there is a problem somewhere in this `let`” – it is saying that there is a problem with the `let` itself. In this example, the problem is that `a`'s `nil` initial value is not a `fixnum`.