Author: marek
Date: 2007-11-07 07:00:11 -0500 (Wed, 07 Nov 2007)
New Revision: 89093

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/class.cs
   trunk/mcs/mcs/cs-parser.jay
   trunk/mcs/mcs/gcs-parser.jay
Log:
2007-11-07  Marek Safar  <[EMAIL PROTECTED]>

        A fix for bug #324754
        * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
        when it was requested.
        


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-11-07 11:31:29 UTC (rev 89092)
+++ trunk/mcs/mcs/ChangeLog     2007-11-07 12:00:11 UTC (rev 89093)
@@ -1,5 +1,11 @@
 2007-11-07  Marek Safar  <[EMAIL PROTECTED]>
 
+       A fix for bug #324754
+       * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
+       when it was requested.
+
+2007-11-07  Marek Safar  <[EMAIL PROTECTED]>
+
        A fix for bug #325101
        * expression.cs: Do type not value comparison for `is' expression.
 

Modified: trunk/mcs/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs      2007-11-07 11:31:29 UTC (rev 89092)
+++ trunk/mcs/mcs/class.cs      2007-11-07 12:00:11 UTC (rev 89093)
@@ -4940,6 +4940,12 @@
                        
                        Parent.MemberCache.AddMember (ConstructorBuilder, this);
                        TypeManager.AddMethod (ConstructorBuilder, this);
+                       
+                       // It's here only to report an error
+                       if ((ModFlags & Modifiers.METHOD_YIELDS) != 0) {
+                               member_type = TypeManager.void_type;
+                               Iterator.CreateIterator (this, Parent, null, 
ModFlags);
+                       }
 
                        return true;
                }

Modified: trunk/mcs/mcs/cs-parser.jay
===================================================================
--- trunk/mcs/mcs/cs-parser.jay 2007-11-07 11:31:29 UTC (rev 89092)
+++ trunk/mcs/mcs/cs-parser.jay 2007-11-07 12:00:11 UTC (rev 89093)
@@ -2104,6 +2104,7 @@
                Constructor c = (Constructor) $3;
                c.Block = (ToplevelBlock) $4;
                c.OptAttributes = (Attributes) $1;
+               int yield_method = c.ModFlags & Modifiers.METHOD_YIELDS;
                c.ModFlags = (int) $2;
        
                if (RootContext.Documentation != null)
@@ -2132,6 +2133,7 @@
                        //Console.WriteLine ("{0} and {1}", c.Name, 
current_container.Basename);
                }
 
+               c.ModFlags |= yield_method;
                current_container.AddConstructor (c);
 
                current_local_parameters = null;

Modified: trunk/mcs/mcs/gcs-parser.jay
===================================================================
--- trunk/mcs/mcs/gcs-parser.jay        2007-11-07 11:31:29 UTC (rev 89092)
+++ trunk/mcs/mcs/gcs-parser.jay        2007-11-07 12:00:11 UTC (rev 89093)
@@ -2332,6 +2332,7 @@
                Constructor c = (Constructor) $3;
                c.Block = (ToplevelBlock) $4;
                c.OptAttributes = (Attributes) $1;
+               int yield_method = c.ModFlags & Modifiers.METHOD_YIELDS;
                c.ModFlags = (int) $2;
        
                if (RootContext.Documentation != null)
@@ -2360,6 +2361,7 @@
                        //Console.WriteLine ("{0} and {1}", c.Name, 
current_container.Basename);
                }
 
+               c.ModFlags |= yield_method;
                current_container.AddConstructor (c);
 
                current_local_parameters = null;

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

Reply via email to