[Mono-bugs] [Bug 76973][Wis] New - Casting an uint8[8] to uint8[] sets it size back to 0

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 13 03:54:46 EST 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 ck at carlo-kok.com.


--- shadow/76973	2005-12-13 03:54:46.000000000 -0500
+++ shadow/76973.tmp.11967	2005-12-13 03:54:46.000000000 -0500
@@ -0,0 +1,81 @@
+Bug#: 76973
+Product: Mono: Runtime
+Version: 1.0
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: ck at carlo-kok.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Casting an uint8[8] to uint8[] sets it size back to 0
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+When having a local variable of uint8[8] (uint8[0...8]) and trying to cast
+it to uint8[] it loses it's length, while on .NET it's possible cast an
+array of these types back and forth. 
+Steps to reproduce the problem:
+1. Get the attached .exe file 
+2. run it
+Actual Results:
+Expected Results:
+How often does this happen? 
+Additional Information:
+When trying to decompile it with monodis, it replaces:
+newobj     instance void uint8[0...]::.ctor(int32)
+newobj     instance void uint8[]::.ctor(int32)
+Which has a different result (then it works, however the 0... variant
+should work too). The original source is:
+namespace MonoTest;
+  ConsoleApp = class
+  public
+    class method Main;
+  end;
+  ByteArray = array of Byte;
+method Test;
+  Buf: array [0..7] of Byte;
+  Console.WriteLine(Length(Buf).ToString);
+  // ouput: 8(Windows) 8(Mono)
+  Console.WriteLine(Length(ByteArray(Buf)).ToString);
+  // ouput: 8(Windows) 0(Mono)
+class method ConsoleApp.Main;
+  Test;
+  Console.ReadLine;

More information about the mono-bugs mailing list