Author: martin
Date: 2006-09-19 10:17:14 -0400 (Tue, 19 Sep 2006)
New Revision: 65644
Modified:
trunk/mcs/gmcs/generic.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/typemanager.cs
Log:
2006-09-19 Martin Baulig <[EMAIL PROTECTED]>
* typemanager.cs
(TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
(TypeManager.IsGenericMethodDefinition): Likewise.
Modified: trunk/mcs/gmcs/generic.cs
===================================================================
--- trunk/mcs/gmcs/generic.cs 2006-09-19 14:15:24 UTC (rev 65643)
+++ trunk/mcs/gmcs/generic.cs 2006-09-19 14:17:14 UTC (rev 65644)
@@ -2201,38 +2201,6 @@
return true;
}
- /// <summary>
- /// Whether `mb' is a generic method definition.
- /// </summary>
- public static bool IsGenericMethodDefinition (MethodBase mb)
- {
- if (mb.DeclaringType is TypeBuilder) {
- IMethodData method = (IMethodData)
builder_to_method [mb];
- if (method == null)
- return false;
-
- return method.GenericMethod != null;
- }
-
- return mb.IsGenericMethodDefinition;
- }
-
- /// <summary>
- /// Whether `mb' is a generic method definition.
- /// </summary>
- public static bool IsGenericMethod (MethodBase mb)
- {
- if (mb.DeclaringType is TypeBuilder) {
- IMethodData method = (IMethodData)
builder_to_method [mb];
- if (method == null)
- return false;
-
- return method.GenericMethod != null;
- }
-
- return mb.IsGenericMethod;
- }
-
//
// Type inference.
//
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-09-19 14:15:24 UTC (rev 65643)
+++ trunk/mcs/mcs/ChangeLog 2006-09-19 14:17:14 UTC (rev 65644)
@@ -1,6 +1,12 @@
2006-09-19 Martin Baulig <[EMAIL PROTECTED]>
* typemanager.cs
+ (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
+ (TypeManager.IsGenericMethodDefinition): Likewise.
+
+2006-09-19 Martin Baulig <[EMAIL PROTECTED]>
+
+ * typemanager.cs
(TypeManager.IsEqual): Moved the gmcs implementation here.
(TypeManager.DropGenericTypeArguments): Likewise.
(TypeManager.DropGenericMethodArguments): Likewise.
Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs 2006-09-19 14:15:24 UTC (rev 65643)
+++ trunk/mcs/mcs/typemanager.cs 2006-09-19 14:17:14 UTC (rev 65644)
@@ -2639,6 +2639,7 @@
return target_list;
}
+#region Generics
// This method always return false for non-generic compiler,
// while Type.IsGenericParameter is returned if it is supported.
public static bool IsGenericParameter (Type type)
@@ -2825,6 +2826,47 @@
return type.Equals (parent);
}
+ /// <summary>
+ /// Whether `mb' is a generic method definition.
+ /// </summary>
+ public static bool IsGenericMethodDefinition (MethodBase mb)
+ {
+#if GMCS_SOURCE
+ if (mb.DeclaringType is TypeBuilder) {
+ IMethodData method = (IMethodData) builder_to_method
[mb];
+ if (method == null)
+ return false;
+
+ return method.GenericMethod != null;
+ }
+
+ return mb.IsGenericMethodDefinition;
+#else
+ return false;
+#endif
+ }
+
+ /// <summary>
+ /// Whether `mb' is a generic method.
+ /// </summary>
+ public static bool IsGenericMethod (MethodBase mb)
+ {
+#if GMCS_SOURCE
+ if (mb.DeclaringType is TypeBuilder) {
+ IMethodData method = (IMethodData) builder_to_method
[mb];
+ if (method == null)
+ return false;
+
+ return method.GenericMethod != null;
+ }
+
+ return mb.IsGenericMethod;
+#else
+ return false;
+#endif
+ }
+#endregion
+
#region MemberLookup implementation
//
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches