public static StandardObject computeRealSlotType(StorageSlot slot, StandardObject firstargtype, StandardObject returntype) {
    { StandardObject slottype = returntype;
      StorageSlot canonicalslot = StorageSlot.canonicalSlot(slot);
      Stella_Class nativeslothome = null;

      if (StorageSlot.nativeSlotP(canonicalslot)) {
        nativeslothome = Slot.nativeSlotHome(slot, StandardObject.typeSpecToClass(firstargtype));
      }
      if (nativeslothome != null) {
        slottype = StandardObject.typeSpecToBaseType(Stella_Class.lookupSlot(nativeslothome, canonicalslot.slotName).computeReturnTypeSpec(nativeslothome.classType));
      }
      else {
        slottype = StandardObject.typeSpecToBaseType(slot.computeReturnTypeSpec(StandardObject.typeSpecToBaseType(firstargtype)));
      }
      if (slottype == StandardObject.typeSpecToBaseType(returntype)) {
        slottype = returntype;
      }
      return (slottype);
    }
  }