X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=54fc2b57bd4e6e8e2596f366f7ae2e0c939f4970;hb=31aa6299ca20515174f1b145e5b3d4dbd9e09a08;hp=eb8f1d733f7c1418a500ee915aeb6b3de689cd49;hpb=b11787bf7cafe5074ae42bf8ef4258c5c176f1d2;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index eb8f1d7..54fc2b5 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -255,8 +255,15 @@ sub install_accessors{ if(exists $attribute->{$type}){ my $generator = '_generate_' . $type; my $code = $accessor_class->$generator($attribute, $metaclass); - $metaclass->add_method($attribute->{$type} => $code); - $attribute->associate_method($attribute->{$type}); + my $name = $attribute->{$type}; +# TODO: do something for compatibility +# if( $metaclass->name->can($name) ) { +# my $t = $metaclass->has_method($name) ? 'method' : 'function'; +# Carp::cluck("You are overwriting a locally defined $t" +# . " ($name) with an accessor"); +# } + $metaclass->add_method($name => $code); + $attribute->associate_method($name); } } @@ -342,7 +349,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 VERSION -This document describes Mouse version 0.80 +This document describes Mouse version 0.95 =head1 DESCRIPTION