Пример #1
0
        private static IType ResolveType(IMethod currentMethod, IType type, Instruction instr)
        {
            if (instr != null && instr.Code == InstructionCode.Ldtoken)
            {
                //NOTE: Ldtoken can has any metadata token including generic types.
                if (type.IsGeneric())
                {
                    return(type);
                }
            }

            var t = GenericType.Resolve(currentMethod.DeclaringType, currentMethod, type);

            if (t == null)
            {
                throw new ILTranslatorException("Unable to resolve type");
            }

            CheckInstantiation(t, instr);
            return(t);
        }
 /// <inheritdoc />
 public override TypeDefinition Resolve() => GenericType.Resolve();