Ejemplo n.º 1
0
        DmdMethodBase CreateMethod(DmdType reflectedType, DmdSpecialMethodKind specialMethodKind, string name, DmdType returnType, params DmdType[] parameterTypes)
        {
            var flags = DmdSignatureCallingConvention.Default | DmdSignatureCallingConvention.HasThis;
            var sig   = new DmdMethodSignature(flags, 0, returnType, parameterTypes, null);

            if (name == DmdConstructorInfo.ConstructorName)
            {
                return(new DmdCreatedConstructorDef(specialMethodKind, name, sig, this, reflectedType));
            }
            return(new DmdCreatedMethodDef(specialMethodKind, name, sig, this, reflectedType));
        }
Ejemplo n.º 2
0
 public DmdCreatedConstructorDef(DmdSpecialMethodKind specialMethodKind, string name, DmdMethodSignature methodSignature, DmdType declaringType, DmdType reflectedType) : base(0, declaringType, reflectedType)
 {
     SpecialMethodKind = specialMethodKind;
     Name = name ?? throw new ArgumentNullException(nameof(name));
     this.methodSignature = methodSignature ?? throw new ArgumentNullException(nameof(methodSignature));
 }