18 if (pattern.IsSZArray)
22 return pattern.ElementType.MatchesExactly(actual.
GetElementType());
26 if (pattern.IsVariableBoundArray)
30 return pattern.ElementType.MatchesExactly(actual.
GetElementType());
38 return pattern.ElementType.MatchesExactly(actual.
GetElementType());
42 if (pattern.IsPointer)
46 return pattern.ElementType.MatchesExactly(actual.
GetElementType());
50 if (pattern.IsConstructedGenericType)
60 Type[] genericTypeArguments = pattern.GenericTypeArguments;
62 int num = genericTypeArguments.Length;
63 if (num != genericTypeArguments2.Length)
67 for (
int i = 0; i < num; i++)
72 if (!pattern2.MatchesExactly(genericTypeArguments2[i]))
77 else if (
type != genericTypeArguments2[i])
84 if (pattern.IsGenericMethodParameter)
104 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"Used to find matching method overloads. Only used for assignability checks.")]
110 if ((
object)
type ==
null)
114 return type.TryMakeArrayType();
118 Type type2 = signatureType.
ElementType.TryResolve(genericMethodParameters);
119 if ((
object)type2 ==
null)
123 return type2.TryMakeArrayType(signatureType.
GetArrayRank());
127 Type type3 = signatureType.
ElementType.TryResolve(genericMethodParameters);
128 if ((
object)type3 ==
null)
132 return type3.TryMakeByRefType();
136 Type type4 = signatureType.
ElementType.TryResolve(genericMethodParameters);
137 if ((
object)type4 ==
null)
141 return type4.TryMakePointerType();
146 int num = genericTypeArguments.Length;
148 for (
int i = 0; i < num; i++)
150 Type type5 = genericTypeArguments[i];
153 array[i] = signatureType2.TryResolve(genericMethodParameters);
154 if (
array[i] ==
null)
169 if (genericParameterPosition >= genericMethodParameters.Length)
173 return genericMethodParameters[genericParameterPosition];
182 return type.MakeArrayType();
194 return type.MakeArrayType(rank);
206 return type.MakeByRefType();
218 return type.MakePointerType();
226 [RequiresUnreferencedCode(
"Wrapper around MakeGenericType which itself has RequiresUnreferencedCode")]
231 return type.MakeGenericType(instantiation);
override Type[] GetGenericArguments()
virtual Type ParameterType
static bool MatchesExactly(this SignatureType pattern, Type actual)
static Type TryMakePointerType(this Type type)
static Type TryMakeGenericType(this Type type, Type[] instantiation)
static Type TryMakeArrayType(this Type type)
static Type TryMakeArrayType(this Type type, int rank)
static bool MatchesParameterTypeExactly(this Type pattern, ParameterInfo parameter)
static Type TryResolve(this SignatureType signatureType, Type[] genericMethodParameters)
static Type TryResolveAgainstGenericMethod(this SignatureType signatureType, MethodInfo genericMethod)
static Type TryMakeByRefType(this Type type)
override bool IsConstructedGenericType
override bool IsGenericMethodParameter
override bool IsVariableBoundArray
override Type GetGenericTypeDefinition()
override int GenericParameterPosition
SignatureType ElementType
override int GetArrayRank()
override Type[] GenericTypeArguments
virtual Type[] GenericTypeArguments
virtual bool IsConstructedGenericType
virtual int GenericParameterPosition
virtual bool IsVariableBoundArray
virtual int GetArrayRank()
virtual bool IsGenericMethodParameter
virtual Type GetGenericTypeDefinition()