Skip Menu |

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

Report information
The Basics
Id: 57579
Status: resolved
Priority: 0/
Queue: MooseX-ClassAttribute

People
Owner: Nobody in particular
Requestors: knb [...] gfz-potsdam.de
Cc:
AdminCc:

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



Subject: class_has "handles => {}" option does not play well with Meta::Attribute::Native::Trait::Array
Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 GNU/Linux This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi Distribution DROLSKY/MooseX-ClassAttribute-0.13.tar.gz class_has handles => { 'count_data' => 'count', ... } does not play well with Meta::Attribute::Native::Trait::Array When I want to use the methods provided by the handles => {} option I get messages like this just because it is a class attribute: Cannot delegate count_data to count because the value of data is not an object (got 'ARRAY(0x5366638)') plus "stacktrace" ... omitted here The Attribute 'data', defined in my class as class_has 'data' => ( is => 'rw', isa => 'ArrayRef', writer => 'set_data', clearer => 'clear_data', predicate => 'has_data', default => sub { [] }, lazy => 1, handles => { 'count_data' => 'count', 'elements_data' => 'elements', 'uniq_data' => 'uniq', 'map_data' => 'map', }, );
Subject: Re: [rt.cpan.org #57579] class_has "handles => {}" option does not play well with Meta::Attribute::Native::Trait::Array
Date: Tue, 18 May 2010 09:43:46 -0500 (CDT)
To: Knut Behrends via RT <bug-MooseX-ClassAttribute [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 18 May 2010, Knut Behrends via RT wrote: Show quoted text
> class_has 'data' => ( > > is => 'rw', > isa => 'ArrayRef', > writer => 'set_data', > clearer => 'clear_data', > predicate => 'has_data', > default => sub { [] }, > lazy => 1, > handles => { > 'count_data' => 'count', > 'elements_data' => 'elements', > 'uniq_data' => 'uniq', > 'map_data' => 'map', > }, > );
You're not using native traits here. Where's the "traits => ['Array']" ? -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
From: knb [...] gfz-potsdam.de
On Tue May 18 10:43:56 2010, autarch@urth.org wrote: Show quoted text
> On Tue, 18 May 2010, Knut Behrends via RT wrote: >
> > class_has 'data' => ( > > > > is => 'rw', > > isa => 'ArrayRef',
Show quoted text
> > You're not using native traits here. Where's the "traits => ['Array']" ? > > > -dave
"traits => ['Array']" used to be where the blank line is in the code above... I admit that I didn't realize that I deleted the declaration together with the 'NoGetopt' trait that wasn't needed for this class. Clearly a case of lack of focus, due to staring at the screen for too many hours. Thanks anyway, Knut