throw not_after_created ();
}
+#if NET_1_2
+ public override bool HasGenericParameters {
+ get {
+ return false;
+ }
+ }
+#endif
+
public override string ToString() {
return "constructor";
}
return new NotSupportedException ("The invoked member is not supported on a dynamic method.");
}
- public override Type[] GetGenericArguments ()
- {
- throw new NotImplementedException ();
- }
-
internal int AddRef (object reference) {
if (refs == null)
refs = new object [4];
}
#if NET_1_2
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public override extern MethodInfo BindGenericParameters (Type [] types);
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern MonoGenericParam define_generic_parameter (string name, int index);
generic_params [index].SetConstraints (constraints);
}
- public override Type[] GetGenericArguments ()
+ public override bool HasGenericParameters {
+ get {
+ return generic_params != null;
+ }
+ }
+
+ public override Type[] GetGenericParameters ()
{
if (generic_params == null)
return new Type [0];
}
return ReturnType.Name+" "+Name+"("+parms+")";
}
-
-#if NET_1_2
- public override Type[] GetGenericArguments ()
- {
- throw new NotImplementedException ();
- }
-#endif
}
}
+2004-03-29 Martin Baulig <martin@ximian.com>
+
+ * MethodBase.cs: Moved the generics stuff here, made it virtual
+ where neccessary and use the correct API.
+
2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
* StrongNameKeyPair.cs: Added an internal method to return a
}
#if NET_1_2
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern MethodInfo GetGenericMethodDefinition_impl ();
+ public virtual MethodInfo BindGenericParameters (Type [] types)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public virtual Type [] GetGenericParameters ()
+ {
+ throw new NotSupportedException ();
+ }
public virtual MethodInfo GetGenericMethodDefinition ()
{
- MethodInfo res = GetGenericMethodDefinition_impl ();
- if (res == null)
- throw new InvalidOperationException ();
+ throw new NotSupportedException ();
+ }
- return res;
+ public virtual bool HasGenericParameters {
+ get {
+ throw new NotSupportedException ();
+ }
}
- public extern bool HasGenericParameters {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- get;
+ public virtual bool IsGenericMethodDefinition {
+ get {
+ throw new NotSupportedException ();
+ }
}
#endif
}
public override MemberTypes MemberType { get {return MemberTypes.Method;} }
public abstract Type ReturnType { get; }
public abstract ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
-
-#if NET_1_2
- public extern bool IsGenericMethodDefinition {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- get;
- }
-
- public abstract Type [] GetGenericArguments ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern MethodInfo BindGenericParameters (Type [] types);
-#endif
}
}
#if NET_1_2
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- public override extern Type [] GetGenericArguments ();
+ public override extern MethodInfo BindGenericParameters (Type [] types);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public override extern Type [] GetGenericParameters ();
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern MethodInfo GetGenericMethodDefinition_impl ();
+
+ public override MethodInfo GetGenericMethodDefinition ()
+ {
+ MethodInfo res = GetGenericMethodDefinition_impl ();
+ if (res == null)
+ throw new InvalidOperationException ();
+
+ return res;
+ }
+
+ public override extern bool HasGenericParameters {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ get;
+ }
+
+ public override extern bool IsGenericMethodDefinition {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ get;
+ }
#endif
}
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
}
+#if NET_1_2
+ public override bool HasGenericParameters {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsGenericMethodDefinition {
+ get {
+ return false;
+ }
+ }
+#endif
+
public override string ToString () {
string parms = "";
ParameterInfo[] p = GetParameters ();