[Mono-bugs] [Bug 75805][Blo] New - CS02220 when define a very large long const value in function

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Aug 12 23:25: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 redforks at gmail.com.

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

--- shadow/75805	2005-08-12 23:25:07.000000000 -0400
+++ shadow/75805.tmp.26163	2005-08-12 23:25:08.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 75805
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: gentoo 2005
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: redforks at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS02220 when define a very large long const value in function
+
+Steps to reproduce the problem:
+1. define a serials constance value in a function, like this:
+
+public static void Main()
+{
+  const long lk = 1024;
+  const long lM = 1024 * lk;
+  const long lG = 1024 * lM;
+  const long lT = 1024 * lG;
+  return;
+}
+
+2. then run mcs
+ 
+
+Actual Results:
+test.cs(9) error CS0220: The operation overflows at compile time in checked
+mode
+test.cs(9) error CS0133: The expression being assigned to 'lT' must be constant
+Compilation failed: 2 error(s), 0 warnings
+
+
+Expected Results:
+success compile
+
+How often does this happen? 
+everytime
+
+Additional Information:
+1. If define these const value outside func(i.e. in class scope), 
+  compile success
+2. If delete the last const value, compile success


More information about the mono-bugs mailing list