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

Making "writer" changed in inheritance

mikhail maluyk
March 17, 2009 10:17
Making "writer" changed in inheritance
Message ID:
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?

Mikhail Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About