return @$overload_operators;
}
+sub is_overloaded {
+ my $self = shift;
+ return overload::Overloaded($self->name);
+}
+
# XXX this could probably stand to be cached, but i figure it should be
# uncommon enough to not particularly matter
sub _overload_map {
my $self = shift;
- return {} unless overload::Overloaded($self->name);
+ return {} unless $self->is_overloaded;
my %map;
for my $op ($self->overload_operators) {
{
my $meta = Foo->meta;
+ ok(!$meta->is_overloaded);
+
is_deeply([sort $meta->overload_operators],
[sort map { split /\s+/ } values %overload::ops]);
{
my $meta = Foo::Overloaded->meta;
+ ok($meta->is_overloaded);
+
ok($meta->has_overloaded_operator('+'));
ok(!$meta->has_overloaded_operator('-'));