Revision history for Perl extension Class::C3.
+ - Fix for overloading to method name string,
+ from Ittetsu Miyazaki.
+
0.14 Tues, Sep 19, 2006
- Fix for rt.cpan.org #21558
- converted to Module::Build
${"${class}::()"} = $MRO{$class}->{has_overload_fallback}
if $MRO{$class}->{has_overload_fallback};
foreach my $method (keys %{$MRO{$class}->{methods}}) {
+ if ( $method =~ /^\(/ ) {
+ my $orig = $MRO{$class}->{methods}->{$method}->{orig};
+ ${"${class}::$method"} = $$orig if defined $$orig;
+ }
*{"${class}::$method"} = $MRO{$class}->{methods}->{$method}->{code};
}
}
use strict;
use warnings;
-use Test::More tests => 8;
+use Test::More tests => 9;
BEGIN {
use_ok('Class::C3');
use warnings;
use base 'OverloadingTest';
use Class::C3;
+
+ package BaseTwo;
+ use overload (
+ q{fallback} => 1,
+ q{""} => 'str', ### character
+ );
+ sub str {
+ return 'BaseTwo str';
+ }
+
+ package OverloadInheritTwo;
+ use Class::C3;
+ use base qw/BaseTwo/;
+
}
Class::C3::initialize();
ok(!$@, '... this should not throw an exception');
ok($result, '... and we should get the true value');
+eval {
+ my $obj = bless {}, 'OverloadInheritTwo';
+};
+is($@, '', "Overloading to method name string");
+
#use Data::Dumper;
#diag Dumper { Class::C3::_dump_MRO_table }