2006-11-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / ilasm / codegen / TypeRef.cs
index 8874b31d22bb76304573937ca1d68016f0a960a3..08846715f99e621f0d2bdcca96a59df6c1d79282 100644 (file)
@@ -37,13 +37,16 @@ namespace Mono.ILASM {
                         return new TypeRef (full_name, is_valuetype, location, (ArrayList) ConversionList.Clone (), sig_mod);
                 }
 
-                public override IMethodRef CreateMethodRef (BaseTypeRef ret_type,
+                protected override BaseMethodRef CreateMethodRef (BaseTypeRef ret_type,
                         PEAPI.CallConv call_conv, string name, BaseTypeRef[] param, int gen_param_count)
                 {
-                         return new MethodRef (this, call_conv, ret_type, name, param, gen_param_count);
+                        if (SigMod == null | SigMod == "")
+                                return new MethodRef (this, call_conv, ret_type, name, param, gen_param_count);
+                        else
+                                return new TypeSpecMethodRef (this, call_conv, ret_type, name, param, gen_param_count);
                 }
 
-                public override IFieldRef CreateFieldRef (BaseTypeRef ret_type, string name)
+                protected override IFieldRef CreateFieldRef (BaseTypeRef ret_type, string name)
                 {
                          return new FieldRef (this, ret_type, name);
                 }
@@ -58,7 +61,7 @@ namespace Mono.ILASM {
                         base_type = code_gen.TypeManager.GetPeapiType (full_name);
 
                         if (base_type == null) {
-                                code_gen.Report.Error ("Reference to undefined class '" +
+                                Report.Error ("Reference to undefined class '" +
                                                        FullName + "'");
                                 return;
                         }