* statement.cs : 'For Each' statement : Wrapping the body of the For loop
authorSatya Sudha K <sudha@mono-cvs.ximian.com>
Mon, 30 May 2005 08:59:24 +0000 (08:59 -0000)
committerSatya Sudha K <sudha@mono-cvs.ximian.com>
Mon, 30 May 2005 08:59:24 +0000 (08:59 -0000)
                 inside an exception block if the enumerator implements
                 'IDisposable' interface

svn path=/trunk/mcs/; revision=45185

mcs/mbas/ChangeLog
mcs/mbas/statement.cs

index 982149df16845671636b70efb0124e5aef017351..681e4764e91bbcd7a9a296d8ca7a719103c599b0 100644 (file)
@@ -1,4 +1,8 @@
-2005-05-27 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-30 Satya Sudha K <ksathyasudha@novell.com>
+       * statement.cs : 'For Each' statement : Wrapping the body of the For loop inside an exception block 
+                        if the enumerator implements 'IDisposable' interface
+
+2005-05-27 Satya Sudha K <ksathyasudha@novell.com>
        * statement.cs :
        * mb-parser.jay :
                - Supporting all kinds of case clauses (like 'A To B', 'Is >= 30')
 2005-05-26 Manjula GHM <mmanjula@novell.com>
        * statement.cs : Fix problem w.r.t 'Exit Sub' 
 
-2005-05-24 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-24 Satya Sudha K <ksathyasudha@novell.com>
        * statement.cs : Added few more members like 'memberName' and 'type_expr' to the 'StatementSequence'
                         class. Added an appropriate constructor for the same.
        * expression.cs: Late binding for method invocations involving object arguments
                         
 
-2005-05-23 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-23 Satya Sudha K <ksathyasudha@novell.com>
        * statement.cs : Copying back the arguments (matching 'ByRef' parameters) in the reverse 
                         order (starting with the last argument backwards) as done by vbc
 
-2005-05-23 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-23 Satya Sudha K <ksathyasudha@novell.com>
        * statement.cs : Support named arguments in late binding
 
-2005-05-17 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-17 Satya Sudha K <ksathyasudha@novell.com>
        * ecore.cs : Removed char <-> numeric/date conversions as they are not supported in vbc
 
-2005-05-17 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-17 Satya Sudha K <ksathyasudha@novell.com>
        * expressions.cs :
                - Disallowing named arguments for 'ParamArray' parameters
                - Creating named arguments (to replace missing arguments), in case other arguments are also named
@@ -56,7 +60,7 @@
                Support Decimal constant declaration  and retrieval of Decimal structure 
                members from corelib
 
-2005-05-16 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-16 Satya Sudha K <ksathyasudha@novell.com>
        * parameter.cs : Converting the default value (for optional param) to param type.
        * ecore.cs     : Fixed string <-> char constant conversions.
        * expression.cs :
@@ -90,7 +94,7 @@
        (Invocation.IsApplicable): Don't create a REF type argument if it is NoArg.
        (Invocation.ConstructArgumentList): Create argument with its DefaultValue for a NoArg.
 
-2005-05-10 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-10 Satya Sudha K <ksathyasudha@novell.com>
        * statement.cs, expression.cs, assign.cs :
                Patch to allow latebinding expressions to be specified as ByRef arguments 
                
        * driver.cs (InitializeRootContextAndOthersFromOptions):
        Overwrite RootContext.RootNamespace only if there's a value.
 
-2005-05-09 Satya Sudha K <ksathyasudha@hotmail.com>
+2005-05-09 Satya Sudha K <ksathyasudha@novell.com>
        * parameter.cs : Support 'Optional ByRef' parameters
        * statement.cs : Using 'System.Reflection.Missing.Value' in case of missing argument for 
                         LateBinding cases
index 935dc60c2e3272e365ef898d6c1ff30a548d1206..44ca0ea516790ef36747fab0bf28c78573819b48 100644 (file)
@@ -5372,7 +5372,7 @@ namespace Mono.MonoBASIC {
        }
 
        /// <summary>
-       ///   Implementation of the foreach C# statement
+       ///   Implementation of the for each statement
        /// </summary>
        public class Foreach : Statement {
                Expression type;
@@ -5463,8 +5463,7 @@ namespace Mono.MonoBASIC {
                        if (!statement.Resolve (ec))
                                return false;
 
-                       //FlowReturns returns = ec.EndFlowBranching ();
-
+                       FlowReturns returns = ec.EndFlowBranching ();
                        return true;
                }
                
@@ -5737,8 +5736,10 @@ namespace Mono.MonoBASIC {
                        //
                        bool old_in_try = ec.InTry;
 
-                       if (hm.is_disposable)
+                       if (hm.is_disposable) {
+                               ig.BeginExceptionBlock ();
                                ec.InTry = true;
+                       }
                        
                        Label end_try = ig.DefineLabel ();