Method combination woes
It seems that the 2018/02 snapshot of CMUCL doesn't properly handle method combination updating in generic functions:
CL-USER> (define-method-combination my-min ()
((methods ()))
`(min ,@(mapcar #'(lambda (method) `(call-method ,method))
methods)))
MY-MIN
CL-USER> (define-method-combination my-max ()
((methods ()))
`(max ,@(mapcar #'(lambda (method) `(call-method ,method))
methods)))
MY-MAX
CL-USER> (defgeneric test (i) (:method-combination my-min)
(:method ((i number)) 5)
(:method ((i integer)) 6))
; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. I):
; Compiling Top-Level Form:
; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. I):
; Compiling Top-Level Form:
#<STANDARD-GENERIC-FUNCTION TEST (2) {494AF709}>
CL-USER> (test 0)
5
CL-USER> (reinitialize-instance #'test :method-combination (mop:find-method-combination #'make-instance 'my-max nil))
#<STANDARD-GENERIC-FUNCTION TEST (2) {4AB267B9}>
CL-USER> (test 0)
5
Here, 6 was expected, not 5, and despite the fact that the method combination slot in the generic function object was correctly updated to MY-MAX.
Besides, ENSURE-GENERIC-FUNCTION also seems to fail handling method-combination changes properly:
(ensure-generic-function 'test :method-combination
(mop:find-method-combination #'make-instance 'my-max nil))
Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER:
#<Method-Combination MY-MAX NIL
{49C2D605}> is not of type LIST
[Condition of type TYPE-ERROR]