namespace Mono.ILASM {
- public class TypeSpecMethodRef : IMethodRef {
+ public class TypeSpecMethodRef : BaseMethodRef {
- private PEAPI.MethodRef peapi_method;
- private ITypeRef owner;
-
- private PEAPI.CallConv call_conv;
- private ITypeRef ret_type;
- private string name;
- private ITypeRef[] param;
-
- private bool is_resolved;
-
- public TypeSpecMethodRef (ITypeRef owner,
- ITypeRef ret_type, PEAPI.CallConv call_conv,
- string name, ITypeRef[] param)
+ public TypeSpecMethodRef (BaseTypeRef owner,
+ PEAPI.CallConv call_conv, BaseTypeRef ret_type,
+ string name, BaseTypeRef[] param, int gen_param_count)
+ : base (owner, call_conv, ret_type, name, param, gen_param_count)
{
- this.owner = owner;
- this.call_conv = call_conv;
- this.ret_type = ret_type;
- this.name = name;
- this.param = param;
- is_resolved = false;
- }
-
- public PEAPI.Method PeapiMethod {
- get {
- return peapi_method;
- }
}
- public PEAPI.CallConv CallConv {
- get { return call_conv; }
- set { call_conv = value; }
- }
-
- public void Resolve (CodeGen code_gen)
+ public override void Resolve (CodeGen code_gen)
{
if (is_resolved)
return;
ret_type.Resolve (code_gen);
int count = 0;
- foreach (ITypeRef typeref in param) {
+ foreach (BaseTypeRef typeref in param) {
typeref.Resolve (code_gen);
param_list[count++] = typeref.PeapiType;
}
owner.Resolve (code_gen);
peapi_method = code_gen.PEFile.AddMethodToTypeSpec (owner.PeapiType, write_name,
- ret_type.PeapiType, param_list);
+ ret_type.PeapiType, param_list, gen_param_count);
peapi_method.AddCallConv (call_conv);
+
+ is_resolved = true;
}
}