Mono.Cecil.GenericParameterResolver.ResolveReturnTypeIfNeeded C# (CSharp) Method

ResolveReturnTypeIfNeeded() static private method

static private ResolveReturnTypeIfNeeded ( MethodReference methodReference ) : TypeReference
methodReference MethodReference
return TypeReference
        internal static TypeReference ResolveReturnTypeIfNeeded(MethodReference methodReference)
        {
            if (methodReference.DeclaringType.IsArray && methodReference.Name == "Get")
                return methodReference.ReturnType;

            var genericInstanceMethod = methodReference as GenericInstanceMethod;
            var declaringGenericInstanceType = methodReference.DeclaringType as GenericInstanceType;

            if (genericInstanceMethod == null && declaringGenericInstanceType == null)
                return methodReference.ReturnType;

            return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, methodReference.ReturnType);
        }

Usage Example

Esempio n. 1
0
 public TypeReference ResolveReturnType(MethodReference method)
 {
     return(Resolve(GenericParameterResolver.ResolveReturnTypeIfNeeded(method)));
 }