Author: marek
Date: 2005-07-06 05:26:32 -0400 (Wed, 06 Jul 2005)
New Revision: 46988

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/cs-tokenizer.cs
   trunk/mcs/mcs/ecore.cs
   trunk/mcs/mcs/expression.cs
Log:
2005-07-06  Marek Safar  <[EMAIL PROTECTED]>

        * cs-tokenizer.cs (consume_identifier): Detect double undescores
        
        * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
        
        * expression.cs (Invocation.DoResolve): Report error CS0245 here.

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-07-06 08:50:24 UTC (rev 46987)
+++ trunk/mcs/mcs/ChangeLog     2005-07-06 09:26:32 UTC (rev 46988)
@@ -1,3 +1,11 @@
+2005-07-06  Marek Safar  <[EMAIL PROTECTED]>
+
+       * cs-tokenizer.cs (consume_identifier): Detect double undescores
+       
+       * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
+       
+       * expression.cs (Invocation.DoResolve): Report error CS0245 here.
+
 2005-07-06  Raja R Harinath  <[EMAIL PROTECTED]>
 
        Fix #75472.

Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs       2005-07-06 08:50:24 UTC (rev 46987)
+++ trunk/mcs/mcs/cs-tokenizer.cs       2005-07-06 09:26:32 UTC (rev 46988)
@@ -1880,6 +1880,10 @@
                                identifiers [pos] = new CharArrayHashtable 
(pos);
 
                        val = new String (id_builder, 0, pos);
+                       if (RootContext.Version == LanguageVersion.ISO_1 && 
((string)val).IndexOf ("__") != -1) {
+                               Report.Error (1638, Location, 
+                                       "`{0}': Any identifier with double 
underscores cannot be used when ISO language version mode is specified", val);
+                       }
 
                        char [] chars = new char [pos];
                        Array.Copy (id_builder, chars, pos);

Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2005-07-06 08:50:24 UTC (rev 46987)
+++ trunk/mcs/mcs/ecore.cs      2005-07-06 09:26:32 UTC (rev 46988)
@@ -853,11 +853,11 @@
 
                        StringBuilder sb = new StringBuilder (valid [0]);
                        for (int i = 1; i < count - 1; i++) {
-                               sb.Append ("', '");
+                               sb.Append ("', `");
                                sb.Append (valid [i]);
                        }
                        if (count > 1) {
-                               sb.Append ("' or '");
+                               sb.Append ("' or `");
                                sb.Append (valid [count - 1]);
                        }
 
@@ -3224,7 +3224,8 @@
                                FieldBase f = TypeManager.GetField (FieldInfo);
                                if (f != null){
                                        if ((f.ModFlags & Modifiers.VOLATILE) 
!= 0){
-                                               Error (676, "volatile variable: 
can not take its address, or pass as ref/out parameter");
+                                               Report.Warning (420, 1, loc, 
"`{0}': A volatile fields cannot be passed using a ref or out parameter",
+                                                       f.GetSignatureForError 
());
                                                return;
                                        }
                                        

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2005-07-06 08:50:24 UTC (rev 46987)
+++ trunk/mcs/mcs/expression.cs 2005-07-06 09:26:32 UTC (rev 46988)
@@ -5082,13 +5082,8 @@
 
                public static void Error_WrongNumArguments (Location loc, 
String name, int arg_count)
                {
-                       if (name == "Finalize" && arg_count == 0) {
-                               Report.Error (245, loc, "Destructors and 
object.Finalize cannot be called directly. Consider calling IDisposable.Dispose 
if available");
-                       }
-                       else {
-                               Report.Error (1501, loc, "No overload for 
method `{0}' takes `{1}' arguments",
-                                       name, arg_count);
-                       }
+                       Report.Error (1501, loc, "No overload for method `{0}' 
takes `{1}' arguments",
+                               name, arg_count);
                }
 
                 static void Error_InvokeOnDelegate (Location loc)
@@ -5289,8 +5284,11 @@
                                return null;
                        }
 
-                       if (method.Name == "Finalize" && Arguments == null) {
-                               Report.Error (250, loc, "Do not directly call 
your base class Finalize method. It is called automatically from your 
destructor");
+                       if (Arguments == null && method.Name == "Finalize") {
+                               if (mg.IsBase)
+                                       Report.Error (250, loc, "Do not 
directly call your base class Finalize method. It is called automatically from 
your destructor");
+                               else
+                                       Report.Error (245, loc, "Destructors 
and object.Finalize cannot be called directly. Consider calling 
IDisposable.Dispose if available");
                                return null;
                        }
 

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

Reply via email to