Skip to content

Commit

Permalink
Merge pull request #2780 from vrurg/issue_2772
Browse files Browse the repository at this point in the history
Fixed method cloning
  • Loading branch information
lizmat committed Mar 22, 2019
2 parents 787d5bf + ed29caa commit 411a415
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -887,4 +887,8 @@ N: Oleksii Varianyk
U: cono
E: q@cono.org.ua

N: Vadim Belman
U: vrurg
E: vrurg@cpan.org

=cut
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/BOOTSTRAP.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ class ContainerDescriptor::BindArrayPos2D does ContainerDescriptor::Whence {
$self
}

method name() {
method name() {
'element at [' ~ $!one ~ ',' ~ $!two ~ ']' # XXX name ?
}
method assigned($scalar) {
Expand Down
5 changes: 5 additions & 0 deletions src/Perl6/World.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,10 @@ class Perl6::World is HLL::World {
unless $precomp {
$compiler_thunk();
}
my $code_obj := nqp::getcodeobj(nqp::curcode());
unless nqp::isnull($code_obj) {
return $code_obj(|@pos, |%named);
}
$precomp(|@pos, |%named);
});
@compstuff[1] := $compiler_thunk;
Expand Down Expand Up @@ -2511,6 +2515,7 @@ class Perl6::World is HLL::World {
self.context().add_cleanup_task(sub () {
nqp::bindattr($clone, $code_type, '@!compstuff', nqp::null());
});
self.context().add_clone_for_cuid($clone, $cuid);
my $tmp := $fixups.unique('tmp_block_fixup');
$fixups.push(QAST::Stmt.new(
QAST::Op.new(
Expand Down

0 comments on commit 411a415

Please sign in to comment.