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;
32 private bool is_resolved;
34 public static readonly TypeRef Ellipsis = new TypeRef ("ELLIPSIS", null);
35 public static readonly TypeRef Any = new TypeRef ("any", null);
37 public TypeRef (string full_name, Location location)
39 this.full_name = full_name;
40 this.location = location;
44 public string FullName {
45 get { return full_name; }
48 public PEAPI.Type PeapiType {
52 public PEAPI.Class PeapiClass {
53 get { return type as PEAPI.Class; }
56 public bool IsResolved {
57 get { return is_resolved; }
60 public IMethodRef GetMethodRef (ITypeRef ret_type,
61 PEAPI.CallConv call_conv, string name, ITypeRef[] param)
63 return new MethodRef (this, call_conv, ret_type, name, param);
66 public IFieldRef GetFieldRef (ITypeRef ret_type, string name)
68 return new FieldRef (this, ret_type, name);
71 public void Resolve (CodeGen code_gen)
78 base_type = code_gen.TypeManager.GetPeapiType (full_name);
79 type = Modify (code_gen, base_type, ref full_name);
84 public IClassRef AsClassRef (CodeGen code_gen)
89 public override string ToString ()