package main;
$| = 1;
-use Test::More tests => 535;
+use Test::More tests => 536;
$a = new Oscalar "087";
use overload "0+" => sub { $_[0][0]++; $_[0] };
package numify_other;
use overload "0+" => sub { $_[0][0]++; $_[0][1] = bless [], 'numify_int' };
+ package numify_by_fallback;
+ use overload "-" => sub { 1 }, fallback => 1;
package main;
my $o = bless [], 'numify_int';
is(int($s), 42, 'numifies to numification of other object');
is($s->[0], 1, 'int() numifies once when returning other object');
is($s->[1][0], 1, 'returned object numifies too');
+
+ my $m = bless $aref, 'numify_by_fallback';
+ is(int($m), $num_val, 'numifies to usual reference value');
}
while (SvAMAGIC(sv)) {
SV *tsv = AMG_CALLun(sv,numer);
+ if (!tsv)
+ break;
if (SvROK(tsv) && SvRV(tsv) == SvRV(sv)) {
SETi(PTR2IV(SvRV(sv)));
RETURN;