X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FAttribute.pm;fp=lib%2FMouse%2FAttribute.pm;h=b5dfb1d109be8cef772d8ab91520bd7bcccbc522;hp=1a971bfa4edd0a2006b86b48a3a9b6b3fb563d15;hb=636c002e5c9f843ad7c7cfb35a1511b4ccbb562f;hpb=010a2b16f8ed60a3dcca43e80ec75daee135447e diff --git a/lib/Mouse/Attribute.pm b/lib/Mouse/Attribute.pm index 1a971bf..b5dfb1d 100644 --- a/lib/Mouse/Attribute.pm +++ b/lib/Mouse/Attribute.pm @@ -78,6 +78,7 @@ sub generate_accessor { $accessor .= '}'; } else { + $accessor .= 'confess "Cannot assign a value to a read-only accessor" if @_;'; } if ($attribute->is_lazy) {