From: Rafael Garcia-Suarez Date: Fri, 30 Nov 2001 23:46:58 +0000 (+0100) Subject: parser panics on lvalue methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a397c3d90f2714d67e8c8dc3e4dfc0b40f61e44e;p=p5sagit%2Fp5-mst-13.2.git parser panics on lvalue methods Message-ID: <20011130234658.A717@rafael> p4raw-id: //depot/perl@13404 --- 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";