Author: marek
Date: 2007-10-08 12:51:23 -0400 (Mon, 08 Oct 2007)
New Revision: 87107

Modified:
   trunk/mcs/mcs/ecore.cs
   trunk/mcs/mcs/expression.cs
   trunk/mcs/mcs/rootcontext.cs
Log:
2007-10-08  Marek Safar  <[EMAIL PROTECTED]>
        
        * expresison.cs, ecore.cs: Issue extension method error message when
        appropriate.
        
        * rootcontext.cs: Added ISO_2 compiler mode option.
        


Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2007-10-08 16:48:09 UTC (rev 87106)
+++ trunk/mcs/mcs/ecore.cs      2007-10-08 16:51:23 UTC (rev 87107)
@@ -380,6 +380,11 @@
                                name);
                }
 
+               protected virtual void Error_TypeDoesNotContainDefinition (Type 
type, string name)
+               {
+                       Error_TypeDoesNotContainDefinition (loc, type, name);
+               }
+
                public static void Error_TypeDoesNotContainDefinition (Location 
loc, Type type, string name)
                {
                        Report.SymbolRelatedToPreviousError (type);
@@ -824,7 +829,7 @@
                                        Report.Error (103, loc, "The name `{0}' 
does not exist in the current context",
                                                name);
                                } else {
-                                       Error_TypeDoesNotContainDefinition 
(loc, queried_type, name);
+                                       Error_TypeDoesNotContainDefinition 
(queried_type, name);
                                }
                                return null;
                        }
@@ -3051,9 +3056,10 @@
 
                        if (mg != null)
                                return mg;
-                       
+
                        if (!may_fail)
-                               return base.OverloadResolve (ec, arguments, 
may_fail, loc);
+                               // TODO: This should be some meaningful error 
message
+                               Invocation.Error_WrongNumArguments (loc, Name, 
arguments.Count);
 
                        return null;
                }

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2007-10-08 16:48:09 UTC (rev 87106)
+++ trunk/mcs/mcs/expression.cs 2007-10-08 16:51:23 UTC (rev 87107)
@@ -6779,6 +6779,20 @@
                        throw new Exception ("Should not happen");
                }
 
+               protected override void Error_TypeDoesNotContainDefinition 
(Type type, string name)
+               {
+                       if (RootContext.Version > LanguageVersion.ISO_2 &&
+                               ((expr.eclass & (ExprClass.Value | 
ExprClass.Variable)) != 0)) {
+                               Report.Error (1061, loc, "Type `{0}' does not 
contain a definition for `{1}' and no " +
+                                       "extension method `{1}' of type `{0}' 
could be found " +
+                                       "(are you missing a using directive or 
an assembly reference?)",
+                                       TypeManager.CSharpName (type), name);
+                               return;
+                       }
+
+                       base.Error_TypeDoesNotContainDefinition (type, name);
+               }
+
                public override string ToString ()
                {
                        return expr + "." + MemberName.MakeName (Identifier, 
args);

Modified: trunk/mcs/mcs/rootcontext.cs
===================================================================
--- trunk/mcs/mcs/rootcontext.cs        2007-10-08 16:48:09 UTC (rev 87106)
+++ trunk/mcs/mcs/rootcontext.cs        2007-10-08 16:51:23 UTC (rev 87107)
@@ -21,9 +21,11 @@
 
        public enum LanguageVersion
        {
-               Default = 0,
                ISO_1   = 1,
-               LINQ
+               ISO_2   = 2,
+               LINQ    = 3,
+
+               Default = ISO_2
        }
 
        public class RootContext {

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

Reply via email to