Author: martin
Date: 2005-08-03 11:43:20 -0400 (Wed, 03 Aug 2005)
New Revision: 47966
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/typemanager.cs
Log:
2005-08-03 Martin Baulig <[EMAIL PROTECTED]>
* typemanager.cs (TypeManager.IsSubclassOf): Use
`TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
(TypeManager.GetFullName_recursed): Improved.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-08-03 15:42:18 UTC (rev 47965)
+++ trunk/mcs/gmcs/ChangeLog 2005-08-03 15:43:20 UTC (rev 47966)
@@ -1,3 +1,9 @@
+2005-08-03 Martin Baulig <[EMAIL PROTECTED]>
+
+ * typemanager.cs (TypeManager.IsSubclassOf): Use
+ `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
+ (TypeManager.GetFullName_recursed): Improved.
+
2005-07-27 Martin Baulig <[EMAIL PROTECTED]>
* anonymous.cs (CaptureContext.AddField): Added
Modified: trunk/mcs/gmcs/typemanager.cs
===================================================================
--- trunk/mcs/gmcs/typemanager.cs 2005-08-03 15:42:18 UTC (rev 47965)
+++ trunk/mcs/gmcs/typemanager.cs 2005-08-03 15:43:20 UTC (rev 47966)
@@ -898,19 +898,15 @@
? CSharpSignature (mi as MethodBase)
: CSharpName (mi.DeclaringType) + '.' + mi.Name;
}
-
- private static void GetFullName_recursed (StringBuilder sb, Type t,
bool recursed)
+
+ private static void GetFullName_recursed (StringBuilder sb, Type t,
Type original_type,
+ ref int pos, bool recursed)
{
if (t.IsGenericParameter) {
sb.Append (t.Name);
return;
}
- if (t.DeclaringType != null) {
- GetFullName_recursed (sb, t.DeclaringType, true);
- sb.Append (".");
- }
-
if (!recursed) {
string ns = t.Namespace;
if ((ns != null) && (ns != "")) {
@@ -919,24 +915,34 @@
}
}
+ if (t.DeclaringType != null) {
+ GetFullName_recursed (sb, t.DeclaringType, t, ref pos,
true);
+ sb.Append (".");
+ }
+
sb.Append (SimpleName.RemoveGenericArity (t.Name));
- Type[] args = GetTypeArguments (t);
- if (args.Length > 0) {
+ Type[] args = GetTypeArguments (original_type);
+ Type[] this_args = GetTypeArguments (t);
+
+ if (this_args.Length > pos) {
sb.Append ("<");
- for (int i = 0; i < args.Length; i++) {
- if (i > 0)
+ for (int i = pos; i < this_args.Length; i++) {
+ if (i > pos)
sb.Append (",");
sb.Append (GetFullName (args [i]));
}
sb.Append (">");
}
+
+ pos += this_args.Length;
}
static public string GetFullName (Type t)
{
StringBuilder sb = new StringBuilder ();
- GetFullName_recursed (sb, t, false);
+ int pos = 0;
+ GetFullName_recursed (sb, t, t, ref pos, false);
return sb.ToString ();
}
@@ -1790,7 +1796,7 @@
}
do {
- if (type.Equals (base_type))
+ if (IsEqual (type, base_type))
return true;
type = type.BaseType;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches