[Mono-bugs] [Bug 52110][Blo] New - mcs generates parser error with custom indexer

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 12 Dec 2003 11:47:22 -0500 (EST)


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 tkaszuba@hotmail.com.

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

--- shadow/52110	2003-12-12 11:47:22.000000000 -0500
+++ shadow/52110.tmp.30466	2003-12-12 11:47:22.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 52110
+Product: Mono/Compilers
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tkaszuba@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs generates parser error with custom indexer
+
+Create a class called Test.cs (or use the attached file) try to compile the file into a 
+library. 
+
+public class IndexParseTest
+{
+        public IndexParseTest()
+        {
+            //image2 
+is an object that containes a custom integer indexer 
+            //which sets a boolean value 
+            
+image2[(ICW.TFI.Fund)int.Parse(list.Items[i].Value)] = true;
+        }
+}
+
+Compiling 
+with the following options:
+
+mcs 
+/r:System.Web.dll,System.Data.dll,System.Drawing.dll,inteligo.dll 
+/target:library /warn:3 /debug+ /debug:Full /out:icw.dll Test.cs
+
+generates the 
+following error:
+
+syntax error, expecting AS IS CLOSE_BRACE OPEN_BRACKET 
+CLOSE_BRACKET OPEN_PARENS CLOSE_PARENS DOT COMMA COLON SEMICOLON PLUS MINUS ASSIGN 
+OP_LT OP_GT BITWISE_AND BITWISE_OR STAR PERCENT DIV CARRET INTERR OP_INC OP_DEC 
+OP_SHIFT_LEFT OP_SHIFT_RIGHT OP_LE OP_GE OP_EQ OP_NE OP_AND OP_OR 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 OP_PTR
+Test.cs(6) 
+error CS1002: Expecting `;'
+Compilation failed: 1 error(s), 0 warnings
+
+Instead of 
+successfully parsing the document and then complaining that the variables aren't 
+declared etc...
+
+Works properly with .NET 1.0 on Windows 2000