Skip Menu |

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

Report information
The Basics
Id: 76054
Status: open
Priority: 0/
Queue: MooseX-LazyRequire

People
Owner: Nobody in particular
Requestors: ilyuha1 [...] mail.ru
Cc:
AdminCc:

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



Subject: 'lazy_required' doesn't work on inherited attributes
MooseX::LazyRequire doesn't work for inherited attributes, test is in attached file.
Subject: moosex-lazyrequire-inheritance.t
#!/usr/bin/env perl use strict; use warnings; use Test::Exception tests => 1; { package Account; use Moose; use MooseX::LazyRequire; has 'password' => ( is => 'rw', isa => 'Str', ); package AccountExt; use Moose; extends 'Account'; use MooseX::LazyRequire; use Carp; has '+password' => ( is => 'ro', # Probably there also should be: # traits => ['LazyRequire'], # but I'm not sure lazy_required => 1, ); } my $r = AccountExt->new; throws_ok( sub { print $r->password }, qr/Attribute password must be provided before calling reader/, 'works on inherited attributes' );
On Mon Mar 26 11:20:00 2012, ichesnokov wrote: Show quoted text
> MooseX::LazyRequire doesn't work for inherited attributes, test is in > attached file.
I think I have a fix at https://github.com/moose/MooseX-LazyRequire/pull/1