# New Ticket Created by  Rob Hoelz 
# Please include the string:  [perl #125719]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125719 >


See the attached files.

If you run test.pl without a precompiled Example.pm, everything works fine 
(FALLBACK is added to the Example class and the die() is called).  However, if 
you precompile Example.pm, you get the following error message:

Cannot invoke this object (REPR: Null, cs = 0)
  in block  at Example.pm:6
  in any  at src/gen/m-Metamodel.nqp:2867
  in block <unit> at test2.pl:6
use v6;

my multi sub trait_mod:<is>(Mu:U $class, Bool :$NYI, *%rest) {
    my $class-name = $class.^name;
    $class.^add_method('FALLBACK', -> | {
        die "Unable to call method on NYI class $class-name";
    });
}

our class Foo is NYI is export {
}
use v6;

use Example;

my $f = Foo.new;
say $f.greet;

Reply via email to