[Mono-bugs] [Bug 75734][Wis] New - [GMCS] InvalidCastException when copying Dictionary

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Aug 6 14:35:06 EDT 2005


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 malekith at pld-linux.org.

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

--- shadow/75734	2005-08-06 14:35:06.000000000 -0400
+++ shadow/75734.tmp.5652	2005-08-06 14:35:06.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 75734
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: amd64 pld linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: JIT
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: malekith at pld-linux.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] InvalidCastException when copying Dictionary
+
+Description of Problem:
+
+The following sample:
+
+using System.Collections.Generic;
+
+class M {
+  public static void Main ()
+  {
+    Dictionary<int,string> d = new Dictionary<int,string>();
+        d[10] = "foo";
+        Dictionary<int,string> copy = new Dictionary<int,string>(d);
+  }
+}
+
+throws an exception during runtime:
+
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type.
+in <0x000af>
+System.Collections.Generic.Dictionary`2[System.Int32,System.String]:.ctor
+(IDictionary`2 , IEqualityComparer`1 )
+in <0x0001f>
+System.Collections.Generic.Dictionary`2[System.Int32,System.String]:.ctor
+(IDictionary`2 )
+in <0x00061> M:Main ()
+
+However there are no castclass opcodes in the corresponding IL, so I guess
+this is runtime issue.
+
+Additional Information:
+
+I'm using mono SVN/trunk.


More information about the mono-bugs mailing list