Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make 'samewith' also work on subs, masak++
This fixes #125539
  • Loading branch information
lizmat committed Jul 5, 2015
1 parent 37b5793 commit f098e0f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/control.pm
Expand Up @@ -140,12 +140,12 @@ my &lastcall := -> {
};

sub samewith(|c) {
my $my = callframe(1).my;
my $self = $my<self>;
die "Could not find 'self'" if !$self.DEFINITE;
my $dispatcher = $my<&?ROUTINE>.dispatcher
|| die "Could not find dispatcher";
$dispatcher( $self, |c );
my $my := callframe(1).my;
my $caller := $my<&?ROUTINE>;
my $dispatcher := $caller.dispatcher || die "Could not find dispatcher";
nqp::istype($caller,Method)
?? $dispatcher($my<self> // $caller.package, |c)
!! $dispatcher(|c);
}

proto sub die(|) {*};
Expand Down

0 comments on commit f098e0f

Please sign in to comment.