develooper Front page | perl.moose | Postings from March 2009

Making "writer" changed in inheritance

From:
mikhail maluyk
Date:
March 17, 2009 10:17
Subject:
Making "writer" changed in inheritance
Message ID:
98c65a030903171017h1e163369m4344ec6a53bf0ffd@mail.gmail.com
Hello everybody
package Foo;
use Moose::Role

has 'file' => ( isa => 'Str' , is => 'rw');

package Bar;
use Moose;

with 'Foo'

has '+file' => ( writer => 'set_foo_file' );

It wouldn't work, breaking with: "Illegal inherited options". I'm wondering
if this restriction could be overridden somehow?
Docs says that it could with using my own meta class, is it okay to add
"writer" to @legal_options_for_inheritance?

-- 
Regards,
Mikhail



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About