[Mono-bugs] [Bug 53695][Min] New - CS0019: Pointer operator + does not allow ushort right operand

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 1 Feb 2004 06:16:01 -0500 (EST)


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 atsushi@ximian.com.

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

--- shadow/53695	2004-02-01 06:16:01.000000000 -0500
+++ shadow/53695.tmp.9665	2004-02-01 06:16:01.000000000 -0500
@@ -0,0 +1,47 @@
+Bug#: 53695
+Product: Mono/Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0019: Pointer operator + does not allow ushort right operand
+
+csc allows pointer + ushort. mcs does not.
+
+Example:
+
+using System;
+
+public class Test
+{
+        public static unsafe void Main ()
+        {
+                byte* bptr = (byte*) 5;
+                ushort us = 3;
+                byte* ret = (byte*) (bptr + us);
+        }
+}
+
+Actual Results:
+
+$ mcs ptrushort.cs -unsafe
+ptrushort.cs(9) error CS0019: Operator + cannot be applied to operands of 
+type `byte*' and `ushort'
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+
+compile successfully.
+
+How often does this happen? 
+always.