better debug name for secondary GF dispatch functions
authorNikodemus Siivola <nikodemus@random-state.net>
Sat, 26 Jan 2013 21:14:02 +0000 (23:14 +0200)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 1 Feb 2013 20:30:10 +0000 (22:30 +0200)
 Fixes lp#503081

src/pcl/methods.lisp
tests/debug.impure.lisp

index c1e5fc4..efbd482 100644 (file)
                         (make-dfun-lambda-list nargs applyp)
                         (make-fast-method-call-lambda-list nargs applyp))))
       (multiple-value-bind (cfunction constants)
-          (get-fun1 `(lambda
+          (get-fun1 `(named-lambda (gf-dispatch ,name)
                       ,arglist
                       ,@(unless function-p
                           `((declare (ignore .pv. .next-method-call.))))
index e64e664..7f6d1bc 100644 (file)
       (unless (zerop (length problems))
         (error problems)))))
 
+(defgeneric gf-dispatch-test/gf (x y)
+  (:method (x y)
+    (+ x y)))
+(defun gf-dispatch-test/f (z)
+  (gf-dispatch-test/gf z))
+
+(with-test (:name :gf-dispatch-backtrace)
+  ;; Fill the cache
+  (gf-dispatch-test/gf 1 1)
+  ;; Wrong argument count
+  (assert (verify-backtrace (lambda () (gf-dispatch-test/f 42))
+                            '(((sb-pcl::gf-dispatch gf-dispatch-test/gf) 42)))))
+
 (write-line "/debug.impure.lisp done")