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->();
};'
}
}
for my $value (@{ $values_for_type{$type}{invalid} }) {
- my $display = defined($value) ? $value : 'undef';
+ my $display = defined($value) ? overload::StrVal($value) : 'undef';
my $via_new;
throws_ok {
$via_new = Class->new($type => $value);