[Mono-bugs] [Bug 52154][Nor] New - text.Chars is accepted by mcs

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 14 Dec 2003 09:22:13 -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 lupus@ximian.com.

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

--- shadow/52154	2003-12-14 09:22:13.000000000 -0500
+++ shadow/52154.tmp.18149	2003-12-14 09:22:13.000000000 -0500
@@ -0,0 +1,35 @@
+Bug#: 52154
+Product: Mono/Compilers
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: text.Chars is accepted by mcs
+
+rodo provided the snippet of code: the code should not compile
+(there is no text.Chars property that can be called that way).
+using System;
+class T {
+	readonly int tabChars = 8;
+        private void WhiteLen (string text, ref int len, ref int chars) {
+               len = 0;
+               chars = 0;
+
+               while (chars < text.Chars
+                        && (text [chars] == ' ' || text [chars] == '\t')) {
+                        len += text [chars] == ' ' ? 1 : tabChars;
+                        chars ++;
+                }
+        }
+	static void Main () {}
+}