CLOS MOP bug in 1.8.0

Pascal Costanza pc at p-cos.net
Fri Nov 27 17:55:35 UTC 2020


Hi,

I have encountered a bug in 1.8.0 when doing my regular Closer to MOP checks. This must be a new bug, because 1.7.1 was fine. Here is the case that triggers the problem:

(use-package :mop)

(defclass test-direct-slot-definition
          (standard-direct-slot-definition)
  ())

(defclass test-effective-slot-definition
          (standard-effective-slot-definition)
  ())

(defclass test-class (standard-class) ())

(defmethod validate-superclass
           ((class test-class)
            (superclass standard-class))
  t)

(defmethod direct-slot-definition-class
           ((class test-class) &rest initargs)
  (declare (ignore initargs))
  (find-class 'test-direct-slot-definition))

(defmethod effective-slot-definition-class
           ((class test-class) &rest initargs)
  (declare (ignore initargs))
  (find-class 'test-effective-slot-definition))

(defclass test-object ()
  ((some-slot :accessor some-slot
              :initarg :some-slot
              :initform 'some-slot
              :type symbol
              :allocation :class
              :documentation "a slot"))
  (:metaclass test-class))

(unless (class-finalized-p (find-class 'test-object))
  (finalize-inheritance (find-class 'test-object)))



Armed Bear Common Lisp 1.8.0
Java 15.0.1 Oracle Corporation
Java HotSpot(TM) 64-Bit Server VM
Low-level initialization completed in 0.134 seconds.
Startup completed in 0.65 seconds.
Loading /Users/costanza/.abclrc completed in 6.061 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (load "test.lisp")
Error loading /Users/costanza/Temp/test.lisp at line 36 (offset 943)
#<THREAD "interpreter" {1970D65C}>: Debugger invoked on condition of type UNBOUND-SLOT
  The slot LOCATION is unbound in the object #<TEST-EFFECTIVE-SLOT-DEFINITION {556F331F}>.
Restarts:
  0: TOP-LEVEL Return to top level.
[1] CL-USER(2): :bt

  0: (SYSTEM:BACKTRACE)
  1: (INVOKE-DEBUGGER #<UNBOUND-SLOT {67D22A29}>)
  2: (ERROR
 UNBOUND-SLOT
 :INSTANCE
 #<TEST-EFFECTIVE-SLOT-DEFINITION {556F331F}>
 :NAME
 SYSTEM::LOCATION)
  3: (#<FUNCTION #<FUNCTION {22446549}> {22446549}>
 (#<STANDARD-CLASS TEST-EFFECTIVE-SLOT-DEFINITION {6670307A}>
  #<TEST-EFFECTIVE-SLOT-DEFINITION {556F331F}> SYSTEM::LOCATION))
  4: (SLOT-VALUE
 #<TEST-EFFECTIVE-SLOT-DEFINITION {556F331F}>
 SYSTEM::LOCATION)
  5: (SLOT-DEFINITION-LOCATION
 #<TEST-EFFECTIVE-SLOT-DEFINITION {556F331F}>)
  6: (MOP::STD-FINALIZE-INHERITANCE #<TEST-CLASS TEST-OBJECT {67510DAF}>)
  7: (#<FUNCTION #<FUNCTION {2C5408FE}> {2C5408FE}>
 (#<TEST-CLASS TEST-OBJECT {67510DAF}>))


I believe the bug is triggered by find-class or class-finalized-p, but not sure.


Pascal

--
Pascal Costanza





More information about the armedbear-devel mailing list