-;;; Check that the keyword args are of the correct type. Each keyword
-;;; should be known and the corresponding argument should be of the
-;;; correct type. If the keyword isn't a constant, then we can't tell,
-;;; so we note slime.
-(declaim (ftype (function (list fixnum function-type) (values)) check-keywords))
-(defun check-keywords (args pre-key type)
+;;; Check that the &KEY args are of the correct type. Each key should
+;;; be known and the corresponding argument should be of the correct
+;;; type. If the key isn't a constant, then we can't tell, so we note
+;;; slime.
+(declaim (ftype (function (list fixnum function-type) (values)) check-key-args))
+(defun check-key-args (args pre-key type)
(min-args call-arguments-limit :type fixnum)
(max-args 0 :type fixnum)
;; A list of lists of the all the types that have been used in each argument
;; position.
(types () :type list)
(min-args call-arguments-limit :type fixnum)
(max-args 0 :type fixnum)
;; A list of lists of the all the types that have been used in each argument
;; position.
(types () :type list)
- ;; A list of the Approximate-Key-Info structures describing all the things
- ;; that looked like keyword arguments. There are distinct structures
- ;; describing each argument position in which the keyword appeared.
+ ;; A list of APPROXIMATE-KEY-INFO structures describing all the
+ ;; things that looked like &KEY arguments. There are distinct
+ ;; structures describing each argument position in which the keyword
+ ;; appeared.
- ;; The keyword name of this argument. Although keyword names don't have to
- ;; be keywords, we only match on keywords when figuring an approximate type.
+ ;; The keyword name of this argument. Although keyword names don't
+ ;; have to be keywords, we only match on keywords when figuring an
+ ;; approximate type.
(name (required-argument) :type keyword)
;; The position at which this keyword appeared. 0 if it appeared as the
;; first argument, etc.
(name (required-argument) :type keyword)
;; The position at which this keyword appeared. 0 if it appeared as the
;; first argument, etc.
- (mapc #'(lambda (var type)
- (let* ((vtype (leaf-type var))
- (int (type-intersection vtype type)))
- (cond
- ((eq int *empty-type*)
- (note-lossage
- "Definition's declared type for variable ~A:~% ~S~@
+ (mapc (lambda (var type)
+ (let* ((vtype (leaf-type var))
+ (int (type-approx-intersection2 vtype type)))
+ (cond
+ ((eq int *empty-type*)
+ (note-lossage
+ "Definition's declared type for variable ~A:~% ~S~@
- (leaf-name var) (type-specifier vtype)
- where (type-specifier type))
- (return-from try-type-intersections (values nil nil)))
- (t
- (res int)))))
+ (leaf-name var) (type-specifier vtype)
+ where (type-specifier type))
+ (return-from try-type-intersections (values nil nil)))
+ (t
+ (res int)))))
;;; Note that the variables in the returned list are the actual
;;; original variables (extracted from the optional dispatch arglist),
;;; rather than the variables that are arguments to the main entry.
;;; Note that the variables in the returned list are the actual
;;; original variables (extracted from the optional dispatch arglist),
;;; rather than the variables that are arguments to the main entry.
x what x where y))))
(frob min (length req) "fixed")
(frob (- (optional-dispatch-max-args od) min) (length opt) "optional"))
(flet ((frob (x y what)
(unless (eq x y)
(note-lossage
x what x where y))))
(frob min (length req) "fixed")
(frob (- (optional-dispatch-max-args od) min) (length opt) "optional"))
(flet ((frob (x y what)
(unless (eq x y)
(note-lossage
(unless (optional-dispatch-keyp od)
(frob (not (null (optional-dispatch-more-entry od)))
(not (null (function-type-rest type)))
(unless (optional-dispatch-keyp od)
(frob (not (null (optional-dispatch-more-entry od)))
(not (null (function-type-rest type)))
- (frob (function-type-optional type) "optional args")
- (frob (function-type-keyp type) "keyword args")
- (frob (function-type-rest type) "rest arg"))
+ (frob (function-type-optional type) "&OPTIONAL arguments")
+ (frob (function-type-keyp type) "&KEY arguments")
+ (frob (function-type-rest type) "&REST argument"))