[Mono-bugs] [Bug 81048][Wis] New - [System.Collections.Generic.List<T>] IList.Add(object item) throws InvalidCastException when item is not of the correct type

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Mar 6 02:34:32 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=81048

--- shadow/81048	2007-03-06 02:34:32.000000000 -0500
+++ shadow/81048.tmp.12137	2007-03-06 02:34:32.000000000 -0500
@@ -0,0 +1,40 @@
+Bug#: 81048
+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.Add(object item) throws InvalidCastException when item is not of the correct type
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+List<T>'s implementation of IList.Add(object item) throws an InvalidCastException if object is not 
+of the correct type. However, under Microsoft's implementation of the same function, an 
+ArgumentException is thrown
+
+Steps to reproduce the problem:
+1. Create a List<string>
+2. Cast to an IList
+3. Call Add(1)
+
+Actual Results:
+An InvalidCastException is thrown
+
+Expected Results:
+An ArgumentException should be thrown
+
+How often does this happen? 
+Always
+
+Additional Information:
+Expect a patch, momentarily.


More information about the mono-bugs mailing list