public static StandardObject computeMostGeneralReturnType(MethodSlot method, StandardObject returntype) {
    { StandardObject mostgeneralreturntype = returntype;
      MethodSlot mostgeneralmethod = method;

      while (mostgeneralmethod.slotDirectEquivalent != null) {
        mostgeneralmethod = ((MethodSlot)(mostgeneralmethod.slotDirectEquivalent));
        if (!(mostgeneralmethod.slotBaseType == Stella.SGT_STELLA_UNKNOWN)) {
          if (StandardObject.arrayTypeSpecifierP(mostgeneralreturntype)) {
            mostgeneralreturntype = mostgeneralmethod.computeReturnTypeSpec(mostgeneralmethod.slotOwner);
          }
          else {
            mostgeneralreturntype = mostgeneralmethod.slotBaseType;
          }
        }
      }
      return (mostgeneralreturntype);
    }
  }