Skip to content

Commit 57988ce

Browse files
committed
Update NQPClassHOW to provide information for the new boolification protocol.
1 parent 1a9cdae commit 57988ce

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/how/NQPClassHOW.pm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ knowhow NQPClassHOW {
170170
# Compose attributes.
171171
for self.attributes($obj, :local<0> ) { $_.compose($obj) }
172172

173-
# Publish type and method caches.
173+
# Publish type and method caches and boolification spec.
174174
self.publish_type_cache($obj);
175175
self.publish_method_cache($obj);
176+
self.publish_boolification_spec($obj);
176177

177178
# Install Parrot v-table mapping.
178179
self.publish_parrot_vtable_mapping($obj);
@@ -350,6 +351,16 @@ knowhow NQPClassHOW {
350351
pir::publish_method_cache($obj, %cache)
351352
}
352353

354+
method publish_boolification_spec($obj) {
355+
my $bool_meth := self.find_method($obj, 'Bool');
356+
if pir::defined($bool_meth) {
357+
pir::set_boolification_spec__0PiP($obj, 0, $bool_meth)
358+
}
359+
else {
360+
pir::set_boolification_spec__0PiP($obj, 5, pir::null__P())
361+
}
362+
}
363+
353364
method publish_parrot_vtable_mapping($obj) {
354365
my %mapping;
355366
for @!mro {

0 commit comments

Comments
 (0)