summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Timmermans <fawaka@gmail.com>2012-01-23 02:01:00 +0100
committerRicardo Signes <rjbs@cpan.org>2012-03-20 20:58:20 -0400
commit011be0badf32a8d73f13b6565fbd8c398f8ab27e (patch)
tree83d50d7edb585b7e790504f831fb891ab957db2f
parent3299bf4643e4bd640bf52cf58da3485cf5b07512 (diff)
downloadperl-011be0badf32a8d73f13b6565fbd8c398f8ab27e.tar.gz
Enforce Any ~~ Object smartmatch precedence
-rw-r--r--pp_ctl.c2
-rw-r--r--t/op/smartmatch.t4
2 files changed, 2 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 60bc30d8b9..06d9124223 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4374,7 +4374,7 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other)
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 da4840eaca..79c9847fbf 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/