Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / ilasm / codegen / TypeSpecMethodRef.cs
index a814f986eeaf32ef02543fd0886c7f3ddb4be65e..ee9cb144e41af242c6e5eaabc42449d76373e41b 100644 (file)
@@ -13,37 +13,16 @@ using System;
 
 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 void Resolve (CodeGen code_gen)
+                public override void Resolve (CodeGen code_gen)
                 {
                         if (is_resolved)
                                 return;
@@ -54,7 +33,7 @@ namespace Mono.ILASM {
                         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;
                         }
@@ -66,9 +45,11 @@ namespace Mono.ILASM {
 
                         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;
                 }
         }