Author: lupus
Date: 2007-07-13 05:06:35 -0400 (Fri, 13 Jul 2007)
New Revision: 81931

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/iterators.cs
Log:


Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>

        * iterators.cs: reverted Miguel's latest change (r81925) as it
        breaks the build in System.



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-07-13 08:01:47 UTC (rev 81930)
+++ trunk/mcs/mcs/ChangeLog     2007-07-13 09:06:35 UTC (rev 81931)
@@ -1,3 +1,9 @@
+
+Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * iterators.cs: reverted Miguel's latest change (r81925) as it
+       breaks the build in System.
+
 2007-07-13  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        * iterators.cs (Yield.CheckContext): Check for the iterator type

Modified: trunk/mcs/mcs/iterators.cs
===================================================================
--- trunk/mcs/mcs/iterators.cs  2007-07-13 08:01:47 UTC (rev 81930)
+++ trunk/mcs/mcs/iterators.cs  2007-07-13 09:06:35 UTC (rev 81931)
@@ -47,26 +47,11 @@
                                return false;
                        }
 
-                       Type ignored_type;
-                       bool ignored_is_enumerable;
-
-                       if (ec.IsConstructor){
-                               Report.Error (1624, loc, "Can not use iterators 
inside constructors");
-                               return false;
-                       }
-                       
-                       if (!Iterator.CheckType (ec.ReturnType, out 
ignored_type, out ignored_is_enumerable)){
-                               Report.Error (1624, loc,
-                                             "Can not use iterator block 
because `{0}' is not an iterator interface type",
-                                             TypeManager.CSharpName 
(ec.ReturnType));
-                               return false;
-                       }
-                       
                        //
                        // We can't use `ec.InUnsafe' here because it's allowed 
to have an iterator
                        // inside an unsafe class.  See test-martin-29.cs for 
an example.
                        //
-                       if (ec.CurrentAnonymousMethod != null && 
ec.CurrentAnonymousMethod.IsIterator == false) {
+                       if (!ec.CurrentAnonymousMethod.IsIterator) {
                                Report.Error (1621, loc,
                                              "The yield statement cannot be 
used inside " +
                                              "anonymous method blocks");
@@ -1027,7 +1012,7 @@
                                             iterator_type, is_enumerable);
                }
 
-               internal static bool CheckType (Type ret, out Type 
original_iterator_type, out bool is_enumerable)
+               static bool CheckType (Type ret, out Type 
original_iterator_type, out bool is_enumerable)
                {
                        original_iterator_type = null;
                        is_enumerable = false;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to