On Thu, Aug 20, 2009 at 4:40 AM, Jesse Luehrs<d...@tozt.net> wrote:
> I have a couple braches sitting around, and it would be great to get
> them reviewed and (possibly) merged. They are:
>
> topic/deprecate_alias_excludes
> - This builds off the previous topic/rename_alias_excludes, but actually
>  adds a warning when using the old names.
>
> topic/immutable_subclass_warning
> - This deals with an issue we ran into in #moose today - someone had
>  classes like this:
>
>  package Parent;
>  use Moose;
>
>  use Child;
>
>  has child => (
>    is  => 'ro',
>    isa => 'Maybe[Child]',
>  );
>
>  __PACKAGE__->meta->make_immutable;
>
>  and
>
>  Package Child;
>  use Moose;
>  extends 'Parent';
>
>  has parent => (
>    is  => 'ro',
>    isa => 'Parent',
>  );
>
>  __PACKAGE__->meta->make_immutable;
>
>  This failed because Child was being created and immutablized partway
>  through the definition of Parent, and so Child's constructor (among
>  other things) was incorrect (it didn't include attribute
>  initialization code for the child attribute). This branch adds a
>  warning whenever someone tries to call make_immutable on a class whose
>  ancestor classes are not already immutable. There are a few caveats:

I'm not familiar with the code, but would it be possible to remove the
warning and, instead attach some kind of memento to the parents'
metaclasses which will freeze the child class once the last parent has
become immutable?

And that code's surely asking for trouble.

Reply via email to