[Mono-bugs] [Bug 50425][Min] New - mcs does not report cast error on const variables: CS0029 " Cannot implicitly convert type 'char' to 'byte' "

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 31 Oct 2003 23:42:33 -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 ginga@kit.hi-ho.ne.jp.

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

--- shadow/50425	2003-10-31 23:42:32.000000000 -0500
+++ shadow/50425.tmp.22035	2003-10-31 23:42:32.000000000 -0500
@@ -0,0 +1,43 @@
+Bug#: 50425
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ginga@kit.hi-ho.ne.jp               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs does not report cast error on const variables: CS0029 " Cannot implicitly convert type 'char' to 'byte' "
+
+csc report constant cast error from char to byte.
+But mcs does not report it. 
+It is limited only to const variables.
+
+MCS results:
+public class Test
+{
+        const byte b = 'A';
+}
+compiles successfully.
+
+CSC results:
+error CS0029: Cannot implicitly convert type 'char' to 'byte'
+
+How often does this happen? 
+ - Always.
+
+Additional Comment:
+
+mcs reports this as CS0027 error correctly.
+
+public class Test
+{
+        byte b = 'A';
+}