[Mono-bugs] [Bug 24020] New - Strange casting bug

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
30 Apr 2002 01:17:43 -0000


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 crichton@gimp.org.

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

--- shadow/24020	Mon Apr 29 21:17:43 2002
+++ shadow/24020.tmp.3327	Mon Apr 29 21:17:43 2002
@@ -0,0 +1,48 @@
+Bug#: 24020
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: crichton@gimp.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Strange casting bug
+
+I've been seeing this casting bug in csvorbis.  Simple test case is attached.
+
+Error is:
+./test.cs(13) error CS29: Cannot convert implicitly from `int' to `byte'
+
+Code:
+
+using System;
+
+namespace test
+{
+        public class test
+        {
+                byte[] buffer = null;
+
+                int test_method(int vv)
+                {
+                        int ptr = 0;
+                        int endbit = 3;
+                        buffer[ptr] |= (byte)(vv << endbit);
+
+                        return 0;
+                }
+
+                public test()
+                {
+                        // Really a noop?
+                }
+        }
+}