Subject: | Set::Scalar::Base::_binary_underload bug |
In sub _binary_underload, Set::Scalar once again assumes that ALL references are objects. What's more, it assumes that ANY reference passed is an instance of Set::Scalar.
Instead, I once again suggest using Sclar::Util::blessed to determine that the object is blessed. Here's a proposed fix:
sub _binary_underload { # Handle overloaded binary operators.
my (@args) = @{ $_[0] };
if (@args == 3) {
$args[1] = (ref $args[0])->new( $args[1] )
unless Scalar::Util::blessed($args[1]) &&
$args[1]->isa('Set::Scalar') ;
@args[0, 1] = @args[1, 0] if $args[OVERLOAD_BINARY_REVERSED];
pop @args;
}
return @args;
}
Enjoy,
Josh