Browse code
Fix let-pat* to ensure that the class is finalized before matching
Showing 1 changed files
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
(when (closer-mop:subclassp pattern 'standard-object) |
35 | 35 |
(apply #'handle-pattern |
36 | 36 |
(closer-mop:class-prototype |
37 |
- (find-class pattern)) |
|
37 |
+ (closer-mop:ensure-finalized (find-class pattern))) |
|
38 | 38 |
form |
39 | 39 |
args))))) |
40 | 40 |
|
... | ... |
@@ -90,12 +90,13 @@ |
90 | 90 |
(declare (ignore a)) |
91 | 91 |
b))) |
92 | 92 |
|
93 |
-(defclass test-base () |
|
94 |
- ((a :initform 1))) |
|
95 |
-(defclass test-sub1 (test-base) |
|
96 |
- ()) |
|
97 |
-(defclass test-sub2 (test-base) |
|
98 |
- ((b :initform 2))) |
|
93 |
+(eval-when (:compile-toplevel :load-toplevel :execute) |
|
94 |
+ (defclass test-base () |
|
95 |
+ ((a :initform 1))) |
|
96 |
+ (defclass test-sub1 (test-base) |
|
97 |
+ ()) |
|
98 |
+ (defclass test-sub2 (test-base) |
|
99 |
+ ((b :initform 2)))) |
|
99 | 100 |
|
100 | 101 |
(defmethod patmatch:handle-pattern append ((pattern test-base) form &rest args) |
101 | 102 |
(alexandria:when-let ((arg (getf args :a))) |