Skip to content

Instantly share code, notes, and snippets.

@eikef

eikef/Problem Secret

Created August 25, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eikef/7de3095f0034ea17b2c85710df1faf76 to your computer and use it in GitHub Desktop.
Save eikef/7de3095f0034ea17b2c85710df1faf76 to your computer and use it in GitHub Desktop.
test.pl produces
test, successfully wrapped
a
test2.pl produces
Cannot invoke this object (REPR: Null; VMNull)
in block at (...)testimport.pm (testimport) line 7
in any enter at gen/moar/m-Metamodel.nqp line 4012
in block <unit> at test2.pl line 6
Unfortunately I am at a loss as to why.
#!/usr/bin/env perl6
use v6;
multi sub trait_mod:<is>(Routine:D $r, :$wrapped!) {
$r.wrap: -> |args {
put "test, successfully wrapped";
callsame
}
}
sub test(Str $a) is wrapped {
$a.say
}
test("a");
#!/usr/bin/env perl6
use v6;
use testimport;
test("a");
#!/usr/bin/env perl6
unit module testimport;
multi sub trait_mod:<is>(Routine:D $r, :$wrapped!) {
$r.wrap: -> |args {
put "test, successfully wrapped";
callsame
}
}
sub test(Str $a) is wrapped is export {
$a.say
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment