Use new overload_op_info() function

This fetches the info for a single overloaded op, instead of fetching
them all and then throwing all but one away.
parent 46bcaee5
......@@ -279,8 +279,8 @@ skip = ^Moose::Meta::TypeConstraint::Union$
;authordep Data::OptList = 0.107
Devel::GlobalDestruction = 0
;authordep Devel::GlobalDestruction = 0
Devel::OverloadInfo = 0.004
;authordep Devel::OverloadInfo = 0.004
Devel::OverloadInfo = 0.005
;authordep Devel::OverloadInfo = 0.005
Devel::StackTrace = 2.03
;authordep Devel::StackTrace = 2.03
Eval::Closure = 0.04
......
......@@ -6,7 +6,7 @@ use warnings;
use Class::MOP::Overload;
use Devel::OverloadInfo 0.004 'overload_info';
use Devel::OverloadInfo 0.005 'overload_info', 'overload_op_info';
use Scalar::Util 'blessed';
use Sub::Identify 'sub_name', 'stash_name';
......@@ -34,7 +34,7 @@ sub get_all_overloaded_operators {
sub has_overloaded_operator {
my $self = shift;
my ($op) = @_;
return defined $self->_overload_info->{$op};
return defined $self->_overload_info_for($op);
}
sub _overload_map {
......@@ -110,7 +110,7 @@ sub remove_overloaded_operator {
sub get_overload_fallback_value {
my $self = shift;
return $self->_overload_info->{fallback}{value};
return ($self->_overload_info_for('fallback') || {})->{value};
}
sub set_overload_fallback_value {
......@@ -127,6 +127,12 @@ sub _overload_info {
return overload_info( $self->name ) || {};
}
sub _overload_info_for {
my $self = shift;
my $op = shift;
return overload_op_info( $self->name, $op );
}
sub _overload_for {
my $self = shift;
my $op = shift;
......@@ -134,7 +140,7 @@ sub _overload_for {
my $map = $self->_overload_map;
return $map->{$op} if $map->{$op};
my $info = $self->_overload_info->{$op};
my $info = $self->_overload_info_for($op);
return unless $info;
my %p = (
......
......@@ -7,7 +7,7 @@ use metaclass;
use Scalar::Util 'blessed';
use List::Util 1.33 'all';
use Devel::OverloadInfo 0.004 'is_overloaded';
use Devel::OverloadInfo 0.005 'is_overloaded';
use parent 'Moose::Meta::Role::Application';
......
......@@ -4,7 +4,7 @@ use strict;
use warnings;
use Test::More 0.88;
use Devel::OverloadInfo 0.004 'is_overloaded';
use Devel::OverloadInfo 0.005 'is_overloaded';
sub test_overloading_for_package {
my $package = shift;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment