diff options
-rw-r--r-- | op.c | 1 | ||||
-rw-r--r-- | t/op/method.t | 21 |
2 files changed, 21 insertions, 1 deletions
@@ -2402,6 +2402,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp) OP *kid; for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) my_kid(kid, attrs, imopsp); + return o; } else if (type == OP_UNDEF #ifdef PERL_MAD || type == OP_STUB diff --git a/t/op/method.t b/t/op/method.t index 7867095c85..13547bc993 100644 --- a/t/op/method.t +++ b/t/op/method.t @@ -13,7 +13,7 @@ BEGIN { use strict; no warnings 'once'; -plan(tests => 85); +plan(tests => 91); @A::ISA = 'B'; @B::ISA = 'C'; @@ -369,3 +369,22 @@ is $kalled, 1, 'calling a class method via a magic variable'; is eval { "Just"->a_japh }, "Just another Perl hacker,", 'constants do not interfere with class methods'; } + +# [perl #109264] +{ + no strict 'vars'; + sub bliggles { 1 } + sub lbiggles :lvalue { index "foo", "f" } + ok eval { main->bliggles(my($foo,$bar)) }, + 'foo->bar(my($foo,$bar)) is not called in lvalue context'; + ok eval { main->bliggles(our($foo,$bar)) }, + 'foo->bar(our($foo,$bar)) is not called in lvalue context'; + ok eval { main->bliggles(local($foo,$bar)) }, + 'foo->bar(local($foo,$bar)) is not called in lvalue context'; + ok eval { () = main->lbiggles(my($foo,$bar)); 1 }, + 'foo->lv(my($foo,$bar)) is not called in lvalue context'; + ok eval { () = main->lbiggles(our($foo,$bar)); 1 }, + 'foo->lv(our($foo,$bar)) is not called in lvalue context'; + ok eval { () = main->lbiggles(local($foo,$bar)); 1 }, + 'foo->lv(local($foo,$bar)) is not called in lvalue context'; +} |