[Mono-bugs] [Bug 81047][Wis] New - [System.Collections.Generic.List<T>] IList.IndexOf(object item) and IList.Contains(object item) throw exceptions when given invalid types
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Mar 6 02:27:33 EST 2007
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 dmitchell at logos.com.
http://bugzilla.ximian.com/show_bug.cgi?id=81047
--- shadow/81047 2007-03-06 02:27:33.000000000 -0500
+++ shadow/81047.tmp.12036 2007-03-06 02:27:33.000000000 -0500
@@ -0,0 +1,43 @@
+Bug#: 81047
+Product: Mono: Class Libraries
+Version: 1.0
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: dmitchell at logos.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [System.Collections.Generic.List<T>] IList.IndexOf(object item) and IList.Contains(object item) throw exceptions when given invalid types
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+In Microsoft's implementation of List<T>, if someone casts a list to an IList and then calls
+IndexOf(object item) or Contains(object item) and passes in an object of a type that is not T, then
+-1 or false (respectively) are returned.
+
+However, in Mono's implementation, each of these cases will result in exceptions.
+
+Steps to reproduce the problem:
+1. Create an instance of List<string>
+2. Cast it to an IList
+3. Call IndexOf(new object()) or Contains(new object())
+
+Actual Results:
+Exceptions are thrown
+
+
+Expected Results:
+-1 or false should be returned
+
+How often does this happen?
+Always
+
+Additional Information:
+patch will be attached momentarily.
More information about the mono-bugs
mailing list