Changeset 14850


Ignore:
Timestamp:
Jun 25, 2011, 10:22:58 PM (8 years ago)
Author:
gb
Message:

If [E|C]TYPECASE warns about a shadowed clause, it has to be a
STYLE-WARNING.

Fixes ticket:872 in the trunk.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-error-system.lisp

    r14807 r14850  
    8686(define-condition invalid-arguments-global (style-warning) ())
    8787(define-condition undefined-keyword-reference (undefined-reference invalid-arguments) ())
     88(define-condition shadowed-typecase-clause (style-warning)
     89  ((construct :initarg :construct :initform typecase)
     90   (clause :initarg :clause)
     91   (by :initarg :by))
     92  (:report (lambda (c s)
     93             (with-slots (construct clause by) c
     94               (format s "Clause ~S ignored in ~S form - shadowed by ~S ."
     95                       clause construct by)))))
    8896
    8997(define-condition simple-error (simple-condition error) ())
  • trunk/source/lib/macros.lisp

    r14793 r14850  
    961961              (dolist (already types nil)
    962962                (when (subtypep typespec already)
    963                   (warn "Clause ~S ignored in ~S form - shadowed by ~S ." clause construct (assq already clauses))
     963                  (warn 'shadowed-typecase-clause
     964                        :construct construct
     965                        :clause clause
     966                        :by (assq already clauses))
    964967                  (return t)))
    965968            (push typespec types)
Note: See TracChangeset for help on using the changeset viewer.