5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
11 using System.Collections;
13 namespace Mono.ILASM {
16 /// Reference to a type in the module being compiled.
18 public class TypeRef : BaseClassRef {
20 private Location location;
21 public static readonly TypeRef Ellipsis = new TypeRef ("ELLIPSIS", false, null);
22 public static readonly TypeRef Any = new TypeRef ("any", false, null);
24 public TypeRef (string full_name, bool is_valuetype, Location location)
25 : this (full_name, is_valuetype, location, null, null)
29 public TypeRef (string full_name, bool is_valuetype, Location location, ArrayList conv_list, string sig_mod)
30 : base (full_name, is_valuetype, conv_list, sig_mod)
32 this.location = location;
35 public override BaseClassRef Clone ()
37 return new TypeRef (full_name, is_valuetype, location, (ArrayList) ConversionList.Clone (), sig_mod);
40 protected override BaseMethodRef CreateMethodRef (BaseTypeRef ret_type,
41 PEAPI.CallConv call_conv, string name, BaseTypeRef[] param, int gen_param_count)
43 if (SigMod == null | SigMod == "")
44 return new MethodRef (this, call_conv, ret_type, name, param, gen_param_count);
46 return new TypeSpecMethodRef (this, call_conv, ret_type, name, param, gen_param_count);
49 protected override IFieldRef CreateFieldRef (BaseTypeRef ret_type, string name)
51 return new FieldRef (this, ret_type, name);
54 public override void Resolve (CodeGen code_gen)
61 base_type = code_gen.TypeManager.GetPeapiType (full_name);
63 if (base_type == null) {
64 code_gen.Report.Error ("Reference to undefined class '" +
68 type = Modify (code_gen, base_type);
73 public BaseClassRef AsClassRef (CodeGen code_gen)
78 public override string ToString ()