Subject: | Role's 'requires' doesn't recognize methods |
Between the black voodoo of M:M:S and the arcane meta-magic of Roles, it
seems that methods aren't recognized by Roles:
yanick@enkidu ~/tmp $ cat Foo.pm
package Foo;
use Moose;
use strict;
use warnings;
use MooseX::Method::Signatures;
with 'Bar';
method frobuscate { }
1;
yanick@enkidu ~/tmp $ cat Bar.pm
package Bar;
use strict;
use warnings;
use Moose::Role;
requires 'frobuscate';
1;
yanick@enkidu ~/tmp $ perl Foo.pm
'Bar' requires the method 'frobuscate' to be implemented by 'Foo' at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Meta/Role/Application.pm line 59
Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0x8a50448)',
'Moose::Meta::Role=HASH(0x8a507a8)',
'Moose::Meta::Class=HASH(0x8586598)') called at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Meta/Role/Application/ToClass.pm
line 17
Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0x8a50448)',
'Moose::Meta::Role=HASH(0x8a507a8)',
'Moose::Meta::Class=HASH(0x8586598)') called at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Meta/Role.pm line 447
Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0x8a507a8)',
'Moose::Meta::Class=HASH(0x8586598)') called at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Util.pm line 93
Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x8586598)',
'Bar') called at /usr/local/lib/perl5/site_perl/5.10.0/Moose.pm line 70
Moose::with('Foo', 'Bar') called at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Exporter.pm line 186
Moose::with('Bar') called at Foo.pm line 10