[Mono-bugs] [Bug 36031][Wis] New - parser bug in mcs with expressions that return a delegate

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
21 Dec 2002 22:50:39 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jpo234@netscape.net.

http://bugzilla.ximian.com/show_bug.cgi?id=36031

--- shadow/36031	Sat Dec 21 17:50:39 2002
+++ shadow/36031.tmp.25834	Sat Dec 21 17:50:39 2002
@@ -0,0 +1,66 @@
+Bug#: 36031
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jpo234@netscape.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: parser bug in mcs with expressions that return a delegate
+
+Description of Problem:
+mcs seems to have a problem with expressions that return a delegate.
+
+Steps to reproduce the problem:
+1. Compile the following code:
+
+using System;
+
+delegate void foobar (int i);
+
+class Tester {
+    static void foo (int i)
+    {
+        Console.Out.WriteLine ("foo got " + i);
+    }
+
+    static void bar (int i)
+    {
+        Console.Out.WriteLine ("bar got " + i);
+    }
+
+    public static void Main ()
+    {
+        foobar foo = new foobar (Tester.foo);
+        foobar bar = new foobar (Tester.bar);
+        ((1 == 1) ? foo : bar) (2);
+
+    //foobar baz = ((1 == 1) ? foo : bar);
+    //baz (2);
+    }
+}
+
+
+Actual Results:
+syntax error, expecting ASSIGN OP_MULT_ASSIGN OP_DIV_ASSIGN 
+OP_MOD_ASSIGN OP_ADD_ASSIGN OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN 
+OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN OP_XOR_ASSIGN OP_OR_ASSIGN
+ternaryif.cs(20) error CS1002: Expecting `;'
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+Compilation succeeded
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Miguel confirmed that this is a parser bug.