Subject: | Aliased attributes and methods do not satisfy role requirements |
Let's say I have a role with the statement "requires qw( that )". I
want to use the role in a class and have an attribute called 'this' with
the property "alias => 'that'". I also want this alias to satisfy the
'requires' statement from the role.
This doesn't work because Moose doesn't recognize aliased attributes
(and possibly methods) as satisfying 'requires' statements from roles.
I get an exception like this:
'MyApp::Role' requires the method 'that' to be implemented by 'MyApp'
...
I have attached a script demonstrating the issue.
Subject: | moosex-aliases-bug.pl |
package MyApp::Role;
use Moose::Role;
requires qw( that );
package MyApp;
use Moose;
use MooseX::Aliases;
with qw( MyApp::Role );
has this => (
isa => 'Str',
is => 'rw',
alias => 'that',
);