[Mono-bugs] [Bug 27311][Wis] New - checked{} does not generate any exception

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
1 Jul 2002 21:33:18 -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 mwh@sysrq.dk.

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

--- shadow/27311	Mon Jul  1 17:33:18 2002
+++ shadow/27311.tmp.15227	Mon Jul  1 17:33:18 2002
@@ -0,0 +1,55 @@
+Bug#: 27311
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: LFS
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mwh@sysrq.dk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: checked{} does not generate any exception
+
+Description of Problem:
+
+The language construct checked seems to have no effect. No exception is
+throwned.
+
+Steps to reproduce the problem:
+
+class Foobar {
+  public static void Main() {
+    byte num1 = 105;
+    byte num2 = 150;
+    byte sum;
+
+    // should generate OverflowException
+    checked {
+      sum = (byte) (num1 +  num2);
+      Console.WriteLine (sum);
+      sum = (byte) (num1 - num2);
+      Console.WriteLine (sum);
+    }
+  }
+}
+
+mono OverflowException.exe
+
+Actual Results:
+4
+216
+RESULT: 0
+
+Expected Results:
+An OverflowException
+
+How often does this happen? 
+Everytime
+
+Additional Information: