mail-archives/mono-bugs/2003-July/006709.html

110 строки
4.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 47215][Wis] Changed - System.Array methods called on implicit arrays generate error
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:bugzilla-daemon%40rocky.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="006708.html">
<LINK REL="Next" HREF="006710.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 47215][Wis] Changed - System.Array methods called on implicit arrays generate error
</H1>
<B>bugzilla-daemon@rocky.ximian.com
</B>
<A HREF="mailto:bugzilla-daemon%40rocky.ximian.com"
TITLE="[Mono-bugs] [Bug 47215][Wis] Changed - System.Array methods called on implicit arrays generate error">bugzilla-daemon@rocky.ximian.com
</A><BR>
<I>Thu, 31 Jul 2003 18:20:58 -0400 (EDT)</I>
<P><UL>
<LI> Previous message: <A HREF="006708.html">[Mono-bugs] [Bug 47216][Wis] Changed - bogus warnings on subclasses overriding parent methods
</A></li>
<LI> Next message: <A HREF="006710.html">[Mono-bugs] [Bug 47216][Wis] Changed - bogus warnings on overriding parent properties with a method
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#6709">[ date ]</a>
<a href="thread.html#6709">[ thread ]</a>
<a href="subject.html#6709">[ subject ]</a>
<a href="author.html#6709">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="mailto:orphennui@yahoo.com.">orphennui@yahoo.com.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=47215">http://bugzilla.ximian.com/show_bug.cgi?id=47215</A>
--- 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: <A HREF="mailto:mono-bugs@ximian.com">mono-bugs@ximian.com</A>
ReportedBy: <A HREF="mailto:orphennui@yahoo.com">orphennui@yahoo.com</A>
QAContact: <A HREF="mailto:mono-bugs@ximian.com">mono-bugs@ximian.com</A>
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 <A HREF="mailto:orphennui@yahoo.com">orphennui@yahoo.com</A> 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[] { &quot;alex&quot;, &quot;rules&quot; };
+
+ Console.WriteLine (&quot;Count: {0}, Contains 'alex': {1}&quot;,
+ ((IList) foo).Count,
+ ((IList) foo).Contains (&quot;alex&quot;));
+
+ Console.WriteLine (&quot;Count: {0}, Contains 'alex': {1}&quot;,
+ foo.Count,
+ foo.Contains (&quot;alex&quot;));
+}
+
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="006708.html">[Mono-bugs] [Bug 47216][Wis] Changed - bogus warnings on subclasses overriding parent methods
</A></li>
<LI> Next message: <A HREF="006710.html">[Mono-bugs] [Bug 47216][Wis] Changed - bogus warnings on overriding parent properties with a method
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#6709">[ date ]</a>
<a href="thread.html#6709">[ thread ]</a>
<a href="subject.html#6709">[ subject ]</a>
<a href="author.html#6709">[ author ]</a>
</LI>
</UL>
</body></html>