The following snippet is conforming CL code AFAIK, but I got warnings when
compiling it using cmucl (both 19a and 19b). The execution result seems to
be correct; I am reporting it here lest it is a symptom of bigger problem.
(defclass r0 ()
((a :accessor a)))
(defclass r1 (r0)
((b :accessor b)))
(defclass s0 ()
((c :accessor c)))
(defmethod f ((r r0) (s s0))
(+ (a r) (c s)))
(defmethod f ((r r1) (s s0))
(+ (b r) (call-next-method r s)))
(defun foo ()
(let ((x (make-instance 'r1))
(y (make-instance 's0)))
(setf (a x) 1
(b x) 2
(c y) 3)
(f x y)))
; Python version 1.1, VM version Intel x86 on 28 JUL 05 06:28:25 pm.
; Compiling: /tmp/bug.lisp 28 JUL 05 06:28:23 pm
;
;
; File: /a/asteria/junkfood/y/yuan/pkg/study/QL/bug.lisp
; In: DEFMETHOD F (R1 S0)
; (DEFMETHOD F (# #)
; (+ # #))
; --> PROGN PCL::LOAD-DEFMETHOD PCL::LOAD-DEFMETHOD LIST* LIST* LAMBDA FUNCTION
; --> MACROLET PCL::FAST-LEXICAL-METHOD-FUNCTIONS
; --> PCL::BIND-FAST-LEXICAL-METHOD-MACROS MACROLET
; --> PCL::BIND-LEXICAL-METHOD-FUNCTIONS PCL::CALL-NEXT-METHOD-BIND LET FLET
; --> BLOCK PCL::CALL-NEXT-METHOD-BODY IF IF
; --> PCL::INVOKE-EFFECTIVE-METHOD-FUNCTION PROGN ETYPECASE LET COND IF COND IF
; --> PROGN LOCALLY SETF LET* MULTIPLE-VALUE-BIND LET PCL::%SET-SVREF LET
; --> LOCALLY SETF LISP::%SVSET LISP::%ASET LET*
; ==>
; (KERNEL:DATA-VECTOR-SET ARRAY KERNEL:INDEX C::NEW-VALUE)
; Warning: Result is a (AND INSTANCE
; R1), not a (VALUES &OPTIONAL NUMBER &REST T).
; ; [Last message occurs 2 times]
; Compilation unit finished.
; 2 warnings
; /tmp/bug.x86f written.
; Compilation finished in 0:00:01.