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)); }
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)); }