In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/6025c6ddd747335b34b2c5958cb7a027bc3170b2?hp=e8acd6c51420b5d9471bf4a2e80536839f244f3a>

- Log -----------------------------------------------------------------
commit 6025c6ddd747335b34b2c5958cb7a027bc3170b2
Author: Ricardo Signes <[email protected]>
Date:   Mon Jan 23 21:27:35 2012 -0500

    perldelta for ~~ fix

M       pod/perldelta.pod

commit b900a653610df47ab299d9e50b8c0ae8d8cb44f6
Author: Leon Timmermans <[email protected]>
Date:   Mon Jan 23 02:01:00 2012 +0100

    Enforce Any ~~ Object smartmatch precedence

M       pp_ctl.c
M       t/op/smartmatch.t
-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod |    3 ++-
 pp_ctl.c          |    2 +-
 t/op/smartmatch.t |    4 +---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index c44ee45..7c5ffa0 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -340,7 +340,8 @@ L</Modules and Pragmata>.
 
 =item *
 
-XXX
+C<~~> now correctly handles the precedence of Any~~Object, and is not tricked
+by an overloaded object on the left-hand side.
 
 =back
 
diff --git a/pp_ctl.c b/pp_ctl.c
index 96c3972..a99a78e 100644
--- 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;
diff --git a/t/op/smartmatch.t b/t/op/smartmatch.t
index da4840e..79c9847 100644
--- a/t/op/smartmatch.t
+++ b/t/op/smartmatch.t
@@ -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/

--
Perl5 Master Repository

Reply via email to