{
[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
- public sealed class GenericTypeParameterBuilder : Type
+ public sealed class GenericTypeParameterBuilder :
+ TypeInfo
{
#region Sync with reflection.h
private TypeBuilder tbuilder;
this.mbuilder = mbuilder;
this.name = name;
this.index = index;
-
- initialize ();
}
internal override Type InternalResolve ()
{
- return tbuilder.InternalResolve ().GetGenericArguments () [index];
+ if (mbuilder != null)
+ return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal, mbuilder.TypeBuilder.InternalResolve ().TypeHandle).GetGenericArguments () [index];
+ return tbuilder.InternalResolve ().GetGenericArguments () [index];
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void initialize ();
+ internal override Type RuntimeResolve ()
+ {
+ if (mbuilder != null)
+ return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal, mbuilder.TypeBuilder.RuntimeResolve ().TypeHandle).GetGenericArguments () [index];
+ return tbuilder.RuntimeResolve ().GetGenericArguments () [index];
+ }
[ComVisible (true)]
public override bool IsSubclassOf (Type c)
protected override TypeAttributes GetAttributeFlagsImpl ()
{
-#if NET_4_0
return TypeAttributes.Public;
-#else
- throw not_supported ();
-#endif
}
protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
throw not_supported ();
}
+ public override bool IsAssignableFrom (TypeInfo typeInfo)
+ {
+ if (typeInfo == null)
+ return false;
+
+ return IsAssignableFrom (typeInfo.AsType ());
+ }
+
public override bool IsInstanceOfType (object o)
{
throw not_supported ();
return new ByRefType (this);
}
- [MonoTODO]
- public override Type MakeGenericType (params Type [] typeArguments)
+ public override Type MakeGenericType (params Type[] typeArguments)
{
- return base.MakeGenericType (typeArguments);
+ throw new InvalidOperationException (Environment.GetResourceString ("Arg_NotGenericTypeDefinition"));
}
public override Type MakePointerType ()