Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make List.sink safe for invoking on the type object
  • Loading branch information
moritz committed Feb 18, 2012
1 parent f9e18ea commit bbfd717
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Perl6/World.pm
Expand Up @@ -765,10 +765,12 @@ class Perl6::World is HLL::World {
}
};
my $stub := sub (*@pos, *%named) {
unless $precomp {
if $precomp {
$precomp(|@pos, |%named);
}
else {
$compiler_thunk();
}
$precomp(|@pos, |%named);
};
pir::setprop__vPsP($stub, 'COMPILER_THUNK', $compiler_thunk);
pir::set__vPS($stub, $code_past.name);
Expand Down Expand Up @@ -1513,7 +1515,8 @@ class Perl6::World is HLL::World {

# Call it right away.
my $ret := $trait_sub(|@pos_args, |%named_args);
# if pir::can__IPs($ret, 'sink') { $ret.sink }
pir::say(pir::typeof__SP($ret));
if pir::can__IPs($ret, 'sink') { $ret.sink }

# Serialize call to it.
if self.is_precompilation_mode() {
Expand Down
1 change: 1 addition & 0 deletions src/core/List.pm
Expand Up @@ -80,6 +80,7 @@ my class List does Positional {

method eager() { self.gimme(*); self }
method sink() {
return unless self.DEFINITE;
while defined $!nextiter {
$!nextiter.reify(*, :sink);
}
Expand Down

0 comments on commit bbfd717

Please sign in to comment.