X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=b6db2a7126d3a73f2d3465789608f8142f326cfe;hb=a189a69454ef7635149319ae213b337f17c50d20;hp=2113f59fc33eeaa18066a1587402f03b78319cc9;hpb=1fa1730414b6c914e502d339945d0ad7a4a7f5d9;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 2113f59..b6db2a7 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -2075,4 +2075,61 @@ (defmethod sb-mop:validate-superclass ((x bug-309076-class) (y standard-class)) t) (assert (typep (make-instance 'bug-309076-class) 'bug-309076-class))) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require 'sb-cltl2) + (defmethod b ())) + +(defmacro macro () + (let ((a 20)) + (declare (special a)) + (assert + (= + (funcall + (compile nil + (sb-mop:make-method-lambda + #'b + (find-method #'b () ()) + '(lambda () (declare (special a)) a) + nil)) + '(1) ()) + 20)))) + +(with-test (:name :make-method-lambda-leakage) + ;; lambda list of X leaks into the invocation of make-method-lambda + ;; during code-walking performed by make-method-lambda invoked by + ;; DEFMETHOD + (sb-cltl2:macroexpand-all '(defmethod x (a) (macro)))) + +(with-test (:name (:defmethod-undefined-function :bug-503095)) + (flet ((test-load (file) + (let (implicit-gf-warning) + (handler-bind + ((sb-ext:implicit-generic-function-warning + (lambda (x) + (setf implicit-gf-warning x) + (muffle-warning x))) + ((or warning error) #'error)) + (load file)) + (assert implicit-gf-warning)))) + (multiple-value-bind (fasl warnings errorsp) (compile-file "bug-503095.lisp") + (unwind-protect + (progn (assert (and fasl (not warnings) (not errorsp))) + (test-load fasl)) + (and fasl (delete-file fasl)))) + (test-load "bug-503095-2.lisp"))) + +(with-test (:name :accessor-and-plain-method) + (defclass a-633911 () + ((x-633911 :initform nil + :accessor x-633911))) + + (defmethod x-633911 ((b a-633911)) 10) + + (defclass b-633911 () + ((x-633911 :initform nil + :accessor x-633911))) + + (assert (= (x-633911 (make-instance 'a-633911)) 10))) + ;;;; success