Author: martin
Date: 2005-04-12 12:12:38 -0400 (Tue, 12 Apr 2005)
New Revision: 42839
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/decl.cs
trunk/mcs/gmcs/ecore.cs
trunk/mcs/gmcs/expression.cs
trunk/mcs/gmcs/namespace.cs
Log:
**** Merged r40699 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-12 16:05:21 UTC (rev 42838)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-12 16:12:38 UTC (rev 42839)
@@ -1,3 +1,16 @@
+2005-02-15 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #71992.
+ * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
+ 'ignore_cs0104' parameter. Pass it to ...
+ (NamespaceEntry.Lookup): ... this.
+ * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
+ * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
+ (TypeLookupExpression.DoResolveAsTypeStep): Update.
+ * expression.cs (MemberAccess.IdenticalNameAndTypeName):
+ Update. Request that cs0104 errors be ignored.
+ (ComposedCast.ResolveAsTypeStep): Update.
+
2005-02-14 Raja R Harinath <[EMAIL PROTECTED]>
Fix #59209.
Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs 2005-04-12 16:05:21 UTC (rev 42838)
+++ trunk/mcs/gmcs/decl.cs 2005-04-12 16:12:38 UTC (rev 42839)
@@ -1206,11 +1206,12 @@
// Public function used to locate types, this can only
// be used after the ResolveTree function has been invoked.
//
+ // Set 'silent' to true if you want to suppress "type not
found" errors.
+ // Set 'ignore_cs0104' to true if you want to ignore cs0104
errors.
+ //
// Returns: Type or null if they type can not be found.
//
- // Come to think of it, this should be a DeclSpace
- //
- public FullNamedExpression LookupType (string name, bool
silent, Location loc)
+ public FullNamedExpression LookupType (string name, Location
loc, bool silent, bool ignore_cs0104)
{
FullNamedExpression e;
@@ -1261,7 +1262,7 @@
containing_ds = containing_ds.Parent;
}
- e = NamespaceEntry.LookupNamespaceOrType (this,
name, loc);
+ e = NamespaceEntry.LookupNamespaceOrType (this,
name, loc, ignore_cs0104);
if (!silent || e != null)
Cache [name] = e;
}
Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs 2005-04-12 16:05:21 UTC (rev 42838)
+++ trunk/mcs/gmcs/ecore.cs 2005-04-12 16:12:38 UTC (rev 42839)
@@ -2083,7 +2083,7 @@
int errors = Report.Errors;
dt = ec.ResolvingTypeTree
? ds.FindType (loc, Name)
- : ds.LookupType (Name, true, loc);
+ : ds.LookupType (Name, loc, /*silent=*/ true,
/*ignore_cs0104=*/ false);
if (Report.Errors != errors)
return null;
@@ -2434,7 +2434,8 @@
protected override TypeExpr DoResolveAsTypeStep (EmitContext ec)
{
if (type == null) {
- FullNamedExpression t = ec.DeclSpace.LookupType
(name, false, Location.Null);
+ FullNamedExpression t = ec.DeclSpace.LookupType
(
+ name, Location.Null, /*silent=*/ false,
/*ignore_cs0104=*/ false);
if (t == null)
return null;
if (!(t is TypeExpr))
Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs 2005-04-12 16:05:21 UTC (rev 42838)
+++ trunk/mcs/gmcs/expression.cs 2005-04-12 16:12:38 UTC (rev 42839)
@@ -5022,17 +5022,6 @@
candidates [k++] = candidates
[i];
-#if false
- //
- // Methods marked 'override'
don't take part in 'applicable_type'
- // computation.
- //
- if (!me.IsBase &&
- candidate.IsVirtual &&
- (candidate.Attributes &
MethodAttributes.NewSlot) == 0)
- continue;
-#endif
-
if (next_applicable_type ==
null ||
IsAncestralType
(next_applicable_type, decl_type))
next_applicable_type =
decl_type;
@@ -7348,7 +7337,7 @@
if (sn == null || left == null || left.Type.Name !=
sn.Name)
return false;
- return ec.DeclSpace.LookupType (sn.Name, true, loc) !=
null;
+ return ec.DeclSpace.LookupType (sn.Name, loc,
/*silent=*/ true, /*ignore_cs0104*/ true) != null;
}
// TODO: possible optimalization
@@ -9013,7 +9002,8 @@
//
// For now, fall back to the full
lookup in that case.
//
- FullNamedExpression e =
ec.DeclSpace.LookupType (cname, false, loc);
+ FullNamedExpression e =
ec.DeclSpace.LookupType (
+ cname, loc, /*silent=*/ false,
/*ignore_cs0104=*/ false);
if (e is TypeExpr)
type = ((TypeExpr)
e).ResolveType (ec);
if (type == null)
Modified: trunk/mcs/gmcs/namespace.cs
===================================================================
--- trunk/mcs/gmcs/namespace.cs 2005-04-12 16:05:21 UTC (rev 42838)
+++ trunk/mcs/gmcs/namespace.cs 2005-04-12 16:12:38 UTC (rev 42839)
@@ -426,7 +426,7 @@
return entry == null ? null : entry.Resolve ();
}
- public FullNamedExpression LookupNamespaceOrType (DeclSpace ds,
string name, Location loc)
+ public FullNamedExpression LookupNamespaceOrType (DeclSpace ds,
string name, Location loc, bool ignore_cs0104)
{
FullNamedExpression resolved = null;
string rest = null;
@@ -439,7 +439,7 @@
}
for (NamespaceEntry curr_ns = this; curr_ns != null;
curr_ns = curr_ns.ImplicitParent) {
- if ((resolved = curr_ns.Lookup (ds, name, loc))
!= null)
+ if ((resolved = curr_ns.Lookup (ds, name, loc,
ignore_cs0104)) != null)
break;
}
@@ -457,7 +457,7 @@
return new TypeExpression (nested, Location.Null);
}
- private FullNamedExpression Lookup (DeclSpace ds, string name,
Location loc)
+ private FullNamedExpression Lookup (DeclSpace ds, string name,
Location loc, bool ignore_cs0104)
{
// Precondition: Only simple names (no dots) will be
looked up with this function.
@@ -486,7 +486,9 @@
match = using_ns.Lookup (ds, name, loc);
if ((match != null) && (match is TypeExpr)) {
if (t != null) {
-
DeclSpace.Error_AmbiguousTypeReference (loc, name, t.FullName, match.FullName);
+ if (!ignore_cs0104)
+
DeclSpace.Error_AmbiguousTypeReference (loc, name, t.FullName, match.FullName);
+
return null;
} else {
t = match;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches