> On 08 Jan 2015, at 13:36, Elizabeth Mattijsen <[email protected]> wrote:
> I further golfed this down to:
>
> multi sub trait_mod:<is>(Routine $r, :$foo!) {
> $r.wrap(-> |c {
> });
> }
> sub a is foo { say "a" };
> a
>
> Put this in a file with a .pm extension, precomp it like above, and try to
> load it.
By making the block completely parameterless, it gives a stack trace
Cannot invoke null object
at A.pm:2 (/Users/liz/Github/rakudo.moar/A.pm.moarvm::17)
from src/gen/m-Metamodel.nqp:3185 (blib/Perl6/Metamodel.moarvm:enter:28)
that brings us to:
src/Perl6/Metamodel/Dispatchers.nqp
line 101:
method enter(*@pos, *%named) {
my $fresh := nqp::clone(self);
my $first := self.candidates[0];
nqp::setdispatcher($fresh);
$first(|@pos, |%named) # <— $first is not set
}
So it would appear that we cannot find a candidate to be dispatched to.
Perhaps the original sub is not serialized???
Liz