X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FAttribute.pm;h=2c8cc5b27f021674625d2de58225cf8bbde9194e;hp=41a56df0a6599013884870a92ea942b7c7deea5f;hb=b250019157d54598932f9e3e2a82f56c9a8937dd;hpb=9f15f9eb5321495ed6ad2001784c01417724ec9d diff --git a/lib/Mouse/Attribute.pm b/lib/Mouse/Attribute.pm index 41a56df..2c8cc5b 100644 --- a/lib/Mouse/Attribute.pm +++ b/lib/Mouse/Attribute.pm @@ -127,6 +127,8 @@ sub create { my $attribute = $self->new(%args, name => $name, class => $class); my $meta = $class->meta; + $meta->add_attribute($attribute); + # install an accessor if ($attribute->{is} eq 'rw' || $attribute->{is} eq 'ro') { my $accessor = $attribute->generate_accessor; @@ -134,8 +136,6 @@ sub create { *{ $class . '::' . $name } = $accessor; } - $meta->add_attribute($attribute); - for my $method (qw/predicate clearer/) { if (exists $attribute->{$method}) { my $generator = "generate_$method";