Comment 2 for bug 309072

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

This is unfortunately the wrong place to fix this. Consider:

;;; Perfectly legal
(defclass foo ()
  ((name :initarg :name)))

(make-instance 'foo :name nil)

;;; Should signal an error
(make-instance (find-class 'sb-mop:standard-direct-slot-definition))

I think the right place to do this check (and others mandated by AMOP, see "Initialization of Slot Definition Metaobjects" at http://www.lisp.org/mop/dictionary.html) is eg. in the primary on either INITIALIZE-INSTANCE (SLOT-DEFINITION).