Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trac/ticket/479/mevenson/20210116a #365

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion abcl-prove.asd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; -*- Mode: LISP; Syntax: COMMON-LISP -*-
(defsystem :abcl-prove
:version "1.8.0"
:version "1.8.1"
:defsystem-depends-on (prove-asdf)
:depends-on (prove)
:perform (test-op (o c)
Expand All @@ -12,6 +12,7 @@
(:test-file "byte-vectors")
(:test-file "compiler-stack-inconsistency")
(:test-file "compiler")
(:test-file "clos")
(:test-file "decode-float")
(:test-file "disassemble")
(:test-file "format-dollar")
Expand Down
2 changes: 1 addition & 1 deletion src/org/armedbear/lisp/clos.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
(incf length)
(push (slot-definition-name slot) instance-slots))
(:class
(unless (slot-definition-location slot)
(unless (ignore-errors (slot-definition-location slot))
(let ((allocation-class (slot-definition-allocation-class slot)))
(if (eq allocation-class class)
;; We initialize class slots here so they can be
Expand Down
20 changes: 20 additions & 0 deletions t/clos.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(in-package :cl-user)

;;; <https://abcl.org/trac/ticket/479>
(prove:plan 1)
(let ((file
(asdf:system-relative-pathname
:abcl
"t/eg/clos-unbound-use-mop.lisp")))
(prove:ok
(handler-case
(load file)
(t (e)
(prove:diag (format nil "Failed to load ~a: ~a" file e))
nil))
"Testing compilation of slot class allocation finalization"))

(prove:finalize)



39 changes: 39 additions & 0 deletions t/eg/clos-unbound-use-mop.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
(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 (mop:class-finalized-p (find-class 'test-object))
(finalize-inheritance (find-class 'test-object)))