Enforce Any ~~ Object smartmatch precedence
authorLeon Timmermans <fawaka@gmail.com>
Mon, 23 Jan 2012 01:01:00 +0000 (02:01 +0100)
committerRicardo Signes <rjbs@cpan.org>
Tue, 24 Jan 2012 02:26:32 +0000 (21:26 -0500)
pp_ctl.c
t/op/smartmatch.t

index 96c3972..a99a78e 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4555,7 +4555,7 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other, const bool copied)
        DEBUG_M(Perl_deb(aTHX_ "    applying rule Any-Object\n"));
        DEBUG_M(Perl_deb(aTHX_ "        attempting overload\n"));
 
-       tmpsv = amagic_call(d, e, smart_amg, 0);
+       tmpsv = amagic_call(d, e, smart_amg, AMGf_noleft);
        if (tmpsv) {
            SPAGAIN;
            (void)POPs;
index da4840e..79c9847 100644 (file)
@@ -73,7 +73,7 @@ my %keyandmore = map { $_ => 0 } @keyandmore;
 my %fooormore = map { $_ => 0 } @fooormore;
 
 # Load and run the tests
-plan tests => 351;
+plan tests => 349;
 
 while (<DATA>) {
   SKIP: {
@@ -223,8 +223,6 @@ __DATA__
 @      "object"        $str_obj
 @      FALSE           $str_obj
 # Those will treat the $str_obj as a string because of fallback:
-!      $ov_obj         $str_obj
-       $ov_obj_2       $str_obj
 
 # object (overloaded or not) ~~ Any
        $obj            qr/NoOverload/