Author: martin
Date: 2005-04-15 04:53:05 -0400 (Fri, 15 Apr 2005)
New Revision: 43030

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/cs-parser.jay
   trunk/mcs/gmcs/iterators.cs
   trunk/mcs/gmcs/namespace.cs
Log:
**** Merged r41399 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-15 08:52:39 UTC (rev 43029)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-15 08:53:05 UTC (rev 43030)
@@ -1,3 +1,13 @@
+2005-03-03  Marek Safar  <[EMAIL PROTECTED]>
+
+       * cs-parser.jay: Add 1534 error test.
+
+       * iterators.cs (Yield.CheckContext): Add error 1629.
+       (Iterator.ctor): Save unsafe modifier.
+       (MoveNextMethod.DoEmit): Restore unsafe context.
+
+       * namespace.cs (UsingAlias): Better error message.
+
 2005-03-03  Dan Winship  <[EMAIL PROTECTED]>
 
        * convert.cs (Error_CannotImplicitConversion): fix two bugs in

Modified: trunk/mcs/gmcs/cs-parser.jay
===================================================================
--- trunk/mcs/gmcs/cs-parser.jay        2005-04-15 08:52:39 UTC (rev 43029)
+++ trunk/mcs/gmcs/cs-parser.jay        2005-04-15 08:53:05 UTC (rev 43030)
@@ -1840,6 +1840,9 @@
          }
          operator_body
          {
+               if ($3 == null)
+                       break;
+
                OperatorDeclaration decl = (OperatorDeclaration) $3;
                
                Parameter [] param_list = new Parameter [decl.arg2type != null 
? 2 : 1];
@@ -1929,6 +1932,17 @@
                                             typeR, (string) $9, 
lexer.Location);
         }
        | conversion_operator_declarator
+       | type OPERATOR overloadable_operator
+         OPEN_PARENS 
+               type IDENTIFIER COMMA
+               type IDENTIFIER COMMA
+               type IDENTIFIER
+         CLOSE_PARENS
+       {
+               Report.Error (1534, lexer.Location, "Overloaded binary operator 
'{0}' takes two parameters", $3);
+               $$ = null;
+       }
+
        ;
 
 overloadable_operator

Modified: trunk/mcs/gmcs/iterators.cs
===================================================================
--- trunk/mcs/gmcs/iterators.cs 2005-04-15 08:52:39 UTC (rev 43029)
+++ trunk/mcs/gmcs/iterators.cs 2005-04-15 08:53:05 UTC (rev 43030)
@@ -46,6 +46,10 @@
                                              "finally clause");
                                return false;
                        }
+                       if (ec.InUnsafe) {
+                               Report.Error (1629, loc, "Unsafe code may not 
appear in iterators");
+                               return false;
+                       }
                        if (ec.CurrentBranching.InCatch ()){
                                Report.Error (1631, loc, "Cannot yield in the 
body of a " +
                                              "catch clause");
@@ -362,7 +366,7 @@
                                 Type [] param_types, InternalParameters 
parameters,
                                 int modifiers, ToplevelBlock block, Location 
loc)
                        : base (container.NamespaceEntry, container, 
MakeProxyName (name),
-                               Modifiers.PRIVATE, null, loc)
+                               (modifiers & Modifiers.UNSAFE) | 
Modifiers.PRIVATE, null, loc)
                {
                        this.container = container;
                        this.return_type = return_type;
@@ -843,6 +847,8 @@
                                if (iterator.is_static)
                                        code_flags |= Modifiers.STATIC;
 
+                               code_flags |= iterator.ModFlags & 
Modifiers.UNSAFE;
+
                                EmitContext new_ec = new EmitContext (
                                        iterator.container, loc, ec.ig,
                                        TypeManager.int32_type, code_flags);

Modified: trunk/mcs/gmcs/namespace.cs
===================================================================
--- trunk/mcs/gmcs/namespace.cs 2005-04-15 08:52:39 UTC (rev 43029)
+++ trunk/mcs/gmcs/namespace.cs 2005-04-15 08:53:05 UTC (rev 43030)
@@ -421,6 +421,8 @@
                                aliases = new Hashtable ();
 
                        if (aliases.Contains (name)){
+                               AliasEntry ae = (AliasEntry)aliases [name];
+                               Report.SymbolRelatedToPreviousError 
(ae.Location, ae.Name);
                                Report.Error (1537, loc, "The using alias `" + 
name +
                                              "' appeared previously in this 
namespace");
                                return;

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

Reply via email to