On Tue, Sep 01, 2009 at 10:58:58PM -0500, Chris Fields wrote: > All, > > Not sure if this is addressed in some way with the merge of MXAH to > core, but I ran into a small issue with roles and aliasing methods. Not > sure if I'm approaching this right though, so please let me know if I'm > not. I already have the workaround (e.g. explicitly define the methods in > the role, don't use 'provides'). This was using Moose 0.89 on OS X 10.6 > (works great on Snow Leopard BTW).
This doesn't actually have anything to do with MX-AttributeHelpers, the same thing happens if you just try to alias the normal accessor. The issue is that attributes in roles aren't real attributes at the moment, and in particular, the attribute accessors aren't generated until the attribute is composed into an actual class, which happens after the processing for 'alias' and 'excludes' takes place. This is something that's intended to be fixed in the future, but it's going to take a bit of effort to get done. In the meantime, you might want to check out MooseX::Aliases, which would let you do something like "alias add_stuff => 'add_my_stuff'" rather than relying on the role composition aliasing features. -doy