Author: martin
Date: 2005-04-12 15:54:28 -0400 (Tue, 12 Apr 2005)
New Revision: 42867

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/ecore.cs
   trunk/mcs/gmcs/expression.cs
   trunk/mcs/gmcs/namespace.cs
Log:
**** Merged r40977-40980 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-12 19:52:38 UTC (rev 42866)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-12 19:54:28 UTC (rev 42867)
@@ -1,5 +1,22 @@
 2005-02-21  Raja R Harinath  <[EMAIL PROTECTED]>
 
+       * namespace.cs (UsingEntry.Resolve): Undo change below.
+
+2005-02-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #72756.
+       * ecore.cs (Expression.MemberLookupFailed): Add argument to
+       disable the error message when the extended MemberLookup also
+       fails.
+       (Expression.MemberLookupFinal): Update.
+       (SimpleName.DoSimpleNameResolve): Update.
+       * expression.cs (MemberAccess.ResolveNamespaceOrType):
+       Don't use MemberLookupFinal.
+       (New.DoResolve): Update.
+       (BaseAccess.CommonResolve): Update.
+
+2005-02-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
        Fix #72732.
        * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
        occured previously, don't resolve again.

Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs     2005-04-12 19:52:38 UTC (rev 42866)
+++ trunk/mcs/gmcs/ecore.cs     2005-04-12 19:54:28 UTC (rev 42867)
@@ -709,15 +709,15 @@
 
                        if (e == null && errors == Report.Errors)
                                // No errors were reported by MemberLookup, but 
there was an error.
-                               MemberLookupFailed (ec, qualifier_type, 
queried_type, name,
-                                                   null, loc);
+                               MemberLookupFailed (ec, qualifier_type, 
queried_type, name, null, true, loc);
 
                        return e;
                }
 
                public static void MemberLookupFailed (EmitContext ec, Type 
qualifier_type,
                                                       Type queried_type, 
string name,
-                                                      string class_name, 
Location loc)
+                                                      string class_name, bool 
complain_if_none_found, 
+                                                      Location loc)
                {
                        if (almostMatchedMembers.Count != 0) {
                                if (qualifier_type == null) {
@@ -765,6 +765,9 @@
                                                                    
BindingFlags.NonPublic, name, null);
 
                        if (mi == null) {
+                               if (!complain_if_none_found)
+                                       return;
+
                                if (class_name != null)
                                        Report.Error (103, loc, "The name `" + 
name + "' could not be " +
                                                      "found in `" + class_name 
+ "'");
@@ -2213,7 +2216,7 @@
                                        almostMatchedMembers = almost_matched;
                                if (almost_matched_type == null)
                                        almost_matched_type = ec.ContainerType;
-                               MemberLookupFailed (ec, null, 
almost_matched_type, ((SimpleName) this).Name, ec.DeclSpace.Name, loc);
+                               MemberLookupFailed (ec, null, 
almost_matched_type, ((SimpleName) this).Name, ec.DeclSpace.Name, true, loc);
                                return null;
                        }
 

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2005-04-12 19:52:38 UTC (rev 42866)
+++ trunk/mcs/gmcs/expression.cs        2005-04-12 19:54:28 UTC (rev 42867)
@@ -6040,7 +6040,7 @@
 
                        if (method == null) {
                                if (almostMatchedMembers.Count != 0) {
-                                       MemberLookupFailed (ec, type, type, 
".ctor", null, loc);
+                                       MemberLookupFailed (ec, type, type, 
".ctor", null, true, loc);
                                        return null;
                                }
 
@@ -7666,7 +7666,7 @@
                        }
                        if (member_lookup == null) {
                                MemberLookupFailed (
-                                       ec, expr_type, expr_type, Identifier, 
null, loc);
+                                       ec, expr_type, expr_type, Identifier, 
null, false, loc);
                                return null;
                        }
 
@@ -7767,18 +7767,21 @@
                                       TypeManager.CSharpName (expr_type) + 
")");
                                return null;
                        }
+                       
+                       Expression member_lookup = MemberLookup (ec, expr_type, 
expr_type, lookup_id, loc);
+                       if (member_lookup == null) {
+                               int errors = Report.Errors;
+                               MemberLookupFailed (ec, expr_type, expr_type, 
lookup_id, null, false, loc);
 
-                       Expression member_lookup;
-                       member_lookup = MemberLookupFinal (ec, expr_type, 
expr_type, lookup_id, loc);
-                       if (!silent && member_lookup == null) {
-                               Report.Error (234, loc, "The type name `{0}' 
could not be found in type `{1}'", 
-                                             Identifier, new_expr.FullName);
+                               if (!silent && errors == Report.Errors)
+                                       Report.Error (234, loc, "The type name 
`{0}' could not be found in type `{1}'", 
+                                                     lookup_id, 
new_expr.FullName);
                                return null;
                        }
 
                        if (!(member_lookup is TypeExpr)) {
                                Report.Error (118, loc, "'{0}.{1}' denotes a 
'{2}', where a type was expected",
-                                             new_expr.FullName, Identifier, 
member_lookup.ExprClassName ());
+                                             new_expr.FullName, lookup_id, 
member_lookup.ExprClassName ());
                                return null;
                        }
 
@@ -8797,8 +8800,7 @@
                                                      member, AllMemberTypes, 
AllBindingFlags,
                                                      loc);
                        if (member_lookup == null) {
-                               MemberLookupFailed (
-                                       ec, base_type, base_type, member, null, 
loc);
+                               MemberLookupFailed (ec, base_type, base_type, 
member, null, true, loc);
                                return null;
                        }
 

Modified: trunk/mcs/gmcs/namespace.cs
===================================================================
--- trunk/mcs/gmcs/namespace.cs 2005-04-12 19:52:38 UTC (rev 42866)
+++ trunk/mcs/gmcs/namespace.cs 2005-04-12 19:54:28 UTC (rev 42867)
@@ -248,10 +248,9 @@
                                        return resolved as Namespace;
 
                                DeclSpace root = RootContext.Tree.Types;
-                               NamespaceEntry orig_ns = root.NamespaceEntry;
                                root.NamespaceEntry = NamespaceEntry;
                                resolved = Name.ResolveAsTypeStep 
(root.EmitContext);
-                               root.NamespaceEntry = orig_ns;
+                               root.NamespaceEntry = null;
 
                                return resolved as Namespace;
                        }

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

Reply via email to