src/sys/dotnet/fanx/emit/Emitter.cs
/// <summary>
/// Find the Field for this field on the given type.
/// </summary>
Find the Field for this field on the given type.
Find the Field for this field on the given type .
internal Field findField(string qname, string fieldName, string fieldType)
    {
      string key = qname + "/F" + fieldName;
      Field field = (Field)fields[key];
      if (field == null)
      {
        PERWAPI.Type ftype = findType(fieldType);
        object obj = findType(qname);
        if (obj is ClassDef)
        {
          ClassDef cdef = obj as ClassDef;
          field = cdef.AddField(FieldAttr.Public, fieldName, ftype);
        }
        else if (obj is ClassRef)
        {
          ClassRef cref = obj as ClassRef;
          field = cref.GetField(fieldName);
          if (field == null) field = cref.AddField(fieldName, ftype);
        }
        else throw new System.Exception("Don't know how to handle: " + obj.GetType());
        fields[key] = field;
      }
      return field;
    }
internal Field findField ( string qname , string fieldName , string fieldType ) { string key = qname + " " + fieldName ; Field field = ( Field ) fields [ key ] ; if ( field == null ) { PERWAPI . Type ftype = findType ( fieldType ) ; object obj = findType ( qname ) ; if ( obj is ClassDef ) { ClassDef cdef = obj as ClassDef ; field = cdef . AddField ( FieldAttr . Public , fieldName , ftype ) ; } else if ( obj is ClassRef ) { ClassRef cref = obj as ClassRef ; field = cref . GetField ( fieldName ) ; if ( field == null ) field = cref . AddField ( fieldName , ftype ) ; } else throw new System . Exception ( " " + obj . GetType ( ) ) ; fields [ key ] = field ; } return field ; }
Find the Field for this field on the given type.
Find the Field for this field on the given type .
// should be same for both cases // check for stubs // class is an internal stub, so we need to stub this field // out too, which is actually complete and not a stub // TODO - fix attr // class is external, just get or add ref // remember to add field to lookup table
qname
string
fieldName
string
fieldType
string