Author: martin
Date: 2005-08-31 11:32:24 -0400 (Wed, 31 Aug 2005)
New Revision: 49200
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/class.cs
trunk/mcs/gmcs/namespace.cs
Log:
**** Merged r47517 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-08-31 15:31:49 UTC (rev 49199)
+++ trunk/mcs/gmcs/ChangeLog 2005-08-31 15:32:24 UTC (rev 49200)
@@ -1,5 +1,10 @@
2005-07-21 Raja R Harinath <[EMAIL PROTECTED]>
+ * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
+ already found a typebuilder.
+ * class.cs (MethodCore.IsDuplicateImplementation): Compare
+ MemberNames, not strings.
+
* const.cs (Error_ExpressionMustBeConst):
Rename from Error_EpressionMustBeConst.
* const.cs, class.cs, statement.cd: Update.
Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs 2005-08-31 15:31:49 UTC (rev 49199)
+++ trunk/mcs/gmcs/class.cs 2005-08-31 15:32:24 UTC (rev 49200)
@@ -3771,12 +3771,13 @@
protected bool IsDuplicateImplementation (MethodCore method)
{
- if ((method == this) ||
- (method.MemberName.GetTypeName () !=
MemberName.GetTypeName ()))
+ if (method == this || !(method.MemberName.Equals
(MemberName)))
return false;
Type[] param_types = method.ParameterTypes;
- if (param_types == null)
+ if (param_types == null && ParameterTypes == null)
+ return true;
+ if (param_types == null || ParameterTypes == null)
return false;
if (param_types.Length != ParameterTypes.Length)
@@ -3832,14 +3833,8 @@
return false;
}
- public override bool IsUsed
- {
- get {
- if (IsExplicitImpl)
- return true;
-
- return base.IsUsed;
- }
+ public override bool IsUsed {
+ get { return IsExplicitImpl || base.IsUsed; }
}
//
@@ -6273,7 +6268,7 @@
public bool IsDuplicateImplementation (MethodCore method)
{
- if (Name != method.Name)
+ if (!MemberName.Equals (method.MemberName))
return false;
Type[] param_types = method.ParameterTypes;
Modified: trunk/mcs/gmcs/namespace.cs
===================================================================
--- trunk/mcs/gmcs/namespace.cs 2005-08-31 15:31:49 UTC (rev 49199)
+++ trunk/mcs/gmcs/namespace.cs 2005-08-31 15:32:24 UTC (rev 49200)
@@ -66,6 +66,9 @@
else
fullname = parent.Name + "." + name;
+ if (fullname == null)
+ throw new InternalErrorException ("Namespace
has a null fullname");
+
if (parent != null && parent.MemberName !=
MemberName.Null)
MemberName = new MemberName (parent.MemberName,
name);
else if (name == "")
@@ -155,7 +158,7 @@
tdecl.DefineType ();
t = tdecl.TypeBuilder;
}
- string lookup = this == Namespace.Root ? name :
fullname + "." + name;
+ string lookup = t != null ? t.FullName : (fullname ==
"" ? name : fullname + "." + name);
Type rt = TypeManager.LookupTypeReflection (lookup);
if (t == null)
t = rt;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches