}
else{ # writer
$accessor .=
- 'if(@_ < 2){ Carp::confess("Not enough arguments for the writer of '.$name.'") }'.
+ 'if(@_ < 2){ Carp::confess("Not enough arguments for the writer of $name") }'.
'{' . "\n";
}
$accessor .= "}\n";
}
elsif($type eq 'ro') {
- $accessor .= 'Carp::confess("Cannot assign a value to a read-only accessor") if scalar(@_) >= 2;' . "\n";
+ $accessor .= 'Carp::confess("Cannot assign a value to a read-only accessor of $name") if scalar(@_) >= 2;' . "\n";
}
else{
$class->throw_error("Unknown accessor type '$type'");
}
- if ($attribute->is_lazy) {
+ if ($attribute->is_lazy and $type ne 'wo') {
my $value;
if (defined $builder){
$value = '$default';
}
- $accessor .= "els" if $type eq 'rw' || $type eq 'wo';
+ $accessor .= "els" if $type eq 'rw';
$accessor .= "if(!exists $slot){\n";
if($should_coerce){
$accessor .= "$slot = \$constraint->coerce($value)";
=head1 VERSION
-This document describes Mouse version 0.52
+This document describes Mouse version 0.72
=head1 SEE ALSO