types of constant default values of keyword arguments not derived?
Bug #309131 reported by
Nikodemus Siivola
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(defun foo (&key (a :x))
(declare (fixnum a))
a)
does not cause a warning. (BTW: old SBCL issued a warning, but for a
function, which was never called!)
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
description: | updated |
To post a comment you must log in.
Fixing this bug will not cope well with DEFSTRUCT.
(defstruct foo (x (sb-int: missing- arg) :type fixnum))
will emit a warning because MAKE-FOO will be defined as follows
(DEFUN MAKE-FOO (&KEY ((:X #:DUM971) (SB-INT: MISSING- ARG))) KERNEL: :%MAKE- STRUCTURE- INSTANCE- MACRO SB-KERNEL: DEFSTRUCT- DESCRIPTION FOOBAR> '((:SLOT T . 1)) #:DUM971))
(DECLARE (TYPE FIXNUM #:DUM971))
(SB-
#<
That kind of initialization- value checking is a useful violation of what CLHS specifies
about DEFSTRUCT. I recall some comment or something which mentions this
issue explicitly, perhaps by WHN, but I can't find it right now.