parser panics on lvalue methods
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 30 Nov 2001 23:46:58 +0000 (00:46 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 1 Dec 2001 15:55:51 +0000 (15:55 +0000)
Message-ID: <20011130234658.A717@rafael>

p4raw-id: //depot/perl@13404

op.c
t/op/method.t

diff --git a/op.c b/op.c
index edd1ad2..8125b30 100644 (file)
--- 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;
index 4e4ac97..0d4e09b 100755 (executable)
@@ -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";