* module/oop/goops.scm (%compute-layout): Fix class slot layout.
Before, a #:class that was an argument to #:allocation was getting
interpreted as a keyword with a value.
* test-suite/tests/goops.test ("#:class slot allocation"): Add test.
(define (slot-protection-and-kind slot)
(define (subclass? class parent)
(memq parent (class-precedence-list class)))
- (let ((type (kw-arg-ref (%slot-definition-options slot) #:class)))
+ (let ((type (get-keyword #:class (%slot-definition-options slot))))
(if (and type (subclass? type <foreign-slot>))
(values (cond
((subclass? type <self-slot>) #\s)
exception:out-of-range
(make <foreign-test> #:a (ash 1 64))))
+(with-test-prefix "#:class slot allocation"
+ (pass-if-equal "basic class slot allocation" #:class
+ (eval '(begin
+ (define-class <has-a-class-slot> ()
+ (bar #:allocation #:class #:init-value 'baz))
+ (slot-definition-allocation
+ (class-slot-definition <has-a-class-slot> 'bar)))
+ (current-module))))
+
(with-test-prefix "#:each-subclass"
(let* ((<subclass-allocation-test>
(class ()