Esempio n. 1
0
        private static IMethod ResolveMethod(IMethod currentMethod, IMethod method)
        {
            if (method.IsGenericInstance)
            {
                return(ResolveGenericMethodInstance(currentMethod, method));
            }

            var declType = method.DeclaringType;

            declType = ResolveType(currentMethod, declType);

            if (declType.IsArray && method.IsInternalCall)
            {
                return(ArrayType.ResolveMethod(declType, method));
            }

            if (!declType.IsGenericInstance())
            {
                throw new ILTranslatorException("declType is not generic instance");
            }

            var proxy = GenericType.FindMethodProxy(declType, method);

            if (proxy != null)
            {
                return(proxy);
            }

            //check that sig of method is resolved
            if (method.GenericParameters.Count > 0)
            {
                throw new ILTranslatorException("method {0} is not resolved");
            }

            return(method);
        }