Subject: | Monkey-patching UNIVERSAL::isa breaks contract |
This monkey patch to UNIVERSAL::isa
*UNIVERSAL::isa = sub
{
my ($thing, $type) = @_;
# Want classes?
if (! $type) {
return $thing->Object::InsideOut::meta()->get_classes();
}
goto $GBL{'isa'};
};
Breaks this code in Rose::HTML::Form::Field::Group -- in the line below,
$class or $group_class may be false, and your patched version of isa
blindly tries to call Object::InsideOut::meta() on $arg, which is not
appropriate:
if(UNIVERSAL::isa($arg, $class) || UNIVERSAL::isa($arg, $group_class))
...
You patch needs to do further checking on $thing to see that it
can(Object::InsideOut::meta), or eval the call.
Thanks!