This is probably the same bug as 216
-167:
- In sbcl-0.7.3.11, compiling the (illegal) code
- (in-package :cl-user)
- (defmethod prove ((uustk uustk))
- (zap ((frob () nil))
- (frob)))
- gives the (not terribly clear) error message
- ; caught ERROR:
- ; (during macroexpansion of (DEFMETHOD PROVE ...))
- ; can't get template for (FROB NIL NIL)
- The problem seems to be that the code walker used by the DEFMETHOD
- macro is unhappy with the illegal syntax in the method body, and
- is giving an unclear error message.
-
173:
The compiler sometimes tries to constant-fold expressions before
it checks to see whether they can be reached. This can lead to
* fixed bug: initialization of condition class metaobjects no longer
causes an instance of the condition to be created. (reported by Marco
Baringer)
+ * fixed bug #167: errors signalled due to illegal syntax in method
+ bodies are now more legible.
* fixed bug #338: instances of EQL-SPECIFIER are now valid type
designators and can hence be used with TYPEP.
* fixed bug #333: CHECK-TYPE now ensures that the type error
`(eval-when (:load-toplevel :execute)
(setf (get-walker-template-internal ',name) ',template)))
-(defun get-walker-template (x)
+(defun get-walker-template (x context)
(cond ((symbolp x)
(get-walker-template-internal x))
((and (listp x) (eq (car x) 'lambda))
'(lambda repeat (eval)))
(t
- (error "can't get template for ~S" x))))
+ ;; FIXME: In an ideal world we would do something similar to
+ ;; COMPILER-ERROR here, replacing the form within the walker
+ ;; with an error-signalling form. This is slightly less
+ ;; pretty, but informative non the less. Best is the enemy of
+ ;; good, etc.
+ (error "Illegal function call in method body:~% ~S"
+ context))))
\f
;;;; the actual templates
newform)))
(t
(let* ((fn (car newform))
- (template (get-walker-template fn)))
+ (template (get-walker-template fn newform)))
(if template
(if (symbolp template)
(funcall template newform context env)
(cdr body) fn env doc-string-p declarations)))
((and form
(listp form)
- (null (get-walker-template (car form)))
+ (null (get-walker-template (car form) form))
(progn
(multiple-value-setq (new-form macrop)
(sb-xc:macroexpand-1 form env))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.12.25"
+"0.8.12.26"