Ugly style-warning from defmethod close
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Medium
|
Unassigned |
Bug Description
I get an ugly style-warning whenever I load a (defmethod close
((stream whatever-stream) &key abort) ...). It complains that an
earlier ftype proclamation is clobbered (see below). Affected systems
are for example chunga and flexi-streams.
I believe that it comes from the fact that the "original" close
/function/ is replaced by a generic function in gray-streams.lisp, but
its inferred ftype is not removed. This might be fixed by giving an
appropriate ftype declamation in gray-streams.lisp.
Minimal test:
CL-USER> (defclass my-stream (stream)
(foo))
#<STANDARD-CLASS MY-STREAM>
CL-USER> (defmethod close ((stream my-stream) &key abort)
(close stream :abort abort))
STYLE-WARNING:
Generic function CLOSE clobbers an earlier FTYPE proclamation
(FUNCTION (STREAM &KEY (:ABORT T)) (VALUES (MEMBER T) &OPTIONAL)) for
the same name with (FUNCTION (T &KEY (:ABORT T)) *).
#<STANDARD-METHOD SB-GRAY::PCL-CLOSE (MY-STREAM) {C222699}>
CL-USER>
sbcl --version: SBCL 1.0.51
uname -a: Linux alraune 2.6.34-
00:16:24 CET 2011 i686 Pentium(R) Dual-Core CPU T4200 @ 2.00GHz
GenuineIntel GNU/Linux
*features*: (:QUICKLISP :SB-BSD-
:COMMON-LISP :SBCL :SB-DOC :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
:SB-SOURCE-
:LARGEFILE :GENCGC :STACK-
:COMPARE-
:STACK-
:STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
:LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
:OS-PROVIDES-
:OS-PROVIDES-POLL)
Actually, an ftype declamation would probably just trigger the style warning earlier (at sbcl loading, not library loading time). I guess that setf of fdefinition should set the inferred ftype as well.