}
if (!(AMGf_noleft & flags) && SvAMAGIC(left)
- && (stash = SvSTASH(SvRV(left)))
+ && (stash = SvSTASH(SvRV(left))) && Gv_AMG(stash)
&& (mg = mg_find((const SV *)stash, PERL_MAGIC_overload_table))
&& (ocvp = cvp = (AMT_AMAGIC((AMT*)mg->mg_ptr)
? (oamtp = amtp = (AMT*)mg->mg_ptr)->table
}
if (!cv) goto not_found;
} else if (!(AMGf_noright & flags) && SvAMAGIC(right)
- && (stash = SvSTASH(SvRV(right)))
+ && (stash = SvSTASH(SvRV(right))) && Gv_AMG(stash)
&& (mg = mg_find((const SV *)stash, PERL_MAGIC_overload_table))
&& (cvp = (AMT_AMAGIC((AMT*)mg->mg_ptr)
? (amtp = (AMT*)mg->mg_ptr)->table
is(ref $b, "Oscalar");
is($a, "087");
-is($b, "88");
+is($b, "89");
is(ref $a, "Oscalar");
package Oscalar;
is(ref $b, "Oscalar");
is($a, "087");
-is($b, "90");
+is($b, "91");
is(ref $a, "Oscalar");
$b=$a;
is($aI, "xx");
is("b${aI}c", "_._.b.__.xx._.__.c._");
-# Here we test blessing to a package updates hash
+# Here we test that both "no overloading" and
+# blessing to a package update hash
eval "package Oscalar; no overload '.'";
-is("b${a}", "_.b.__.xx._");
+is("b${a}", "bxx");
$x="1";
bless \$x, Oscalar;
is("b${a}c", "bxxc");
eval "package Oscalar; sub comple; use overload '~' => 'comple'";
-$na = eval { ~$a }; # Hash was not updated
-like($@, qr/no method found/);
+$na = eval { ~$a };
+is($@, '');
bless \$x, Oscalar;
$na = 0;
-$na = eval { ~$aI }; # Hash was not updated
-like($@, qr/no method found/);
+$na = eval { ~$aI };
+like($@, '');
bless \$x, OscalarI;
eval "package Oscalar; sub rshft; use overload '>>' => 'rshft'";
-$na = eval { $aI >> 1 }; # Hash was not updated
-like($@, qr/no method found/);
+$na = eval { $aI >> 1 };
+is($@, '');
bless \$x, OscalarI;
undef $TODO;
is cos $o, 'eleven',
'ovrld applies to previously-blessed obj after other obj is blessed';
- $TODO = '[perl #112708]';
$o = bless [], 'eleventative';
*eleventative::cos = sub { 'ten' };
is cos $o, 'ten', 'method changes affect overloading';