[Mono-bugs] [Bug 77767][Nor] New - [PATCH][GMCS] allow yield break in catch clause

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Mar 12 07:22:43 EST 2006


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 at ximian.com.

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

--- shadow/77767	2006-03-12 07:22:43.000000000 -0500
+++ shadow/77767.tmp.17007	2006-03-12 07:22:43.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 77767
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH][GMCS] allow yield break in catch clause
+
+According to ECMA 334 section 15.14, yield break is not rejected in try
+statement that contains catch clauses. gmcs however reports an error.
+
+using System;
+using System.Collections.Generic;
+
+public class Test
+{
+        public IEnumerator<string> GetEnumerator2 ()
+        {
+                try {
+                } catch {
+                        yield break;
+                }
+        }
+}
+
+Actual Results:
+
+yield-try-catch.cs(10,4): error CS1631: Cannot yield a value in the body of
+a catch clause
+
+Expected Results:
+
+no CS1631 error.
+
+How often does this happen? 
+
+consistently.
+
+Additional Information:
+
+A proposed fix is being attached.


More information about the mono-bugs mailing list