chiark / gitweb /
src/method-impl.lisp: Handle varargs methods in `next-method-type'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 6 Sep 2015 14:13:21 +0000 (15:13 +0100)
src/method-impl.lisp

index 49c667640ac5f9d84433451f8ee78d42efabc6d4..26dce5d05cb30d80ccbe2b4183815ce84f9f6356 100644 (file)
@@ -192,12 +192,17 @@ (defmethod slot-unbound (class
                         (slot-name (eql 'next-method-type)))
   (declare (ignore class))
   (let* ((message (sod-method-message method))
-        (type (sod-message-type message)))
+        (return-type (c-type-subtype (sod-message-type message)))
+        (msgargs (sod-message-argument-tail message))
+        (arguments (if (varargs-message-p message)
+                       (cons (make-argument *sod-master-ap*
+                                            (c-type va-list))
+                             (butlast msgargs))
+                       msgargs)))
     (setf (slot-value method 'next-method-type)
-         (c-type (fun (lisp (c-type-subtype type))
+         (c-type (fun (lisp return-type)
                       ("me" (* (class (sod-method-class method))))
-                      .
-                      (c-function-arguments type))))))
+                      . arguments)))))
 
 (defmethod slot-unbound (class
                         (method delegating-direct-method)