[Mono-bugs] [Bug 47215][Wis] Changed - System.Array methods called on implicit arrays generate error
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Thu, 31 Jul 2003 18:20:58 -0400 (EDT)
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 orphennui@yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=47215
--- shadow/47215 Thu Jul 31 18:01:54 2003
+++ shadow/47215.tmp.32359 Thu Jul 31 18:20:57 2003
@@ -1,14 +1,14 @@
Bug#: 47215
Product: Mono/MCS
Version: unspecified
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Wishlist
Component: Misc
AssignedTo: mono-bugs@ximian.com
ReportedBy: orphennui@yahoo.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
@@ -16,6 +16,29 @@
Cc:
Summary: System.Array methods called on implicit arrays generate error
Calling any Collections.IList methods on an implicit array (string[])
generate a compile error. In this case I was calling Contains(). Compiles
okay if you explicitly cast to IList.
+
+------- Additional Comments From orphennui@yahoo.com 2003-07-31 18:20 -------
+Test case:
+The first WriteLine compiles and runs correctly, the second does not
+compile...
+
+
+using System;
+using System.Collections;
+
+public static void Main ()
+{
+ string [] foo = new string[] { "alex", "rules" };
+
+ Console.WriteLine ("Count: {0}, Contains 'alex': {1}",
+ ((IList) foo).Count,
+ ((IList) foo).Contains ("alex"));
+
+ Console.WriteLine ("Count: {0}, Contains 'alex': {1}",
+ foo.Count,
+ foo.Contains ("alex"));
+}
+