// now that everthing is mapped, we can fill in the super
// class fields (unless something is wacked, this will only
// use Types in my pod or in pods already loaded)
void load(FPod fpod)
  {
    this.fpod = fpod;
    this.typesByName = new HashMap();
    // create a hollow Type for each FType (this requires two steps,
    // because we don't necessary have all the Types created for
    // superclasses until this loop completes)
    int numTypes = fpod.types == null ? 0 : fpod.types.length;
    types = new ClassType[numTypes];
    for (int i=0; i<numTypes; ++i)
    {
      // create type instance
      ClassType type = new ClassType(this, fpod.types[i]);
      // add to my data structures
      types[i] = type;
      if (typesByName.put(type.name, type) != null)
        throw Err.make("Invalid pod: " + name + " type already defined: " + type.name);
    }
    // get TypeType to use for mixin List (we need to handle case
    // when loading sys itself - and lookup within my own pod)
    Type typeType = Sys.TypeType;
    if (typeType == null)
      typeType = (Type)typesByName.get("Type");
    // now that everthing is mapped, we can fill in the super
    // class fields (unless something is wacked, this will only
    // use Types in my pod or in pods already loaded)
    for (int i=0; i<numTypes; ++i)
    {
      FType ftype = fpod.types[i];
      ClassType type = types[i];
      type.base = type(ftype.base);
      Object[] mixins = new Object[ftype.mixins.length];
      for (int j=0; j<mixins.length; ++j)
        mixins[j] = type(ftype.mixins[j]);
      type.mixins = new List(typeType, mixins).ro();
    }
  }
if (typeType == null)
typeType = (Type)typesByName.get("Type");
// now that everthing is mapped, we can fill in the super
// class fields (unless something is wacked, this will only
// use Types in my pod or in pods already loaded)
for (int i=0; i<numTypes; ++i)
{
// add to my data structures
types[i] = type;
if (typesByName.put(type.name, type) != null)
throw Err.make("Invalid pod: " + name + " type already defined: " + type.name);
}
// get TypeType to use for mixin List (we need to handle case
// when loading sys itself - and lookup within my own pod)
Type typeType = Sys.TypeType;
if (typeType == null)
typeType = (Type)typesByName.get("Type");
// now that everthing is mapped, we can fill in the super
// class fields (unless something is wacked, this will only
// use Types in my pod or in pods already loaded)
for (int i=0; i<numTypes; ++i)
{
FType ftype = fpod.types[i];
ClassType type = types[i];
type.base = type(ftype.base);
Object[] mixins = new Object[ftype.mixins.length];
for (int j=0; j<mixins.length; ++j)
mixins[j] = type(ftype.mixins[j]);
type.mixins = new List(typeType, mixins).ro();
}
this.typesByName = new HashMap();
// create a hollow Type for each FType (this requires two steps,
// because we don't necessary have all the Types created for
// superclasses until this loop completes)
int numTypes = fpod.types == null ? 0 : fpod.types.length;
types = new ClassType[numTypes];
for (int i=0; i<numTypes; ++i)
{
// create type instance
ClassType type = new ClassType(this, fpod.types[i]);
// add to my data structures
types[i] = type;
if (typesByName.put(type.name, type) != null)
throw Err.make("Invalid pod: " + name + " type already defined: " + type.name);
}
// get TypeType to use for mixin List (we need to handle case
// when loading sys itself - and lookup within my own pod)
Type typeType = Sys.TypeType;
if (typeType == null)
typeType = (Type)typesByName.get("Type");
// now that everthing is mapped, we can fill in the super
// class fields (unless something is wacked, this will only
// use Types in my pod or in pods already loaded)
for (int i=0; i<numTypes; ++i)
{
FType ftype = fpod.types[i];
ClassType type = types[i];
type.base = type(ftype.base);
Object[] mixins = new Object[ftype.mixins.length];
for (int j=0; j<mixins.length; ++j)
mixins[j] = type(ftype.mixins[j]);
type.mixins = new List(typeType, mixins).ro();
}
}