Пример #1
0
        public override DmdTypeBase FullResolve()
        {
            if (IsFullyResolved)
            {
                return(this);
            }
            var returnType = ((DmdTypeBase)methodSignature.ReturnType).FullResolve();

            if ((object)returnType == null)
            {
                return(null);
            }
            var parameterTypes = DmdTypeUtilities.FullResolve(methodSignature.GetParameterTypes());

            if (parameterTypes == null)
            {
                return(null);
            }
            var varArgsParameterTypes = DmdTypeUtilities.FullResolve(methodSignature.GetVarArgsParameterTypes());

            if (varArgsParameterTypes == null)
            {
                return(null);
            }
            return((DmdTypeBase)returnType.AppDomain.MakeFunctionPointerType(methodSignature.Flags, methodSignature.GenericParameterCount, returnType, parameterTypes, varArgsParameterTypes, GetCustomModifiers()));
        }
Пример #2
0
 public DmdFunctionPointerType(DmdAppDomain appDomain, DmdMethodSignature methodSignature, IList <DmdCustomModifier> customModifiers) : base(customModifiers)
 {
     AppDomain            = appDomain ?? throw new ArgumentNullException(nameof(appDomain));
     this.methodSignature = methodSignature ?? throw new ArgumentNullException(nameof(methodSignature));
     IsFullyResolved      = ((DmdTypeBase)methodSignature.ReturnType).IsFullyResolved &&
                            DmdTypeUtilities.IsFullyResolved(methodSignature.GetParameterTypes()) &&
                            DmdTypeUtilities.IsFullyResolved(methodSignature.GetVarArgsParameterTypes());
 }