Subject: | Validation of objects with overloads |
Validation of objects with overloaded 'bool' ( as well as '0+') leads to
side effects.
This test
http://cpansearch.perl.org/src/DROLSKY/Params-Validate-0.95/t/22-overload-can-bug.t
seems to address related bug.
But if I change
use overload 'bool' => sub {0};
to
use overload 'bool' => sub {die};
then boolean conversion will be called and die, which is not what I want
when validating with { isa => ...} rule.
Specifically, this behavior gives me unwanted database requests when I
validate DBIx::Class::ResultSet objects, which has numification defined
on them.