From a397c3d90f2714d67e8c8dc3e4dfc0b40f61e44e Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Sat, 1 Dec 2001 00:46:58 +0100 Subject: [PATCH] parser panics on lvalue methods Message-ID: <20011130234658.A717@rafael> p4raw-id: //depot/perl@13404 --- op.c | 5 ----- t/op/method.t | 11 ++++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/op.c b/op.c index edd1ad2..8125b30 100644 --- a/op.c +++ b/op.c @@ -1446,11 +1446,6 @@ Perl_mod(pTHX_ OP *o, I32 type) || kid->op_type == OP_METHOD) { UNOP *newop; - - if (kid->op_sibling || kid->op_next != kid) { - yyerror("panic: unexpected optree near method call"); - break; - } NewOp(1101, newop, 1, UNOP); newop->op_type = OP_RV2CV; diff --git a/t/op/method.t b/t/op/method.t index 4e4ac97..0d4e09b 100755 --- a/t/op/method.t +++ b/t/op/method.t @@ -9,7 +9,7 @@ BEGIN { @INC = '../lib'; } -print "1..72\n"; +print "1..73\n"; @A::ISA = 'B'; @B::ISA = 'C'; @@ -240,4 +240,13 @@ test( Foo->boogie(), "yes, sir!"); eval { sub AUTOLOAD { "ok ", shift, "\n"; } }; print nonsuch(++$cnt); +# Bug ID 20010902.002 +test ( + eval q[ + $x = 'x'; + sub Foo::x : lvalue { $x } + Foo->$x = 'ok'; + ] || $@, 'ok' +); + print "# $cnt tests completed\n"; -- 2.7.4