[Mono-bugs] [Bug 75369][Wis] New - error in stack constructor
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jun 23 18:40:08 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 john.caloyannis at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=75369
--- shadow/75369 2005-06-23 18:40:08.000000000 -0400
+++ shadow/75369.tmp.17274 2005-06-23 18:40:08.000000000 -0400
@@ -0,0 +1,87 @@
+Bug#: 75369
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details: Ubuntu Hoary 5.0.4
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: john.caloyannis at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: error in stack constructor
+
+Error in both mcs and gmcs version mono-1.1.8
+compiled from source using ./configure --prefix=/usr/local, make, sudo make
+install.
+Operating system Linux Ubuntu Hoary 5.0.4
+
+// vim:sw=4:ts=8
+using System;
+using System.Collections;
+
+public class Test
+{
+ static void Print (ICollection c)
+ {
+ Console.Write ("[{0,2} items]:", c.Count);
+ foreach (bool b in c) {
+ Console.Write ("{0} ", b ? "1" : "0");
+ }
+ Console.WriteLine ();
+ }
+
+ public static void Main()
+ {
+ bool[] bools = {true, false, true};
+ BitArray b = new BitArray(bools);
+ /*
+ ArrayList b = new ArrayList(bools);
+ */
+ Stack s = new Stack (b);
+ Print (s);
+ }
+}
+
+when compiled and run produces error:
+
+Unhandled Exception: System.ArgumentException: array
+Parameter name: Unsupported type
+in <0x0029f> System.Collections.BitArray:CopyTo (System.Array array, Int32
+index)
+in <0x000a0> System.Collections.Stack:.ctor (ICollection col)
+in <0x00096> Test:Main ()
+
+if one comments the BitArray line and uncomments the ArrayList line the
+program runs correctly and produces
+[ 3 items]:1 0 1
+
+running monodis on the two exes produces the following differences (same in
+mcs as well as in gmcs apart from line numbers):
+
+11c11
+< .module Test.exe // GUID = {8903F511-BA65-4D57-BA69-8CC574A40ECA}
+---
+> .module Test.exe // GUID = {CD8419A2-FAF3-4231-A573-A38517EF333F}
+98c98 (99c99 for mcs)
+< class [mscorlib]System.Collections.ArrayList V_1,
+---
+> class [mscorlib]System.Collections.BitArray V_1,
+116c116 (117c117 for mcs)
+< IL_0014: newobj instance void class
+[mscorlib]System.Collections.ArrayList::.ctor(class
+[mscorlib]System.Collections.ICollection)
+---
+> IL_0014: newobj instance void class
+[mscorlib]System.Collections.BitArray::.ctor(bool[])
+
+
+happens always:
+
+Hope this helps
+Cordially John Caloyannis
More information about the mono-bugs
mailing list