Subject: | Overloading still broken with Moose |
Non-role use of "overload" still appears to be broken after the 0.16_TRIAL fix (RT #50938).
There are tests for non-Moose overload and for Moose::Role overload (with MooseX::Role::WithOverload), but don't appear to be any for plain Moose objects.
Subject: | overload-with-moose.t |
use Test::More;
{
package Foo;
use Moose;
use namespace::autoclean;
use overload q{""} => 'as_string';
has name => (is => 'ro', isa => 'Str');
sub as_string {
return shift->name;
}
1;
}
my $foo = Foo->new( { name => "Foo" } );
is "$foo", 'Foo', "overload as_string ok";