experimental feature and probably not finished
see t/038_attribute_inherited_slot_specs.t for
more details, or ask about it on #moose
+ - added tests for this
* Moose::Role
- keywords are now exported with Sub::Exporter
t/031_attribute_writer_generation.t
t/032_attribute_accessor_generation.t
t/033_attribute_triggers.t
-t/034_does_attribute_option.t
+t/034_attribute_does.t
t/040_meta_role.t
t/041_role.t
t/042_apply_role.t
$meta = Moose::Meta::Class->initialize($class);
$meta->add_method('meta' => sub {
# re-initialize so it inherits properly
- Moose::Meta::Class->initialize($class);
+ Moose::Meta::Class->initialize(blessed($_[0]) || $_[0]);
})
}
}
});
- sub import {
+ sub import {
$CALLER = caller();
# we should never export to main
return if $CALLER eq 'main';
goto $exporter;
- };
+ }
}
## Utility functions
delete $options{$legal_option};
}
}
- # isa can be changed, but only if the new type
- # is a subtype
+ # isa can be changed, but only if the
+ # new type is a subtype
if ($options{isa}) {
my $type_constraint;
if (blessed($options{isa}) && $options{isa}->isa('Moose::Meta::TypeConstraint')) {
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+
+BEGIN {
+ use_ok('Moose');
+}
+
+=pod
+
+This just makes sure that the Bar gets
+a metaclass initialized for it correctly.
+
+=cut
+
+{
+ package Foo;
+ use strict;
+ use warnings;
+ use Moose;
+
+ package Bar;
+ use strict;
+ use warnings;
+
+ use base 'Foo';
+}
+
+my $bar = Bar->new;
+isa_ok($bar, 'Bar');
+isa_ok($bar, 'Foo');
\ No newline at end of file