Skip to content

Commit 686d9ed

Browse files
committed
Fix composing roles with regexes in.
The runtime mixin case worked, but curiously not the compile time one.
1 parent 5e80295 commit 686d9ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/NQP/World.pm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class NQP::World is HLL::World {
1212
# compilation unit ID to a list of code objects.
1313
has %!code_objects_to_fix_up;
1414

15+
# The types of those code objects.
16+
has %!code_object_types;
17+
1518
# Mapping of QAST::Stmts node containing fixups, keyed by sub ID. If
1619
# we do dynamic compilation then we do the fixups immediately and
1720
# then clear this list.
@@ -23,6 +26,7 @@ class NQP::World is HLL::World {
2326
method BUILD(*%opts) {
2427
@!BLOCKS := nqp::list();
2528
%!code_objects_to_fix_up := nqp::hash();
29+
%!code_object_types := nqp::hash();
2630
%!code_object_fixup_list := nqp::hash();
2731
%!code_stub_sc_idx := nqp::hash();
2832
}
@@ -235,9 +239,9 @@ class NQP::World is HLL::World {
235239
# entry in the SC. Make sure the newly compiled code is marked
236240
# as a static code ref.
237241
my $static := %!code_objects_to_fix_up{$subid}.shift();
238-
nqp::bindattr($static, $code_type, '$!do', $compiled[$i]);
242+
nqp::bindattr($static, %!code_object_types{$subid}, '$!do', $compiled[$i]);
239243
for %!code_objects_to_fix_up{$subid} {
240-
nqp::bindattr($_, $code_type, '$!do', nqp::clone($compiled[$i]));
244+
nqp::bindattr($_, %!code_object_types{$subid}, '$!do', nqp::clone($compiled[$i]));
241245
}
242246
pir::setprop__vPsP($compiled[$i], 'STATIC_CODE_REF', $compiled[$i]);
243247
self.update_root_code_ref(%!code_stub_sc_idx{$subid}, $compiled[$i]);
@@ -340,6 +344,7 @@ class NQP::World is HLL::World {
340344

341345
# Add it to the dynamic compilation fixup todo list.
342346
%!code_objects_to_fix_up{$past.cuid()} := [$code_obj];
347+
%!code_object_types{$past.cuid()} := $code_type;
343348

344349
$code_obj
345350
}

0 commit comments

Comments
 (0)