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=a2569d464619290ede01fc71cedef355f6d784d6;hp=7d3c3805ad4fdab790e06ea0eb849b76e57a2fed;hb=e8b3db47ed7f906cc4ad294d2a28b36656a3c333;hpb=384072a3e031806229e4b11dfb5c055e8829ff08 diff --git a/lib/Mouse/Attribute.pm b/lib/Mouse/Attribute.pm index 7d3c380..a2569d4 100644 --- a/lib/Mouse/Attribute.pm +++ b/lib/Mouse/Attribute.pm @@ -60,7 +60,7 @@ sub generate_accessor { if ($constraint) { $accessor .= 'do { - my $display = defined($_) ? $_ : "undef"; + my $display = defined($_) ? overload::StrVal($_) : "undef"; Carp::confess("Attribute ($name) does not pass the type constraint because: Validation failed for \'$type\' failed with value $display") unless $constraint->(); };' }