Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MakeGenericType()

override Type System.RuntimeType.MakeGenericType ( params Type[] instantiation)
inlinevirtual

Reimplemented from System.Type.

Definition at line 2881 of file RuntimeType.cs.

2882 {
2883 if (instantiation == null)
2884 {
2885 throw new ArgumentNullException("instantiation");
2886 }
2888 {
2889 throw new InvalidOperationException(SR.Format(SR.Arg_NotGenericTypeDefinition, this));
2890 }
2892 if (genericArgumentsInternal.Length != instantiation.Length)
2893 {
2894 throw new ArgumentException(SR.Argument_GenericArgsCount, "instantiation");
2895 }
2897 {
2899 try
2900 {
2901 return new RuntimeTypeHandle(this).Instantiate(runtimeType);
2902 }
2903 catch (TypeLoadException e)
2904 {
2906 throw;
2907 }
2908 }
2910 bool flag = false;
2911 bool flag2 = false;
2912 for (int i = 0; i < instantiation.Length; i++)
2913 {
2915 if (type == null)
2916 {
2917 throw new ArgumentNullException();
2918 }
2920 if (runtimeType2 == null)
2921 {
2922 flag2 = true;
2923 if (type.IsSignatureType)
2924 {
2925 flag = true;
2926 }
2927 }
2928 array[i] = runtimeType2;
2929 }
2930 if (flag2)
2931 {
2932 if (flag)
2933 {
2935 }
2937 }
2939 try
2940 {
2941 RuntimeTypeHandle runtimeTypeHandle = new RuntimeTypeHandle(this);
2942 Type[] inst = array;
2943 return runtimeTypeHandle.Instantiate(inst);
2944 }
2945 catch (TypeLoadException e2)
2946 {
2948 throw;
2949 }
2950 }
static Type MakeGenericType(Type type, Type[] typeArguments)
override bool IsGenericTypeDefinition
RuntimeType[] GetGenericArgumentsInternal()
static void ThrowIfTypeNeverValidGenericArgument(RuntimeType type)
static void SanityCheckGenericArguments(RuntimeType[] genericArguments, RuntimeType[] genericParameters)
static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)

References System.RuntimeType.RuntimeType(), System.SR.Arg_NotGenericTypeDefinition, System.SR.Argument_GenericArgsCount, System.array, System.SR.Format(), System.RuntimeType.GetGenericArgumentsInternal(), System.RuntimeTypeHandle.Instantiate(), System.RuntimeType.IsGenericTypeDefinition, System.Reflection.Emit.TypeBuilderInstantiation.MakeGenericType(), System.RuntimeType.SanityCheckGenericArguments(), System.RuntimeType.ThrowIfTypeNeverValidGenericArgument(), System.type, and System.RuntimeType.ValidateGenericArguments().

Referenced by System.RuntimeType.RuntimeTypeCache.MemberInfoCache< T >.PopulateInterfaces().