Hi all,

I was trying to add MooseX::Role::Warnings to MooseX::Role::Strict only to find 
that tests now fail due to a behavior change.  Specifically, the cause is this:

    #!/usr/bin/env perl 

    use Modern::Perl;
    {
        package My::Role;
        use Moose::Role;
        sub foo { }
    }
    {
        package My::Class;
        use Moose;
        with 'My::Role';
    }
    foreach my $role ( @{My::Class->meta->roles} ) {
        my $name = $role->name;
        foreach my $method ( $role->get_method_list ) {
            say "$name - $method";
        }
    }
    __END__
    My::Role - meta
    My::Role - foo

The method 'meta' is now the method list for the role. As of .075, this was not 
true.  I assume this new behavior is intended?  

I'm trying to think of the best to handle this.  MooseX::Role::Warnings will be 
intended to offer warnings (rather than being fatal) if a class provides a 
method that overrides a role method without explicitly listing this method as 
excluded from the role.  (I know that not everyone likes this, that's not what 
I'm trying to get consensus on :)

Cheers,

Ovid 
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Reply via email to