Author: martin
Date: 2005-04-12 16:59:23 -0400 (Tue, 12 Apr 2005)
New Revision: 42876

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/class.cs
   trunk/mcs/gmcs/expression.cs
Log:
**** Merged r41006-r41024 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-12 20:57:36 UTC (rev 42875)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-12 20:59:23 UTC (rev 42876)
@@ -1,3 +1,11 @@
+2005-02-22  Marek Safar  <[EMAIL PROTECTED]>
+
+       * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
+       Fixed error 217.
+       
+       * class.cs (MethodCore.CheckMethodAgainstBase):
+       Add error 239 report.
+
 2005-02-21  Marek Safar  <[EMAIL PROTECTED]>
 
        * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.

Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs     2005-04-12 20:57:36 UTC (rev 42875)
+++ trunk/mcs/gmcs/class.cs     2005-04-12 20:59:23 UTC (rev 42876)
@@ -3414,17 +3414,9 @@
                                // Now we check that the overriden method is 
not final
                                
                                if (base_method.IsFinal) {
-                                       // This happens when implementing 
interface methods.
-                                       if (base_method.IsHideBySig && 
base_method.IsVirtual) {
-                                               Report.Error (
-                                                       506, Location, 
Parent.MakeName (Name) +
-                                                       ": cannot override 
inherited member `" +
-                                                       name + "' because it is 
not " +
-                                                       "virtual, abstract or 
override");
-                                       } else
-                                               Report.Error (239, Location, 
Parent.MakeName (Name) + " : cannot " +
-                                                             "override 
inherited member `" + name +
-                                                             "' because it is 
sealed.");
+                                       Report.SymbolRelatedToPreviousError 
(base_method);
+                                       Report.Error (239, Location, "'{0}': 
cannot override inherited member '{1}' because it is sealed",
+                                                             
GetSignatureForError (), TypeManager.CSharpSignature (base_method));
                                        ok = false;
                                }
                                //

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-12 20:57:36 UTC (rev 42875)
+++ trunk/mcs/gmcs/expression.cs        2005-04-12 20:59:23 UTC (rev 42876)
@@ -3384,11 +3384,17 @@
                        method = Invocation.OverloadResolve (
                                ec, (MethodGroupExpr) operator_group, 
arguments, false, loc)
                                as MethodInfo;
-                       if ((method == null) || (method.ReturnType != type)) {
+                       if (method == null) {
                                Error19 ();
                                return null;
                        }
 
+                       if (method.ReturnType != type) {
+                               Report.Error (217, loc, "In order to be 
applicable as a short circuit operator a user-defined logical operator ('{0}') 
" +
+                                               "must have the same return type 
as the type of its 2 parameters", TypeManager.CSharpSignature (method));
+                               return null;
+                       }
+
                        op = new StaticCallExpr (method, arguments, loc);
 
                        op_true = GetOperatorTrue (ec, left_temp, loc);

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

Reply via email to