Also see Moose::Manual::Delta for more details of, and workarounds
for, noteworthy changes.
+ * Moose::Meta::Class
+ - Metaclass compat fixing should already happen recursively, there's no
+ need to explicitly walk up the inheritance tree. (doy)
+
0.91 Thu, Sep 17, 2009
* Moose::Object
- Don't import any functions, in order to avoid polluting our namespace
sub _fix_metaclass_incompatibility {
my ($self, @superclasses) = @_;
- foreach my $super (@superclasses) {
- my $meta = Class::MOP::Class->initialize($super);
-
- my @all_supers = $meta->linearized_isa;
- shift @all_supers;
-
- my @super_metas_to_fix = ($meta);
-
- # We need to check & fix the immediate superclass. If its @ISA
- # contains a class without a metaclass instance, followed by a
- # class _with_ a metaclass instance, init a metaclass instance
- # for classes without one and fix compat up to and including
- # the class which was already initialized.
- my $idx = first_index { Class::MOP::class_of($_) } @all_supers;
-
- push @super_metas_to_fix,
- map { Class::MOP::Class->initialize($_) } @all_supers[ 0 .. $idx ]
- if $idx >= 0;
-
- foreach my $super_meta (@super_metas_to_fix) {
- $self->_fix_one_incompatible_metaclass($super_meta);
- }
- }
+ $self->_fix_one_incompatible_metaclass($_)
+ for map { Moose::Meta::Class->initialize($_) } @superclasses;
}
sub _fix_one_incompatible_metaclass {
ok does_role($subsubclass_meta, 'My::Role'),
'SubSubClass metaclass does role from grandparent metaclass';
my $subclass_meta = find_meta('SubClassUseBase');
-TODO: {
- local $TODO = "In-between class' metaclass does not do My::Role";
- ok does_role($subclass_meta, 'My::Role'),
- 'SubClass metaclass does role from parent metaclass';
-}
+ok does_role($subclass_meta, 'My::Role'),
+ 'SubClass metaclass does role from parent metaclass';
use Test::More tests => 1;
use Test::Exception;
-TODO: {
- local $TODO = 'Metaclass incompatibility';
-
- lives_ok {
- Moose->init_meta(for_class => 'SomeClass');
- } 'Moose class => use base => Moose Class, then Moose->init_meta on middle class ok';
-}
-
+lives_ok {
+ Moose->init_meta(for_class => 'SomeClass');
+} 'Moose class => use base => Moose Class, then Moose->init_meta on middle class ok';