def rtype_next(self, hop):
    variant = self.variant
    (v_iter,) = hop.inputargs(self)
    if (variant in ('keys', 'values')):
        c1 = hop.inputconst(lltype.Void, None)
    else:
        c1 = hop.inputconst(lltype.Void, hop.r_result.lowleveltype)
    hop.has_implicit_exception(StopIteration)
    hop.has_implicit_exception(RuntimeError)
    hop.exception_is_here()
    v = hop.gendirectcall(self.ll_dictnext, c1, v_iter)
    if (variant == 'keys'):
        return self.r_dict.recast_key(hop.llops, v)
    elif (variant == 'values'):
        return self.r_dict.recast_value(hop.llops, v)
    else:
        return v
def rtype_next(self, hop):
    variant = self.variant
    (v_iter,) = hop.inputargs(self)
    if (variant in ('keys', 'values')):
        c1 = hop.inputconst(lltype.Void, None)
    else:
        c1 = hop.inputconst(lltype.Void, hop.r_result.lowleveltype)
    hop.has_implicit_exception(StopIteration)
    hop.has_implicit_exception(RuntimeError)
    hop.exception_is_here()
    v = hop.gendirectcall(self.ll_dictnext, c1, v_iter)
    if (variant == 'keys'):
        return self.r_dict.recast_key(hop.llops, v)
    elif (variant == 'values'):
        return self.r_dict.recast_value(hop.llops, v)
    else:
        return v