Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMNull in add_method in indirect use #2897

gfldex opened this issue May 14, 2019 · 0 comments


None yet
1 participant
Copy link

commented May 14, 2019

#  warn-in-add_method.pm6 
sub EXPORT {
    Nil.^add_method('list', method ($self: ){ my $i = 41++; Empty });

# warn-in-add_method-indirect.pm6
use warn-in-add_method;

#  warn-in-add_method.p6 
use v6.d;

use lib '.';
use warn-in-add_method-indirect;



Cannot invoke this object (REPR: Null; VMNull)
  in method <anon> at /home/dex/projects/perl6/rakudobug/warn-in-add_method.pm6 (warn-in-add_method) line 2
  in block <unit> at warn-in-add_method.p6 line 6

It doesn't really matter what the first statement in the added method is as long as it's not optimised away. The indirection is needed to trigger this and the `sub EXPORT´ is required to avoid STable-confusion (what may also be a bug).

$ perl6 --version
This is Rakudo version 2019.03.1-292-g48a12551f built on MoarVM version 2019.03-110-g081823ffc
implementing Perl 6.d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.