Ignore:
Timestamp:
Aug 15, 2009, 2:40:54 PM (11 years ago)
Author:
gz
Message:

more extensive compile-time checking involving methods/gfs: warn about incongruent lambda lists, duplicate gf defs, required keyword args (from defgeneric), and invalid keyword args in gf calls. Also fix to keep method source files in env function info so dup method warnings can cite the right file. Also merged r12581 and r12583 from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/nx-basic.lisp

    r12531 r12585  
    587587    (setq env (lexenv.parent-env env))))
    588588
    589 (defun report-compile-time-argument-mismatch (condition stream)
     589(defun report-compile-time-argument-mismatch (condition stream &aux (type (compiler-warning-warning-type condition)))
    590590  (destructuring-bind (callee reason args spread-p)
    591591      (compiler-warning-args condition)
     
    594594            callee
    595595            args)
    596     (case (car reason)
     596    (ecase (car reason)
    597597      (:toomany
    598598       (destructuring-bind (provided max)
     
    609609       (destructuring-bind (badguy goodguys)
    610610           (cdr reason)
    611          (format stream "the keyword argument~:[ ~s is~;s~{ ~s~^~#[~; and~:;,~]~} are~] not one of ~s, which are recognized~&  by "
    612                  (consp badguy) badguy goodguys))))
     611         (format stream "the keyword argument~:[ ~s is~;s~{ ~s~^~#[~; and~:;,~]~} are~] not one of ~:s, which are recognized by "
     612                 (consp badguy) badguy goodguys)))
     613      (:unknown-gf-keywords
     614         (let ((badguys (cadr reason)))
     615           (format stream "the keyword argument~:[ ~s is~;s~{ ~s~^~#[~; and~:;,~]~} are~] not recognized by "
     616                   (consp badguys) badguys))))
    613617    (format stream
    614             (ecase (compiler-warning-warning-type condition)       
     618            (ecase type
    615619              (:ftype-mismatch "the FTYPE declaration of ~s")
    616620              (:global-mismatch "the current global definition of ~s")
     
    623627    (:unused . "Unused lexical variable ~S")
    624628    (:ignore . "Variable ~S not ignored.")
    625     (:undefined-function . "Undefined function ~S") ;; (not reported if defined later)
    626     (:undefined-type . "Undefined type ~S")         ;; (not reported if defined later)
     629    (:undefined-function . "Undefined function ~S") ;; (deferred)
     630    (:undefined-type . "Undefined type ~S")         ;; (deferred)
    627631    (:unknown-type-in-declaration . "Unknown or invalid type ~S, declaration ignored")
    628632    (:bad-declaration . "Unknown or invalid declaration ~S")
     
    640644    (:special-fbinding . "Attempt to bind compiler special name: ~s. Result undefined.")
    641645    (:lambda . "Suspicious lambda-list: ~s")
     646    (:incongruent-gf-lambda-list . "Lambda list of generic function ~s is incongruent with previously defined methods")
     647    (:incongruent-method-lambda-list . "Lambda list of ~s is incongruent with previous definition of ~s")
     648    (:gf-keys-not-accepted . "~s does not accept keywords ~s required by the generic functions")
    642649    (:result-ignored . "Function result ignored in call to ~s")
    643650    (:duplicate-definition . report-compile-time-duplicate-definition)
Note: See TracChangeset for help on using the changeset viewer.