Skip Menu |

This queue is for tickets about the MooX-ClassAttribute CPAN distribution.

Report information
The Basics
Id: 86209
Status: stalled
Priority: 0/
Queue: MooX-ClassAttribute

People
Owner: perl [...] toby.ink
Requestors: rsimoes [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Issues with class attribute inheritance
Creating an attribute "stub" in a role doesn't appear to work with MooX::ClassAttribute. See, for example, the following, which yields "Must have an is at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Method/Generate/Accessor.pm line 30.": https://gist.github.com/rsimoes/5799805 Changing Moo to Moose (and MooX::ClassAttribute to MooseX::ClassAttribute) yields the expected result. Changing the class attributes to regular object attributes also works.
The CAVEATS section in the documentation does explicitly say: Show quoted text
> Overriding class attributes and their accessors > in subclasses is not yet supported. The > implementation, and expected behaviour hasn't > been figured out yet.
For now, a workaround would be to set a *builder* rather than a default in the parent class, and then override the builder in the child class.
Guess I should read docs more thoroughly. Sorry! On Mon Jun 17 16:25:30 2013, TOBYINK wrote: Show quoted text
> The CAVEATS section in the documentation does explicitly say: >
> > Overriding class attributes and their accessors > > in subclasses is not yet supported. The > > implementation, and expected behaviour hasn't > > been figured out yet.
> > For now, a workaround would be to set a *builder* rather than a > default in the parent class, and then override the builder in the > child class.
No problem. I'm keeping this bug open because, documented or not, it is an issue that needs to be resolved.