missing error when a slot-definition is created with a bogus or missing name
Bug #309072 reported by
Nikodemus Siivola
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(reported by Bruno Haible)
The MOP says about slot-definition initialization:
"The :NAME argument is a slot name. An ERROR is SIGNALled if this argument
is not a symbol which can be used as a variable name. An ERROR is SIGNALled
if this argument is not supplied."
CL-USER> (make-instance 'sb-mop:
#<SB-MOP:
CL-USER> (make-instance 'sb-mop:
#<SB-MOP:
CL-USER> (make-instance 'sb-mop:
#<SB-MOP:
description: | updated |
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: review |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
These changes seem to fix it for me,
--- src/pcl/init.lisp 2009-06-02 11:33:52.000000000 -0700
+++ ../init.lisp 2009-07-03 05:18:06.000000000 -0700
@@ -1,3 +1,4 @@
+
;;;; This file defines the initialization and related protocols.
;;;; This software is part of the SBCL system. See the README file for
@@ -25,7 +26,10 @@
(in-package "SB-PCL")
-(defmethod make-instance ((class symbol) &rest initargs)
+(defmethod make-instance ((class symbol) &rest initargs &key (name nil) &allow-other-keys)
+ (declare (type (or symbol null) name))
+ (unless name
+ (error "The name slot is unspecified."))
(apply #'make-instance (find-class class) initargs))
(defmethod make-instance ((class class) &rest initargs)