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 : ModifiableType, IClassRef {
20 private enum ConversionMethod {
28 private Location location;
29 private string full_name;
30 private PEAPI.Type type;
31 private bool is_valuetype;
33 private bool is_resolved;
35 public static readonly TypeRef Ellipsis = new TypeRef ("ELLIPSIS", false, null);
36 public static readonly TypeRef Any = new TypeRef ("any", false, null);
38 public TypeRef (string full_name, bool is_valuetype, Location location)
40 this.full_name = full_name;
41 this.location = location;
42 this.is_valuetype = is_valuetype;
46 public string FullName {
47 get { return full_name; }
50 public PEAPI.Type PeapiType {
54 public PEAPI.Class PeapiClass {
55 get { return type as PEAPI.Class; }
58 public bool IsResolved {
59 get { return is_resolved; }
62 public void MakeValueClass ()
67 public IMethodRef GetMethodRef (ITypeRef ret_type,
68 PEAPI.CallConv call_conv, string name, ITypeRef[] param)
70 return new MethodRef (this, call_conv, ret_type, name, param);
73 public IFieldRef GetFieldRef (ITypeRef ret_type, string name)
75 return new FieldRef (this, ret_type, name);
78 public void Resolve (CodeGen code_gen)
85 base_type = code_gen.TypeManager.GetPeapiType (full_name);
86 type = Modify (code_gen, base_type, ref full_name);
91 public IClassRef AsClassRef (CodeGen code_gen)
96 public override string ToString ()