← all packages

vctrs

native: 1495 functions analysed · 1050 typed · 136 untypeable · 30 timed out · 164 entry points (115 typed) · R: 1089 definitions, 200 typed strict, 879 gradual, prelude debt 350 · fuzzing: 287 definitions, 2 unsound, 105 accept calls outside their domain · tyr dc7f1a7 · Rsem 7bcb45f · NativeSem 770a1eb · rstt 2b2696f unpinned

Native functions

C functions reachable from an entry point
1495 / 1495 (100.0%)
typed
1050 / 1495 (70.2%)
279 more bound at their declared C signature after inference failed.

Native → R

entry points
164 / 164 (100.0%)
defined in src/
164 / 164 (100.0%)
typed
115 / 164 (70.1%)
bound in R
115 / 164 (70.1%)

R definitions

named top-level definitions
1089 / 1089 (100.0%)
not blocked by an unbound native symbol
1055 / 1089 (96.9%)
34 definitions report unbound variable on a native symbol tyr could not bind — the native panel’s loss, arriving here.
typed, gradual
879 / 1089 (80.7%)
typed, strict
200 / 1089 (18.4%)
350 of the strict failures are a name missing from the prelude.
side
mode
2621 / 2621

Native functions 1495

_r_pairlist typed

([*any_sexp, *any_sexp] -> lang | null)&([*any_sexp, c_null] -> empty)
timing: 2.90 s
source
SEXP _r_pairlist(SEXP* tags, SEXP* cars) {
  if (!cars) {
    r_stop_internal("NULL `cars`.");
  }

  SEXP list = PROTECT(Rf_cons(R_NilValue, R_NilValue));
  SEXP node = list;

  while (*cars) {
    SEXP next_node = Rf_cons(*cars, R_NilValue);
    SETCDR(node, next_node);
    node = next_node;

    if (tags) {
      SET_TAG(next_node, *tags);
      ++tags;
    }

    ++cars;
  }

  UNPROTECT(1);
  return CDR(list);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1301

abort_parse typed

[any_sexp, c_string] -> ()
timing: 0.017 s
source
static void abort_parse(r_obj* code, const char* why) {
  if (r_peek_option("rlang__verbose_errors") != r_null) {
    r_obj_print(code);
  }
  r_abort("Internal error: %s", why);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/parse.c:5

allow_null_as_bool typed

[c_bool] -> c_bool
timing: 0.002 s
source
bool allow_null_as_bool(enum vctrs_allow_null allow_null) {
  return (bool) allow_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:21

altrep_rle_is_materialized typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.019 s
fuzzing as vctrs_altrep_rle_is_materialized: 6 inside (6 ok) · 7 outside (7 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1
source
SEXP altrep_rle_is_materialized(SEXP x) {
  return Rf_ScalarLogical(R_altrep_data2(x) != R_NilValue);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/altrep-rle.c:6

altrep_rle_Make typed entry .Call fuzz ok

[any_sexp] -> any_sexp
timing: 0.007 s
fuzzing as vctrs_altrep_rle_Make: 7 inside (1 ok, 6 invalid) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
vctrs_altrep_rle_Make(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))invalidINTEGER() can only be applied to a 'integer', not a 'closure'
vctrs_altrep_rle_Make(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))invalidINTEGER() can only be applied to a 'integer', not a 'externalptr'
vctrs_altrep_rle_Make(as.name("x"))invalidINTEGER() can only be applied to a 'integer', not a 'symbol'
vctrs_altrep_rle_Make(NULL)invalidINTEGER() can only be applied to a 'integer', not a 'NULL'
vctrs_altrep_rle_Make(new.env())invalidINTEGER() can only be applied to a 'integer', not a 'environment'
vctrs_altrep_rle_Make(function(...) quote(f(x)))invalidINTEGER() can only be applied to a 'integer', not a 'closure'
source
SEXP altrep_rle_Make(SEXP input) {
  SEXP res = R_new_altrep(altrep_rle_class, input, R_NilValue);
  MARK_NOT_MUTABLE(res);
  return res;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/altrep-rle.c:10

any_has_suffix typed

[CHR] -> c_bool
timing: 0.292 s
source
bool any_has_suffix(r_obj* names) {
  r_ssize n = r_length(names);
  r_obj* const * v_names = r_chr_cbegin(names);

  for (r_ssize i = 0; i < n; ++i) {
    if (suffix_pos(r_str_c_string(v_names[i])) >= 0) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:265

apply_name_spec typed

∀'a,'b. ([CHR | null, null & 'a, any_sexp & 'b, c_int_na] -> null | any_sexp & 'b)&([CHR | null, p(CHR) & 'a, null & 'b, c_true] | [CHR | null, 'a & (<...> | p(CHR) | sym), null & 'b, c_false] -> any_sexp)
timing: 7.04 s
source
r_obj* apply_name_spec(r_obj* name_spec, r_obj* outer, r_obj* inner, r_ssize n) {
  if (r_inherits(name_spec, "rlang_zap")) {
    return r_null;
  }

  if (name_spec_is_inner(name_spec)) {
    // Ignore `outer` entirely
    return inner;
  }
  if (outer == r_null) {
    // `outer` doesn't exist, no need to apply `name_spec`
    return inner;
  }

  if (r_typeof(outer) != R_TYPE_string) {
    r_stop_internal("`outer` must be a scalar string.");
  }

  if (outer == strings_empty || outer == r_globals.na_str) {
    if (inner == r_null) {
      return chrs_empty;
    } else {
      return inner;
    }
  }

  if (r_is_empty_names(inner)) {
    if (n == 0) {
      return r_globals.empty_chr;
    }
    if (n == 1) {
      return r_str_as_character(outer);
    }
    inner = KEEP(r_seq(1, n + 1));
  } else {
    inner = KEEP(inner);
  }

  switch (r_typeof(name_spec)) {
  case R_TYPE_closure:
    break;
  case R_TYPE_character:
    name_spec = glue_as_name_spec(name_spec);
    break;
  default:
    name_spec = r_as_function(name_spec, ".name_spec");
    break;
  case R_TYPE_null: {
    const char* reason;
    if (n > 1) {
      reason = "a vector of length > 1";
    } else {
      reason = "a named vector";
    }
    r_abort("Can't merge the outer name `%s` with %s.\n"
            "Please supply a `.name_spec` specification.",
            r_str_c_string(outer),
            reason);
  }}
  KEEP(name_spec);

  r_obj* outer_chr = KEEP(r_str_as_character(outer));

  r_obj* out = KEEP(vctrs_dispatch2(syms_dot_name_spec, name_spec,
                                    syms_outer, outer_chr,
                                    syms_inner, inner));

  if (out != r_null) {
    if (r_typeof(out) != R_TYPE_character) {
      r_abort("`.name_spec` must return a character vector.");
    }
    vec_check_recyclable(out, n, VCTRS_ALLOW_NULL_no, vec_args.empty, r_lazy_null);
  }

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:570

arg_as_allow_null typed

[LGL, c_string] -> c_bool
timing: 0.031 s
source
enum vctrs_allow_null arg_as_allow_null(r_obj* x, const char* arg) {
  return r_arg_as_bool(x, arg) ? VCTRS_ALLOW_NULL_yes : VCTRS_ALLOW_NULL_no;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:26

as_df_row typed

∀'a. [null & 'a, *struct name_repair_opts, struct r_lazy] -> null & 'a
timing: 0.033 s
source
r_obj* as_df_row(r_obj* x,
                 struct name_repair_opts* name_repair,
                 struct r_lazy error_call) {
  if (vec_is_unspecified(x) && r_names(x) == r_null) {
    return x;
  } else {
    return as_df_row_impl(x, name_repair, error_call);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:351

as_df_row_impl typed

∀'a. [null & 'a, *struct name_repair_opts, struct r_lazy] -> null & 'a
timing: 0.105 s
source
r_obj* as_df_row_impl(r_obj* x,
                      struct name_repair_opts* name_repair,
                      struct r_lazy error_call) {
  if (x == r_null) {
    return x;
  }
  if (is_data_frame(x)) {
    return df_repair_names(x, name_repair);
  }

  int nprot = 0;

  r_obj* dim = KEEP_N(vec_bare_dim(x), &nprot);
  r_ssize ndim = (dim == r_null) ? 1 : r_length(dim);

  if (ndim > 2) {
    r_abort_lazy_call(error_call, "Can't bind arrays.");
  }
  if (ndim == 2) {
    r_obj* out = KEEP_N(r_as_data_frame(x), &nprot);
    r_attrib_poke_names(out, vec_as_names(KEEP_N(colnames2(x), &nprot), name_repair));
    FREE(nprot);
    return out;
  }

  // Take names before removing dimensions so we get colnames if needed
  r_obj* nms = KEEP_N(vec_names2(x), &nprot);
  nms = KEEP_N(vec_as_names(nms, name_repair), &nprot);

  if (dim != r_null) {
    x = KEEP_N(r_clone_referenced(x), &nprot);
    r_attrib_poke(x, r_syms.dim, r_null);
    r_attrib_poke(x, r_syms.dim_names, r_null);
  }

  // Remove names first as they are promoted to data frame column names.
  // Can be a user side object, so use `VCTRS_OWNERSHIP_foreign`.
  x = KEEP_N(vec_set_names(x, r_null, VCTRS_OWNERSHIP_foreign), &nprot);

  x = KEEP_N(vec_chop_unsafe(x, r_null, r_null), &nprot);
  r_attrib_poke_names(x, nms);
  x = new_data_frame(x, 1);

  FREE(nprot);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:362

as_run_bound typed

[any_sexp, struct r_lazy] -> c_bool
timing: 0.068 s
source
enum vctrs_run_bound as_run_bound(r_obj* which, struct r_lazy error_call) {
  struct r_lazy error_arg = { .x = chrs_which, .env = r_null };

  r_obj* values = KEEP(r_alloc_character(2));
  r_chr_poke(values, 0, r_str("start"));
  r_chr_poke(values, 1, r_str("end"));

  const int match = r_arg_match(which, values, error_arg, error_call);

  enum vctrs_run_bound out;

  switch (match) {
  case 0: out = VCTRS_RUN_BOUND_start; break;
  case 1: out = VCTRS_RUN_BOUND_end; break;
  default: r_stop_internal("Unknown `which` value.");
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:362

attrib_append_row_names typed

[any_sexp, any_sexp] -> ()
timing: 0.010 s
source
void attrib_append_row_names(r_obj* x, r_obj* row_names) {
#if R_VERSION >= R_Version(4, 6, 0)
  r_attrib_poke(x, r_syms.row_names, row_names);
#else
  r_obj* attrib = ATTRIB(x);
  attrib = KEEP(r_new_node(row_names, attrib));
  r_node_poke_tag(attrib, r_syms.row_names);
  SET_ATTRIB(x, attrib);
  FREE(1);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:140

attrib_hash_cb typed

[any_sexp, any_sexp, c_ptr] -> c_null
timing: 0.073 s
source
static inline r_obj* attrib_hash_cb(r_obj* tag, r_obj* value, void* data) {
  uint32_t* p_hash = (uint32_t*) data;
  *p_hash = hash_combine(*p_hash, obj_hash(tag));
  *p_hash = hash_combine(*p_hash, obj_hash(value));
  // Return C `NULL` to continue iteration through the attributes
  return NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:138

bare_df_map typed

∀'a. [{ 'a }, ([any_sexp] --> any_sexp) & (['a] --> any)] -> any_sexp
timing: 0.060 s
source
SEXP bare_df_map(SEXP df, SEXP (*fn)(SEXP)) {
  SEXP out = PROTECT(map(df, fn));

  // Shallow ownership over `out` because `map()` generates a fresh
  // list. We only care about "restoring" that bare list to the type of `df`,
  // not the columns, so not recursive.
  struct vec_restore_opts opts = {
    .ownership = VCTRS_OWNERSHIP_shallow,
    .recursively_proxied = false
  };

  out = vec_bare_df_restore(out, df, &opts);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:290

base_list_combine_fallback typed

[any_sexp, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_bool, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] | [any_sexp, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_bool, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.917 s
source
r_obj* base_list_combine_fallback(
  r_obj* xs,
  bool has_indices,
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  bool has_default,
  r_obj* default_,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* name_spec,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call
) {
  if (!has_indices) {
    // Sequential combination, nothing fancy here
    return base_c_invoke(xs, name_spec, error_call);
  }

  // Otherwise we have `indices`. We need to recreate a bunch of the "main" path
  // logic, and then combine all `xs` together and reorder using the `indices`.
  //
  // We end up doing something like:
  //
  // ```
  // vec_slice_fallback(base_c(!!!xs), order(vec_c(!!!indices)))
  // ```

  // Normalize `indices` to the location style, because that's what the fallback
  // is designed to handle. It's also the style we convert `default` to.
  switch (indices_style) {
  case VCTRS_INDEX_STYLE_location: {
    indices = list_location_to_location_indices(indices);
    break;
  }
  case VCTRS_INDEX_STYLE_condition: {
    indices_style = VCTRS_INDEX_STYLE_location;
    indices = list_condition_to_location_indices(indices);
    break;
  }
  default: r_stop_unreachable();
  }
  KEEP(indices);

  // Normalize and check `xs` sizes
  //
  // - If `slice_xs = no`, each `x` must be size 1 or the size of the `index`
  //   - Size 1 must be recycled up to the size of the `index`
  // - If `slice_xs = yes`, each `x` must be size 1 or size `size`
  //   - Size 1 must be recycled up to the size of the `index`
  //   - Size `size` must be sliced down to the size of the `index`
  switch (slice_xs) {
  case ASSIGNMENT_SLICE_VALUE_no: {
    xs = vec_recycle_xs_fallback(xs, indices, p_xs_arg, error_call);
    break;
  }
  case ASSIGNMENT_SLICE_VALUE_yes: {
    xs = vec_slice_xs_fallback(xs, indices, size, p_xs_arg, error_call);
    break;
  }
  default: r_stop_unreachable();
  }
  KEEP(xs);

  // Reverse `xs` and `indices` if required for `multiple`
  //
  // - Done after recycling/slicing of `xs` because `p_xs_arg` is used there
  //   and we need to generate correct index locations in errors.
  // - Done before `default` handling because `default` is always pushed
  //   at the end.
  switch (multiple) {
  case LIST_COMBINE_MULTIPLE_last: {
    // Nothing to do, this is the standard behavior
    break;
  }
  case LIST_COMBINE_MULTIPLE_first: {
    xs = KEEP(vec_reverse(xs));
    indices = KEEP(vec_reverse(indices));
    FREE(2);
    break;
  }
  }
  KEEP(xs);
  KEEP(indices);

  if (has_default) {
    // Materialize the `default`'s index in location style, as that is what
    // we normalized `indices` to.
    r_obj* default_index = KEEP(compute_default_index(indices, indices_style, size));
    default_index = KEEP(compact_condition_materialize_location(default_index));

    // `default` recycles against the output size
    const r_ssize default_size = vec_size(default_);
    const r_ssize default_index_size = r_length(default_index);

    // Other `xs` have been sliced already, we now need to sliced `default`,
    // which is always provided in `slice_xs = yes` style.
    if (default_size == 1) {
      // Recycle "up" to the size of the index
      default_ = vec_recycle_fallback(default_, default_index_size, p_default_arg, error_call);
    } else if (default_size == size) {
      // Slice "down" to the size of the index
      default_ = vec_slice_fallback(default_, default_index);
    } else {
      // `default` is the wrong size, error
      vec_check_recyclable(default_, size, VCTRS_ALLOW_NULL_no, p_default_arg, error_call);
    }
    KEEP(default_);

    // Append the default to `xs` and `indices` before the fallback
    xs = KEEP(push_default(xs, default_));
    indices = KEEP(push_default_index(indices, default_index));

    FREE(5);
  }
  KEEP(xs);
  KEEP(indices);

  // Remove all `NULL`s from `xs` and their corresponding slot in `indices`.
  //
  // `base_c_invoke()` does this as well, but we need to remove the `indices` slot
  // at the same time.
  //
  // - Done after `default_index` computation, so `default_index` doesn't capture
  //   dropped indices.
  // - Done after `vec_recycle_xs_fallback()` so we have correct indices in recycling
  //   error messages.
  if (vec_any_missing(xs)) {
    r_obj* complete = KEEP(vec_detect_complete(xs));
    complete = KEEP(r_lgl_which(complete, false));
    xs = KEEP(vec_slice_unsafe(xs, complete));
    indices = KEEP(vec_slice_unsafe(indices, complete));
    FREE(4);
  }
  KEEP(xs);
  KEEP(indices);

  r_obj* out = KEEP(base_c_invoke(xs, name_spec, error_call));

  r_obj* index = KEEP(build_fallback_index(indices, size, error_call));

  out = vec_slice_fallback(out, index);

  FREE(10);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1107

build_fallback_index typed

([any_sexp, c_int, struct r_lazy] -> INT)&([any_sexp, c_true, struct r_lazy] -> INT1)
timing: 0.557 s
source
r_obj* build_fallback_index(r_obj* indices, r_ssize size, struct r_lazy error_call) {
  const struct name_repair_opts name_repair_opts = {
    .type = NAME_REPAIR_none,
    .fn = r_null,
    .call = error_call
  };

  r_obj* index = KEEP(vec_c(
    indices,
    r_globals.empty_int,
    name_spec_inner,
    &name_repair_opts,
    vec_args.indices,
    error_call
  ));

  const int* v_index = r_int_cbegin(index);

  // Not necessarily same as `size`!
  //
  // ```
  // local_c_foobar()
  // list_combine(
  //   list(foobar("a"), NULL, foobar("b")),
  //   indices = list(2, 3, 1),
  //   size = 3
  // )
  // ```
  //
  // Implies `size` of 3 but `NULL` causes the `3`
  // index to get dropped, so `index_size` is `2`.
  const r_ssize index_size = r_length(index);

  r_obj* locations = KEEP(r_alloc_integer(size));
  int* v_locations = r_int_begin(locations);

  // Initialize with missing to handle locations that are never selected
  for (r_ssize i = 0; i < size; ++i) {
    v_locations[i] = r_globals.na_int;
  }

  // At each index location, put the order value, note that results in "last
  // wins" behavior when multiple indices overwrite the same location
  for (r_ssize i = 0; i < index_size; ++i) {
    const int elt = v_index[i];
    if (elt != r_globals.na_int) {
      v_locations[elt - 1] = i + 1;
    }
  }

  FREE(2);
  return locations;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1352

build_indices_for_single_to typed

[any_sexp, any_sexp] -> list
timing: 0.034 s
source
r_obj* build_indices_for_single_to(r_obj* x, r_obj* from_flat) {
  r_obj* indices = KEEP(r_alloc_list(1));

  // Want `na_equal = true` for `vec_recode_values(x, from = NA, to = to)`
  const bool na_equal = true;

  // TODO: For a lower memory footprint, we could teach `list_combine()` how to
  // take `compact_condition` as `indices` elements and then give `vec_in()` an
  // option to return one of these. For 10 mil integer elements, this reduces
  // memory usage by 30mb and is ~10% faster. That also makes giving a "single
  // `to`" its own path even more compelling.
  //
  // Find locations where `to` will be utilized
  r_obj* index = vec_in(
    x,
    from_flat,
    na_equal,
    vec_args.empty,
    vec_args.empty,
    r_lazy_null
  );
  r_list_poke(indices, 0, index);

  FREE(1);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:651

build_repeated_to typed

[any_sexp, any_sexp] -> any_sexp
timing: 0.032 s
source
r_obj* build_repeated_to(r_obj* to, r_obj* from) {
  r_obj* from_sizes = KEEP(list_sizes(from, vec_args.empty, r_lazy_null));
  to = vec_rep_each(to, from_sizes, r_lazy_null, vec_args.empty, vec_args.empty);
  FREE(1);
  return to;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:751

c_data_frame_class typed

[any_sexp] -> any
timing: 0.017 s
source
r_obj* c_data_frame_class(r_obj* cls) {
  if (r_typeof(cls) != R_TYPE_character) {
    r_abort_call(r_null, "`class` must be NULL or a character vector");
  }
  return chr_c(cls, classes_data_frame);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:171

check_any_unmatched typed empty return

[list, c_bool, c(..-1), struct r_lazy] -> empty
timing: 0.033 s
source
void check_any_unmatched(
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  struct r_lazy error_call
) {
  r_obj* default_index = KEEP(compute_default_index(indices, indices_style, size));
  const bool* v_default_index = compact_condition_cbegin(default_index);

  if (p_bool_any(v_default_index, size)) {
    r_obj* loc = KEEP(compact_condition_materialize_location(default_index));
    stop_combine_unmatched(loc, error_call);
  }

  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1671

check_assign_sizes typed empty return

[any_sexp, any_sexp, c_int_na, c_bool, c_false] | [any_sexp, any_sexp, c_int_na, c_bool, c_true] -> empty
timing: 0.069 s
source
void check_assign_sizes(
  r_obj* x,
  r_obj* index,
  r_ssize value_size,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  switch (index_style) {
  case VCTRS_INDEX_STYLE_location: {
    switch (slice_value) {
    case ASSIGNMENT_SLICE_VALUE_no: {
      if (value_size != 1 && value_size != vec_subscript_size(index)) {
        r_stop_internal("`value` should have been recycled to match `index`.");
      }
      return;
    }
    case ASSIGNMENT_SLICE_VALUE_yes: {
      if (value_size != 1 && value_size != vec_size(x)) {
        r_stop_internal("`value` should have been recycled to match `x`.");
      }
      return;
    }
    default: r_stop_unreachable();
    }
  }
  case VCTRS_INDEX_STYLE_condition: {
    switch (slice_value) {
    case ASSIGNMENT_SLICE_VALUE_no: {
      // In theory, we'd check `value_size` against the number of `TRUE`
      // values in `index`, but this is too expensive, so we rely on
      // the caller to check this.
      return;
    }
    case ASSIGNMENT_SLICE_VALUE_yes: {
      if (value_size != 1 && value_size != vec_size(x)) {
        r_stop_internal("`value` should have been recycled to match `x`.");
      }
      return;
    }
    default: r_stop_unreachable();
    }
  }
  default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:983

check_condition_index typed

([<...>, c_null, struct r_lazy] -> empty)&([any_sexp, c_null, struct r_lazy] -> ())
timing: 0.043 s
source
void check_condition_index(
  r_obj* x,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  if (!is_condition_index(x)) {
    r_abort_lazy_call(
      call,
      "%s must be a logical vector, not %s.",
      vec_arg_format(p_x_arg),
      r_obj_type_friendly(x)
    );
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:942

check_names typed

[any_sexp, null] | [any_sexp, <...> | p(CHR) | sym] -> ()
timing: 0.046 s
source
void check_names(r_obj* x, r_obj* names) {
  if (names == r_null) {
    return;
  }

  if (r_typeof(names) != R_TYPE_character) {
    r_abort(
      "`names` must be a character vector, not a %s.",
      r_type_as_c_string(r_typeof(names))
    );
  }

  r_ssize x_size = vec_size(x);
  r_ssize names_size = vec_size(names);

  if (x_size != names_size) {
    r_abort(
      "The size of `names`, %i, must be the same as the size of `x`, %i.",
      names_size,
      x_size
    );
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:748

check_rcrd typed

([list] -> ())&([(env | externalptr | lang | vec | arrow) | null | p(CHR) | sym] -> empty)
timing: 0.101 s
source
void check_rcrd(SEXP x) {
  if (!Rf_isVectorList(x))
    Rf_errorcall(R_NilValue, "Corrupt rcrd: not a list");
  if (Rf_length(x) == 0)
    Rf_errorcall(R_NilValue, "Corrupt rcrd: length 0");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:102

check_recyclable_against_index typed

[<> | null | p(CHR) | sym, INT, c_int_na, c_false, c_false, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_false, c_true, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_true, c_bool, c_null, struct r_lazy] -> ()
timing: 0.239 s
source
void check_recyclable_against_index(
  r_obj* value,
  r_obj* index,
  r_ssize size,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style,
  struct vctrs_arg* p_value_arg,
  struct r_lazy call
) {
  r_ssize check_size;

  switch (slice_value) {
  case ASSIGNMENT_SLICE_VALUE_no: {
    switch (index_style) {
    case VCTRS_INDEX_STYLE_location: check_size = vec_subscript_size(index); break;
    case VCTRS_INDEX_STYLE_condition: check_size = vec_condition_subscript_sum(index, true); break;
    default: r_stop_unreachable();
    }
    break;
  }
  case ASSIGNMENT_SLICE_VALUE_yes: check_size = size; break;
  default: r_stop_unreachable();
  }

  vec_check_recyclable(value, check_size, VCTRS_ALLOW_NULL_no, p_value_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:1037

check_rep_each_times typed

([c(..-1), c_int_na, struct r_lazy, c_null] -> empty)&([c_int_na \ c(..-1), c_int_na, struct r_lazy, c_null] -> ())
timing: 0.085 s
source
void check_rep_each_times(int times,
                          r_ssize i,
                          struct r_lazy call,
                          struct vctrs_arg* p_times_arg) {
  if (times < 0) {
    if (times == r_globals.na_int) {
      stop_rep_each_times_missing(i, call, p_times_arg);
    } else {
      stop_rep_each_times_negative(i, call, p_times_arg);
    }
  } else if (times_is_oob(times)) {
    stop_rep_each_times_oob(times, i, call, p_times_arg);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:278

check_rep_times typed

([c(..-1), struct r_lazy, c_null] -> empty)&([c_int_na \ c(..-1), struct r_lazy, c_null] -> ())
timing: 0.075 s
source
void check_rep_times(int times,
                     struct r_lazy call,
                     struct vctrs_arg* p_times_arg) {
  if (times < 0) {
    if (times == r_globals.na_int) {
      stop_rep_times_missing(call, p_times_arg);
    } else {
      stop_rep_times_negative(call, p_times_arg);
    }
  } else if (times_is_oob(times)) {
    stop_rep_times_oob(times, call, p_times_arg);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:233

check_unique_names typed

([any_sexp, c_null] -> empty)&([any_sexp, *struct name_repair_opts] \ [any_sexp, c_null] -> any_sexp)
timing: 0.119 s
source
r_obj* check_unique_names(r_obj* names,
                          const struct name_repair_opts* opts) {
  r_obj* ffi_arg = KEEP(r_lazy_eval(opts->name_repair_arg));
  r_obj* ffi_call = KEEP(r_lazy_eval(opts->call));

  r_obj* out = KEEP(vctrs_dispatch3(syms_check_unique_names, fns_check_unique_names,
                                    syms_names, names,
                                    r_syms.arg, ffi_arg,
                                    syms_call, ffi_call));

  // Restore visibility
  r_eval(r_null, r_envs.empty);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:103

chop_fallback_shaped typed

([any_sexp, c_null] -> empty)&([any_sexp, *struct vctrs_chop_indices] \ [any_sexp, c_null] -> any_sexp)
timing: 0.062 s
source
r_obj* chop_fallback_shaped(r_obj* x, struct vctrs_chop_indices* p_indices) {
  const r_ssize out_size = indices_out_size(p_indices, x);
  r_obj* out = KEEP(r_alloc_list(out_size));

  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* index = indices_next(p_indices);

    index = KEEP(vec_subscript_materialize(index));

    // `vec_slice_fallback()` will also `vec_restore()` for us
    r_obj* elt = vec_slice_fallback(x, index);
    r_list_poke(out, i, elt);

    FREE(1);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:483

chr_all_same typed

([*(c_string | c_null), c_false] -> c_true)&([c_null, c_int_na \ c_false] -> empty)&([*c_null, c_int_na \ c_false] | [*c_string, c_int_na \ c_false] -> c_bool)
timing: 0.521 s
source
bool chr_all_same(
  const char** p_x,
  const r_ssize size
) {
  if (size == 0) {
    return true;
  }

  const char* first = p_x[0];

  for (r_ssize i = 1; i < size; ++i) {
    if (first != p_x[i]) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3048

chr_all_same_byte typed

([*(c_string | c_null), c_false] -> c_true)&([*(c_string | c_null), c_int_na \ c_false] -> c_bool)
timing: 0.383 s
source
bool chr_all_same_byte(
  const char** p_x,
  const r_ssize size
) {
  if (size == 0) {
    return true;
  }

  const uint8_t first = (uint8_t) *p_x[0];

  for (r_ssize i = 1; i < size; ++i) {
    const uint8_t this = (uint8_t) *p_x[i];

    if (this != first) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3071

chr_apply typed

[any_sexp, any_sexp] -> any
timing: 0.026 s
source
SEXP chr_apply(SEXP x, SEXP chr_proxy_collate) {
  // Don't use vctrs dispatch utils because we match argument positionally
  SEXP call = PROTECT(Rf_lang2(syms_chr_proxy_collate, syms_x));

  SEXP mask = PROTECT(r_alloc_empty_environment(R_GlobalEnv));
  Rf_defineVar(syms_chr_proxy_collate, chr_proxy_collate, mask);
  Rf_defineVar(syms_x, x, mask);

  SEXP out = PROTECT(Rf_eval(call, mask));

  if (vec_typeof(out) != VCTRS_TYPE_character) {
    Rf_errorcall(
      R_NilValue,
      "`chr_proxy_collate` must return a character vector."
    );
  }

  R_len_t x_size = vec_size(x);
  R_len_t out_size = vec_size(out);

  if (x_size != out_size) {
    Rf_errorcall(
      R_NilValue,
      "`chr_proxy_collate` must return a vector of the same length (%i, not %i).",
      x_size,
      out_size
    );
  }

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-collate.c:43

chr_as_factor typed

[any_sexp, any_sexp, *c_bool, *struct vctrs_arg] -> any_sexp
timing: 0.066 s
source
SEXP chr_as_factor(SEXP x, SEXP to, bool* lossy, struct vctrs_arg* to_arg) {
  SEXP levels = PROTECT(Rf_getAttrib(to, R_LevelsSymbol));

  if (TYPEOF(levels) != STRSXP) {
    stop_corrupt_factor_levels(to, to_arg);
  }

  SEXP out;

  // When `to` has no levels, it is treated as a template and the
  // levels come from `x`
  if (vec_size(levels) == 0) {
    out = chr_as_factor_from_self(x, false);
  } else {
    out = chr_as_factor_impl(x, levels, lossy, false);
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:138

chr_as_ordered typed

[any_sexp, any_sexp, *c_bool, *struct vctrs_arg] -> any_sexp
timing: 0.070 s
source
SEXP chr_as_ordered(SEXP x, SEXP to, bool* lossy, struct vctrs_arg* to_arg) {
  SEXP levels = PROTECT(Rf_getAttrib(to, R_LevelsSymbol));

  if (TYPEOF(levels) != STRSXP) {
    stop_corrupt_ordered_levels(to, to_arg);
  }

  SEXP out;

  // When `to` has no levels, it is treated as a template and the
  // levels come from `x`
  if (vec_size(levels) == 0) {
    out = chr_as_factor_from_self(x, true);
  } else {
    out = chr_as_factor_impl(x, levels, lossy, true);
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:160

chr_assign typed

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_bool] -> ([CHR, c_int, p(CHR)] -> ())
timing: 0.014 s
source
r_obj* chr_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_BARRIER(r_obj*, r_chr_cbegin, r_chr_poke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:720

chr_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.432 s
source
static inline SEXP chr_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_BARRIER_SHAPED(SEXP, STRING_PTR_RO, SET_STRING_ELT);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:541

chr_c typed

∀'a,'b. ([null & 'a, null & 'b] -> null & 'b)&([null & 'a, any_sexp & 'b] -> any_sexp & 'b)&([null & 'a, 'b & ((externalptr | vec1 | arrow) | sym)] -> 'b & ((externalptr | vec1 | arrow) | sym))&([any_sexp & 'a, null & 'b] -> 'a & (<...> | p(CHR) | sym) | null & 'b)&(['a & ((externalptr | vec1 | arrow) | sym), null & 'b] -> 'a & ((externalptr | vec1 | arrow) | sym))
timing: 0.203 s
source
SEXP chr_c(SEXP x, SEXP y) {
  r_ssize x_n = r_length(x);
  r_ssize y_n = r_length(y);

  if (x_n == 0) {
    return y;
  }
  if (y_n == 0) {
    return x;
  }

  r_ssize out_n = r_ssize_add(x_n, y_n);
  SEXP out = PROTECT(r_alloc_vector(STRSXP, out_n));

  const SEXP* p_x = STRING_PTR_RO(x);
  const SEXP* p_y = STRING_PTR_RO(y);

  for (r_ssize i = 0; i < x_n; ++i) {
    SET_STRING_ELT(out, i, p_x[i]);
  }
  for (r_ssize i = 0, j = x_n; i < y_n; ++i, ++j) {
    SET_STRING_ELT(out, j, p_y[i]);
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1510

chr_col_detect_missing typed

[any_sexp, *c_int_na, c_int_na] -> ([any_sexp] -> c_bool)
timing: 0.008 s
source
r_ssize chr_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(r_obj*, r_chr_cbegin, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:247

chr_col_detect_run_bounds_bool typed

[any_sexp, c_int_na, c_bool, *c_bool] -> ()
timing: 0.005 s
source
void chr_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(r_obj*, r_chr_cbegin, chr_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:327

chr_compare_na_equal typed

[p(CHR), p(CHR)] -> c_int
timing: 0.031 s
source
int chr_compare_na_equal(r_obj* x, r_obj* y) {
  if (chr_equal_na_equal(x, y)) {
    return 0;
  } else if (chr_is_missing(x)) {
    return -1;
  } else if (chr_is_missing(y)) {
    return 1;
  } else {
    return chr_compare_scalar(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:88

chr_compare_na_propagate typed

[p(CHR), p(CHR)] -> c_int_na
timing: 0.039 s
source
int chr_compare_na_propagate(r_obj* x, r_obj* y) {
  if (chr_is_missing(x) || chr_is_missing(y)) {
    return r_globals.na_int;
  } else if (chr_equal_na_equal(x, y)) {
    return 0;
  } else {
    return chr_compare_scalar(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:236

chr_compare_scalar typed

[p(CHR), p(CHR)] -> c_int
timing: 0.016 s
source
int chr_compare_scalar(r_obj* x, r_obj* y) {
  // Assume UTF-8 encoding is handled by `obj_encode_utf8()`
  int cmp = strcmp(r_str_c_string(x), r_str_c_string(y));
  return cmp / abs(cmp);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:25

chr_detect_missing typed

[any_sexp] -> ([any_sexp] -> c_bool)
timing: 0.006 s
source
r_obj* chr_detect_missing(r_obj* x) {
  DETECT_MISSING(r_obj*, r_chr_cbegin, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:78

chr_detect_run_bounds_bool typed

[any_sexp, c_int_na, c_bool, *c_bool] -> ()
timing: 0.005 s
source
void chr_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(r_obj*, r_chr_cbegin, chr_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:228

chr_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t chr_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return chr_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:177

chr_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.008 s
source
uint32_t chr_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_chr_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:134

chr_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_false)&([c_null, c_int_na] -> empty)
timing: 0.117 s
source
bool chr_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_chr_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:220

chr_equal typed

([CHR, CHR, c_int, c_false, c_false, c_false] | [CHR, CHR, c_int, c_false, c_false, c_int_na \ c_false] | [CHR, CHR, c_int, c_false, c_int_na \ c_false, c_false] | [CHR, CHR, c_int, c_false, c_int_na \ c_false, c_int_na \ c_false] | [CHR, CHR, c_int, c_int_na \ c_false, c_false, c_false] | [CHR, CHR, c_int, c_int_na \ c_false, c_false, c_int_na \ c_false] | [CHR, CHR, c_int, c_int_na \ c_false, c_int_na \ c_false, c_false] | [CHR, CHR, c_int, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL)&([CHR, CHR, c_true, c_false, c_false, c_false] | [CHR, CHR, c_true, c_false, c_false, c_int_na \ c_false] | [CHR, CHR, c_true, c_false, c_int_na \ c_false, c_false] | [CHR, CHR, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false] | [CHR, CHR, c_true, c_int_na \ c_false, c_false, c_false] | [CHR, CHR, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false] | [CHR, CHR, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false] | [CHR, CHR, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL1)
timing: 2.04 s
source
SEXP chr_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(SEXP, STRING_PTR_RO, chr_equal_na_equal, chr_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:151

chr_equal_na_equal typed

[any_sexp, any_sexp] -> c_bool
timing: 0.008 s
source
static inline int chr_equal_na_equal(SEXP x, SEXP y) {
  return x == y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:41

chr_equal_na_propagate typed

[any_sexp, any_sexp] -> c_lgl
timing: 0.029 s
source
static inline int chr_equal_na_propagate(SEXP x, SEXP y) {
  if (chr_is_missing(x) || chr_is_missing(y)) {
    return NA_LOGICAL;
  } else {
    return chr_equal_na_equal(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:165

chr_extract_without_missings typed

[c_int_na, *p(CHR), *(c_string | c_null)] -> struct r_ssize_int_pair
timing: 1.37 s
source
struct r_ssize_int_pair chr_extract_without_missings(
  r_ssize size,
  const SEXP* p_x,
  const char** p_x_strings
) {
  r_ssize n_missing = 0;
  int max_string_size = 0;

  r_ssize loc = 0;

  for (r_ssize i = 0; i < size; ++i) {
    SEXP elt = p_x[i];

    if (elt == NA_STRING) {
      ++n_missing;
    } else {
      const int elt_string_size = (int) Rf_length(elt);
      if (max_string_size < elt_string_size) {
        max_string_size = elt_string_size;
      }

      p_x_strings[loc] = CHAR(elt);
      ++loc;
    }
  }

  return (struct r_ssize_int_pair) {
    .x = n_missing,
    .y = max_string_size
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2613

chr_find_encoding_start typed

∀'a. [CHR, c_int_na & 'a] -> c_int | 'a
timing: 0.123 s
source
r_ssize chr_find_encoding_start(r_obj* x, r_ssize size) {
  r_obj* const* p_x = r_chr_cbegin(x);

  for (r_ssize i = 0; i < size; ++i) {
    r_obj* const elt = p_x[i];

    if (!str_is_ascii_or_utf8(elt)) {
      return i;
    }
  }

  return size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:79

chr_first_missing typed

[any_sexp] -> ([any_sexp] -> c_bool)
timing: 0.006 s
source
r_ssize chr_first_missing(r_obj* x) {
  FIRST_MISSING(r_obj*, r_chr_cbegin, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:336

chr_handle_missings typed

([c_int_na, c_int_na, c_false, *any_sexp, *c_int_na, *c_int_na] | [c_int_na, c_int_na, c_int_na \ c_false, *any_sexp, *c_int_na, *c_int_na] -> ())&([c_int_na, c_int_na, c_false, *any_sexp, *c_int_na, c_null] | [c_int_na, c_int_na, c_int_na \ c_false, *any_sexp, *c_int_na, c_null] -> empty)
timing: 2.20 s
source
void chr_handle_missings(
  r_ssize size,
  r_ssize n_missing,
  const bool na_last,
  const SEXP* p_x,
  int* p_o,
  int* p_o_aux
) {
  r_ssize loc_missing = na_last ? (size - n_missing) : 0;
  r_ssize loc_not_missing = na_last ? 0 : n_missing;

  for (r_ssize i = 0; i < size; ++i) {
    SEXP elt = p_x[i];

    if (elt == NA_STRING) {
      p_o_aux[loc_missing] = p_o[i];
      ++loc_missing;
    } else {
      p_o_aux[loc_not_missing] = p_o[i];
      ++loc_not_missing;
    }
  }

  // Copy back
  r_memcpy(p_o, p_o_aux, size * sizeof(*p_o_aux));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2654

chr_hash typed

[any_sexp] -> ([any_sexp] -> c_int_na)
timing: 0.005 s
source
static inline uint32_t chr_hash(r_obj* x) {
  HASH(r_obj*, r_chr_cbegin, chr_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:92

chr_hash_fill_na_equal typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.006 s
source
static inline void chr_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(r_obj*, r_chr_cbegin, chr_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:238

chr_hash_fill_na_propagate typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.006 s
source
static inline void chr_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(r_obj*, r_chr_cbegin, chr_hash_scalar, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:260

chr_hash_scalar typed

[any_sexp] -> c_int_na
timing: 0.005 s
source
static inline uint32_t chr_hash_scalar(r_obj* x) {
  return uint64_hash((uintptr_t) x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:99

chr_is_missing typed

[any_sexp] -> c_bool
timing: 0.009 s
source
bool chr_is_missing(r_obj* x) {
  return x == r_globals.na_str;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:32

chr_order_chunk typed

([c_false, c_false, c_false, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ())&([c_false, c_false, c_true, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_int_na \ c_false, c_true, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_false, c_true, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_int_na \ c_false, c_true, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] -> empty)
timing: 5.57 s
source
void chr_order_chunk(
  bool decreasing,
  bool na_last,
  r_ssize size,
  int* p_o,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  SEXP* p_x_chunk_sexp = (SEXP*) p_lazy_x_chunk->p_data;

  const enum vctrs_sortedness sortedness = chr_sortedness(
    p_x_chunk_sexp,
    size,
    decreasing,
    na_last,
    p_group_infos
  );

  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    ord_resolve_sortedness_chunk(sortedness, size, p_o);
    return;
  }

  const char** p_x_aux = (const char**) init_lazy_raw(p_lazy_x_aux);

  // Extract out `CHAR()` string pointers and `Rf_length()` string sizes,
  // skipping missings along the way, but returning the count of them and
  // the max string size
  const struct r_ssize_int_pair pair = chr_extract_without_missings(
    size,
    p_x_chunk_sexp,
    p_x_aux
  );
  const r_ssize n_missing = pair.x;
  const int max_string_size = pair.y;

  if (n_missing != 0) {
    // If there are missings, handle them by pushing their ordering to the front
    // (or back, depending on `na_last`) of `p_o`
    int* p_o_aux = init_lazy_raw(p_lazy_o_aux);

    chr_handle_missings(
      size,
      n_missing,
      na_last,
      p_x_chunk_sexp,
      p_o,
      p_o_aux
    );

    size -= n_missing;
    p_o = na_last ? p_o : (p_o + n_missing);
  }

  // Now forget about `p_x_chunk_sexp` and swap `p_x_aux` with `p_x_chunk`
  // to get back to the "standard" definition of these pointers
  //p_x_chunk_sexp = NULL;
  const char** p_x_chunk = (const char**) p_lazy_x_chunk->p_data;
  SWAP(const char**, p_x_chunk, p_x_aux);

  if (!na_last && n_missing != 0) {
    // Push `!na_last` group before sorting
    groups_size_maybe_push(n_missing, p_group_infos);
  }

  if (size <= ORDER_INSERTION_BOUNDARY) {
    chr_order_insertion(
      size,
      decreasing,
      p_x_chunk,
      p_o,
      p_group_infos
    );
  } else {
    int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);
    uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

    chr_order_radix(
      size,
      decreasing,
      max_string_size,
      p_x_chunk,
      p_o,
      p_x_aux,
      p_o_aux,
      p_bytes,
      p_group_infos
    );
  }

  if (na_last && n_missing != 0) {
    // Push `na_last` group after sorting
    groups_size_maybe_push(n_missing, p_group_infos);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2396

chr_order_radix typed

[c_false, c_false, c_int_na, *(c_string | c_null), *c_int_na, *(c_string | c_null), *c_int_na, *c_int_na, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na, *(c_string | c_null), *c_int_na, *(c_string | c_null), *c_int_na, *c_int_na, *struct group_infos] | [c_int_na, c_false, c_int_na, *(c_string | c_null), *c_int_na, *(c_string | c_null), *c_int_na, *c_int_na, c_null] | [c_int_na, c_int_na \ c_false, c_int_na, *(c_string | c_null), *c_int_na, *(c_string | c_null), *c_int_na, *c_int_na, c_null] -> ()
timing: 0.155 s
source
void chr_order_radix(
  const r_ssize size,
  const bool decreasing,
  const int max_string_size,
  const char** p_x,
  int* p_o,
  const char** p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  struct group_infos* p_group_infos
) {
  int pass = 0;

  // If `pass == max_string_size == 0`, we are already done!
  //
  // This is needed when a vector of `NA` followed by all `""` are passed in. The
  // `NA` make it look unsorted, but then the `NA` are removed, so we are left
  // with a vector of `""` with `max_string_size == 0`.
  //
  // Without this, we can infloop because the `next_pass == max_string_size`
  // exit never occurs because `next_pass` starts above `max_string_size`. We
  // have a test to make sure we return the correct result.
  if (pass == max_string_size) {
    groups_size_maybe_push(size, p_group_infos);
    return;
  }

  chr_order_radix_recurse(
    size,
    decreasing,
    pass,
    max_string_size,
    p_x,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2682

chr_slice_shaped typed

([CHR, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [CHR, any_sexp, c_null] -> any_sexp)
timing: 0.533 s
source
static SEXP chr_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_BARRIER_SHAPED(STRSXP, SEXP, STRING_PTR_RO, SET_STRING_ELT, NA_STRING);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:262

chr_sortedness typed

([*any_sexp, c_false, c_false, c_false, *struct group_infos] | [*any_sexp, c_false, c_false, c_int_na \ c_false, *struct group_infos] | [*any_sexp, c_false, c_int_na \ c_false, c_false, *struct group_infos] | [*any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> c_true)&([*any_sexp, c_true, c_false, c_false, c_null] | [*any_sexp, c_true, c_false, c_int_na \ c_false, c_null] | [*any_sexp, c_true, c_int_na \ c_false, c_false, c_null] | [*any_sexp, c_true, c_int_na \ c_false, c_int_na \ c_false, c_null] | [c_null, c_int_na \ c_bool, c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_false, c_int_na \ c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> empty)&([*p(CHR), c_int_na \ c_bool, c_false, c_false, c_null] | [*p(CHR), c_int_na \ c_bool, c_false, c_int_na \ c_false, c_null] | [*p(CHR), c_int_na \ c_bool, c_int_na \ c_false, c_false, c_null] | [*p(CHR), c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_null] -> c_false | c(2))
timing: 5.66 s
source
enum vctrs_sortedness chr_sortedness(const SEXP* p_x,
                                     r_ssize size,
                                     bool decreasing,
                                     bool na_last,
                                     struct group_infos* p_group_infos) {
  if (size == 0) {
    return VCTRS_SORTEDNESS_sorted;
  }

  if (size == 1) {
    groups_size_maybe_push(1, p_group_infos);
    return VCTRS_SORTEDNESS_sorted;
  }

  const int direction = decreasing ? -1 : 1;
  const int na_order = na_last ? 1 : -1;

  SEXP previous = p_x[0];
  const char* previous_string = CHAR(previous);

  r_ssize count = 0;

  // Check for strictly opposite of expected order
  // (ties are not allowed so we can reverse the vector stably)
  for (r_ssize i = 1; i < size; ++i, ++count) {
    SEXP current = p_x[i];
    const char* current_string = CHAR(current);

    int cmp = str_cmp_maybe_na(
      current,
      previous,
      current_string,
      previous_string,
      direction,
      na_order
    );

    if (cmp >= 0) {
      break;
    }

    previous = current;
    previous_string = current_string;
  }

  // Was in strictly opposite of expected order.
  if (count == size - 1) {
    // Each group is size 1 since this is strict ordering
    for (r_ssize j = 0; j < size; ++j) {
      groups_size_maybe_push(1, p_group_infos);
    }
    return VCTRS_SORTEDNESS_reversed;
  }

  // Was partially in expected order. Need to sort.
  if (count != 0) {
    return VCTRS_SORTEDNESS_unsorted;
  }

  // Retain the original `n_groups` to be able to reset the group sizes if
  // it turns out we don't have expected ordering
  struct group_info* p_group_info = groups_current(p_group_infos);
  r_ssize original_n_groups = p_group_info->n_groups;

  r_ssize group_size = 1;

  // Check for expected ordering - allowing ties since we don't have to
  // reverse the ordering.
  for (r_ssize i = 1; i < size; ++i) {
    SEXP current = p_x[i];
    const char* current_string = CHAR(current);

    int cmp = str_cmp_maybe_na(
      current,
      previous,
      current_string,
      previous_string,
      direction,
      na_order
    );

    // Not expected ordering
    if (cmp < 0) {
      p_group_info->n_groups = original_n_groups;
      return VCTRS_SORTEDNESS_unsorted;
    }

    previous = current;
    previous_string = current_string;

    // Continue group run
    if (cmp == 0) {
      ++group_size;
      continue;
    }

    // Expected ordering
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);

  // Expected ordering
  return VCTRS_SORTEDNESS_sorted;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:325

class_implements_base_c typed

[any_sexp] -> c_bool
timing: 0.020 s
source
bool class_implements_base_c(r_obj* cls) {
  if (s3_class_find_method("c", cls, base_method_table) != r_null) {
    return true;
  }
  if (s4_class_find_method(cls, s4_c_method_table) != r_null) {
    return true;
  }
  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1582

class_type typed

[<> | null | p(CHR) | sym] -> c(11)
timing: 0.044 s
source
enum vctrs_class_type class_type(r_obj* x) {
  if (!r_is_object(x)) {
    return VCTRS_CLASS_none;
  }

  r_obj* cls = KEEP(r_class(x));

  // Avoid corrupt objects where `x` is an object, but the class is NULL
  if (cls == r_null) {
    FREE(1);
    return VCTRS_CLASS_none;
  }

  enum vctrs_class_type type = class_type_impl(cls);

  FREE(1);
  return type;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils-dispatch.c:10

class_type_impl typed

([CHR] -> c(0..10))&([CHR1] -> c(0..3) | c(5) | c(7) | c(10))
timing: 1.86 s
source
enum vctrs_class_type class_type_impl(r_obj* cls) {
  int n = r_length(cls);
  r_obj* const* p = r_chr_cbegin(cls);

  // First check for bare types for which we know how many strings are
  // the classes composed of
  switch (n) {
  case 1: {
    r_obj* p0 = p[0];

    if (p0 == strings_data_frame) {
      return VCTRS_CLASS_bare_data_frame;
    } else if (p0 == strings_factor) {
      return VCTRS_CLASS_bare_factor;
    } else if (p0 == strings_date) {
      return VCTRS_CLASS_bare_date;
    } else if (p0 == strings.AsIs) {
      return VCTRS_CLASS_bare_asis;
    }

    break;
  }
  case 2: {
    r_obj* p0 = p[0];
    r_obj* p1 = p[1];

    if (p0 == strings_ordered &&
        p1 == strings_factor) {
      return VCTRS_CLASS_bare_ordered;
    }

    if (p1 == strings_posixt) {
      if (p0 == strings_posixct) {
        return VCTRS_CLASS_bare_posixct;
      } else if (p0 == strings_posixlt) {
        return VCTRS_CLASS_bare_posixlt;
      }
    }

    break;
  }
  case 3: {
    if (p[0] == strings_tbl_df &&
        p[1] == strings_tbl &&
        p[2] == strings_data_frame) {
      return VCTRS_CLASS_bare_tibble;
    }

    break;
  }}

  // Now check for inherited classes
  p = p + n - 1;
  r_obj* last = *p;

  if (last == strings_data_frame) {
    return VCTRS_CLASS_data_frame;
  } else if (last == strings_list) {
    return VCTRS_CLASS_list;
  }

  return VCTRS_CLASS_unknown;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils-dispatch.c:30

class_type_is_data_frame typed

([c_false | c(5..11) | c(2)] -> c_false)&([c_true | c(3..4)] -> c_true)
timing: 0.027 s
source
bool class_type_is_data_frame(enum vctrs_class_type type) {
  switch (type) {
  case VCTRS_CLASS_data_frame:
  case VCTRS_CLASS_bare_data_frame:
  case VCTRS_CLASS_bare_tibble:
    return true;
  default:
    return false;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils-dispatch.h:24

col_detect_complete_switch typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.274 s
source
void col_detect_complete_switch(SEXP x, R_len_t size, int* p_out) {
  switch (vec_proxy_typeof(x)) {
  case VCTRS_TYPE_logical: lgl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_integer: int_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_double: dbl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_complex: cpl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_character: chr_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_raw: raw_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_list: list_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_dataframe: r_stop_internal("Data frame columns should have been flattened by now.");
  case VCTRS_TYPE_null: r_abort("Unexpected `NULL` column found in a data frame.");
  case VCTRS_TYPE_scalar: stop_scalar_type(x, vec_args.empty, r_lazy_null);
  default: stop_unimplemented_vctrs_type("vec_detect_complete", vec_proxy_typeof(x));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:185

col_detect_run_bounds_bool typed

[any_sexp, c_int_na, c_bool, *c_bool] -> ()
timing: 0.191 s
source
void col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  switch (vec_proxy_typeof(x)) {
  case VCTRS_TYPE_logical: lgl_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_integer: int_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_double: dbl_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_complex: cpl_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_character: chr_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_raw: raw_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_list: list_col_detect_run_bounds_bool(x, size, which, v_out); break;
  case VCTRS_TYPE_dataframe: r_stop_internal("Data frame columns should be flattened.");
  case VCTRS_TYPE_scalar: r_abort("Can't compare scalars.");
  default: r_abort("Unimplemented type.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:278

col_ptype typed

[any_sexp] -> any_sexp
timing: 0.011 s
source
r_obj* col_ptype(r_obj* x) {
  return vec_ptype(x, vec_args.empty, r_lazy_null);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:32

compact_condition_begin typed

[raw] -> *c_bool
timing: 0.011 s
source
bool* compact_condition_begin(r_obj* x) {
  return (bool*) r_raw_begin(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:927

compact_condition_cbegin typed

[raw] -> *c_bool
timing: 0.011 s
source
const bool* compact_condition_cbegin(r_obj* x) {
  return (const bool*) r_raw_cbegin(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:930

compact_condition_materialize typed

[raw] -> LGL
timing: 0.139 s
source
r_obj* compact_condition_materialize(r_obj* x) {
  const bool* v_x = compact_condition_cbegin(x);
  const r_ssize size = compact_condition_size(x);

  r_obj* out = KEEP(r_alloc_logical(size));
  int* v_out = r_lgl_begin(out);

  for (r_ssize i = 0; i < size; ++i) {
    v_out[i] = v_x[i];
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:905

compact_condition_materialize_location typed

[raw] -> any_sexp
timing: 0.058 s
source
r_obj* compact_condition_materialize_location(r_obj* x) {
  const bool* v_x = compact_condition_cbegin(x);
  const r_ssize size = compact_condition_size(x);
  return p_bool_which(v_x, size);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:921

compact_condition_size typed

[any_sexp] -> c_int
timing: 0.028 s
source
r_ssize compact_condition_size(r_obj* x) {
  // Should always be the same as the length, but you never know
  return r_length(x) / sizeof(bool);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:898

compact_condition_sum typed

[raw] -> c_int
timing: 0.053 s
source
r_ssize compact_condition_sum(r_obj* x) {
  const bool* v_x = compact_condition_cbegin(x);
  const r_ssize size = compact_condition_size(x);
  return p_bool_sum(v_x, size);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:934

compact_rep typed

([c_int_na, c(..-1)] -> empty)&([c_int_na, c_int_na \ c(..-1)] -> INT)
timing: 0.126 s
source
SEXP compact_rep(R_len_t i, R_len_t n) {
  if (n < 0) {
    r_stop_internal("Negative `n` in `compact_rep()`.");
  }

  SEXP rep = PROTECT(Rf_allocVector(INTSXP, 2));

  int* p = INTEGER(rep);
  init_compact_rep(p, i, n);

  r_attrib_poke_class(rep, compact_rep_classes);

  UNPROTECT(1);
  return rep;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:832

compact_rep_materialize typed

[^INT1] -> INT
timing: 0.092 s
source
SEXP compact_rep_materialize(SEXP x) {
  int i = r_int_get(x, 0);
  int n = r_int_get(x, 1);

  SEXP out = PROTECT(Rf_allocVector(INTSXP, n));
  r_int_fill(out, i, n);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:852

compact_rownames_length typed

[^INT1] -> c(0..)
timing: 0.019 s
source
r_ssize compact_rownames_length(r_obj* x) {
  return abs(r_int_get(x, 1));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:435

compact_seq typed

([c(..-1), c_int_na, c_false] | [c(..-1), c_int_na, c_int_na \ c_false] | [c_int_na \ c(..-1), c(..-1), c_false] | [c_int_na \ c(..-1), c(..-1), c_int_na \ c_false] -> empty)&([c_int_na \ c(..-1), c_int_na \ c(..-1), c_false] | [c_int_na \ c(..-1), c_int_na \ c(..-1), c_int_na \ c_false] -> INT)
timing: 0.363 s
source
SEXP compact_seq(R_len_t start, R_len_t size, bool increasing) {
  if (start < 0) {
    r_stop_internal("`start` must not be negative.");
  }

  if (size < 0) {
    r_stop_internal("`size` must not be negative.");
  }

  if (!increasing && size > start + 1) {
    r_stop_internal("`size` must not be larger than `start` for decreasing sequences.");
  }

  SEXP info = PROTECT(Rf_allocVector(INTSXP, 3));

  int* p = INTEGER(info);
  init_compact_seq(p, start, size, increasing);

  r_attrib_poke_class(info, compact_seq_classes);

  UNPROTECT(1);
  return info;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:775

compact_seq_materialize typed

[^INT1] -> INT
timing: 0.323 s
source
SEXP compact_seq_materialize(SEXP x) {
  int* p = INTEGER(x);
  R_len_t start = p[0] + 1;
  R_len_t size = p[1];
  R_len_t step = p[2];

  SEXP out = PROTECT(Rf_allocVector(INTSXP, size));
  int* out_data = INTEGER(out);

  for (R_len_t i = 0; i < size; ++i, ++out_data, start += step) {
    *out_data = start;
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:804

compute_default_index typed

([list, c_bool, c(..-1)] -> empty)&([any_sexp, c_bool, c_int_na] \ [list, c_bool, c(..-1)] -> any_sexp)
timing: 0.224 s
source
r_obj* compute_default_index(
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size
) {
  const r_ssize indices_size = r_length(indices);
  r_obj* const* v_indices = r_list_cbegin(indices);

  r_obj* out = KEEP(new_compact_condition(size));
  bool* v_out = compact_condition_begin(out);

  // Initialize mark everything as unmatched
  p_bool_fill(v_out, size, true);

  // Unmark matched locations according to the index style
  switch (indices_style) {
  case VCTRS_INDEX_STYLE_location: {
    for (r_ssize i = 0; i < indices_size; ++i) {
      r_obj* index = v_indices[i];

      if (is_compact_seq(index)) {
        const int* v_index = r_int_cbegin(index);
        const r_ssize start = v_index[0];
        const r_ssize size = v_index[1];
        const r_ssize step = v_index[2];

        r_ssize loc = start;

        for (r_ssize j = 0; j < size; ++j) {
          v_out[loc] = false;
          loc += step;
        }
      } else {
        const r_ssize size = r_length(index);
        const int* v_index = r_int_cbegin(index);

        for (r_ssize j = 0; j < size; ++j) {
          const int loc = v_index[j];

          if (loc != r_globals.na_int) {
            // If not `NA`, mark location as matched by at least 1 index
            v_out[loc - 1] = false;
          }
        }
      }
    }
    break;
  }
  case VCTRS_INDEX_STYLE_condition: {
    for (r_ssize i = 0; i < indices_size; ++i) {
      r_obj* index = v_indices[i];
      const int* v_index = r_lgl_cbegin(index);

      for (r_ssize j = 0; j < size; ++j) {
        const int elt = v_index[j];
        // If `TRUE`, mark location as matched by at least 1 index.
        // Specially optimized to be branchless, which does greatly help.
        v_out[j] &= (elt != 1);
      }
    }
    break;
  }
  default: {
    r_stop_unreachable();
  }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1709

compute_indices_style typed

[list, c_int_na] -> c_bool
timing: 0.140 s
source
enum vctrs_index_style compute_indices_style(r_obj* indices, r_ssize size) {
  r_obj* const* v_indices = r_list_cbegin(indices);
  r_ssize indices_size = vec_size(indices);

  for (r_ssize i = 0; i < indices_size; ++i) {
    r_obj* index = v_indices[i];

    if (!is_condition_index(index)) {
      return VCTRS_INDEX_STYLE_location;
    }
    if (r_length(index) != size) {
      return VCTRS_INDEX_STYLE_location;
    }
  }

  return VCTRS_INDEX_STYLE_condition;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1650

compute_iter_loc typed

([c_int, c_true] -> c_int)&([c_int_na, c_false] -> c_false)&([c_int_na, c_true] -> c_int_na)
timing: 0.040 s
source
r_ssize compute_iter_loc(r_ssize size, enum vctrs_run_bound which) {
  switch (which) {
  case VCTRS_RUN_BOUND_start: return 0;
  case VCTRS_RUN_BOUND_end: return size - 1;
  default: r_stop_internal("Unknown `which` value.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:344

compute_iter_step typed

([c_false] -> c_true)&([c_true] -> c(-1))
timing: 0.016 s
source
r_ssize compute_iter_step(enum vctrs_run_bound which) {
  switch (which) {
  case VCTRS_RUN_BOUND_start: return 1;
  case VCTRS_RUN_BOUND_end: return -1;
  default: r_stop_internal("Unknown `which` value.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:353

compute_nesting_container_ids typed

([<> | null | p(CHR) | sym, *c_int_na, *c_int_na, *c_int_na, c_int_na, c_int_na, c_false] | [<> | null | p(CHR) | sym, *c_int_na, *c_int_na, *c_int_na, c_int_na, c_int_na, c_int_na \ c_false] -> empty)&([any_sexp, *c_int_na, *c_int_na, *c_int_na, c_int_na, c_int_na, c_int_na] & ~[<> | null | p(CHR) | sym, *c_int_na, *c_int_na, *c_int_na, c_int_na, c_int_na, c_false] & ~[<> | null | p(CHR) | sym, *c_int_na, *c_int_na, *c_int_na, c_int_na, c_int_na, c_int_na \ c_false] -> any_sexp)
timing: 0.083 s
source
r_obj* compute_nesting_container_ids(r_obj* x,
                                     const int* v_order,
                                     const int* v_group_sizes,
                                     const int* v_outer_group_sizes,
                                     r_ssize size,
                                     r_ssize n_groups,
                                     bool has_outer_group_sizes) {
  if (!is_data_frame(x)) {
    r_stop_internal("`x` must be a data frame.");
  }

  int n_prot = 0;

  const r_ssize n_cols = r_length(x);

  r_obj* out = KEEP_N(r_alloc_list(2), &n_prot);

  r_obj* container_ids = r_alloc_integer(size);
  r_list_poke(out, 0, container_ids);
  int* v_container_ids = r_int_begin(container_ids);

  r_obj* n_container_ids = r_alloc_integer(1);
  r_list_poke(out, 1, n_container_ids);
  int* p_n_container_ids = r_int_begin(n_container_ids);

  // Initialize ids to 0, which is always our first container id value.
  // This means we start with 1 container.
  r_memset(v_container_ids, 0, size * sizeof(int));
  *p_n_container_ids = 1;

  if (size == 0) {
    // Algorithm requires at least 1 row
    FREE(n_prot);
    return out;
  }

  if (n_cols == 1) {
    // If there is only 1 column, `x` is in increasing order already when
    // ordered by `v_order`.
    // If `v_outer_group_sizes` were supplied, within each group `x` will
    // be in increasing order (since the single `x` column is the one that
    // broke any ties), and that is all that is required.
    FREE(n_prot);
    return out;
  }

  struct r_dyn_array* p_prev_rows = r_new_dyn_vector(R_TYPE_integer, 10000);
  KEEP_N(p_prev_rows->shelter, &n_prot);

  struct poly_vec* p_poly_x = new_poly_vec(x, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_x->shelter, &n_prot);
  const void* v_x = p_poly_x->p_vec;

  // Will be used if `has_outer_group_sizes` is `true`
  r_ssize loc_outer_group_sizes = 0;
  r_ssize loc_next_outer_group_start = 0;

  r_ssize loc_group_start = 0;

  for (r_ssize i = 0; i < n_groups; ++i) {
    if (has_outer_group_sizes && loc_next_outer_group_start == loc_group_start) {
      // Start of a new outer group. Clear all stored previous rows.
      p_prev_rows->count = 0;
      loc_next_outer_group_start += v_outer_group_sizes[loc_outer_group_sizes];
      ++loc_outer_group_sizes;
    }

    const r_ssize group_size = v_group_sizes[i];

    const int cur_row = v_order[loc_group_start] - 1;

    int container_id = 0;
    int n_container_ids_group = p_prev_rows->count;

    for (; container_id < n_container_ids_group; ++container_id) {
      const int prev_row = r_dyn_int_get(p_prev_rows, container_id);

      if (p_nesting_container_df_compare_fully_ge_na_equal(v_x, cur_row, v_x, prev_row)) {
        // Current row is fully greater than or equal to previous row.
        // Meaning it is not a new `container_id`, and it falls in the current container.
        break;
      }
    }

    if (container_id == n_container_ids_group) {
      // New `container_id` for this outer group, which we add to the end
      r_dyn_push_back(p_prev_rows, &cur_row);
      ++n_container_ids_group;

      if (n_container_ids_group > *p_n_container_ids) {
        // `p_prev_rows` is reset for each outer group,
        // so we have to keep a running overall count
        *p_n_container_ids = n_container_ids_group;
      }
    } else {
      // Update stored row location to the current row,
      // since the current row is greater than or equal to it
      r_dyn_int_poke(p_prev_rows, container_id, cur_row);
    }

    for (r_ssize j = 0; j < group_size; ++j) {
      v_container_ids[v_order[loc_group_start] - 1] = container_id;
      ++loc_group_start;
    }
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2420

compute_nesting_container_info typed

[any_sexp, c_int_na, *c_false] -> list
timing: 15.28 s
source
r_obj* compute_nesting_container_info(r_obj* haystack,
                                      r_ssize size_haystack,
                                      const enum vctrs_ops* v_ops) {
  int n_prot = 0;

  const r_ssize n_cols = r_length(haystack);

  // Outputs:
  // - `haystack` order
  // - Container id vector
  // - Number of containers as a scalar
  // - Boolean for if there are any-non-equi conditions
  r_obj* out = KEEP_N(r_alloc_list(4), &n_prot);

  bool any_non_equi = false;
  int first_non_equi = 0;
  for (r_ssize i = 0; i < n_cols; ++i) {
    const enum vctrs_ops op = v_ops[i];

    if (op != VCTRS_OPS_eq) {
      any_non_equi = true;
      first_non_equi = i;
      break;
    }
  }

  if (!any_non_equi) {
    // Container info isn't required for only `==`
    r_list_poke(out, 0, vec_order(haystack, chrs_asc, chrs_smallest, true, r_null));
    r_list_poke(out, 1, r_globals.empty_int);
    r_list_poke(out, 2, r_int(1));
    r_list_poke(out, 3, r_lgl(any_non_equi));
    FREE(n_prot);
    return out;
  }

  r_obj* info = KEEP_N(vec_order_info(
    haystack,
    chrs_asc,
    chrs_smallest,
    true,
    r_null
  ), &n_prot);

  r_obj* o_haystack = r_list_get(info, 0);
  const int* v_o_haystack = r_int_cbegin(o_haystack);

  r_obj* group_sizes = r_list_get(info, 1);
  const int* v_group_sizes = r_int_cbegin(group_sizes);
  const r_ssize n_groups = r_length(group_sizes);

  // This is the haystack we compute container ids with.
  // This is initially the whole `haystack`, but will be adjusted to contain
  // fewer columns if there are `==` conditions before the first non-equi
  // condition.
  r_keep_loc haystack_container_pi;
  r_obj* haystack_container = haystack;
  KEEP_HERE(haystack_container, &haystack_container_pi);
  ++n_prot;

  // If there are `==` conditions before the first non-equi condition,
  // we separate those columns from the haystack and compute their group sizes,
  // which are used for computing the container ids.
  bool has_outer_group_sizes = false;
  const int* v_outer_group_sizes = NULL;

  if (first_non_equi != 0) {
    // We have equality comparisons before the first non-equi comparison.
    // In this case, we can skip nested containment ordering for the equality
    // comparisons before the first non-equi comparison if we pass on the
    // group sizes of the ordered equality columns as `v_outer_group_sizes`.
    r_obj* const* v_haystack = r_list_cbegin(haystack);
    r_obj* const* v_haystack_names = r_chr_cbegin(r_names(haystack));

    // "Outer" data frame columns before the first non-equi condition
    r_obj* haystack_outer = KEEP_N(r_alloc_list(first_non_equi), &n_prot);
    r_obj* haystack_outer_names = r_alloc_character(first_non_equi);
    r_attrib_poke_names(haystack_outer, haystack_outer_names);
    r_init_data_frame(haystack_outer, size_haystack);
    for (r_ssize i = 0; i < first_non_equi; ++i) {
      r_list_poke(haystack_outer, i, v_haystack[i]);
      r_chr_poke(haystack_outer_names, i, v_haystack_names[i]);
    }

    // "Inner" data frame columns at and after the first non-equi condition
    r_obj* haystack_inner = KEEP_N(r_alloc_list(n_cols - first_non_equi), &n_prot);
    r_obj* haystack_inner_names = r_alloc_character(n_cols - first_non_equi);
    r_attrib_poke_names(haystack_inner, haystack_inner_names);
    r_init_data_frame(haystack_inner, size_haystack);
    for (r_ssize i = first_non_equi, j = 0; i < n_cols; ++i, ++j) {
      r_list_poke(haystack_inner, j, v_haystack[i]);
      r_chr_poke(haystack_inner_names, j, v_haystack_names[i]);
    }

    // Compute the order info of the outer columns, just to pluck off the
    // group sizes. These automatically create a set of groups that
    // "surround" the non-equi columns.
    r_obj* info = vec_order_info(
      haystack_outer,
      chrs_asc,
      chrs_smallest,
      true,
      r_null
    );
    r_obj* outer_group_sizes = KEEP_N(r_list_get(info, 1), &n_prot);
    v_outer_group_sizes = r_int_cbegin(outer_group_sizes);
    has_outer_group_sizes = true;

    // Inner columns become the new container haystack
    haystack_container = haystack_inner;
    KEEP_AT(haystack_container, haystack_container_pi);
  }

  r_obj* container_ids_info = KEEP_N(compute_nesting_container_ids(
    haystack_container,
    v_o_haystack,
    v_group_sizes,
    v_outer_group_sizes,
    size_haystack,
    n_groups,
    has_outer_group_sizes
  ), &n_prot);

  const int n_containers = r_as_int(r_list_get(container_ids_info, 1));

  if (n_containers == 1) {
    // If only a single container exists at this point, either there was
    // only 1 non-equi column which must already be in order, or we hit the
    // somewhat rare case of having a >1 col `haystack_container` data frame
    // that is already in nested containment order. In that case, original
    // haystack ordering is sufficient and we don't need the ids.
    r_list_poke(out, 0, o_haystack);
    r_list_poke(out, 1, r_globals.empty_int);
    r_list_poke(out, 2, r_int(1));
    r_list_poke(out, 3, r_lgl(any_non_equi));
    FREE(n_prot);
    return out;
  }

  // Otherwise, we need to recompute the haystack ordering accounting for
  // `container_ids`. One way to do this is to append `container_ids` to the
  // front of the `haystack` data frame and recompute the order, but since
  // we already have `o_haystack` and `group_sizes`, we can build a simpler
  // proxy for `haystack` that orders the exact same, but faster. So we end
  // up with a two column data frame of `container_ids` and `haystack_proxy`
  // to compute the new order for.
  r_obj* container_ids = r_list_get(container_ids_info, 0);

  r_obj* haystack_proxy = KEEP_N(r_alloc_integer(size_haystack), &n_prot);
  int* v_haystack_proxy = r_int_begin(haystack_proxy);

  r_ssize loc_o_haystack = 0;

  // Insert group number as the proxy value
  for (r_ssize i = 0; i < n_groups; ++i) {
    const r_ssize group_size = v_group_sizes[i];
    for (r_ssize j = 0; j < group_size; ++j) {
      v_haystack_proxy[v_o_haystack[loc_o_haystack] - 1] = i;
      ++loc_o_haystack;
    }
  }

  r_obj* df = KEEP_N(r_alloc_list(2), &n_prot);
  r_list_poke(df, 0, container_ids);
  r_list_poke(df, 1, haystack_proxy);

  r_obj* df_names = r_alloc_character(2);
  r_attrib_poke_names(df, df_names);
  r_chr_poke(df_names, 0, r_str("container_ids"));
  r_chr_poke(df_names, 1, r_str("haystack_proxy"));

  r_init_data_frame(df, size_haystack);

  o_haystack = KEEP_N(vec_order(
    df,
    chrs_asc,
    chrs_smallest,
    true,
    r_null
  ), &n_prot);

  r_list_poke(out, 0, o_haystack);
  r_list_poke(out, 1, container_ids);
  r_list_poke(out, 2, r_int(n_containers));
  r_list_poke(out, 3, r_lgl(any_non_equi));

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2226

compute_size typed

∀'a. ([c(-1) & 'a, null | { (externalptr | vec1 | arrow) | sym | null }] -> c_bool)&([c(-1) & 'a, null | { any_sexp }] -> c_int)&([c(-1) & 'a, null | { null }] -> c_false)&([c_int_na \ c(-1) & 'a, any_sexp] -> c_int_na \ c(-1) & 'a)
timing: 0.210 s
source
r_ssize compute_size(r_ssize size, r_obj* conditions) {
  if (size != -1) {
    return size;
  }

  if (r_length(conditions) == 0) {
    return 0;
  }

  return r_length(r_list_get(conditions, 0));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/case-when.c:165

counters_increment typed

([*struct counters] -> ())&([c_null] -> empty)
timing: 0.289 s
source
void counters_increment(struct counters* counters) {
  ++(counters->next);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg-counter.c:45

counters_shift typed

([*struct counters] -> ())&([c_null] -> empty)
timing: 0.460 s
source
void counters_shift(struct counters* p_counters) {
  // Swap the counters data
  SWAP(struct vctrs_arg, p_counters->curr_counter, p_counters->next_counter);
  SWAP(r_ssize*, p_counters->curr_counter_arg_data.i, p_counters->next_counter_arg_data.i);

  // Update the handles to `vctrs_arg`
  p_counters->curr_arg = (struct vctrs_arg*) &p_counters->curr_counter;
  p_counters->next_arg = (struct vctrs_arg*) &p_counters->next_counter;

  // Update the current index
  p_counters->curr = p_counters->next;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg-counter.c:55

cpl_assign typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.408 s
source
r_obj* cpl_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN(Rcomplex, COMPLEX, COMPLEX_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:520

cpl_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.546 s
source
static inline SEXP cpl_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_SHAPED(Rcomplex, COMPLEX, COMPLEX_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:273

cpl_col_detect_missing typed

[CLX, c_null, c_int_na] -> c_false
timing: 0.149 s
source
r_ssize cpl_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(r_complex, r_cpl_cbegin, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:235

cpl_compare_na_equal typed empty return any: arg 1, arg 2

tuple2 -> empty
timing: 0.004 s
source
int cpl_compare_na_equal(Rcomplex x, Rcomplex y) {
  r_stop_internal("Can't compare complex types.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:84

cpl_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t cpl_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return cpl_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:173

cpl_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.007 s
source
uint32_t cpl_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_cpl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:130

cpl_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.115 s
source
bool cpl_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_cpl_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:216

cpl_equal_na_equal typed

[{ r : c_double ; i : c_double ..}, { r : c_double ; i : c_double ..}] -> c_bool
timing: 0.039 s
source
static inline int cpl_equal_na_equal(Rcomplex x, Rcomplex y) {
  return dbl_equal_na_equal(x.r, y.r) && dbl_equal_na_equal(x.i, y.i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:38

cpl_equal_na_propagate typed

[{ r : c_double ; i : c_double ..}, { r : c_double ; i : c_double ..}] -> c_lgl
timing: 0.058 s
source
static inline int cpl_equal_na_propagate(Rcomplex x, Rcomplex y) {
  int real_equal = dbl_equal_na_propagate(x.r, y.r);
  int imag_equal = dbl_equal_na_propagate(x.i, y.i);

  if (real_equal == NA_LOGICAL || imag_equal == NA_LOGICAL) {
    return NA_LOGICAL;
  } else {
    return real_equal && imag_equal;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:155

cpl_hash_scalar typed

[{ r : c_double ; i : c_double ..}] -> c_int_na
timing: 0.019 s
source
static inline uint32_t cpl_hash_scalar(r_complex x) {
  uint32_t hash = 0;
  hash = hash_combine(hash, dbl_hash_scalar(x.r));
  hash = hash_combine(hash, dbl_hash_scalar(x.i));
  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:88

cpl_is_missing typed

[{ r : c_double ; i : c_double ..}] -> c_bool
timing: 0.018 s
source
bool cpl_is_missing(r_complex x) {
  return dbl_is_missing(x.r) || dbl_is_missing(x.i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:28

cpl_normalise_missing typed

[{ r : c_double ; i : c_double ..}] -> any
timing: 0.125 s
source
r_complex cpl_normalise_missing(r_complex x) {
  const double na = r_globals.na_dbl;
  const double nan = R_NaN;

  const enum vctrs_dbl r_type = dbl_classify(x.r);
  const enum vctrs_dbl i_type = dbl_classify(x.i);

  switch (r_type) {
  case VCTRS_DBL_number:
    switch (i_type) {
    case VCTRS_DBL_number: return x;
    case VCTRS_DBL_missing: return (r_complex) { .r = na, .i = na};
    case VCTRS_DBL_nan: return (r_complex) { .r = nan, .i = nan};
    }
  case VCTRS_DBL_missing:
    switch (i_type) {
    case VCTRS_DBL_number: return (r_complex) { .r = na, .i = na};
    case VCTRS_DBL_missing: return x;
    case VCTRS_DBL_nan: return x;
    }
  case VCTRS_DBL_nan:
    switch (i_type) {
    case VCTRS_DBL_number: return (r_complex) { .r = nan, .i = nan};
    case VCTRS_DBL_missing: return x;
    case VCTRS_DBL_nan: return x;
    }
  }

  never_reached("cpl_normalise_missing");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-complex.h:17

cpl_order typed empty return

[any_sexp, c_false, c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] -> empty
timing: 5.43 s
source
void cpl_order(
  SEXP x,
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  // We treat complex as a two column data frame, so we have to use group
  // information for at least the first column.
  // - If a complex atomic vector is used, `ignore_groups` will be true unless
  //   the user also requested group information.
  // - If the first column of a df is a complex column, `ignore_groups` will
  //   be false.
  bool reset_ignore_groups = false;
  if (p_group_infos->ignore_groups) {
    p_group_infos->ignore_groups = false;
    reset_ignore_groups = true;
  }

  const Rcomplex* p_x_cpl = COMPLEX_RO(x);

  // When a complex column is present,
  // `lazy_x_chunk` and `lazy_x_aux` are created to have the
  // size of a double vector.
  double* p_x_chunk_dbl = (double*) init_lazy_raw(p_lazy_x_chunk);

  // Handle the real portion first
  for (r_ssize i = 0; i < size; ++i) {
    p_x_chunk_dbl[i] = cpl_normalise_missing(p_x_cpl[i]).r;
  }

  /*
   * Call double ordering algorithm on real section.
   *
   * In this case, both `p_x_chunk_dbl` and `p_lazy_x_chunk` are passed through,
   * but we set `copy = false` which tells `dbl_order_impl()` not to copy
   * the input (`p_x_chunk_dbl`) over to the chunk vector of (`p_lazy_x_chunk`).
   * It has already been done when we extracted the real section.
   */
  dbl_order_impl(
    p_x_chunk_dbl,
    decreasing,
    na_last,
    nan_distinct,
    size,
    false,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );

  // Ordering will now be initialized
  int* p_o = p_order->p_data;

  // Reset `ignore_groups` for the second pass if we don't need to track groups.
  // This happens if an atomic complex vector is passed in and the user
  // hasn't requested group information.
  if (reset_ignore_groups) {
    p_group_infos->ignore_groups = true;
  }

  // Get the number of group chunks from the first pass
  struct group_info* p_group_info_pre = groups_current(p_group_infos);
  r_ssize n_groups = p_group_info_pre->n_groups;

  // If there were no ties, we are completely done
  if (n_groups == size) {
    return;
  }

  // Swap to other group info to prepare for the imaginary section
  groups_swap(p_group_infos);

  // Fill with the imaginary portion.
  // Uses updated ordering to place it in sequential order.
  for (r_ssize i = 0; i < size; ++i) {
    const int loc = p_o[i] - 1;
    p_x_chunk_dbl[i] = cpl_normalise_missing(p_x_cpl[loc]).i;
  }

  // Iterate over the group chunks from the first pass
  for (r_ssize group = 0; group < n_groups; ++group) {
    r_ssize group_size = p_group_info_pre->p_data[group];

    // Fast handling of simplest case
    if (group_size == 1) {
      ++p_x_chunk_dbl;
      ++p_o;
      groups_size_maybe_push(1, p_group_infos);
      continue;
    }

    dbl_order_chunk_impl(
      decreasing,
      na_last,
      nan_distinct,
      group_size,
      p_x_chunk_dbl,
      p_o,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    p_x_chunk_dbl += group_size;
    p_o += group_size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2262

cpl_slice_shaped typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.329 s
source
static SEXP cpl_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_SHAPED(CPLXSXP, Rcomplex, COMPLEX, COMPLEX_RO, vctrs_shared_na_cpl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:128

data_frame typed

[any_sexp, c_int_na, *struct name_repair_opts, struct r_lazy] -> any_sexp
timing: 0.025 s
source
r_obj* data_frame(r_obj* x,
                  r_ssize size,
                  const struct name_repair_opts* p_name_repair_opts,
                  struct r_lazy error_call) {
  const bool unpack = true;
  r_obj* out = KEEP(df_list(x, size, unpack, p_name_repair_opts, error_call));
  out = new_data_frame(out, size);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:206

datetime_validate typed empty return

[any_sexp] -> empty
timing: 0.008 s
source
static SEXP datetime_validate(SEXP x) {
  x = PROTECT(datetime_validate_tzone(x));
  x = PROTECT(datetime_validate_type(x));
  UNPROTECT(2);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:355

datetime_validate_tzone typed empty return

[any_sexp] -> empty
timing: 0.028 s
source
static SEXP datetime_validate_tzone(SEXP x) {
  SEXP tzone = Rf_getAttrib(x, syms_tzone);

  if (tzone != R_NilValue) {
    return x;
  }

  x = PROTECT(r_clone_referenced(x));

  Rf_setAttrib(x, syms_tzone, chrs_empty);

  UNPROTECT(1);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:362

dbl_adjust_nan_distinct typed

[c_false, c_false, c_int_na, c_null, *c_int_na] | [c_int_na \ c_false, c_false, c_int_na, c_null, *c_int_na] -> ()
timing: 0.112 s
source
void dbl_adjust_nan_distinct(
  const bool decreasing,
  const bool na_last,
  const r_ssize size,
  double* p_x_dbl,
  uint64_t* p_x_u64
) {
  const int direction = decreasing ? -1 : 1;
  const uint64_t na_u64 = na_last ? UINT64_MAX : 0;
  const uint64_t nan_u64 = na_last ? UINT64_MAX - 1 : 1;

  for (r_ssize i = 0; i < size; ++i) {
    double elt = p_x_dbl[i];
    const enum vctrs_dbl type = dbl_classify(elt);

    switch (type) {
    case VCTRS_DBL_number: {
      elt = elt * direction;
      p_x_u64[i] = dbl_map_to_uint64(elt);
      break;
    }
    case VCTRS_DBL_missing: {
      p_x_u64[i] = na_u64;
      break;
    }
    case VCTRS_DBL_nan: {
      p_x_u64[i] = nan_u64;
      break;
    }
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1804

dbl_adjust_nan_identical typed

[c_false, c_false, c_int_na, c_null, *c_int_na] | [c_int_na \ c_false, c_false, c_int_na, c_null, *c_int_na] -> ()
timing: 0.139 s
source
void dbl_adjust_nan_identical(
  const bool decreasing,
  const bool na_last,
  const r_ssize size,
  double* p_x_dbl,
  uint64_t* p_x_u64
) {
  const int direction = decreasing ? -1 : 1;
  const uint64_t na_u64 = na_last ? UINT64_MAX : 0;

  for (r_ssize i = 0; i < size; ++i) {
    double elt = p_x_dbl[i];

    if (isnan(elt)) {
      p_x_u64[i] = na_u64;
      continue;
    }

    elt = elt * direction;
    p_x_u64[i] = dbl_map_to_uint64(elt);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1780

dbl_as_integer typed

([DBL, *c_bool] -> INT | null)&([DBL1, *c_bool] -> INT1 | null)
timing: 0.576 s
source
r_obj* dbl_as_integer(r_obj* x, bool* lossy) {
  double* data = r_dbl_begin(x);
  r_ssize n = r_length(x);

  r_obj* out = KEEP(r_alloc_integer(n));
  int* out_data = r_int_begin(out);

  for (r_ssize i = 0; i < n; ++i, ++data, ++out_data) {
    double elt = *data;

    if (elt <= INT_MIN || elt >= INT_MAX + 1.0) {
      *lossy = true;
      FREE(1);
      return r_null;
    }

    if (isnan(elt)) {
      *out_data = r_globals.na_int;
      continue;
    }

    int value = (int) elt;

    if (value != elt) {
      *lossy = true;
      FREE(1);
      return r_null;
    }

    *out_data = value;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:116

dbl_as_location typed

[any_sexp, c_int_na, *struct location_opts] -> any_sexp
timing: 0.027 s
source
r_obj* dbl_as_location(r_obj* subscript,
                       r_ssize n,
                       const struct location_opts* opts) {
  subscript = KEEP(vec_cast(subscript,
                            r_globals.empty_int,
                            vec_args.empty,
                            vec_args.empty,
                            r_lazy_null));
  subscript = int_as_location(subscript, n, opts);

  FREE(1);
  return subscript;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:440

dbl_as_logical typed

([DBL, *c_bool] -> LGL | null)&([DBL1, *c_bool] -> LGL1 | null)
timing: 0.412 s
source
r_obj* dbl_as_logical(r_obj* x, bool* lossy) {
  double* data = r_dbl_begin(x);
  r_ssize n = r_length(x);

  r_obj* out = KEEP(r_alloc_logical(n));
  int* out_data = r_lgl_begin(out);

  for (r_ssize i = 0; i < n; ++i, ++data, ++out_data) {
    double elt = *data;

    if (isnan(elt)) {
      *out_data = r_globals.na_lgl;
      continue;
    }

    if (elt != 0 && elt != 1) {
      *lossy = true;
      FREE(1);
      return r_null;
    }

    *out_data = (int) elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:31

dbl_assign typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.467 s
source
r_obj* dbl_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN(double, REAL, REAL_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:509

dbl_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.551 s
source
static inline SEXP dbl_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_SHAPED(double, REAL, REAL_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:263

dbl_cast_subscript typed

[DBL, *struct subscript_opts, *any] -> any_sexp
timing: 0.510 s
source
r_obj* dbl_cast_subscript(r_obj* subscript,
                          const struct subscript_opts* opts,
                          ERR* err) {
  double* p = r_dbl_begin(subscript);
  r_ssize n = r_length(subscript);

  r_obj* out = KEEP(r_alloc_integer(n));
  int* out_p = r_int_begin(out);

  for (r_ssize i = 0; i < n; ++i) {
    double elt = p[i];

    // Generally `(int) nan` results in the correct `na_int` value,
    // but this is not guaranteed, so we have to explicitly check for it.
    // https://stackoverflow.com/questions/10366485/problems-casting-nan-floats-to-int
    if (isnan(elt)) {
      out_p[i] = r_globals.na_int;
      continue;
    }

    if (!isfinite(elt) || elt <= INT_MIN || elt > INT_MAX) {
      // Once we throw lazy errors from the cast method, we should
      // throw the error here as well
      FREE(1);
      return dbl_cast_subscript_fallback(subscript, opts, err);
    }

    int elt_int = (int) elt;

    if (elt != elt_int) {
      FREE(1);
      return dbl_cast_subscript_fallback(subscript, opts, err);
    }

    out_p[i] = elt_int;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:152

dbl_cast_subscript_fallback typed

([any_sexp, c_null, *any] -> empty)&([any_sexp, *struct subscript_opts, *any] \ [any_sexp, c_null, *any] -> any_sexp)
timing: 0.092 s
source
r_obj* dbl_cast_subscript_fallback(r_obj* subscript,
                                   const struct subscript_opts* opts,
                                   ERR* err) {
  struct cast_opts cast_opts = {
    .x = subscript,
    .to = r_globals.empty_int,
    opts->subscript_arg
  };
  r_obj* out = KEEP(vec_cast_e(&cast_opts, err));
  if (*err) {
    r_obj* err_obj = KEEP(*err);

    r_obj* body = KEEP(vctrs_eval_mask1(syms_new_dbl_cast_subscript_body,
                                        syms_lossy_err, err_obj));

    *err = new_error_subscript_type(subscript, opts, body);
    FREE(3);
    return r_null;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:194

dbl_classify typed

[c_double] -> c(0..2)
timing: 0.046 s
source
enum vctrs_dbl dbl_classify(double x) {
  if (!isnan(x)) {
    return VCTRS_DBL_number;
  }

  union vctrs_dbl_indicator indicator;
  indicator.value = x;

  if (indicator.key[vctrs_indicator_pos] == 1954) {
    return VCTRS_DBL_missing;
  } else {
    return VCTRS_DBL_nan;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vctrs-core.h:143

dbl_cmp typed

∀'a. ([c_double, c_double, c(2), c(2), c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_false, c(2), c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_true, c(2), c_int_na, c_int_na & 'a, c_int_na] -> c_false)&([c_double, c_double, c(2), c_false, c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_false, c_false, c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_true, c_false, c_int_na, c_int_na & 'a, c_int_na] -> c_int_na & 'a)&([c_double, c_double, c(2), c_true, c_int_na, c_int_na & 'a, c_int] | [c_double, c_double, c_false, c_true, c_int_na, c_int_na & 'a, c_int] | [c_double, c_double, c_true, c_true, c_int_na, c_int_na & 'a, c_int] -> c_int)&([c_double, c_double, c(2), c_true, c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_false, c_true, c_int_na, c_int_na & 'a, c_int_na] | [c_double, c_double, c_true, c_true, c_int_na, c_int_na & 'a, c_int_na] -> c_int_na)
timing: 0.996 s
source
int dbl_cmp(double x,
            double y,
            enum vctrs_dbl x_type,
            enum vctrs_dbl y_type,
            int direction,
            int na_order,
            int na_nan_order) {
  switch (x_type) {
  case VCTRS_DBL_number:
    switch (y_type) {
    case VCTRS_DBL_number: return dbl_cmp_numbers(x, y, direction);
    case VCTRS_DBL_missing: return -na_order;
    case VCTRS_DBL_nan: return -na_order;
    }
  case VCTRS_DBL_missing:
    switch (y_type) {
    case VCTRS_DBL_number: return na_order;
    case VCTRS_DBL_missing: return 0;
    case VCTRS_DBL_nan: return na_nan_order;
    }
  case VCTRS_DBL_nan:
    switch (y_type) {
    case VCTRS_DBL_number: return na_order;
    case VCTRS_DBL_missing: return -na_nan_order;
    case VCTRS_DBL_nan: return 0;
    }
  }
  never_reached("dbl_cmp");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:155

dbl_cmp_numbers typed

([c_double, c_double, c_int] -> c_int)&([c_double, c_double, c_int_na] -> c_int_na)
timing: 0.020 s
source
int dbl_cmp_numbers(double x, double y, int direction) {
  const int cmp = (x > y) - (x < y);
  return cmp * direction;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:186

dbl_col_detect_missing typed

([DBL, *c_int_na, c_int_na] -> c_int)&([DBL, c_null, c_int_na] -> c_false)
timing: 0.206 s
source
r_ssize dbl_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(double, r_dbl_cbegin, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:229

dbl_compare_na_equal typed

[c_double, c_double] -> c(-1..0)
timing: 0.108 s
source
int dbl_compare_na_equal(double x, double y) {
  enum vctrs_dbl x_class = dbl_classify(x);
  enum vctrs_dbl y_class = dbl_classify(y);

  switch (x_class) {
  case VCTRS_DBL_number: {
    switch (y_class) {
    case VCTRS_DBL_number: return dbl_compare_scalar(x, y);
    case VCTRS_DBL_missing: return 1;
    case VCTRS_DBL_nan: return 1;
    }
  }
  case VCTRS_DBL_missing: {
    switch (y_class) {
    case VCTRS_DBL_number: return -1;
    case VCTRS_DBL_missing: return 0;
    case VCTRS_DBL_nan: return 1;
    }
  }
  case VCTRS_DBL_nan: {
    switch (y_class) {
    case VCTRS_DBL_number: return -1;
    case VCTRS_DBL_missing: return -1;
    case VCTRS_DBL_nan: return 0;
    }
  }
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:53

dbl_compare_na_propagate typed

[c_double, c_double] -> c_int_na
timing: 0.023 s
source
int dbl_compare_na_propagate(double x, double y) {
  if (dbl_is_missing(x) || dbl_is_missing(y)) {
    return r_globals.na_int;
  } else {
    return dbl_compare_scalar(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:224

dbl_compare_scalar typed

[c_double, c_double] -> c_int
timing: 0.011 s
source
int dbl_compare_scalar(double x, double y) {
  return (x > y) - (x < y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:21

dbl_compute_skips typed

([c_null, c_int_na, *c_bool] -> empty)&([*c_int_na, c_int_na, *c_bool] \ [c_null, c_int_na, *c_bool] -> c_int_na)
timing: 0.177 s
source
uint8_t dbl_compute_skips(const uint64_t* p_x, r_ssize size, bool* p_skips) {
  uint8_t radix_start = PASS_TO_RADIX(0, DBL_MAX_RADIX_PASS);
  uint8_t shift_start = radix_start * 8;

  for (uint8_t i = 0; i < DBL_MAX_RADIX_PASS; ++i) {
    p_skips[i] = true;
  }

  uint8_t p_bytes[DBL_MAX_RADIX_PASS];
  const uint64_t elt0 = p_x[0];

  // Get bytes of first element in MSD->LSD order.
  // Placed in `p_bytes` in a way that aligns with the `pass` variable
  for (uint8_t pass = 0, shift = shift_start;
       pass < DBL_MAX_RADIX_PASS;
       ++pass, shift += SHIFT_ADJUSTMENT) {
    p_bytes[pass] = dbl_extract_uint64_byte(elt0, shift);
  }

  // Check to see which passes are skippable
  for (r_ssize i = 1; i < size; ++i) {
    uint8_t n_skips = DBL_MAX_RADIX_PASS;
    const uint64_t elt = p_x[i];

    for (uint8_t pass = 0, shift = shift_start;
         pass < DBL_MAX_RADIX_PASS;
         ++pass, shift += SHIFT_ADJUSTMENT) {
      bool skip = p_skips[pass];

      if (skip) {
        p_skips[pass] = (p_bytes[pass] == dbl_extract_uint64_byte(elt, shift));
      } else {
        --n_skips;
      }
    }

    // No passes are skippable
    if (n_skips == 0) {
      break;
    }
  }

  uint8_t pass = 0;

  // Shift forward to the first pass with varying bytes
  while (pass < DBL_MAX_RADIX_PASS && p_skips[pass]) {
    ++pass;
  }

  return pass;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2188

dbl_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t dbl_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return dbl_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:169

dbl_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.008 s
source
uint32_t dbl_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_dbl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:126

dbl_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.117 s
source
bool dbl_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_dbl_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:212

dbl_equal typed

([DBL, DBL, c_int, c_false, c_false, c_false] | [DBL, DBL, c_int, c_false, c_false, c_int_na \ c_false] | [DBL, DBL, c_int, c_false, c_int_na \ c_false, c_false] | [DBL, DBL, c_int, c_false, c_int_na \ c_false, c_int_na \ c_false] | [DBL, DBL, c_int, c_int_na \ c_false, c_false, c_false] | [DBL, DBL, c_int, c_int_na \ c_false, c_false, c_int_na \ c_false] | [DBL, DBL, c_int, c_int_na \ c_false, c_int_na \ c_false, c_false] | [DBL, DBL, c_int, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL)&([DBL, DBL, c_true, c_false, c_false, c_false] | [DBL, DBL, c_true, c_false, c_false, c_int_na \ c_false] | [DBL, DBL, c_true, c_false, c_int_na \ c_false, c_false] | [DBL, DBL, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false] | [DBL, DBL, c_true, c_int_na \ c_false, c_false, c_false] | [DBL, DBL, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false] | [DBL, DBL, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false] | [DBL, DBL, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL1)
timing: 1.99 s
source
SEXP dbl_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(double, REAL_RO, dbl_equal_na_equal, dbl_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:143

dbl_equal_na_equal typed

[c_double, c_double] -> c_bool
timing: 0.049 s
source
static inline int dbl_equal_na_equal(double x, double y) {
  switch (dbl_classify(x)) {
  case VCTRS_DBL_number: return isnan(y) ? false : x == y;
  case VCTRS_DBL_missing: return dbl_classify(y) == VCTRS_DBL_missing;
  case VCTRS_DBL_nan: return dbl_classify(y) == VCTRS_DBL_nan;
  default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:30

dbl_equal_na_propagate typed

[c_double, c_double] -> c_lgl
timing: 0.020 s
source
static inline int dbl_equal_na_propagate(double x, double y) {
  if (dbl_is_missing(x) || dbl_is_missing(y)) {
    return NA_LOGICAL;
  } else {
    // Faster than `dbl_equal_na_equal()`,
    // which has unneeded missing value checks
    return x == y;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:146

dbl_first_missing typed

[DBL] -> c_int
timing: 0.316 s
source
r_ssize dbl_first_missing(r_obj* x) {
  FIRST_MISSING(double, r_dbl_cbegin, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:324

dbl_flip_uint64 typed

[c_int_na] -> c_int
timing: 0.006 s
source
uint64_t dbl_flip_uint64(uint64_t x) {
  const uint64_t mask = (x & HEX_UINT64_SIGN) ? HEX_UINT64_ONES : HEX_UINT64_SIGN;
  return x ^ mask;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1870

dbl_hash typed

[DBL] -> c_int_na
timing: 0.274 s
source
static inline uint32_t dbl_hash(r_obj* x) {
  HASH(double, r_dbl_cbegin, dbl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:83

dbl_hash_scalar typed

[c_double] -> c_int_na
timing: 0.058 s
source
static inline uint32_t dbl_hash_scalar(double x) {
  // Seems like something designed specifically for doubles should work better
  // but I haven't been able to find anything

  // Hash all NAs and NaNs to same value (i.e. ignoring significand)
  double value;
  switch (dbl_classify(x)) {
  case VCTRS_DBL_number: value = x; break;
  case VCTRS_DBL_missing: value = NA_REAL; break;
  case VCTRS_DBL_nan: value = R_NaN; break;
  default: r_stop_unreachable();
  }

  // Treat positive/negative 0 as equivalent
  if (value == 0.0) {
    value = 0.0;
  }

  union {
    double d;
    uint64_t i;
  } value_union;

  value_union.d = value;
  return uint64_hash(value_union.i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:61

dbl_is_missing typed

[c_double] -> c_bool
timing: 0.004 s
source
bool dbl_is_missing(double x) {
  return isnan(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:24

dbl_map_to_uint64 typed

[c_double] -> c_int_na
timing: 0.009 s
source
uint64_t dbl_map_to_uint64(double x) {
  // Catch `-0` vs `0`
  if (x == 0) {
    x = 0;
  }

  // Reinterpret as uint64_t without changing bytes
  d_u64.d = x;

  d_u64.u64 = dbl_flip_uint64(d_u64.u64);

  return d_u64.u64;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1849

dbl_order typed

[DBL, c_false, c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_int_na \ c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ()
timing: 0.904 s
source
void dbl_order(
  SEXP x,
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  const double* p_x = REAL_RO(x);

  dbl_order_impl(
    p_x,
    decreasing,
    na_last,
    nan_distinct,
    size,
    true,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1557

dbl_order_chunk typed empty return

[c_false, c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> empty
timing: 1.07 s
source
void dbl_order_chunk(
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  int* p_o,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  void* p_x_chunk = p_lazy_x_chunk->p_data;

  dbl_order_chunk_impl(
    decreasing,
    na_last,
    nan_distinct,
    size,
    p_x_chunk,
    p_o,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1526

dbl_order_chunk_impl typed

([c_false, c_false, c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_false, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ())&([c_false, c_false, c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_false, c_int_na \ c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_int_na \ c_false, c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_false, c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_bool, c_null, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_true, *c_double, *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] -> empty)
timing: 19.02 s
source
void dbl_order_chunk_impl(
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  void* p_x,
  int* p_o,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  const enum vctrs_sortedness sortedness = dbl_sortedness(
    p_x,
    size,
    decreasing,
    na_last,
    nan_distinct,
    p_group_infos
  );

  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    ord_resolve_sortedness_chunk(sortedness, size, p_o);
    return;
  }

  dbl_adjust(decreasing, na_last, nan_distinct, size, p_x);

  if (size <= ORDER_INSERTION_BOUNDARY) {
    dbl_order_insertion(size, p_x, p_o, p_group_infos);
    return;
  }

  uint64_t* p_x_aux = (uint64_t*) init_lazy_raw(p_lazy_x_aux);

  int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);

  uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

  r_ssize* p_counts = (r_ssize*) init_lazy_raw(p_lazy_counts);
  r_memset(p_counts, 0, p_lazy_counts->size);

  dbl_order_radix(
    size,
    p_x,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1597

dbl_order_compare_na_equal typed

([c_double, c_double, c_false] -> c(-1..0))&([c_double, c_double, c_int_na \ c_false] -> c(-1..1))
timing: 0.220 s
source
int dbl_order_compare_na_equal(double x, double y, bool nan_distinct) {
  enum vctrs_dbl x_class = dbl_classify(x);
  enum vctrs_dbl y_class = dbl_classify(y);

  switch (x_class) {
  case VCTRS_DBL_number: {
    switch (y_class) {
    case VCTRS_DBL_number: return dbl_compare_scalar(x, y);
    case VCTRS_DBL_missing: return 1;
    case VCTRS_DBL_nan: return 1;
    }
  }
  case VCTRS_DBL_missing: {
    switch (y_class) {
    case VCTRS_DBL_number: return -1;
    case VCTRS_DBL_missing: return 0;
    case VCTRS_DBL_nan: return nan_distinct ? -1 : 0;
    }
  }
  case VCTRS_DBL_nan: {
    switch (y_class) {
    case VCTRS_DBL_number: return -1;
    case VCTRS_DBL_missing: return nan_distinct ? 1 : 0;
    case VCTRS_DBL_nan: return 0;
    }
  }
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:34

dbl_order_radix typed

([c_int_na, c_null, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *struct group_infos] -> empty)&([c_false, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *struct group_infos] | [c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, c_null] -> ())
timing: 0.089 s
source
void dbl_order_radix(
  const r_ssize size,
  uint64_t* p_x,
  int* p_o,
  uint64_t* p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  r_ssize* p_counts,
  struct group_infos* p_group_infos
) {
  bool p_skips[DBL_MAX_RADIX_PASS];

  uint8_t pass = dbl_compute_skips(p_x, size, p_skips);

  // Skipped all passes - Happens when `x` is 1 value repeated
  if (pass == DBL_MAX_RADIX_PASS) {
    groups_size_maybe_push(size, p_group_infos);
    return;
  }

  dbl_order_radix_recurse(
    size,
    pass,
    p_x,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_skips,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1974

dbl_slice_shaped typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.334 s
source
static SEXP dbl_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_SHAPED(REALSXP, double, REAL, REAL_RO, NA_REAL);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:125

dbl_sortedness typed

([*c_double, c_false, c_false, c_false, c_false, *struct group_infos] | [*c_double, c_false, c_false, c_false, c_int_na \ c_false, *struct group_infos] | [*c_double, c_false, c_false, c_int_na \ c_false, c_false, *struct group_infos] | [*c_double, c_false, c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] | [*c_double, c_false, c_int_na \ c_false, c_false, c_false, *struct group_infos] | [*c_double, c_false, c_int_na \ c_false, c_false, c_int_na \ c_false, *struct group_infos] | [*c_double, c_false, c_int_na \ c_false, c_int_na \ c_false, c_false, *struct group_infos] | [*c_double, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> c_true)&([*c_double, c_int_na \ c_bool, c_false, c_false, c_false, c_null] | [*c_double, c_int_na \ c_bool, c_false, c_false, c_int_na \ c_false, c_null] | [*c_double, c_int_na \ c_bool, c_false, c_int_na \ c_false, c_false, c_null] | [*c_double, c_int_na \ c_bool, c_false, c_int_na \ c_false, c_int_na \ c_false, c_null] | [*c_double, c_int_na \ c_bool, c_int_na \ c_false, c_false, c_false, c_null] | [*c_double, c_int_na \ c_bool, c_int_na \ c_false, c_false, c_int_na \ c_false, c_null] | [*c_double, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_false, c_null] | [*c_double, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_null] -> c_false | c(2))&([*c_double, c_true, c_false, c_false, c_false, c_null] | [*c_double, c_true, c_false, c_false, c_int_na \ c_false, c_null] | [*c_double, c_true, c_false, c_int_na \ c_false, c_false, c_null] | [*c_double, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false, c_null] | [*c_double, c_true, c_int_na \ c_false, c_false, c_false, c_null] | [*c_double, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false, c_null] | [*c_double, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false, c_null] | [*c_double, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_null] | [c_null, c_int_na \ c_bool, c_false, c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_false, c_false, c_int_na \ c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_false, c_int_na \ c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_false, c_int_na \ c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> empty)
timing: 14.54 s
source
enum vctrs_sortedness dbl_sortedness(const double* p_x,
                                     r_ssize size,
                                     bool decreasing,
                                     bool na_last,
                                     bool nan_distinct,
                                     struct group_infos* p_group_infos) {
  if (size == 0) {
    return VCTRS_SORTEDNESS_sorted;
  }

  if (size == 1) {
    groups_size_maybe_push(1, p_group_infos);
    return VCTRS_SORTEDNESS_sorted;
  }

  const int direction = decreasing ? -1 : 1;
  const int na_order = na_last ? 1 : -1;
  const int na_nan_order = nan_distinct ? na_order : 0;

  double previous = p_x[0];
  enum vctrs_dbl previous_type = dbl_classify(previous);

  r_ssize count = 0;

  // Check for strictly opposite of expected order
  // (ties are not allowed so we can reverse the vector stably)
  for (r_ssize i = 1; i < size; ++i, ++count) {
    double current = p_x[i];
    enum vctrs_dbl current_type = dbl_classify(current);

    int cmp = dbl_cmp(
      current,
      previous,
      current_type,
      previous_type,
      direction,
      na_order,
      na_nan_order
    );

    if (cmp >= 0) {
      break;
    }

    previous = current;
    previous_type = current_type;
  }

  // Was in strictly opposite of expected order.
  if (count == size - 1) {
    // Each group is size 1 since this is strict ordering
    for (r_ssize j = 0; j < size; ++j) {
      groups_size_maybe_push(1, p_group_infos);
    }

    return VCTRS_SORTEDNESS_reversed;
  }

  // Was partially in expected order. Need to sort.
  if (count != 0) {
    return VCTRS_SORTEDNESS_unsorted;
  }

  // Retain the original `n_groups` to be able to reset the group sizes if
  // it turns out we don't have expected ordering
  struct group_info* p_group_info = groups_current(p_group_infos);
  r_ssize original_n_groups = p_group_info->n_groups;

  r_ssize group_size = 1;

  // Check for expected ordering - allowing ties since we don't have to
  // reverse the ordering.
  for (r_ssize i = 1; i < size; ++i) {
    double current = p_x[i];
    enum vctrs_dbl current_type = dbl_classify(current);

    int cmp = dbl_cmp(
      current,
      previous,
      current_type,
      previous_type,
      direction,
      na_order,
      na_nan_order
    );

    // Not expected ordering
    if (cmp < 0) {
      p_group_info->n_groups = original_n_groups;
      return VCTRS_SORTEDNESS_unsorted;
    }

    previous = current;
    previous_type = current_type;

    // Continue group run
    if (cmp == 0) {
      ++group_size;
      continue;
    }

    // Expected ordering
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);

  // Expected ordering
  return VCTRS_SORTEDNESS_sorted;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:36

df_apply typed

[list, any_sexp] -> list
timing: 0.282 s
source
SEXP df_apply(SEXP x, SEXP chr_proxy_collate) {
  const r_ssize n_cols = r_length(x);
  const SEXP* v_x = VECTOR_PTR_RO(x);

  r_ssize i = 0;

  for (; i < n_cols; ++i) {
    SEXP col = v_x[i];
    if (vec_proxy_typeof(col) == VCTRS_TYPE_character) {
      break;
    }
  }

  if (i == n_cols) {
    // No character columns
    return x;
  }

  SEXP out = PROTECT(r_clone_referenced(x));

  for (; i < n_cols; ++i) {
    SEXP col = v_x[i];

    if (vec_proxy_typeof(col) != VCTRS_TYPE_character) {
      continue;
    }

    col = chr_apply(col, chr_proxy_collate);
    SET_VECTOR_ELT(out, i, col);
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-collate.c:79

df_cast_loop typed

([c_null, any_sexp] -> empty)&([*struct cast_opts, any_sexp] \ [c_null, any_sexp] -> any_sexp)
timing: 12.99 s
source
r_obj* df_cast_loop(const struct cast_opts* opts, r_obj* names) {
  r_obj* x = opts->x;
  r_obj* to = opts->to;

  r_ssize len = r_length(names);

  r_obj* out = KEEP(r_alloc_list(len));
  r_attrib_poke(out, r_syms.names, names);

  r_ssize size = df_size(x);

  r_ssize i = 0;
  struct vctrs_arg* named_x_arg = new_subscript_arg(opts->p_x_arg, names, len, &i);
  KEEP(named_x_arg->shelter);

  struct vctrs_arg* named_to_arg = new_subscript_arg(opts->p_to_arg, names, len, &i);
  KEEP(named_to_arg->shelter);

  for (; i < len; ++i) {
    struct cast_opts col_opts = {
      .x = r_list_get(x, i),
      .to = r_list_get(to, i),
      .p_x_arg = named_x_arg,
      .p_to_arg = named_to_arg,
      .call = opts->call,
      .s3_fallback = opts->s3_fallback
    };
    r_obj* col = vec_cast_opts(&col_opts);

    r_list_poke(out, i, col);
  }

  // Restore data frame size before calling `vec_restore()`. `x` and
  // `to` might not have any columns to compute the original size.
  init_data_frame(out, size);
  r_attrib_poke(out, r_syms.row_names, df_rownames(x));

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:845

df_compare_impl typed

[*c_int_na, *struct df_short_circuit_info, list, list, c_false] | [*c_int_na, *struct df_short_circuit_info, list, list, c_int_na \ c_false] -> ()
timing: 0.814 s
source
void df_compare_impl(int* v_out,
                     struct df_short_circuit_info* p_info,
                     r_obj* x,
                     r_obj* y,
                     bool na_equal) {
  r_ssize n_col = r_length(x);

  if (n_col != r_length(y)) {
    stop_not_comparable(x, y, "must have the same number of columns");
  }

  for (r_ssize i = 0; i < n_col; ++i) {
    r_obj* x_col = r_list_get(x, i);
    r_obj* y_col = r_list_get(y, i);

    vec_compare_col(v_out, p_info, x_col, y_col, na_equal);

    // If we know all comparison values, break
    if (p_info->remaining == 0) {
      break;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:103

df_compute_n_bytes_lazy_counts typed

([{ }] -> c_false)&([{ any_sexp }] -> c_false | c(4) | c(8))
timing: 0.081 s
source
size_t df_compute_n_bytes_lazy_counts(SEXP x) {
  r_ssize n_cols = r_length(x);

  size_t multiplier = 0;

  for (r_ssize i = 0; i < n_cols; ++i) {
    SEXP col = VECTOR_ELT(x, i);
    const enum vctrs_type type = vec_proxy_typeof(col);

    size_t col_multiplier = vec_compute_n_bytes_lazy_counts(col, type);

    if (col_multiplier > multiplier) {
      multiplier = col_multiplier;
    }
  }

  return multiplier;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3518

df_compute_n_bytes_lazy_raw typed

[{ }] -> c_false
timing: 0.063 s
source
size_t df_compute_n_bytes_lazy_raw(SEXP x) {
  r_ssize n_cols = r_length(x);

  size_t multiplier = 0;

  for (r_ssize i = 0; i < n_cols; ++i) {
    SEXP col = VECTOR_ELT(x, i);
    const enum vctrs_type type = vec_proxy_typeof(col);

    size_t col_multiplier = vec_compute_n_bytes_lazy_raw(col, type);

    if (col_multiplier > multiplier) {
      multiplier = col_multiplier;
    }
  }

  return multiplier;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3464

df_decreasing_expansion typed

[{ any_sexp }] -> c_int_na
timing: 0.071 s
source
int df_decreasing_expansion(SEXP x) {
  r_ssize n_cols = r_length(x);

  int out = 0;

  // Accumulate the expansion factors of the cols of the df-col
  for (r_ssize i = 0; i < n_cols; ++i) {
    SEXP col = VECTOR_ELT(x, i);
    out += vec_decreasing_expansion(col);
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3736

df_detect_complete typed

[list, c_int_na, *c_int_na] -> ()
timing: 0.108 s
source
void df_detect_complete(SEXP x, R_len_t size, int* p_out) {
  r_ssize n_cols = r_length(x);
  const SEXP* p_x = VECTOR_PTR_RO(x);

  for (r_ssize i = 0; i < n_cols; ++i) {
    col_detect_complete_switch(p_x[i], size, p_out);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:175

df_detect_run_bounds_bool typed

([list, c_int_na \ c_false, c_false, c_null] | [list, c_int_na \ c_false, c_true, c_null] -> empty)&([list, c_int_na \ c_false, c_false, *c_bool] | [list, c_int_na \ c_false, c_true, *c_bool] | [any_sexp, c_false, c_bool, *c_bool] -> ())
timing: 1.07 s
source
void df_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  if (size == 0) {
    // Algorithm requires at least 1 value
    return;
  }

  const r_ssize n_col = r_length(x);
  r_obj* const* v_x = r_list_cbegin(x);

  r_ssize loc = compute_iter_loc(size, which);
  const r_ssize step = compute_iter_step(which);

  // `v_out` will eventually be `true` if we are in a run
  // continuation, and `false` if we are starting a new run.
  v_out[loc] = false;
  loc += step;

  for (r_ssize i = 1; i < size; ++i) {
    v_out[loc] = true;
    loc += step;
  }

  for (r_ssize i = 0; i < n_col; ++i) {
    col_detect_run_bounds_bool(v_x[i], size, which, v_out);
  }

  // Now invert to detect the bounds
  for (r_ssize i = 0; i < size; ++i) {
    v_out[i] = !v_out[i];
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:245

df_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.022 s
source
uint32_t df_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return df_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:189

df_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.021 s
source
uint32_t df_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_df_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:146

df_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.120 s
source
bool df_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_df_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:232

df_expand_args typed

∀'a,'b. ([{ }, { 'b & any_sexp } & 'a] -> { 'b & any_sexp } & 'a)&([{ }, { 'b & null } & 'a] -> { 'b & null } & 'a)&([{ }, { 'b & ((externalptr | vec1 | arrow) | sym | null) } & 'a] -> { 'b & ((externalptr | vec1 | arrow) | sym | null) } & 'a)&([any_sexp, { } & 'a] -> empty)&([any_sexp, { 'b & ((externalptr | vec1 | arrow) | sym) } & 'a] -> ({ 'b & ((externalptr | vec1 | arrow) | sym) } & ~{ null }) & 'a)
timing: 5.17 s
source
SEXP df_expand_args(SEXP x, SEXP args) {
  SEXP decreasing = VECTOR_ELT(args, 0);
  SEXP na_largest = VECTOR_ELT(args, 1);

  r_ssize n_decreasing = r_length(decreasing);
  r_ssize n_na_largest = r_length(na_largest);
  r_ssize n_cols = r_length(x);

  // They will be recycled correctly even if columns get flattened
  if (n_decreasing == 1 && n_na_largest == 1) {
    return args;
  }

  // Must start out with the same length as the number of columns
  if (n_decreasing != 1 && n_decreasing != n_cols) {
    Rf_errorcall(
      R_NilValue,
      "`direction` should have length 1 or length equal to the number of "
      "columns of `x` when `x` is a data frame."
    );
  }

  if (n_na_largest != 1 && n_na_largest != n_cols) {
    Rf_errorcall(
      R_NilValue,
      "`na_value` should have length 1 or length equal to the number of "
      "columns of `x` when `x` is a data frame."
    );
  }

  SEXP expansions = PROTECT(Rf_allocVector(INTSXP, n_cols));
  int* p_expansions = INTEGER(expansions);

  int size = 0;
  bool needs_expansion = false;

  // Compute expansion factor
  for (r_ssize i = 0; i < n_cols; ++i) {
    SEXP col = VECTOR_ELT(x, i);
    int expansion = vec_decreasing_expansion(col);

    if (expansion != 1) {
      needs_expansion = true;
    }

    p_expansions[i] = expansion;
    size += expansion;
  }

  if (!needs_expansion) {
    UNPROTECT(1);
    return args;
  }

  decreasing = expand_arg(decreasing, p_expansions, n_decreasing, size);
  SET_VECTOR_ELT(args, 0, decreasing);

  na_largest = expand_arg(na_largest, p_expansions, n_na_largest, size);
  SET_VECTOR_ELT(args, 1, na_largest);

  UNPROTECT(1);
  return args;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3605

df_first_missing typed

[list | null] -> c_int_na
timing: 0.976 s
source
r_ssize df_first_missing(r_obj* x) {
  const r_ssize n_cols = r_length(x);
  const r_ssize size = vec_size(x);

  r_ssize i = 0;

  if (n_cols > 0) {
    // First perform a very cheap check to see if there is at least 1 missing
    // value in the first column. If not, then we are done. If there is at least
    // 1 missing value, we start the loop below from there by updating `i`. This
    // avoids the more expensive rowwise poly-op loop when there aren't any
    // missing values.
    r_obj* col = r_list_get(x, 0);
    i = vec_first_missing(col);

    if (i == size) {
      return size;
    }
  }

  int n_prot = 0;

  struct poly_vec* p_poly_x = new_poly_vec(x, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_x->shelter, &n_prot);
  const void* v_x = p_poly_x->p_vec;

  r_ssize out = size;

  for (; i < size; ++i) {
    if (p_df_is_missing(v_x, i)) {
      out = i;
      break;
    }
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:349

df_hash_fill typed

[list, c_int_na, c_false, *c_int_na] | [list, c_int_na, c_int_na \ c_false, *c_int_na] -> ()
timing: 0.240 s
source
static inline void df_hash_fill(r_obj* x, r_ssize size, bool na_equal, uint32_t* v_out) {
  const r_ssize n_col = r_length(x);
  r_obj* const* v_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < n_col; ++i) {
    vec_hash_fill(v_x[i], size, na_equal, v_out);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:273

df_list_combine_common_class_fallback typed empty return

[any_sexp, any_sexp, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_bool, LGL<> | null, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] | [any_sexp, any_sexp, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_bool, LGL<> | null, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] | [any_sexp, any_sexp, c_int_na \ c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_bool, LGL<> | null, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] | [any_sexp, any_sexp, c_int_na \ c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_bool, LGL<> | null, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] -> empty
timing: 1.78 s
source
void df_list_combine_common_class_fallback(
  r_obj* out,
  r_obj* xs,
  bool has_indices,
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  bool has_default,
  r_obj* default_,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_indices_arg,
  struct r_lazy error_call
) {
  int n_protect = 0;
  r_ssize n_cols = r_length(out);

  r_obj* ptype_orig = ptype;

  if (!is_data_frame(ptype)) {
    ptype = KEEP_N(vec_proxy(ptype), &n_protect);
    if (!is_data_frame(ptype)) {
      r_stop_internal("Expected fallback target to have a df proxy.");
    }
  }

  if (r_length(ptype) != n_cols ||
      r_typeof(out) != R_TYPE_list ||
      r_typeof(ptype) != R_TYPE_list) {
    r_stop_internal("`ptype` and `out` must be lists of the same length.");
  }

  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* col = r_list_get(out, i);
    r_obj* ptype_col = r_list_get(ptype, i);

    if (is_data_frame(col) && needs_df_list_combine_common_class_fallback(ptype_col)) {
      // Recurse into df-cols
      r_obj* out_col = r_list_get(out, i);
      r_obj* xs_col = KEEP(list_pluck(xs, i));
      r_obj* default_col = has_default ? r_list_get(default_, i) : r_null;

      df_list_combine_common_class_fallback(
        out_col,
        xs_col,
        has_indices,
        indices,
        indices_style,
        size,
        has_default,
        default_col,
        multiple,
        slice_xs,
        ptype_col,
        name_spec,
        p_name_repair_opts,
        p_indices_arg,
        error_call
      );

      FREE(1);
    } else if (needs_list_combine_common_class_fallback(ptype_col)) {
      r_obj* xs_col = KEEP(list_pluck(xs, i));
      r_obj* default_col = has_default ? r_list_get(default_, i) : r_null;

      struct vctrs_arg* p_xs_col_arg = vec_args.empty;
      struct vctrs_arg* p_default_col_arg = vec_args.empty;

      r_obj* out_col = list_combine_common_class_fallback(
        xs_col,
        has_indices,
        indices,
        indices_style,
        size,
        has_default,
        default_col,
        multiple,
        slice_xs,
        ptype_col,
        name_spec,
        p_name_repair_opts,
        p_xs_col_arg,
        p_indices_arg,
        p_default_col_arg,
        error_call
      );
      r_list_poke(out, i, out_col);

      if (vec_size(out_col) != size) {
        r_stop_internal(
          "`c()` method returned a vector of unexpected size %d instead of %d.",
          vec_size(out_col),
          size
        );
      }

      // Remove fallback vector from the ptype so it doesn't get in
      // the way of restoration later on
      r_list_poke(ptype_orig, i, vec_ptype_final(out_col, vec_args.empty, error_call));

      FREE(1);
    }
  }

  FREE(n_protect);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:874

df_list_drop_null typed

∀'a. [{ } & 'a] -> { } & 'a
timing: 1.11 s
source
r_obj* df_list_drop_null(r_obj* x) {
  r_ssize n_cols = r_length(x);
  r_ssize count = 0;

  for (r_ssize i = 0; i < n_cols; ++i) {
    count += r_list_get(x, i) == r_null;
  }

  if (count == 0) {
    return x;
  }

  r_obj* names = KEEP(r_names(x));
  r_obj* const * p_names = r_chr_cbegin(names);

  r_ssize n_out = n_cols - count;
  r_obj* out = KEEP(r_alloc_list(n_out));
  r_obj* out_names = KEEP(r_alloc_character(n_out));
  r_ssize out_i = 0;

  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* col = r_list_get(x, i);

    if (col != r_null) {
      r_list_poke(out, out_i, col);
      r_chr_poke(out_names, out_i, p_names[i]);
      ++out_i;
    }
  }

  r_attrib_poke_names(out, out_names);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:284

df_map typed

∀'a. [{ 'a }, ([any_sexp] --> any_sexp) & (['a] --> any)] -> any_sexp
timing: 0.059 s
source
SEXP df_map(SEXP df, SEXP (*fn)(SEXP)) {
  SEXP out = PROTECT(map(df, fn));

  // Shallow ownership over `out` because `map()` generates a fresh
  // list. We only care about "restoring" that bare list to the type of `df`,
  // not the contents, so not recursive.
  struct vec_restore_opts opts = {
    .ownership = VCTRS_OWNERSHIP_shallow,
    .recursively_proxied = false
  };

  out = vec_df_restore(out, df, &opts);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:308

DF_ORDER_EXTRACT_CHUNK typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

DF_ORDER_EXTRACT_CHUNK_CPL typed

() --> any
timing: 0.000 s
(definition not located in src/)

df_raw_size typed

[{ any_sexp }] -> c_int_na
timing: 0.029 s
source
r_ssize df_raw_size(r_obj* x) {
  r_ssize n = df_rownames_size(x);
  if (n >= 0) {
    return n;
  }

  return df_raw_size_from_list(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:134

df_raw_size_from_list typed

([{ }] -> c_false)&([{ any_sexp }] -> c_int_na)
timing: 0.086 s
source
r_ssize df_raw_size_from_list(r_obj* x) {
  if (r_length(x) >= 1) {
    return vec_size(r_list_get(x, 0));
  } else {
    return 0;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:143

df_rownames_size_cb typed

∀'a. [any_sexp, any_sexp & 'a, c_ptr] -> c_null | 'a & (<...> | c_null | null | p(CHR) | sym)
timing: 0.017 s
source
r_obj* df_rownames_size_cb(r_obj* tag, r_obj* value, void* _data) {
  if (tag == r_syms.row_names) {
    // Found row names
    return value;
  } else {
    // Continue iterating
    return NULL;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:102

df_size typed

[any_sexp] -> c_int_na
timing: 0.011 s
source
r_ssize df_size(r_obj* x) {
  r_ssize n = df_rownames_size(x);

  if (n < 0) {
    r_stop_internal("Corrupt data frame: row.names are missing");
  }

  return n;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:124

df_size_from_n typed

([INT] -> c_int_na)&([^INT1] -> c_int)
timing: 0.116 s
source
r_ssize df_size_from_n(r_obj* n) {
  if (r_typeof(n) != R_TYPE_integer || r_length(n) != 1) {
    r_abort("`n` must be an integer of size 1.");
  }

  r_ssize out = r_int_get(n, 0);

  if (out == r_globals.na_int) {
    r_abort("`n` can't be missing.");
  }
  if (out < 0) {
    r_abort("`n` can't be negative.");
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:153

dict_hash_is_missing typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.058 s
source
bool dict_hash_is_missing(struct dictionary* d, R_len_t i) {
  return d->hash[i] == HASH_MISSING;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:195

DICT_HASH_WITH typed any: arg 1

tuple1 --> any
timing: 0.001 s
(definition not located in src/)

dict_put typed

([*struct dictionary, c_int_na, c_int_na] -> ())&([c_null, c_int_na, c_int_na] -> empty)
timing: 0.363 s
source
void dict_put(struct dictionary* d, uint32_t hash, R_len_t i) {
  d->key[hash] = i;
  d->used++;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:56

dim2 typed

∀'a,'b. ([c_int_na \ c_true & 'a, c_int_na \ c_true & 'b, c_int_na, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> () | 'a & (c_int_na \ c_true | ()))&([c_int_na \ c_true & 'a, c_true & 'b, c_int_na, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> c_int_na \ c_true & 'a)&([c_true & 'a, c_int_na & 'b, c_int_na, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> c_true & 'a | c_int_na & 'b)
timing: 0.142 s
source
int dim2(
  int x_dimension,
  int y_dimension,
  int axis,
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  if (x_dimension == y_dimension) {
    return x_dimension;
  } else if (x_dimension == 1) {
    return y_dimension;
  } else if (y_dimension == 1) {
    return x_dimension;
  } else {
    stop_incompatible_shape(x, y, x_dimension, y_dimension, axis, p_x_arg, p_y_arg);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:188

dims_shape typed

∀'a. ([INT & 'a] -> INT & 'a)&([^INT1 & 'a] -> ^INT1 & 'a)&([null & 'a] -> empty)
timing: 0.254 s
source
r_obj* dims_shape(r_obj* dimensions) {
  if (r_length(dimensions) == 0) {
    r_stop_internal("`dimensions` must have length.");
  }
  if (r_typeof(dimensions) != R_TYPE_integer) {
    r_stop_internal("`dimensions` must be an integer vector.");
  }

  if (r_int_get(dimensions, 0) == 0) {
    // Already a shape, no clone required
    return dimensions;
  }

  dimensions = KEEP(r_clone_referenced(dimensions));
  r_int_begin(dimensions)[0] = 0;
  FREE(1);
  return dimensions;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:102

dims_shape2 typed

([INT, INT, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> INT)&([INT1, INT1, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> INT1)&([null, null, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> empty)
timing: 4.10 s
source
r_obj* dims_shape2(
  r_obj* x_dimensions,
  r_obj* y_dimensions,
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  r_ssize x_dimensionality = r_length(x_dimensions);
  r_ssize y_dimensionality = r_length(y_dimensions);

  r_obj* max_dimensions;
  r_ssize max_dimensionality;
  r_ssize min_dimensionality;

  if (x_dimensionality >= y_dimensionality) {
    max_dimensions = x_dimensions;
    max_dimensionality = x_dimensionality;
    min_dimensionality = y_dimensionality;
  } else {
    max_dimensions = y_dimensions;
    max_dimensionality = y_dimensionality;
    min_dimensionality = x_dimensionality;
  }

  // Sanity check, should never be true
  if (max_dimensionality == 0) {
    r_stop_internal("`max_dimensionality` must have length.");
  }

  const int* p_x_dimensions = r_int_cbegin(x_dimensions);
  const int* p_y_dimensions = r_int_cbegin(y_dimensions);
  const int* p_max_dimensions = r_int_cbegin(max_dimensions);

  r_obj* out = KEEP(r_alloc_integer(max_dimensionality));
  int* p_out = r_int_begin(out);

  // Set the first axis to zero
  p_out[0] = 0;

  // Start loop at the second axis
  r_ssize i = 1;

  for (; i < min_dimensionality; ++i) {
    const int axis = i + 1;
    const int x_dimension = p_x_dimensions[i];
    const int y_dimension = p_y_dimensions[i];

    p_out[i] = dim2(x_dimension, y_dimension, axis, x, y, p_x_arg, p_y_arg);
  }

  for (; i < max_dimensionality; ++i) {
    p_out[i] = p_max_dimensions[i];
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:128

duplicated_any_loop typed

([c_null, c_int_na] -> empty)&([*struct dictionary, c_int_na] \ [c_null, c_int_na] -> c_bool)
timing: 1.11 s
source
bool duplicated_any_loop(struct dictionary* d, R_len_t n) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: DUPLICATED_ANY_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: DUPLICATED_ANY_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: DUPLICATED_ANY_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: DUPLICATED_ANY_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: DUPLICATED_ANY_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: DUPLICATED_ANY_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: DUPLICATED_ANY_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: DUPLICATED_ANY_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: DUPLICATED_ANY_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("duplicated_any_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:257

equal_string typed

([any_sexp, *c_string, p(CHR)] -> c_bool)&([any_sexp, c_null, any_sexp] -> c_true)
timing: 0.230 s
source
bool equal_string(SEXP x, const char** x_utf8, SEXP y) {
  // Try fast pointer comparison
  if (x == y)
    return true;

  if (*x_utf8 == NULL)
    *x_utf8 = Rf_translateCharUTF8(x);

  // Try slower conversion to common encoding
  const char* y_utf = Rf_translateCharUTF8(y);
  return (strcmp(y_utf, *x_utf8) == 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:7

expand_arg typed

∀'a. ([LGL & 'a, *c_int_na, c_int_na \ c_true, c_int] -> LGL)&([LGL & 'a, *c_int_na, c_int_na \ c_true, c_true] -> LGL1)&([any_sexp & 'a, *c_int_na, c_true, c_int_na] -> any_sexp & 'a)
timing: 0.831 s
source
SEXP expand_arg(
  SEXP arg,
  const int* p_expansions,
  r_ssize n_arg,
  r_ssize size
) {
  if (n_arg == 1) {
    return arg;
  }

  SEXP out = PROTECT(Rf_allocVector(LGLSXP, size));
  int* p_out = LOGICAL(out);

  int* p_arg = LOGICAL(arg);

  int k = 0;

  // Fill `out` with repeated `arg` values to match expanded size
  for (r_ssize i = 0; i < n_arg; ++i) {
    int col_arg = p_arg[i];
    int expansion = p_expansions[i];

    for (r_ssize j = 0; j < expansion; ++j) {
      p_out[k] = col_arg;
      ++k;
    }
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3670

expr_hash typed

[list] -> c_int_na
timing: 0.106 s
source
static inline uint32_t expr_hash(r_obj* x) {
  uint32_t hash = 0;
  r_ssize n = Rf_xlength(x);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* elt = r_list_get(x, i);
    hash = hash_combine(hash, obj_hash(elt));
  }

  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:101

expr_protect typed

∀'a,'b. ([(lang | sym)<...> & 'a] -> lang)&([v('b) & 'a] -> v('b) & 'a)&(['a & (null | p(CHR) | sym | (v('b) | (~(lang | sym | vec))<...>))] -> 'a & (null | p(CHR) | sym | (v('b) | (~(lang | sym | vec))<...>)))
timing: 0.144 s
source
static inline SEXP expr_protect(SEXP x) {
  switch (TYPEOF(x)) {
  case SYMSXP:
  case LANGSXP:
    return Rf_lang2(fns_quote, x);
  default:
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:364

fct_as_character typed

[INT<factor, ...>, *struct vctrs_arg] -> CHR
timing: 0.079 s
source
SEXP fct_as_character(SEXP x, struct vctrs_arg* x_arg) {
  SEXP levels = PROTECT(Rf_getAttrib(x, R_LevelsSymbol));

  if (TYPEOF(levels) != STRSXP) {
    stop_corrupt_factor_levels(x, x_arg);
  }

  UNPROTECT(1);
  return Rf_asCharacterFactor(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:117

fct_as_factor typed

[any_sexp, any_sexp, *c_bool, *struct vctrs_arg, *struct vctrs_arg] -> any_sexp
timing: 0.090 s
source
SEXP fct_as_factor(SEXP x,
                   SEXP to,
                   bool* lossy,
                   struct vctrs_arg* x_arg,
                   struct vctrs_arg* to_arg) {

  SEXP x_levels = PROTECT(Rf_getAttrib(x, R_LevelsSymbol));
  SEXP to_levels = PROTECT(Rf_getAttrib(to, R_LevelsSymbol));

  if (TYPEOF(x_levels) != STRSXP) {
    stop_corrupt_factor_levels(x, x_arg);
  }

  if (TYPEOF(to_levels) != STRSXP) {
    stop_corrupt_factor_levels(to, to_arg);
  }

  SEXP out = fct_as_factor_impl(x, x_levels, to_levels, lossy, false);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:253

ffi_altrep_lazy_character_is_materialized typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.011 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1
source
r_obj* ffi_altrep_lazy_character_is_materialized(r_obj* x) {
  return r_lgl(R_altrep_data2(x) != r_null);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/altrep-lazy-character.c:7

ffi_altrep_new_lazy_character typed entry .Call fuzz ok

[any_sexp] -> any_sexp
timing: 0.006 s
fuzzing: 6 inside (6 invalid) · 7 outside (7 rejected)
type drawn from: (x1: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_altrep_new_lazy_character(new.env())invalidattempt to apply non-function
ffi_altrep_new_lazy_character(list(NULL, list(new.env(), function(...) quote(f(x)))))invalidattempt to apply non-function
ffi_altrep_new_lazy_character(function(...) NULL)invalid`fn` must evaluate to a character vector. ℹ In file 'altrep-lazy-character.c' at line 33. ℹ This is an internal error, please report it to the package authors.
ffi_altrep_new_lazy_character(NULL)invalidattempt to apply non-function
ffi_altrep_new_lazy_character(quote(f(x)))invalidcould not find function "f"
ffi_altrep_new_lazy_character(as.name("x"))invalidcould not find function "x"
source
r_obj* ffi_altrep_new_lazy_character(r_obj* fn) {
  r_obj* out = R_new_altrep(altrep_lazy_character_class, fn, r_null);
  r_mark_shared(out);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/altrep-lazy-character.c:11

ffi_as_compact_condition typed entry .Call fuzz ok

[LGL] -> raw
timing: 0.344 s
fuzzing: 7 inside (5 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: LGL) -> raw

Other calls inside the domain

callverdicterror
ffi_as_compact_condition(c(TRUE, TRUE, FALSE, NA, FALSE))error_pkg::ffi_as_compact_condition: Can't use `NA` when creating a `compact_condition`. ℹ In file 'utils.c' at line 956. ℹ This is an internal error, please report it to the package authors.
ffi_as_compact_condition(c(NA, TRUE))error_pkg::ffi_as_compact_condition: Can't use `NA` when creating a `compact_condition`. ℹ In file 'utils.c' at line 956. ℹ This is an internal error, please report it to the package authors.
source
r_obj* ffi_as_compact_condition(r_obj* x) {
  if (r_typeof(x) != R_TYPE_logical) {
    r_stop_internal("`x` must be a logical condition vector.");
  }

  const r_ssize size = r_length(x);
  const int* v_x = r_lgl_cbegin(x);

  r_obj* out = KEEP(new_compact_condition(size));
  bool* v_out = compact_condition_begin(out);

  for (r_ssize i = 0; i < size; ++i) {
    const int elt = v_x[i];

    if (elt == r_globals.na_int) {
      r_stop_internal("Can't use `NA` when creating a `compact_condition`.");
    }

    v_out[i] = elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:941

ffi_as_df_col typed entry .Call fuzz ok

[any_sexp, CHR, any_sexp] -> any_sexp
timing: 0.025 s
fuzzing: 8 inside (7 ok, 1 invalid) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: CHR, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_as_df_col(c(42L, NA_integer_, -2147483647L, 2L, NA_integer_), c(NA_character_, "é", "é", NA_character_, "a"), NULL)invalid
source
r_obj* ffi_as_df_col(r_obj* x, r_obj* outer, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  bool allow_pack;
  return as_df_col(x, r_chr_get(outer, 0), &allow_pack, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:691

ffi_as_df_row typed entry .Call accepts outside

∀'a. [null & 'a, LGL, any_sexp] -> null & 'a
timing: 0.055 s
fuzzing: 20 inside (14 ok, 6 crash) · 8 outside (6 rejected, 2 accepted)
type drawn from: (x1: 'I98969 & null, x2: LGL, x3: any_sexp) -> null & 'I98969

Accepted outside the domain x1: 2

parameterchangecallreturned
x1kind:dblffi_as_df_row(1.5, FALSE, list()){ ...1: (^DBL1 \ (..))<> with { } }<data.frame> with { names: "...1"<> with { }, row.names: 1L<> with { } }
x1wrapffi_as_df_row(list(NULL), c(TRUE, TRUE, NA, NA, FALSE), as.raw(c(255))){ ...1: { null }<> with { } }<data.frame> with { names: "...1"<> with { }, row.names: 1L<> with { } }

Other calls inside the domain

callverdicterror
ffi_as_df_row(NULL, logical(0), c(42L, NA_integer_, NA_integer_, 1L, -2147483647L))crash
ffi_as_df_row(NULL, logical(0), new.env())crash
ffi_as_df_row(NULL, logical(0), list())crash
ffi_as_df_row(NULL, logical(0), as.name("x"))crash
ffi_as_df_row(NULL, logical(0), list(raw(0)))crash
ffi_as_df_row(NULL, logical(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))crash

Side effects

gzfile
source
r_obj* ffi_as_df_row(r_obj* x, r_obj* quiet, r_obj* frame) {
  struct name_repair_opts name_repair_opts = {
    .type = NAME_REPAIR_unique,
    .fn = r_null,
    .quiet = r_lgl_get(quiet, 0)
  };
  struct r_lazy error_call = { .x = frame, .env = r_null };
  return as_df_row(x, &name_repair_opts, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:410

ffi_as_minimal_names typed entry .Call fuzz ok

∀'a. [CHR & 'a] -> 'a
timing: 0.388 s
fuzzing: 6 inside (6 ok) · 8 outside (8 rejected)
type drawn from: (x1: 'I15074 & CHR) -> 'I15074
source
r_obj* ffi_as_minimal_names(r_obj* names) {
  if (r_typeof(names) != R_TYPE_character) {
    r_abort("`names` must be a character vector");
  }

  r_ssize i = 0;
  r_ssize n = r_length(names);
  r_obj* const * v_names = r_chr_cbegin(names);

  for (; i < n; ++i) {
    if (v_names[i] == r_globals.na_str) {
      break;
    }
  }
  if (i == n) {
    return names;
  }

  names = KEEP(r_clone(names));

  for (; i < n; ++i) {
    if (v_names[i] == r_globals.na_str) {
      r_chr_poke(names, i, strings_empty);
    }
  }

  FREE(1);
  return names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:187

ffi_as_subscript_result typed entry .Call fuzz ok

[any_sexp, CHR, CHR, CHR, any_sexp] -> any_sexp
timing: 0.075 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: CHR, x3: CHR, x4: CHR, x5: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_as_subscript_result(as.name("x"), "NA", character(0), "é", new.env())error_pkg::abort: could not find function "abort"
ffi_as_subscript_result(function(...) NULL, character(0), c("é", "a"), NA_character_, NULL)error_pkg::abort: could not find function "abort"
ffi_as_subscript_result(as.name("x"), character(0), character(0), "NA", function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_as_subscript_result(as.name("x"), "a", character(0), character(0), as.name("x"))error_pkg::abort: could not find function "abort"
ffi_as_subscript_result(c(complex(real = 1, imaginary = -2), NA_complex_, complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0)), character(0), "NA", c(NA_character_, "NA"), list())error_pkg::abort: could not find function "abort"
ffi_as_subscript_result(list(function(...) quote(f(x))), "a", "", c("a", ""), as.name("x"))error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_as_subscript_result(r_obj* subscript,
                               r_obj* logical,
                               r_obj* numeric,
                               r_obj* character,
                               r_obj* frame) {
  struct r_lazy arg_ = { .x = syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame };

  struct subscript_opts opts = {
    .logical = parse_subscript_arg_type(logical, "logical"),
    .numeric = parse_subscript_arg_type(numeric, "numeric"),
    .character = parse_subscript_arg_type(character, "character"),
    .subscript_arg = &arg,
    .call = call
  };

  ERR err = NULL;
  r_obj* out = vec_as_subscript_opts(subscript, &opts, &err);
  KEEP2(out, err);

  out = r_result(out, err);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:251

ffi_assign typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, LGL, any_sexp] -> any_sexp
timing: 0.123 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: LGL, x5: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_assign(new.env(), NULL, c(2L, 1000000L), NA, new.env())error_pkg::abort: could not find function "abort"
ffi_assign(new.env(), quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c(FALSE, TRUE, TRUE, FALSE, NA), as.raw(c(0)))error_pkg::abort: could not find function "abort"
ffi_assign(function(...) NULL, NULL, as.name("x"), c(FALSE, TRUE, TRUE, TRUE, FALSE), as.name("x"))error_pkg::abort: could not find function "abort"
ffi_assign(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) as.name("x"), as.name("x"), c(TRUE, FALSE, FALSE, TRUE, TRUE), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_assign(0L, list(), 42, c(TRUE, FALSE), c(FALSE, TRUE, FALSE, NA, TRUE))error_pkg::abort: could not find function "abort"
ffi_assign(as.name("x"), quote(f(x)), new.env(), c(FALSE, NA, FALSE, NA, FALSE), as.name("x"))error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_assign(
  r_obj* ffi_x,
  r_obj* ffi_i,
  r_obj* ffi_value,
  r_obj* ffi_slice_value,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy value_arg_lazy = { .x = syms.value_arg, .env = ffi_frame };
  struct vctrs_arg value_arg = new_lazy_arg(&value_arg_lazy);

  struct r_lazy call = { .x = ffi_frame, .env = r_null };

  const enum assignment_slice_value slice_value =
    r_arg_as_bool(ffi_slice_value, "slice_value") ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  // We don't expose this in the R API
  const bool assign_names = false;

  // Comes from the R side, so no known ownership
  const enum vctrs_ownership ownership = VCTRS_OWNERSHIP_foreign;

  const struct vec_assign_opts opts = {
    .assign_names = assign_names,
    .slice_value = slice_value,
    .ownership = ownership,
    .x_arg = &x_arg,
    .value_arg = &value_arg,
    .call = call
  };

  return vec_assign_opts(ffi_x, ffi_i, ffi_value, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:84

ffi_assign_params typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, LGL, LGL, any_sexp] -> any_sexp
timing: 0.220 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: LGL, x5: LGL, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_assign_params(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) as.raw(c(0)), quote(f(x)), c(TRUE, FALSE), FALSE, c(NA_complex_, complex(real = 1, imaginary = -2)))error_pkg::abort: could not find function "abort"
ffi_assign_params(logical(0), as.name("x"), function(...) as.name("x"), c(FALSE, TRUE), c(NA, FALSE, TRUE, NA, FALSE), quote(f(x)))error_pkg::abort: could not find function "abort"
ffi_assign_params(function(...) as.name("x"), new.env(), quote(f(x)), c(NA, NA, FALSE, FALSE, FALSE), logical(0), function(...) list(new.env()))error_pkg::abort: could not find function "abort"
ffi_assign_params(as.name("x"), list(as.name("x"), list(as.name("x"), function(...) NULL)), quote(f(x)), c(NA, TRUE), c(TRUE, TRUE, NA, TRUE, TRUE), NULL)error_pkg::abort: could not find function "abort"
ffi_assign_params(function(...) NULL, function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(NULL), NA, TRUE, list(NULL))error_pkg::abort: could not find function "abort"
ffi_assign_params(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"), as.name("x"), c(TRUE, TRUE, FALSE, NA, NA), FALSE, NULL)error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_assign_params(
  r_obj* ffi_x,
  r_obj* ffi_index,
  r_obj* ffi_value,
  r_obj* ffi_assign_names,
  r_obj* ffi_slice_value,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy value_arg_lazy = { .x = syms.value_arg, .env = ffi_frame };
  struct vctrs_arg value_arg = new_lazy_arg(&value_arg_lazy);

  struct r_lazy call = { .x = ffi_frame, .env = r_null };

  const bool assign_names = r_arg_as_bool(ffi_assign_names, "assign_names");

  const enum assignment_slice_value slice_value =
    r_arg_as_bool(ffi_slice_value, "slice_value") ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  // Comes from the R side, so no known ownership
  enum vctrs_ownership ownership = VCTRS_OWNERSHIP_foreign;

  const struct vec_assign_opts opts = {
    .assign_names = assign_names,
    .ownership = ownership,
    .slice_value = slice_value,
    .x_arg = &x_arg,
    .value_arg = &value_arg,
    .call = call
  };

  return vec_assign_opts(ffi_x, ffi_index, ffi_value, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:123

ffi_cast typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.080 s
fuzzing: 8 inside (1 ok, 7 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_cast(quote(f(x)), function(...) list(NULL), function(...) NULL)error_pkg::ffi_cast: 'rho' must be an environment not closure: detected in C-level eval
ffi_cast(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, new.env())error_pkgobject 'x_arg' not found
ffi_cast(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env())error_pkgobject 'x_arg' not found
ffi_cast(quote(f(x)), list(new.env(), quote(f(x))), "é")error_pkg::ffi_cast: 'rho' must be an environment not character: detected in C-level eval
ffi_cast(function(...) raw(0), list(), new.env())error_pkgobject 'x_arg' not found
ffi_cast(as.name("x"), "é", local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_cast: 'rho' must be an environment not externalptr: detected in C-level eval
and 1 more
source
r_obj* ffi_cast(r_obj* x,
                r_obj* to,
                r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy to_arg_ = { .x = syms.to_arg, .env = frame };
  struct vctrs_arg to_arg = new_lazy_arg(&to_arg_);

  struct r_lazy call = { .x = syms_call, .env = frame };

  return vec_cast(x, to, &x_arg, &to_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:6

ffi_cast_dispatch_native typed entry .Call fuzz ok

[LGL<> | null, LGL<> | null, any_sexp, CHR | null, CHR | null, any_sexp] -> any_sexp
timing: 0.277 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: LGL<> | null, x2: LGL<> | null, x3: any_sexp, x4: CHR | null, x5: CHR | null, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_cast_dispatch_native(c(TRUE, FALSE, NA, FALSE, NA), logical(0), new.env(), NULL, "x y", local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_cast_dispatch_native: VECTOR_ELT() can only be applied to a 'list', not a 'environment'
ffi_cast_dispatch_native(c(FALSE, TRUE, FALSE, NA, TRUE), FALSE, function(...) quote(f(x)), "", c("x y", "a"), as.name("x"))error_pkgArgument tag must be a string.
ffi_cast_dispatch_native(NULL, NULL, list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), "a", c(NA_character_, "a"), NULL)error_pkgArgument tag must be a string.
ffi_cast_dispatch_native(TRUE, c(FALSE, NA), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, character(0), NULL)error_pkgArgument tag must be a string.
ffi_cast_dispatch_native(c(FALSE, TRUE, NA, TRUE, TRUE), FALSE, as.name("x"), c("", NA_character_, "NA", "", "NA"), "", NULL)error_pkgArgument tag must be a string.
ffi_cast_dispatch_native(FALSE, FALSE, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NA_character_, character(0), as.name("x"))error_pkgArgument tag must be a string.
and 2 more
source
r_obj* ffi_cast_dispatch_native(r_obj* x,
                                r_obj* to,
                                r_obj* opts,
                                r_obj* x_arg,
                                r_obj* to_arg,
                                r_obj* frame) {
  struct vctrs_arg c_x_arg = vec_as_arg(x_arg);
  struct vctrs_arg c_to_arg = vec_as_arg(to_arg);
  struct r_lazy call = { .x = syms_call, .env = frame };

  struct cast_opts cast_opts = new_cast_opts(
    x,
    to,
    &c_x_arg,
    &c_to_arg,
    call,
    opts
  );

  bool lossy = false;
  r_obj* out = vec_cast_dispatch_native(&cast_opts, vec_typeof(x), vec_typeof(to), &lossy);

  if (lossy || out == r_null) {
    return vec_cast_default(x,
                            to,
                            &c_x_arg,
                            &c_to_arg,
                            cast_opts.call,
                            cast_opts.s3_fallback);
  } else {
    return out;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-dispatch.c:86

ffi_check_list typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, any_sexp] -> null
timing: 0.042 s
fuzzing: 8 inside (3 ok, 5 error pkg) · 7 outside (7 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: any_sexp) -> null

Other calls inside the domain

callverdicterror
ffi_check_list(as.name("x"), quote(f(x)))error_pkg::ffi_check_list: 'rho' must be an environment not language: detected in C-level eval
ffi_check_list(function(...) NULL, NULL)error_pkg::abort: could not find function "abort"
ffi_check_list(2, NULL)error_pkg::abort: could not find function "abort"
ffi_check_list(c(complex(real = 0, imaginary = 0), NA_complex_, NA_complex_, NA_complex_, complex(real = 0, imaginary = 0)), as.name("x"))error_pkg::ffi_check_list: 'rho' must be an environment not symbol: detected in C-level eval
ffi_check_list(quote(f(x)), quote(f(x)))error_pkg::ffi_check_list: 'rho' must be an environment not language: detected in C-level eval
source
r_obj* ffi_check_list(r_obj* x, r_obj* frame) {
  struct r_lazy call = { .x = r_syms.call, .env = frame };
  struct r_lazy arg_data = { .x = syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_data);

  obj_check_list(x, &arg, call);
  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:217

ffi_chr_is_ascii_or_utf8 typed entry .Call fuzz ok

([CHR] -> LGL)&([CHR1] -> LGL1)
timing: 0.392 s
fuzzing: 5 inside (5 ok) · 8 outside (8 rejected)
type drawn from: ((x1: CHR) -> LGL) & ((x1: CHR1) -> LGL1)
source
r_obj* ffi_chr_is_ascii_or_utf8(r_obj* x) {
  const r_ssize size = r_length(x);
  r_obj* const* v_x = r_chr_cbegin(x);

  r_obj* out = KEEP(r_alloc_logical(size));
  int* v_out = r_lgl_begin(out);

  for (r_ssize i = 0; i < size; ++i) {
    v_out[i] = str_is_ascii_or_utf8(v_x[i]);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:187

ffi_compact_seq typed entry .Call fuzz ok

[any_sexp, any_sexp, LGL] -> INT
timing: 0.027 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: LGL) -> INT

Other calls inside the domain

callverdicterror
ffi_compact_seq(NULL, quote(f(x)), FALSE)error_pkg::abort: could not find function "abort"
ffi_compact_seq(NULL, NULL, FALSE)error_pkg::abort: could not find function "abort"
ffi_compact_seq(NULL, new.env(), NA)error_pkg::abort: could not find function "abort"
ffi_compact_seq(as.name("x"), NULL, TRUE)error_pkg::abort: could not find function "abort"
ffi_compact_seq(NULL, new.env(), c(FALSE, TRUE, TRUE, TRUE, FALSE))error_pkg::abort: could not find function "abort"
ffi_compact_seq(NULL, as.name("x"), logical(0))error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_compact_seq(r_obj* ffi_start, r_obj* ffi_size, r_obj* ffi_increasing) {
  return compact_seq(
    r_arg_as_ssize(ffi_start, "start"),
    r_arg_as_ssize(ffi_size, "size"),
    r_arg_as_bool(ffi_increasing, "increasing")
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:763

ffi_data_frame typed entry .Call fuzz ok

[any_sexp, null, CHR | null, any_sexp] -> any_sexp
timing: 0.104 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: null, x3: CHR | null, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_data_frame(quote(f(x)), NULL, "", quote(f(x)))error_pkg::ffi_data_frame: 'rho' must be an environment not language: detected in C-level eval
ffi_data_frame(NULL, NULL, "a", c(complex(real = 1, imaginary = -2), NA_complex_, NA_complex_, complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0)))error_pkg::ffi_data_frame: 'rho' must be an environment not complex: detected in C-level eval
ffi_data_frame(NULL, NULL, NULL, function(...) NULL)error_pkg::ffi_data_frame: 'rho' must be an environment not closure: detected in C-level eval
ffi_data_frame(quote(f(x)), NULL, c("NA", "NA"), new.env())error_pkgobject '.error_call' not found
ffi_data_frame(list(), NULL, c("é", NA_character_), quote(f(x)))error_pkg::ffi_data_frame: 'rho' must be an environment not language: detected in C-level eval
ffi_data_frame(quote(f(x)), NULL, "x y", NULL)error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_data_frame(r_obj* x,
                      r_obj* size,
                      r_obj* name_repair,
                      r_obj* frame) {
  struct r_lazy error_call = { .x = syms.dot_error_call, .env = frame };

  struct name_repair_opts name_repair_opts = new_name_repair_opts(name_repair,
                                                                  lazy_args.dot_name_repair,
                                                                  false,
                                                                  error_call);
  KEEP(name_repair_opts.shelter);

  r_ssize c_size = 0;
  if (size == r_null) {
    c_size = vec_size_common(x, 0, vec_args.empty, error_call);
  } else {
    c_size = vec_as_short_length(size, vec_args.dot_size, error_call);
  }

  r_obj* out = data_frame(x, c_size, &name_repair_opts, error_call);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:180

ffi_df_cast_opts typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.073 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_df_cast_opts(function(...) quote(f(x)), NULL, quote(f(x)), NULL)error_pkg::ffi_df_cast_opts: VECTOR_ELT() can only be applied to a 'list', not a 'language'
ffi_df_cast_opts(as.name("x"), as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))error_pkg::ffi_df_cast_opts: VECTOR_ELT() can only be applied to a 'list', not a 'externalptr'
ffi_df_cast_opts(function(...) function(...) as.name("x"), logical(0), as.name("x"), list(quote(f(x))))error_pkg::ffi_df_cast_opts: VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
ffi_df_cast_opts(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) new.env(), function(...) list(quote(f(x)), quote(f(x))))error_pkg::ffi_df_cast_opts: VECTOR_ELT() can only be applied to a 'list', not a 'closure'
ffi_df_cast_opts(character(0), NULL, list(), NULL)error_pkg::ffi_df_cast_opts: attempt access index 0/0 in VECTOR_ELT
ffi_df_cast_opts(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), "a", quote(f(x)))error_pkg::ffi_df_cast_opts: VECTOR_ELT() can only be applied to a 'list', not a 'character'
and 2 more
source
r_obj* ffi_df_cast_opts(r_obj* x, r_obj* to, r_obj* opts, r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy to_arg_ = { .x = syms.to_arg, .env = frame };
  struct vctrs_arg to_arg = new_lazy_arg(&to_arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame };

  struct cast_opts c_opts = new_cast_opts(x,
                                          to,
                                          &x_arg,
                                          &to_arg,
                                          call,
                                          opts);

  return df_cast_opts(&c_opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:712

ffi_df_list typed entry .Call fuzz ok

[any_sexp, null, LGL, CHR | null, any_sexp] -> any_sexp
timing: 0.149 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: null, x3: LGL, x4: CHR | null, x5: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_df_list(NULL, NULL, c(NA, FALSE, NA, TRUE, NA), character(0), as.name("x"))error_pkg::ffi_df_list: 'rho' must be an environment not symbol: detected in C-level eval
ffi_df_list(list(quote(f(x)), as.name("x")), NULL, c(TRUE, NA), NULL, list())error_pkg::ffi_df_list: 'rho' must be an environment not list: detected in C-level eval
ffi_df_list(list(function(...) new.env()), NULL, logical(0), character(0), c(complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2)))error_pkg::ffi_df_list: 'rho' must be an environment not complex: detected in C-level eval
ffi_df_list(NULL, NULL, logical(0), NULL, as.name("x"))error_pkg::ffi_df_list: 'rho' must be an environment not symbol: detected in C-level eval
ffi_df_list(as.name("x"), NULL, c(FALSE, TRUE), c("é", "NA", "x y", "x y", "x y"), list(c(complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0)), 0L))error_pkg::ffi_df_list: 'rho' must be an environment not list: detected in C-level eval
ffi_df_list(as.raw(c(0)), NULL, logical(0), "", c(NA, NA))error_pkg::ffi_df_list: 'rho' must be an environment not logical: detected in C-level eval
and 2 more
source
r_obj* ffi_df_list(r_obj* x,
                   r_obj* size,
                   r_obj* unpack,
                   r_obj* name_repair,
                   r_obj* frame) {
  struct r_lazy error_call = { .x = syms.dot_error_call, .env = frame };

  struct name_repair_opts name_repair_opts = new_name_repair_opts(name_repair,
                                                                  lazy_args.dot_name_repair,
                                                                  false,
                                                                  error_call);
  KEEP(name_repair_opts.shelter);

  r_ssize c_size = 0;
  if (size == r_null) {
    c_size = vec_size_common(x, 0, vec_args.empty, error_call);
  } else {
    c_size = vec_as_short_length(size, vec_args.dot_size, error_call);
  }

  const bool c_unpack = r_arg_as_bool(unpack, ".unpack");

  r_obj* out = df_list(x, c_size, c_unpack, &name_repair_opts, error_call);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:219

ffi_df_proxy typed entry .Call empty return

[any_sexp, (~INT)<...> | null | p(CHR) | sym] -> empty
timing: 0.063 s
source
r_obj* ffi_df_proxy(r_obj* x, r_obj* kind) {
  if (!r_is_number(kind)) {
    r_stop_internal("`kind` must be a single integer.");
  }

  enum vctrs_proxy_kind c_kind = r_int_get(kind, 0);

  return df_proxy(x, c_kind);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:232

ffi_df_ptype2_opts typed entry .Call fuzz crash

[any_sexp, any_sexp, { INT }, any_sexp] -> any_sexp
timing: 0.070 s
fuzzing: 8 inside (5 ok, 2 error pkg, 1 crash) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: { INT }, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_df_ptype2_opts(NULL, quote(f(x)), list(), quote(f(x)))error_pkg::ffi_df_ptype2_opts: attempt access index 0/0 in VECTOR_ELT
ffi_df_ptype2_opts(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_df_ptype2_opts: attempt access index 0/0 in VECTOR_ELT
ffi_df_ptype2_opts(new.env(), list(), list(integer(0), integer(0)), quote(f(x)))crash
source
r_obj* ffi_df_ptype2_opts(r_obj* x, r_obj* y, r_obj* opts, r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame };

  const enum s3_fallback s3_fallback = s3_fallback_from_opts(opts);

  return df_ptype2(
    x,
    y,
    &x_arg,
    &y_arg,
    call,
    s3_fallback
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:496

ffi_is_coercible typed entry .Call fuzz crash

[any_sexp, any_sexp, { INT }, any_sexp] -> ^LGL1
timing: 0.068 s
fuzzing: 8 inside (1 ok, 6 error pkg, 1 crash) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: { INT }, x4: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
ffi_is_coercible(NULL, list(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), as.name("x")), list(), new.env())error_pkg::ffi_is_coercible: attempt access index 0/0 in VECTOR_ELT
ffi_is_coercible(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, list(), NULL)error_pkg::ffi_is_coercible: attempt access index 0/0 in VECTOR_ELT
ffi_is_coercible(list(as.name("x"), list()), function(...) as.name("x"), list(c(-2147483647L, 1000000L)), list(new.env(), function(...) as.name("x")))error_pkg::try_catch_callback: 'rho' must be an environment not list: detected in C-level eval
ffi_is_coercible(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, list(), as.name("x"))error_pkg::ffi_is_coercible: attempt access index 0/0 in VECTOR_ELT
ffi_is_coercible(as.name("x"), as.name("x"), list(integer(0)), complex(real = 0, imaginary = 0))crash
ffi_is_coercible(raw(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(c(0L, 1L, -2147483647L, 1000000L, 0L)), new.env())error_pkgobject 'y_arg' not found
and 1 more
source
r_obj* ffi_is_coercible(r_obj* x,
                        r_obj* y,
                        r_obj* opts,
                        r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  struct r_lazy call = { .x = syms_call, .env = frame };

  const enum s3_fallback s3_fallback = s3_fallback_from_opts(opts);

  return r_lgl(vec_is_coercible(
    x,
    y,
    &x_arg,
    &y_arg,
    call,
    s3_fallback
  ));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:339

ffi_list_all_recyclable typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, any_sexp, LGL, any_sexp] -> ^LGL1
timing: 0.044 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: any_sexp, x3: LGL, x4: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
ffi_list_all_recyclable(quote(f(x)), function(...) as.name("x"), FALSE, NULL)error_pkg`x` must be a list, not a call.
ffi_list_all_recyclable(logical(0), quote(f(x)), TRUE, new.env())error_pkg`x` must be a list, not an empty logical vector.
ffi_list_all_recyclable(NULL, NULL, c(NA, TRUE), as.raw(c(255, 0, 255, 255, 0)))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a raw vector.
ffi_list_all_recyclable(quote(f(x)), as.name("x"), c(TRUE, TRUE), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a pointer.
ffi_list_all_recyclable(NULL, as.name("x"), c(TRUE, NA), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_recyclable(quote(f(x)), function(...) quote(f(x)), c(FALSE, TRUE, FALSE, NA, FALSE), NULL)error_pkg`x` must be a list, not a call.
and 2 more

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_list_all_recyclable(
  r_obj* ffi_xs,
  r_obj* ffi_size,
  r_obj* ffi_allow_null,
  r_obj* ffi_frame
) {
  struct r_lazy error_call = {.x = ffi_frame, .env = r_null };

  // This is an internal error
  obj_check_list(ffi_xs, vec_args.x, error_call);

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");
  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");

  return r_lgl(list_all_recyclable(ffi_xs, size, allow_null, vec_args.x, error_call));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:241

ffi_list_all_size typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, any_sexp, LGL, any_sexp] -> ^LGL1
timing: 0.045 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: any_sexp, x3: LGL, x4: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
ffi_list_all_size(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), TRUE, as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_size(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c(FALSE, FALSE), NULL)error_pkg`x` must be a list, not `NULL`.
ffi_list_all_size(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), logical(0), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_size(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), c(NA, NA, FALSE, NA, FALSE), function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a function.
ffi_list_all_size(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), as.raw(c(255)), FALSE, c(NA_character_, "x y"))error_pkg::abort: could not find function "abort"
ffi_list_all_size(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c(NA, FALSE, TRUE, NA, NA), NULL)error_pkg`x` must be a list, not an environment.
and 2 more
source
r_obj* ffi_list_all_size(
  r_obj* ffi_xs,
  r_obj* ffi_size,
  r_obj* ffi_allow_null,
  r_obj* ffi_frame
) {
  struct r_lazy error_call = {.x = ffi_frame, .env = r_null };

  // This is an internal error
  obj_check_list(ffi_xs, vec_args.x, error_call);

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");
  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");

  return r_lgl(list_all_size(ffi_xs, size, allow_null, vec_args.x, error_call));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:99

ffi_list_all_vectors typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, LGL, any_sexp] -> ^LGL1
timing: 0.030 s
fuzzing: 8 inside (2 ok, 6 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: LGL, x3: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
ffi_list_all_vectors(new.env(), TRUE, as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_vectors(NULL, TRUE, new.env())error_pkg`x` must be a list, not `NULL`.
ffi_list_all_vectors(as.name("x"), logical(0), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_vectors(NULL, c(NA, FALSE, TRUE, TRUE, FALSE), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_all_vectors(function(...) NULL, c(FALSE, NA), NULL)error_pkg`x` must be a list, not a function.
ffi_list_all_vectors(as.raw(c(0)), c(NA, NA), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a pointer.
source
r_obj* ffi_list_all_vectors(r_obj* ffi_xs, r_obj* ffi_allow_null, r_obj* ffi_frame) {
  obj_check_list(ffi_xs, vec_args.x, (struct r_lazy) { ffi_frame, r_null });
  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");
  return r_lgl(list_all_vectors(ffi_xs, allow_null));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:23

ffi_list_check_all_recyclable typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, any_sexp, LGL, any_sexp] -> null
timing: 0.060 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: any_sexp, x3: LGL, x4: any_sexp) -> null

Other calls inside the domain

callverdicterror
ffi_list_check_all_recyclable(c(42, 1), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), logical(0), c(NA_real_, Inf, 1, NA_real_, -1))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a double vector.
ffi_list_check_all_recyclable(NULL, c(-Inf, Inf, Inf, 1000000, 1000000), FALSE, 2L)error_pkgrlang::rlang::abort: `call` must be a call or environment, not the number 2.
ffi_list_check_all_recyclable(raw(0), integer(0), c(NA, NA, NA, FALSE, FALSE), list())error_pkgrlang::rlang::abort: When a list, `call` must have "call" and "frame" names.
ffi_list_check_all_recyclable(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), NA, as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_check_all_recyclable(as.name("x"), as.name("x"), logical(0), NULL)error_pkg`x` must be a list, not a symbol.
ffi_list_check_all_recyclable(NULL, list(quote(f(x))), c(FALSE, FALSE), complex(real = 0, imaginary = 0))error_pkgrlang::rlang::abort: `call` must be a call or environment, not the complex number 0+0i.
and 2 more
source
r_obj* ffi_list_check_all_recyclable(
  r_obj* ffi_xs,
  r_obj* ffi_size,
  r_obj* ffi_allow_null,
  r_obj* ffi_frame
) {
  // This is an internal error
  obj_check_list(ffi_xs, vec_args.x, (struct r_lazy) {.x = ffi_frame, .env = r_null });

  struct r_lazy xs_arg_lazy = { .x = syms.arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  struct r_lazy call = { .x = r_syms.call, .env = ffi_frame };

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");
  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");

  list_check_all_recyclable(ffi_xs, size, allow_null, &xs_arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:292

ffi_list_check_all_size typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, any_sexp, LGL, any_sexp] -> null
timing: 0.060 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: any_sexp, x3: LGL, x4: any_sexp) -> null

Other calls inside the domain

callverdicterror
ffi_list_check_all_size(new.env(), as.name("x"), logical(0), quote(f(x)))error_pkg::f: `x` must be a list, not an environment.
ffi_list_check_all_size(c(TRUE, NA), NULL, c(FALSE, NA, NA, FALSE, NA), NULL)error_pkg`x` must be a list, not a logical vector.
ffi_list_check_all_size(new.env(), as.name("x"), c(NA, FALSE), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_check_all_size(as.name("x"), list(), c(FALSE, FALSE), new.env())error_pkg`x` must be a list, not a symbol.
ffi_list_check_all_size(list(NULL), quote(f(x)), NA, quote(f(x)))error_pkg::abort: could not find function "abort"
ffi_list_check_all_size(as.name("x"), as.name("x"), c(FALSE, NA), "a")error_pkgrlang::rlang::abort: `call` must be a call or environment, not the string "a".
and 2 more
source
r_obj* ffi_list_check_all_size(
  r_obj* ffi_xs,
  r_obj* ffi_size,
  r_obj* ffi_allow_null,
  r_obj* ffi_frame
) {
  // This is an internal error
  obj_check_list(ffi_xs, vec_args.x, (struct r_lazy) {.x = ffi_frame, .env = r_null });

  struct r_lazy xs_arg_lazy = { .x = syms.arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  struct r_lazy call = { .x = r_syms.call, .env = ffi_frame };

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");
  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");

  list_check_all_size(ffi_xs, size, allow_null, &xs_arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:150

ffi_list_check_all_vectors typed entry .Call fuzz ok

[<> | null | p(CHR) | sym, LGL, any_sexp] -> null
timing: 0.056 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: LGL, x3: any_sexp) -> null

Other calls inside the domain

callverdicterror
ffi_list_check_all_vectors(quote(f(x)), NA, list(function(...) list(), NULL))error_pkgrlang::rlang::abort: When a list, `call` must have "call" and "frame" names.
ffi_list_check_all_vectors(as.name("x"), c(TRUE, NA, NA, NA, TRUE), quote(f(x)))error_pkg::f: `x` must be a list, not a symbol.
ffi_list_check_all_vectors(quote(f(x)), c(FALSE, NA, TRUE, FALSE, TRUE), new.env())error_pkg`x` must be a list, not a call.
ffi_list_check_all_vectors(list(as.name("x")), c(NA, FALSE), list())error_pkg::abort: could not find function "abort"
ffi_list_check_all_vectors(c(FALSE, TRUE), c(NA, NA), function(...) as.raw(c(0, 255)))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a function.
ffi_list_check_all_vectors(complex(0), c(TRUE, NA), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
and 2 more
source
r_obj* ffi_list_check_all_vectors(r_obj* ffi_xs, r_obj* ffi_allow_null, r_obj* ffi_frame) {
  // This is an internal error
  obj_check_list(ffi_xs, vec_args.x, (struct r_lazy) {.x = ffi_frame, .env = r_null });

  struct r_lazy call = { .x = r_syms.call, .env = ffi_frame };

  struct r_lazy xs_arg_lazy = { .x = syms.arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  const enum vctrs_allow_null allow_null = arg_as_allow_null(ffi_allow_null, "allow_null");

  list_check_all_vectors(ffi_xs, allow_null, &xs_arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:47

ffi_list_combine typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, any_sexp, CHR | null, CHR | null, LGL, any_sexp, any_sexp, CHR | null, any_sexp] -> any_sexp)&([any_sexp, any_sexp, any_sexp, any_sexp, null, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] | [any_sexp, any_sexp, any_sexp, any_sexp, CHR | null, null, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] -> empty)
timing: 0.223 s
fuzzing: 8 inside (6 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: CHR | null, x6: CHR | null, x7: LGL, x8: any_sexp, x9: any_sexp, x10: CHR | null, x11: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: null, x6: any_sexp, x7: any_sexp, x8: any_sexp, x9: any_sexp, x10: any_sexp, x11: any_sexp) | (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: CHR | null, x6: null, x7: any_sexp, x8: any_sexp, x9: any_sexp, x10: any_sexp, x11: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_list_combine(function(...) list(), NULL, new.env(), NULL, character(0), c("x y", "é"), TRUE, as.name("x"), new.env(), c("NA", "a"), as.name("x"))error_pkg::abort: could not find function "abort"
ffi_list_combine(quote(f(x)), as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(c("", "")), "é", "NA", TRUE, as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "x y", quote(f(x)))error_pkg::abort: could not find function "abort"
source
r_obj* ffi_list_combine(
  r_obj* ffi_xs,
  r_obj* ffi_indices,
  r_obj* ffi_size,
  r_obj* ffi_default,
  r_obj* ffi_unmatched,
  r_obj* ffi_multiple,
  r_obj* ffi_slice_xs,
  r_obj* ffi_ptype,
  r_obj* ffi_name_spec,
  r_obj* ffi_name_repair,
  r_obj* ffi_frame
) {
  // On the R side it's `x_arg` to go with `x`, but on the C side we use `xs`
  struct r_lazy xs_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  struct r_lazy indices_arg_lazy = { .x = syms.indices_arg, .env = ffi_frame };
  struct vctrs_arg indices_arg = new_lazy_arg(&indices_arg_lazy);

  struct r_lazy default_arg_lazy = { .x = syms.default_arg, .env = ffi_frame };
  struct vctrs_arg default_arg = new_lazy_arg(&default_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");

  const enum list_combine_unmatched unmatched = parse_list_combine_unmatched(ffi_unmatched, error_call);
  const enum list_combine_multiple multiple = parse_list_combine_multiple(ffi_multiple, error_call);

  // On the R side it's `slice_x` to go with `x`, but on the C side we use `xs`
  const enum assignment_slice_value slice_xs =
    r_arg_as_bool(ffi_slice_xs, "slice_x") ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  struct name_repair_opts name_repair_opts = new_name_repair_opts(
    ffi_name_repair,
    r_lazy_null,
    false,
    error_call
  );
  KEEP(name_repair_opts.shelter);

  r_obj* out = list_combine(
    ffi_xs,
    ffi_indices,
    size,
    ffi_default,
    unmatched,
    multiple,
    slice_xs,
    ffi_ptype,
    ffi_name_spec,
    &name_repair_opts,
    &xs_arg,
    &indices_arg,
    &default_arg,
    error_call
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:7

ffi_list_interleave typed entry .Call fuzz ok

[any_sexp, null, any_sexp, any_sexp, CHR | null, any_sexp] -> any_sexp
timing: 0.200 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: null, x3: any_sexp, x4: any_sexp, x5: CHR | null, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_list_interleave(NULL, NULL, c(complex(real = 0, imaginary = 0), NA_complex_), as.name("x"), NULL, as.name("x"))error_pkg::ffi_list_interleave: 'rho' must be an environment not symbol: detected in C-level eval
ffi_list_interleave(new.env(), NULL, "NA", c(FALSE, FALSE), c("é", "a", "", "a", "NA"), function(...) as.name("x"))error_pkg::ffi_list_interleave: 'rho' must be an environment not closure: detected in C-level eval
ffi_list_interleave(NULL, NULL, function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c("a", "a"), as.name("x"))error_pkg::ffi_list_interleave: 'rho' must be an environment not symbol: detected in C-level eval
ffi_list_interleave(as.name("x"), NULL, as.name("x"), NULL, NULL, as.name("x"))error_pkg::ffi_list_interleave: 'rho' must be an environment not symbol: detected in C-level eval
ffi_list_interleave(NULL, NULL, NULL, NULL, "é", new.env())error_pkgobject 'error_call' not found
ffi_list_interleave(as.name("x"), NULL, NULL, NULL, NULL, NA)error_pkg::ffi_list_interleave: 'rho' must be an environment not logical: detected in C-level eval
and 2 more
source
r_obj* ffi_list_interleave(
  r_obj* ffi_x,
  r_obj* ffi_size,
  r_obj* ffi_ptype,
  r_obj* ffi_name_spec,
  r_obj* ffi_name_repair,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  const r_ssize size = (ffi_size == r_null) ?
    -1 :
    vec_as_short_length(ffi_size, vec_args.size, error_call);

  struct name_repair_opts name_repair_opts = new_name_repair_opts(
    ffi_name_repair,
    r_lazy_null,
    false,
    error_call
  );
  KEEP(name_repair_opts.shelter);

  r_obj* out = list_interleave(
    ffi_x,
    size,
    ffi_ptype,
    ffi_name_spec,
    &name_repair_opts,
    &x_arg,
    error_call
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-interleave.c:6

ffi_list_sizes typed entry .Call fuzz ok

[any_sexp, any_sexp] -> any_sexp
timing: 0.022 s
fuzzing: 8 inside (2 ok, 6 error pkg) · 7 outside (7 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_list_sizes(new.env(), as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_sizes(list(numeric(0), new.env()), as.name("x"))error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_list_sizes(as.name("x"), NULL)error_pkg`x` must be a list, not a symbol.
ffi_list_sizes(as.name("x"), function(...) c(complex(real = 0, imaginary = 0), NA_complex_))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a function.
ffi_list_sizes(NULL, function(...) as.name("x"))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a function.
ffi_list_sizes(function(...) as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::rlang::abort: `call` must be a call or environment, not a pointer.

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_list_sizes(r_obj* x, r_obj* frame) {
  struct r_lazy call = { .x = frame, .env = r_null };
  return list_sizes(x, vec_args.x, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:68

ffi_list_unchop typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp, CHR | null, any_sexp] -> any_sexp
timing: 0.096 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: CHR | null, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_list_unchop(new.env(), function(...) NULL, quote(f(x)), c(-Inf, 2, 1, -2147483647, 0), character(0), list())error_pkg::ffi_list_unchop: 'rho' must be an environment not list: detected in C-level eval
ffi_list_unchop(new.env(), NULL, NULL, as.name("x"), character(0), list(as.raw(c(255, 255, 255, 0, 255))))error_pkg::ffi_list_unchop: 'rho' must be an environment not list: detected in C-level eval
ffi_list_unchop(list(), as.name("x"), list(), new.env(), NULL, as.name("x"))error_pkg::ffi_list_unchop: 'rho' must be an environment not symbol: detected in C-level eval
ffi_list_unchop(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, quote(f(x)), as.name("x"), character(0), quote(f(x)))error_pkg::ffi_list_unchop: 'rho' must be an environment not language: detected in C-level eval
ffi_list_unchop(as.name("x"), function(...) quote(f(x)), as.name("x"), function(...) -1L, NULL, function(...) complex(real = 0, imaginary = 0))error_pkg::ffi_list_unchop: 'rho' must be an environment not closure: detected in C-level eval
ffi_list_unchop(list(function(...) function(...) new.env()), as.raw(c(255, 255, 255, 255, 0)), NULL, quote(f(x)), c("é", "NA", "x y", "", "é"), as.raw(c(0)))error_pkg::ffi_list_unchop: 'rho' must be an environment not raw: detected in C-level eval
and 2 more
source
r_obj* ffi_list_unchop(
  r_obj* x,
  r_obj* indices,
  r_obj* ptype,
  r_obj* name_spec,
  r_obj* name_repair,
  r_obj* frame
) {
  struct r_lazy error_arg_lazy = { .x = r_syms.error_arg, .env = frame };
  struct vctrs_arg error_arg = new_lazy_arg(&error_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = frame };

  struct name_repair_opts name_repair_opts = new_name_repair_opts(
    name_repair,
    r_lazy_null,
    false,
    error_call
  );
  KEEP(name_repair_opts.shelter);

  r_obj* out = list_unchop(
    x,
    indices,
    ptype,
    name_spec,
    &name_repair_opts,
    &error_arg,
    error_call
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-unchop.c:5

ffi_obj_equal typed entry .Call fuzz ok

[any_sexp, any_sexp] -> ^LGL1
timing: 0.013 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> ^LGL1
source
r_obj* ffi_obj_equal(r_obj* x, r_obj* y) {
  return r_lgl(obj_equal(x, y));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:326

ffi_obj_hash typed entry .Call fuzz ok

[any_sexp] -> raw
timing: 0.031 s
fuzzing: 5 inside (5 ok) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp) -> raw
source
r_obj* ffi_obj_hash(r_obj* x) {
  uint32_t hash = 0;
  hash = hash_combine(hash, obj_hash(x));

  r_obj* out = KEEP(r_alloc_raw(sizeof(uint32_t)));
  r_memcpy(r_raw_begin(out), &hash, sizeof(uint32_t));
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:9

ffi_obj_is_list typed entry .Call accepts outside

[<> | null | p(CHR) | sym] -> ^LGL1
timing: 0.015 s
fuzzing: 7 inside (7 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: (x1: p(CHR) | <> | sym | null) -> ^LGL1

Accepted outside the domain x1: 4

parameterchangecallreturned
x1class:addffi_obj_is_list(structure(new.env(), class = "fuzz_cls"))ff<> with { }
x1class:addffi_obj_is_list(structure(function(...) function(...) list(), class = "fuzz_cls"))ff<> with { }
x1class:addffi_obj_is_list(structure(function(...) new.env(), class = "fuzz_cls"))ff<> with { }
x1class:addffi_obj_is_list(structure(function(...) as.raw(c(255, 255, 0, 0, 0)), class = "fuzz_cls"))ff<> with { }
source
r_obj* ffi_obj_is_list(r_obj* x) {
  return r_lgl(obj_is_list(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:199

ffi_obj_is_vector typed entry .Call accepts outside

[<> | null | p(CHR) | sym] -> ^LGL1
timing: 0.015 s
fuzzing: 6 inside (6 ok) · 8 outside (5 rejected, 3 accepted)
type drawn from: (x1: p(CHR) | <> | sym | null) -> ^LGL1

Accepted outside the domain x1: 3

parameterchangecallreturned
x1class:addffi_obj_is_vector(structure(function(...) quote(f(x)), class = "fuzz_cls"))ff<> with { }
x1class:addffi_obj_is_vector(structure(42, class = "fuzz_cls"))tt<> with { }
x1class:addffi_obj_is_vector(structure(function(...) as.name("x"), class = "fuzz_cls"))ff<> with { }
source
r_obj* ffi_obj_is_vector(r_obj* x) {
  // Not exposed at the R level for single vector checks
  const enum vctrs_allow_null allow_null = VCTRS_ALLOW_NULL_no;
  return r_lgl(obj_is_vector(x, allow_null));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:3

ffi_outer_names typed entry .Call fuzz ok

∀'a. ([null & 'a, null, INT] | ['a & (<...> | p(CHR) | sym), null, INT] -> any_sexp & 'a)&([null & 'a, any_sexp, (~INT)<...> | null | p(CHR) | sym] | ['a & (<...> | p(CHR) | sym), any_sexp, (~INT)<...> | null | p(CHR) | sym] -> empty)
timing: 0.499 s
fuzzing: 20 inside (11 ok, 9 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: 'I80361 & null, x2: any_sexp, x3: p(CHR) | (~INT)<...> | sym | null) | (x1: 'I80361 & (p(CHR) | <...> | sym), x2: any_sexp, x3: p(CHR) | (~INT)<...> | sym | null) -> empty) & ((x1: 'I80361 & null, x2: null, x3: INT) | (x1: 'I80361 & (p(CHR) | <...> | sym), x2: null, x3: INT) -> any_sexp & 'I80361)

Other calls inside the domain

callverdicterror
ffi_outer_names(c(TRUE, TRUE, TRUE, NA, TRUE), NULL, 0L)error_pkg::ffi_outer_names: `names` must be `NULL` or a string. ℹ In file 'names.c' at line 511. ℹ This is an internal error, please report it to the package authors.
ffi_outer_names(c(NA_integer_, 2L, NA_integer_, 2147483647L, 1L), NULL, 42L)error_pkg::ffi_outer_names: `names` must be `NULL` or a string. ℹ In file 'names.c' at line 511. ℹ This is an internal error, please report it to the package authors.
ffi_outer_names(Inf, NULL, c(1000000L, -2147483647L, 2L, 2L, 1L))error_pkg::ffi_outer_names: `names` must be `NULL` or a string. ℹ In file 'names.c' at line 511. ℹ This is an internal error, please report it to the package authors.
ffi_outer_names(complex(0), NULL, c(1L, -1L))error_pkg::ffi_outer_names: `names` must be `NULL` or a string. ℹ In file 'names.c' at line 511. ℹ This is an internal error, please report it to the package authors.
ffi_outer_names(character(0), NULL, c(2L, -1L))error_pkg::ffi_outer_names: `n` must be a single integer. ℹ In file 'names.c' at line 514. ℹ This is an internal error, please report it to the package authors.
ffi_outer_names(as.raw(c(0, 255, 0, 0, 255)), NULL, integer(0))error_pkg::ffi_outer_names: `names` must be `NULL` or a string. ℹ In file 'names.c' at line 511. ℹ This is an internal error, please report it to the package authors.
and 3 more
source
r_obj* ffi_outer_names(r_obj* names, r_obj* outer, r_obj* n) {
  if (names != r_null && r_typeof(names) != R_TYPE_character) {
    r_stop_internal("`names` must be `NULL` or a string.");
  }
  if (!r_is_number(n)) {
    r_stop_internal("`n` must be a single integer.");
  }

  if (outer != r_null) {
    outer = r_chr_get(outer, 0);
  }

  return outer_names(names, outer, r_int_get(n, 0));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:509

ffi_ptype typed entry .Call fuzz ok

[any_sexp, CHR | null, any_sexp] -> any_sexp
timing: 0.051 s
fuzzing: 8 inside (1 ok, 7 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: CHR | null, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_ptype(as.name("x"), NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_ptype: 'rho' must be an environment not externalptr: detected in C-level eval
ffi_ptype(list(quote(f(x))), character(0), as.name("x"))error_pkgArgument tag must be a string.
ffi_ptype(function(...) NULL, "a", quote(f(x)))error_pkg::ffi_ptype: 'rho' must be an environment not language: detected in C-level eval
ffi_ptype(NULL, c(NA_character_, NA_character_), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgArgument tag must be a string.
ffi_ptype(quote(f(x)), "x y", local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_ptype: 'rho' must be an environment not externalptr: detected in C-level eval
ffi_ptype(new.env(), c("x y", "NA"), NULL)error_pkgArgument tag must be a string.
and 1 more
source
r_obj* ffi_ptype(r_obj* x, r_obj* x_arg_ffi, r_obj* frame) {
  struct vctrs_arg x_arg = vec_as_arg(x_arg_ffi);
  struct r_lazy call = { .x = r_syms.call, .env = frame };
  return vec_ptype(x, &x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:7

ffi_ptype2 typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.049 s
fuzzing: 8 inside (2 ok, 6 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_ptype2(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"), quote(f(x)))error_pkg::ffi_ptype2: 'rho' must be an environment not language: detected in C-level eval
ffi_ptype2(list(list()), as.name("x"), as.raw(c(0)))error_pkg::ffi_ptype2: 'rho' must be an environment not raw: detected in C-level eval
ffi_ptype2(function(...) "x y", local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)))error_pkg::ffi_ptype2: 'rho' must be an environment not language: detected in C-level eval
ffi_ptype2(list(NULL, as.name("x")), function(...) NULL, as.name("x"))error_pkg::ffi_ptype2: 'rho' must be an environment not symbol: detected in C-level eval
ffi_ptype2(as.name("x"), new.env(), function(...) as.name("x"))error_pkg::ffi_ptype2: 'rho' must be an environment not closure: detected in C-level eval
ffi_ptype2(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, quote(f(x)))error_pkg::ffi_ptype2: 'rho' must be an environment not language: detected in C-level eval
source
r_obj* ffi_ptype2(r_obj* x,
                  r_obj* y,
                  r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  struct r_lazy call = { .x = syms_call, .env = frame };

  int _;
  return vec_ptype2(
    x,
    y,
    &x_arg,
    &y_arg,
    call,
    S3_FALLBACK_false,
    &_
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:365

ffi_ptype2_dispatch_native typed entry .Call fuzz ok

[LGL<> | null, LGL<> | null, { INT }, any_sexp] -> any_sexp
timing: 0.279 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: LGL<> | null, x2: LGL<> | null, x3: { INT }, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_ptype2_dispatch_native(c(TRUE, FALSE, FALSE, TRUE, NA), c(FALSE, TRUE), list(1L), NULL)error_pkg::abort: could not find function "abort"
ffi_ptype2_dispatch_native(NULL, NULL, list(), new.env())error_pkg::ffi_ptype2_dispatch_native: attempt access index 0/0 in VECTOR_ELT
ffi_ptype2_dispatch_native(logical(0), c(FALSE, TRUE, TRUE, NA, TRUE), list(c(-1L, 1000000L, 2147483647L, 2L, 42L), c(-1L, 2147483647L)), NULL)error_pkg::abort: could not find function "abort"
ffi_ptype2_dispatch_native(logical(0), NA, list(-2147483647L, c(1000000L, -2147483647L, -1L, 42L, -2147483647L)), list(as.raw(c(255, 255, 0, 0, 0)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkg::ffi_ptype2_dispatch_native: 'rho' must be an environment not list: detected in C-level eval
ffi_ptype2_dispatch_native(NULL, TRUE, list(), quote(f(x)))error_pkg::ffi_ptype2_dispatch_native: attempt access index 0/0 in VECTOR_ELT
ffi_ptype2_dispatch_native(NULL, TRUE, list(c(-2147483647L, NA_integer_), c(2147483647L, NA_integer_, NA_integer_, NA_integer_, -1L)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_ptype2_dispatch_native: 'rho' must be an environment not externalptr: detected in C-level eval
and 2 more
source
r_obj* ffi_ptype2_dispatch_native(r_obj* x,
                                  r_obj* y,
                                  r_obj* opts,
                                  r_obj* frame) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  struct r_lazy call = { .x = syms_call, .env = frame };

  const enum s3_fallback s3_fallback = s3_fallback_from_opts(opts);

  int _;
  r_obj* out = vec_ptype2_dispatch_native(
    x,
    y,
    vec_typeof(x),
    vec_typeof(y),
    &x_arg,
    &y_arg,
    call,
    s3_fallback,
    &_
  );

  if (out == r_null) {
    out = vec_ptype2_default_full(
      x,
      y,
      &x_arg,
      &y_arg,
      call,
      s3_fallback,
      true
    );
    return out;
  } else {
    return out;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:225

ffi_ptype2_opts typed entry .Call fuzz crash

[any_sexp, any_sexp, { INT }, any_sexp] -> any_sexp
timing: 0.077 s
fuzzing: 8 inside (1 ok, 6 error pkg, 1 crash) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: { INT }, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_ptype2_opts(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) function(...) new.env(), list(c(1000000L, 1L)), new.env())error_pkgobject 'x_arg' not found
ffi_ptype2_opts(function(...) list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), function(...) quote(f(x)), list(c(NA_integer_, 1000000L, -1L, 42L, NA_integer_)), as.raw(c(255)))error_pkg::ffi_ptype2_opts: 'rho' must be an environment not raw: detected in C-level eval
ffi_ptype2_opts(quote(f(x)), list(), list(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_ptype2_opts: attempt access index 0/0 in VECTOR_ELT
ffi_ptype2_opts(quote(f(x)), as.raw(c(0)), list(integer(0), integer(0)), NULL)crash
ffi_ptype2_opts(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), list(), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkg::ffi_ptype2_opts: attempt access index 0/0 in VECTOR_ELT
ffi_ptype2_opts(new.env(), function(...) new.env(), list(), as.name("x"))error_pkg::ffi_ptype2_opts: attempt access index 0/0 in VECTOR_ELT
and 1 more
source
r_obj* ffi_ptype2_opts(r_obj* x,
                       r_obj* y,
                       r_obj* ffi_opts,
                       r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame, };

  enum s3_fallback s3_fallback = s3_fallback_from_opts(ffi_opts);

  int _;
  return vec_ptype2(
    x,
    y,
    &x_arg,
    &y_arg,
    call,
    s3_fallback,
    &_
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:6

ffi_recycle typed entry .Call accepts outside

[null, any_sexp, any_sexp] | [<...> | p(CHR) | sym, null, any_sexp] -> null
timing: 0.164 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)
type drawn from: (x1: null, x2: any_sexp, x3: any_sexp) | (x1: p(CHR) | <...> | sym, x2: null, x3: any_sexp) -> null

Accepted outside the domain x1: 1

parameterchangecallreturned
x1kind:chrffi_recycle("fuzz", c(2L, 0L, 2L, 42L, 2147483647L), complex(0))(CHR & ~vec1)<> with { }

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_recycle(r_obj* x,
                   r_obj* size_obj,
                   r_obj* frame) {
  if (x == r_null || size_obj == r_null) {
    return r_null;
  }

  struct r_lazy recycle_call = { .x = frame, .env = r_null };

  size_obj = KEEP(vec_cast(size_obj,
                           r_globals.empty_int,
                           vec_args.empty,
                           vec_args.empty,
                           recycle_call));
  R_len_t size = r_int_get(size_obj, 0);
  FREE(1);

  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy call = { .x = syms_call, .env = frame };

  return vec_recycle(x, size, &x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:184

ffi_s3_get_method typed entry .Call fuzz ok

([CHR, CHR, env] -> any_sexp)&([null, any_sexp, any_sexp] | [CHR | null, null, any_sexp] -> empty)
timing: 0.053 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: CHR, x2: CHR, x3: env) -> any_sexp) & ((x1: null, x2: any_sexp, x3: any_sexp) | (x1: CHR | null, x2: null, x3: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_s3_get_method(character(0), character(0), new.env())error_pkg::ffi_s3_get_method: `generic` must be a string ℹ In file 'utils.c' at line 440. ℹ This is an internal error, please report it to the package authors.
ffi_s3_get_method(c("a", NA_character_, "a", "NA", "a"), c("x y", "", NA_character_, "x y", "NA"), new.env())error_pkg::ffi_s3_get_method: `generic` must be a string ℹ In file 'utils.c' at line 440. ℹ This is an internal error, please report it to the package authors.
ffi_s3_get_method("NA", c("a", ""), new.env())error_pkg::ffi_s3_get_method: `cls` must be a string ℹ In file 'utils.c' at line 443. ℹ This is an internal error, please report it to the package authors.
source
r_obj* ffi_s3_get_method(r_obj* generic, r_obj* cls, r_obj* table) {
  if (!r_is_string(generic)) {
    r_stop_internal("`generic` must be a string");
  }
  if (!r_is_string(cls)) {
    r_stop_internal("`cls` must be a string");
  }
  return s3_get_method(r_chr_get_c_string(generic, 0),
                       r_chr_get_c_string(cls, 0),
                       table);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:438

ffi_slice typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.028 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_slice(quote(f(x)), new.env(), list(quote(f(x))))error_pkg::ffi_slice: 'rho' must be an environment not list: detected in C-level eval
ffi_slice(NULL, as.name("x"), as.name("x"))error_pkg::ffi_slice: 'rho' must be an environment not symbol: detected in C-level eval
ffi_slice(as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(function(...) quote(f(x))))error_pkg::ffi_slice: 'rho' must be an environment not list: detected in C-level eval
ffi_slice(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) NULL, NULL)error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_slice(new.env(), character(0), NULL)error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_slice(function(...) list(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), function(...) quote(f(x)), NULL)error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
and 2 more
source
r_obj* ffi_slice(r_obj* x,
                 r_obj* i,
                 r_obj* frame) {
  struct vec_slice_opts opts = {
    .x_arg = vec_args.x,
    .i_arg = vec_args.i,
    .call = {.x = r_syms.error_call, .env = frame}
  };
  return vec_slice_opts(x, i, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:434

ffi_tib_cast typed entry .Call fuzz ok

[any_sexp, any_sexp, CHR | null, CHR | null, any_sexp] -> <...>
timing: 0.061 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: CHR | null, x4: CHR | null, x5: any_sexp) -> <...>

Other calls inside the domain

callverdicterror
ffi_tib_cast(list(integer(0)), NULL, c(NA_character_, "é", NA_character_, "a", "é"), c("NA", "NA"), as.name("x"))error_pkgArgument tag must be a string.
ffi_tib_cast(as.name("x"), list(new.env()), NULL, "é", local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_tib_cast: Data frame must have names. ℹ In file 'type-data-frame.c' at line 741. ℹ This is an internal error, please report it to the package authors.
ffi_tib_cast(c(complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), NA_complex_, complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0)), list(function(...) list(list(), new.env()), as.name("x")), "a", c("NA", NA_character_, "NA", "é", ""), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkgArgument tag must be a string.
ffi_tib_cast(new.env(), list(list(as.name("x"), list())), NULL, c("x y", "NA", "a", "a", ""), as.name("x"))error_pkgArgument tag must be a string.
ffi_tib_cast(quote(f(x)), NULL, character(0), NA_character_, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgArgument tag must be a string.
ffi_tib_cast(integer(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c("NA", "NA"), c("x y", "", "", "", NA_character_), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgArgument tag must be a string.
and 2 more
source
r_obj* ffi_tib_cast(r_obj* x,
                    r_obj* to,
                    r_obj* ffi_x_arg,
                    r_obj* ffi_to_arg,
                    r_obj* frame) {
  struct vctrs_arg x_arg = vec_as_arg(ffi_x_arg);
  struct vctrs_arg to_arg = vec_as_arg(ffi_to_arg);

  const struct cast_opts opts = {
    .x = x,
    .to = to,
    .p_x_arg = &x_arg,
    .p_to_arg = &to_arg,
    .call = { .x = r_syms.call, .env = frame }
  };

  return tib_cast(&opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-tibble.c:57

ffi_tib_ptype2 typed entry .Call fuzz ok

[any_sexp, any_sexp, CHR | null, CHR | null, any_sexp] -> any_sexp
timing: 0.046 s
fuzzing: 8 inside (1 ok, 7 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: CHR | null, x4: CHR | null, x5: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_tib_ptype2(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"), c(NA_character_, "x y", "NA", "", ""), c("é", ""), list(NULL))error_pkgArgument tag must be a string.
ffi_tib_ptype2(quote(f(x)), NULL, NULL, c(NA_character_, "é"), NULL)error_pkgArgument tag must be a string.
ffi_tib_ptype2(c(NA, FALSE), new.env(), c(NA_character_, ""), c("a", NA_character_), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgArgument tag must be a string.
ffi_tib_ptype2(quote(f(x)), quote(f(x)), c("x y", NA_character_, NA_character_, "x y", "x y"), c(NA_character_, "é", "NA", "a", ""), as.name("x"))error_pkgArgument tag must be a string.
ffi_tib_ptype2(as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), character(0), c("x y", "a"), new.env())error_pkgArgument tag must be a string.
ffi_tib_ptype2(as.name("x"), as.name("x"), NULL, c("é", "NA", "é", "", NA_character_), as.name("x"))error_pkgArgument tag must be a string.
and 1 more
source
r_obj* ffi_tib_ptype2(r_obj* x,
                      r_obj* y,
                      r_obj* ffi_x_arg_,
                      r_obj* ffi_y_arg_,
                      r_obj* frame) {
  struct vctrs_arg x_arg = vec_as_arg(ffi_x_arg_);
  struct vctrs_arg y_arg = vec_as_arg(ffi_y_arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame };

  return tib_ptype2(
    x,
    y,
    &x_arg,
    &y_arg,
    call,
    S3_FALLBACK_false
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-tibble.c:26

ffi_typeof2 typed entry .Call accepts outside

[LGL<> | null, LGL<> | null] -> ^CHR1
timing: 0.018 s
fuzzing: 8 inside (8 ok) · 7 outside (2 rejected, 5 accepted)
type drawn from: (x1: LGL<> | null, x2: LGL<> | null) -> ^CHR1

Accepted outside the domain x1: 4, x2: 1

parameterchangecallreturned
x1class:addffi_typeof2(structure(FALSE, class = "fuzz_cls"), TRUE)"VCTRS_TYPE2_logical_s3"<> with { }
x1retype:lgl>rawffi_typeof2(as.raw(c(0)), NULL)"VCTRS_TYPE2_null_raw"<> with { }
x1wrapffi_typeof2(list(NULL), c(NA, NA))"VCTRS_TYPE2_unspecified_list"<> with { }
x1wrapffi_typeof2(list(c(FALSE, TRUE)), FALSE)"VCTRS_TYPE2_logical_list"<> with { }
x2retype:lgl>rawffi_typeof2(logical(0), as.raw(c(0)))"VCTRS_TYPE2_logical_raw"<> with { }
source
r_obj* ffi_typeof2(r_obj* x, r_obj* y) {
  enum vctrs_type2 type = vec_typeof2(x, y);
  return r_chr(vctrs_type2_as_str(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2.c:322

ffi_typeof2_s3 typed entry .Call accepts outside

[LGL<> | null, LGL<> | null] -> ^CHR1
timing: 0.018 s
fuzzing: 7 inside (7 ok) · 8 outside (8 accepted)
type drawn from: (x1: LGL<> | null, x2: LGL<> | null) -> ^CHR1

Accepted outside the domain x1: 3, x2: 5

parameterchangecallreturned
x1wrapffi_typeof2_s3(list(NULL), c(TRUE, NA))"VCTRS_TYPE2_S3_list_unknown"<> with { }
x1wrapffi_typeof2_s3(list(NULL), TRUE)"VCTRS_TYPE2_S3_list_unknown"<> with { }
x1wrapffi_typeof2_s3(list(FALSE), TRUE)"VCTRS_TYPE2_S3_list_unknown"<> with { }
x2class:addffi_typeof2_s3(c(FALSE, FALSE, FALSE, NA, FALSE), structure(logical(0), class = "fuzz_cls"))"VCTRS_TYPE2_S3_logical_unknown"<> with { }
x2kind:envffi_typeof2_s3(c(FALSE, FALSE, FALSE, NA, FALSE), new.env())"VCTRS_TYPE2_S3_logical_unknown"<> with { }
x2retype:lgl>chrffi_typeof2_s3(NULL, c("é", NA_character_))"VCTRS_TYPE2_S3_null_unknown"<> with { }
and 2 more
source
r_obj* ffi_typeof2_s3(r_obj* x, r_obj* y) {
  enum vctrs_type2_s3 type = vec_typeof2_s3(x, y);
  return r_chr(vctrs_type2_s3_as_str(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2-s3.c:460

ffi_unique_names typed entry .Call fuzz crash

[any_sexp, LGL] -> any_sexp
timing: 0.028 s
fuzzing: 8 inside (1 ok, 4 error pkg, 3 crash) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: LGL) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_unique_names(function(...) function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NA)error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_unique_names(quote(f(x)), c(TRUE, FALSE, FALSE, FALSE, FALSE))error_pkg::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_unique_names(new.env(), logical(0))crash
ffi_unique_names(NULL, logical(0))crash
ffi_unique_names(quote(f(x)), TRUE)error_pkg::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_unique_names(function(...) new.env(), TRUE)error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
and 1 more

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_unique_names(r_obj* x, r_obj* quiet) {
  return vec_unique_names(x, LOGICAL(quiet)[0]);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:448

ffi_vec_any_missing typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.015 s
fuzzing: 5 inside (2 ok, 3 error pkg) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
ffi_vec_any_missing(function(...) function(...) quote(f(x)))error_pkgInput must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_any_missing(as.name("x"))error_pkg::ffi_vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error, please report it to the package authors.
ffi_vec_any_missing(quote(f(x)))error_pkg::ffi_vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error, please report it to the package authors.

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_vec_any_missing(r_obj* x) {
  return r_lgl(vec_any_missing(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:263

ffi_vec_as_names typed entry .Call fuzz ok

[CHR, CHR | null, LGL, any_sexp] -> any_sexp
timing: 0.108 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: CHR, x2: CHR | null, x3: LGL, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_as_names(c("", "x y"), "", TRUE, new.env())error_pkgobject 'repair_arg' not found
ffi_vec_as_names("", character(0), c(TRUE, TRUE, TRUE, TRUE, FALSE), new.env())error_pkg::abort: could not find function "abort"
ffi_vec_as_names("é", character(0), TRUE, list(as.name("x")))error_pkg::ffi_vec_as_names: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_as_names(c("x y", NA_character_), NA_character_, logical(0), list(list(quote(f(x))), NULL))error_pkg::abort: could not find function "abort"
ffi_vec_as_names("x y", NULL, NA, NULL)error_pkg::abort: could not find function "abort"
ffi_vec_as_names("x y", c("a", "NA"), FALSE, NULL)error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_vec_as_names(r_obj* names,
                        r_obj* repair,
                        r_obj* ffi_quiet,
                        r_obj* frame) {
  if (!r_is_bool(ffi_quiet)) {
    r_abort("`quiet` must a boolean value.");
  }
  bool quiet = r_lgl_get(ffi_quiet, 0);

  struct r_lazy call = (struct r_lazy) { .x = r_syms.call, .env = frame };
  struct r_lazy repair_arg = { .x = syms.repair_arg, .env = frame };

  struct name_repair_opts repair_opts = new_name_repair_opts(repair,
                                                             repair_arg,
                                                             quiet,
                                                             call);
  KEEP(repair_opts.shelter);

  r_obj* out = vec_as_names(names, &repair_opts);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:25

ffi_vec_bare_df_restore typed entry .Call fuzz ok

([any_sexp, any_sexp] -> any_sexp)&([any_sexp, LGL<> | null] -> empty)
timing: 0.020 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: LGL<> | null) -> empty) & ((x1: any_sexp, x2: any_sexp) -> any_sexp)

Other calls inside the domain

callverdicterror
ffi_vec_bare_df_restore(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_bare_df_restore: Attempt to restore data frame from a NULL. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error, please report it to the package authors.
ffi_vec_bare_df_restore(new.env(), as.name("x"))error_pkg::ffi_vec_bare_df_restore: Attempt to restore data frame from a environment. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error, please report it to the package authors.
ffi_vec_bare_df_restore(as.name("x"), as.name("x"))error_pkg::ffi_vec_bare_df_restore: Attempt to restore data frame from a symbol. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error, please report it to the package authors.
source
r_obj* ffi_vec_bare_df_restore(r_obj* x, r_obj* to) {
  // Never own user objects
  const struct vec_restore_opts opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };
  return vec_bare_df_restore(x, to, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:266

ffi_vec_case_when typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, null, any_sexp, null, any_sexp] | [any_sexp, any_sexp, any_sexp, null, any_sexp, <...> | p(CHR) | sym, any_sexp] -> empty)&([null | { any_sexp }<>, <> | null | p(CHR) | sym, any_sexp, CHR | null, any_sexp, null, any_sexp] | [null | { any_sexp }<>, <> | null | p(CHR) | sym, any_sexp, CHR | null, any_sexp, <...> | p(CHR) | sym, any_sexp] -> any_sexp)
timing: 0.223 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: null, x5: any_sexp, x6: null, x7: any_sexp) | (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: null, x5: any_sexp, x6: p(CHR) | <...> | sym, x7: any_sexp) -> empty) & ((x1: { any_sexp }<> | null, x2: p(CHR) | <> | sym | null, x3: any_sexp, x4: CHR | null, x5: any_sexp, x6: null, x7: any_sexp) | (x1: { any_sexp }<> | null, x2: p(CHR) | <> | sym | null, x3: any_sexp, x4: CHR | null, x5: any_sexp, x6: p(CHR) | <...> | sym, x7: any_sexp) -> any_sexp)

Other calls inside the domain

callverdicterror
ffi_vec_case_when(NULL, c("x y", "é", "NA", "", ""), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c("x y", "a"), list(function(...) NULL), NULL, quote(f(x)))error_pkg::ffi_vec_case_when: 'rho' must be an environment not language: detected in C-level eval
ffi_vec_case_when(NULL, quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c("é", "x y"), new.env(), as.name("x"), c(0.5, 42))error_pkg::abort: could not find function "abort"
ffi_vec_case_when(NULL, quote(f(x)), new.env(), "", as.name("x"), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), NULL)error_pkg::abort: could not find function "abort"
source
r_obj* ffi_vec_case_when(
  r_obj* ffi_conditions,
  r_obj* ffi_values,
  r_obj* ffi_default,
  r_obj* ffi_unmatched,
  r_obj* ffi_ptype,
  r_obj* ffi_size,
  r_obj* ffi_frame
) {
  struct r_lazy conditions_arg_lazy = { .x = syms.conditions_arg, .env = ffi_frame };
  struct vctrs_arg conditions_arg = new_lazy_arg(&conditions_arg_lazy);

  struct r_lazy values_arg_lazy = { .x = syms.values_arg, .env = ffi_frame };
  struct vctrs_arg values_arg = new_lazy_arg(&values_arg_lazy);

  struct r_lazy default_arg_lazy = { .x = syms.default_arg, .env = ffi_frame };
  struct vctrs_arg default_arg = new_lazy_arg(&default_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  const r_ssize size = (ffi_size == r_null) ? -1 : r_arg_as_ssize(ffi_size, "size");
  const enum list_combine_unmatched unmatched = parse_list_combine_unmatched(ffi_unmatched, error_call);

  return vec_case_when(
    ffi_conditions,
    ffi_values,
    ffi_default,
    unmatched,
    ffi_ptype,
    size,
    &conditions_arg,
    &values_arg,
    &default_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/case-when.c:95

ffi_vec_chop typed entry .Call fuzz ok

([any_sexp, <...> | p(CHR) | sym, <...> | p(CHR) | sym] -> empty)&([<> | null | p(CHR) | sym, list | null, any_sexp] -> any_sexp)
timing: 0.029 s
fuzzing: 8 inside (7 ok, 1 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: p(CHR) | <...> | sym, x3: p(CHR) | <...> | sym) -> empty) & ((x1: p(CHR) | <> | sym | null, x2: list | null, x3: any_sexp) -> any_sexp)

Other calls inside the domain

callverdicterror
ffi_vec_chop(new.env(), list(list(list(), NULL), function(...) NULL), NULL)error_pkg::vec_size: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
r_obj* ffi_vec_chop(r_obj* x, r_obj* indices, r_obj* sizes) {
  return vec_chop(x, indices, sizes);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:167

ffi_vec_chop_seq typed entry .Call fuzz crash

[<> | null | p(CHR) | sym, INT, INT, LGL] -> any_sexp
timing: 1.34 s
fuzzing: 8 inside (1 ok, 5 error pkg, 2 crash) · 8 outside (8 rejected)
type drawn from: (x1: p(CHR) | <> | sym | null, x2: INT, x3: INT, x4: LGL) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_chop_seq(as.name("x"), integer(0), integer(0), c(FALSE, NA, FALSE, TRUE, NA))error_pkgInput must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_chop_seq(NULL, c(-1L, -2147483647L), 42L, TRUE)error_pkg::ffi_vec_chop_seq: `start` must not be negative. ℹ In file 'utils.c' at line 777. ℹ This is an internal error, please report it to the package authors.
ffi_vec_chop_seq(function(...) NULL, c(-2147483647L, 1L, -2147483647L, -1L, 1L), c(-1L, 42L, NA_integer_, 0L, 1000000L), NA)error_pkg::ffi_vec_chop_seq: `start` must not be negative. ℹ In file 'utils.c' at line 777. ℹ This is an internal error, please report it to the package authors.
ffi_vec_chop_seq(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), 0L, c(2147483647L, NA_integer_), logical(0))crash
ffi_vec_chop_seq(as.name("x"), 2147483647L, c(-1L, 0L, 42L, 42L, -1L), TRUE)error_pkg::ffi_vec_chop_seq: `size` must not be negative. ℹ In file 'utils.c' at line 781. ℹ This is an internal error, please report it to the package authors.
ffi_vec_chop_seq(as.name("x"), 1000000L, c(1L, 2147483647L, -2147483647L, NA_integer_, 2147483647L), logical(0))crash
and 1 more

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_vec_chop_seq(r_obj* x, r_obj* starts, r_obj* sizes, r_obj* increasings) {
  int* v_starts = r_int_begin(starts);
  int* v_sizes = r_int_begin(sizes);
  int* v_increasings = r_lgl_begin(increasings);

  const r_ssize n = r_length(starts);

  r_obj* indices = KEEP(r_alloc_list(n));

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* index = compact_seq(v_starts[i], v_sizes[i], v_increasings[i]);
    r_list_poke(indices, i, index);
  }

  r_obj* out = KEEP(vec_chop_unsafe(x, indices, r_null));

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:147

ffi_vec_compare typed entry .Call fuzz ok

([any_sexp, any_sexp, null] -> empty)&([any_sexp, any_sexp, LGL | null] -> any_sexp)
timing: 0.034 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: LGL | null) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: null) -> empty)

Other calls inside the domain

callverdicterror
ffi_vec_compare(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), FALSE)error_pkg::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_compare(function(...) NULL, function(...) new.env(), c(TRUE, TRUE, NA, TRUE, TRUE))error_pkgInput must be a single `TRUE` or `FALSE`.
ffi_vec_compare(as.name("x"), c(complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), NA_complex_), logical(0))error_pkgInput must be a single `TRUE` or `FALSE`.
source
r_obj* ffi_vec_compare(r_obj* x, r_obj* y, r_obj* ffi_na_equal) {
  const bool na_equal = r_bool_as_int(ffi_na_equal);
  return vec_compare(x, y, na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:74

ffi_vec_detect_run_bounds typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.015 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_detect_run_bounds(NULL, FALSE, quote(f(x)))error_pkg::abort: could not find function "abort"
ffi_vec_detect_run_bounds(as.name("x"), list(list(NULL, NULL), new.env()), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_vec_detect_run_bounds(quote(f(x)), list(list()), as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_detect_run_bounds(list(), list(), as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_detect_run_bounds(complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0), new.env())error_pkg::abort: could not find function "abort"
ffi_vec_detect_run_bounds(function(...) as.raw(c(255)), new.env(), as.raw(c(0, 0, 0, 255, 255)))error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_vec_detect_run_bounds(r_obj* x, r_obj* ffi_start, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  const enum vctrs_run_bound which = as_run_bound(ffi_start, error_call);
  return vec_detect_run_bounds(x, which, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:13

ffi_vec_equal typed entry .Call fuzz ok

[any_sexp, any_sexp, LGL, any_sexp, any_sexp] -> any_sexp
timing: 0.042 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: LGL, x4: any_sexp, x5: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_equal(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), logical(0), c(NA, TRUE), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list())error_pkg::abort: could not find function "abort"
ffi_vec_equal(as.name("x"), function(...) list(quote(f(x))), logical(0), function(...) raw(0), c(-2147483647L, 2147483647L, 1L, 0L, -1L))error_pkg::abort: could not find function "abort"
ffi_vec_equal(list(as.name("x")), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), logical(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_vec_equal(NULL, as.name("x"), logical(0), numeric(0), function(...) as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_equal(quote(f(x)), c(complex(real = 1, imaginary = -2), complex(real = 1, imaginary = -2)), logical(0), function(...) function(...) NULL, as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_equal(0, quote(f(x)), NA, quote(f(x)), function(...) new.env())error_pkg::abort: could not find function "abort"
and 2 more
source
SEXP ffi_vec_equal(
  SEXP ffi_x,
  SEXP ffi_y,
  SEXP ffi_na_equal,
  SEXP ffi_ptype,
  SEXP ffi_frame
) {
  struct r_lazy error_call = { .x = ffi_frame, .env = r_null };

  const bool na_equal = r_arg_as_bool(ffi_na_equal, "na_equal");

  return vec_equal(
    ffi_x,
    ffi_y,
    na_equal,
    ffi_ptype,
    vec_args.x,
    vec_args.y,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:8

ffi_vec_expand_grid typed entry .Call fuzz ok

([any_sexp, null, any_sexp, any_sexp] -> empty)&([any_sexp, CHR | null, CHR | null, any_sexp] -> any_sexp)
timing: 0.073 s
fuzzing: 7 inside (5 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: CHR | null, x3: CHR | null, x4: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: null, x3: any_sexp, x4: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_vec_expand_grid(as.name("x"), c(NA_character_, NA_character_, "NA", "x y", "x y"), c("x y", "x y", NA_character_, "x y", "NA"), list(character(0)))error_pkg::ffi_vec_expand_grid: `vary` must be a string. ℹ In file 'expand.c' at line 122. ℹ This is an internal error, please report it to the package authors.
ffi_vec_expand_grid(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "", "", as.raw(c(255)))error_pkg::ffi_vec_expand_grid: `vary` must be either "slowest" or "fastest". ℹ In file 'expand.c' at line 130. ℹ This is an internal error, please report it to the package authors.
source
r_obj* ffi_vec_expand_grid(r_obj* xs,
                           r_obj* ffi_vary,
                           r_obj* ffi_name_repair,
                           r_obj* frame) {
  struct r_lazy error_call = { .x = syms.dot_error_call, .env = frame };

  enum vctrs_expand_vary vary = parse_vary(ffi_vary);

  struct name_repair_opts name_repair_opts = new_name_repair_opts(
    ffi_name_repair,
    lazy_args.dot_name_repair,
    false,
    error_call
  );
  KEEP(name_repair_opts.shelter);

  r_obj* out = vec_expand_grid(xs, vary, &name_repair_opts, error_call);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/expand.c:6

ffi_vec_identify_runs typed entry .Call fuzz ok

[any_sexp, any_sexp] -> any_sexp
timing: 0.011 s
fuzzing: 8 inside (1 ok, 7 error pkg) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_identify_runs(function(...) new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::abort: `call` must be a call or environment, not a pointer.
ffi_vec_identify_runs(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_vec_identify_runs(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(as.name("x"), NULL))error_pkgrlang::abort: When a list, `call` must have "call" and "frame" names.
ffi_vec_identify_runs(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env())error_pkg`x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_identify_runs(NULL, NULL)error_pkg`x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_identify_runs(as.name("x"), quote(f(x)))error_pkg::f: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
and 1 more
source
r_obj* ffi_vec_identify_runs(r_obj* x, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  return vec_identify_runs(x, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:80

ffi_vec_if_else typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.100 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: any_sexp, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_if_else(function(...) NULL, quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), NULL, as.name("x"))error_pkg::ffi_vec_if_else: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_if_else(new.env(), list(function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), NULL, as.name("x"), function(...) raw(0), function(...) NULL)error_pkg::ffi_vec_if_else: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_if_else(NULL, quote(f(x)), as.raw(c(255)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(), function(...) new.env())error_pkg::ffi_vec_if_else: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_if_else(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), function(...) c("a", "a", "é", NA_character_, "a"), as.name("x"), quote(f(x)), FALSE)error_pkg::ffi_vec_if_else: 'rho' must be an environment not logical: detected in C-level eval
ffi_vec_if_else(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(as.name("x")), function(...) NULL, list(quote(f(x)), list()), c("é", NA_character_, "", NA_character_, "a"), list())error_pkg::ffi_vec_if_else: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_if_else(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(), as.name("x"), new.env())error_pkgobject 'error_call' not found
and 2 more
source
r_obj* ffi_vec_if_else(
  r_obj* ffi_condition,
  r_obj* ffi_true,
  r_obj* ffi_false,
  r_obj* ffi_missing,
  r_obj* ffi_ptype,
  r_obj* ffi_frame
) {
  struct r_lazy condition_arg_lazy = { .x = syms.condition_arg, .env = ffi_frame };
  struct vctrs_arg condition_arg = new_lazy_arg(&condition_arg_lazy);

  struct r_lazy true_arg_lazy = { .x = syms.true_arg, .env = ffi_frame };
  struct vctrs_arg true_arg = new_lazy_arg(&true_arg_lazy);

  struct r_lazy false_arg_lazy = { .x = syms.false_arg, .env = ffi_frame };
  struct vctrs_arg false_arg = new_lazy_arg(&false_arg_lazy);

  struct r_lazy missing_arg_lazy = { .x = syms.missing_arg, .env = ffi_frame };
  struct vctrs_arg missing_arg = new_lazy_arg(&missing_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  return vec_if_else(
    ffi_condition,
    ffi_true,
    ffi_false,
    ffi_missing,
    ffi_ptype,
    &condition_arg,
    &true_arg,
    &false_arg,
    &missing_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:6

ffi_vec_locate_run_bounds typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> INT
timing: 0.019 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> INT

Other calls inside the domain

callverdicterror
ffi_vec_locate_run_bounds(as.name("x"), NULL, new.env())error_pkg::abort: could not find function "abort"
ffi_vec_locate_run_bounds(list(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), function(...) as.name("x"), character(0))error_pkg::abort: could not find function "abort"
ffi_vec_locate_run_bounds(function(...) as.name("x"), as.name("x"), list())error_pkgrlang::abort: When a list, `call` must have "call" and "frame" names.
ffi_vec_locate_run_bounds(list(new.env()), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_locate_run_bounds(as.name("x"), function(...) NULL, as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_locate_run_bounds(as.name("x"), "é", NULL)error_pkg`which` must be one of "start" or "end", not "é".
and 2 more
source
r_obj* ffi_vec_locate_run_bounds(r_obj* x, r_obj* ffi_start, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  const enum vctrs_run_bound which = as_run_bound(ffi_start, error_call);
  return vec_locate_run_bounds(x, which, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:40

ffi_vec_pall typed entry .Call fuzz ok

([any_sexp, null, any_sexp, any_sexp] -> empty)&([any_sexp, LGL | null, null, any_sexp] | [any_sexp, LGL | null, <...> | p(CHR) | sym, any_sexp] -> any_sexp)
timing: 0.078 s
fuzzing: 8 inside (4 ok, 4 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: LGL | null, x3: null, x4: any_sexp) | (x1: any_sexp, x2: LGL | null, x3: p(CHR) | <...> | sym, x4: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: null, x3: any_sexp, x4: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_vec_pall(NULL, FALSE, NULL, function(...) function(...) as.name("x"))error_pkg::ffi_vec_pall: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_pall(as.name("x"), c(FALSE, FALSE), list(NULL), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_pall(function(...) list(function(...) quote(f(x))), TRUE, NULL, list())error_pkg::ffi_vec_pall: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_pall(c(2147483647L, NA_integer_), c(FALSE, TRUE, FALSE, FALSE, FALSE), NULL, list(c(TRUE, NA, FALSE, TRUE, NA), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkg::ffi_vec_pall: 'rho' must be an environment not list: detected in C-level eval
source
r_obj* ffi_vec_pall(r_obj* ffi_xs, r_obj* ffi_missing, r_obj* ffi_size, r_obj* ffi_frame) {
  struct r_lazy xs_arg_lazy = { .x = syms.dot_arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  const struct r_lazy error_call = { .x = syms.dot_error_call, .env = ffi_frame };

  const enum vec_parallel_missing missing = parse_vec_parallel_missing(ffi_missing, error_call);
  const r_ssize size = (ffi_size == r_null) ? -1 : r_arg_as_ssize(ffi_size, ".size");

  return vec_pall(ffi_xs, missing, size, &xs_arg, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:24

ffi_vec_pany typed entry .Call fuzz ok

([any_sexp, null, any_sexp, any_sexp] -> empty)&([any_sexp, LGL | null, null, any_sexp] | [any_sexp, LGL | null, <...> | p(CHR) | sym, any_sexp] -> any_sexp)
timing: 0.076 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: LGL | null, x3: null, x4: any_sexp) | (x1: any_sexp, x2: LGL | null, x3: p(CHR) | <...> | sym, x4: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: null, x3: any_sexp, x4: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_vec_pany(function(...) function(...) as.name("x"), logical(0), NULL, new.env())error_pkgobject '.error_call' not found
ffi_vec_pany(NULL, c(NA, FALSE, TRUE, FALSE, NA), as.name("x"), list(NULL))error_pkg::ffi_vec_pany: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_pany(function(...) as.name("x"), c(TRUE, FALSE, FALSE, TRUE, TRUE), NULL, c(FALSE, TRUE, TRUE, FALSE, NA))error_pkg::ffi_vec_pany: 'rho' must be an environment not logical: detected in C-level eval
source
r_obj* ffi_vec_pany(r_obj* ffi_xs, r_obj* ffi_missing, r_obj* ffi_size, r_obj* ffi_frame) {
  struct r_lazy xs_arg_lazy = { .x = syms.dot_arg, .env = ffi_frame };
  struct vctrs_arg xs_arg = new_lazy_arg(&xs_arg_lazy);

  const struct r_lazy error_call = { .x = syms.dot_error_call, .env = ffi_frame };

  const enum vec_parallel_missing missing = parse_vec_parallel_missing(ffi_missing, error_call);
  const r_ssize size = (ffi_size == r_null) ? -1 : r_arg_as_ssize(ffi_size, ".size");

  return vec_pany(ffi_xs, missing, size, &xs_arg, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:12

ffi_vec_recode_values typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, any_sexp, null, LGL, LGL, any_sexp, any_sexp] -> empty)&([any_sexp, any_sexp, any_sexp, any_sexp, CHR | null, LGL, LGL, any_sexp, any_sexp] -> any_sexp)
timing: 0.586 s
fuzzing: 8 inside (4 ok, 4 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: CHR | null, x6: LGL, x7: LGL, x8: any_sexp, x9: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: null, x6: LGL, x7: LGL, x8: any_sexp, x9: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
ffi_vec_recode_values(c(Inf, 0, -2.5, -2147483647, 0), complex(real = 0, imaginary = 0), NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "é", c(FALSE, TRUE), c(TRUE, TRUE), quote(f(x)), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_recode_values(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, quote(f(x)), function(...) function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "", logical(0), c(NA, NA, NA, FALSE, TRUE), new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_vec_recode_values(list(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), function(...) as.name("x"), function(...) numeric(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "", FALSE, FALSE, NULL, c(-2.5, 42, NaN, 1, NA_real_))error_pkg::ffi_vec_recode_values: 'rho' must be an environment not double: detected in C-level eval
ffi_vec_recode_values(as.raw(c(0)), NULL, list(), as.name("x"), character(0), FALSE, logical(0), new.env(), NULL)error_pkg::abort: could not find function "abort"
source
r_obj* ffi_vec_recode_values(
  r_obj* ffi_x,
  r_obj* ffi_from,
  r_obj* ffi_to,
  r_obj* ffi_default,
  r_obj* ffi_unmatched,
  r_obj* ffi_from_as_list_of_vectors,
  r_obj* ffi_to_as_list_of_vectors,
  r_obj* ffi_ptype,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy from_arg_lazy = { .x = syms.from_arg, .env = ffi_frame };
  struct vctrs_arg from_arg = new_lazy_arg(&from_arg_lazy);

  struct r_lazy to_arg_lazy = { .x = syms.to_arg, .env = ffi_frame };
  struct vctrs_arg to_arg = new_lazy_arg(&to_arg_lazy);

  struct r_lazy default_arg_lazy = { .x = syms.default_arg, .env = ffi_frame };
  struct vctrs_arg default_arg = new_lazy_arg(&default_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  const bool from_as_list_of_vectors = r_arg_as_bool(ffi_from_as_list_of_vectors, "from_as_list_of_vectors");
  const bool to_as_list_of_vectors = r_arg_as_bool(ffi_to_as_list_of_vectors, "to_as_list_of_vectors");

  const enum list_combine_unmatched unmatched = parse_list_combine_unmatched(ffi_unmatched, error_call);

  return vec_recode_values(
    ffi_x,
    ffi_from,
    ffi_to,
    ffi_default,
    unmatched,
    from_as_list_of_vectors,
    to_as_list_of_vectors,
    &x_arg,
    &from_arg,
    &to_arg,
    &default_arg,
    ffi_ptype,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:299

ffi_vec_rep_each typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.054 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_rep_each(list(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_rep_each: 'rho' must be an environment not externalptr: detected in C-level eval
ffi_vec_rep_each(as.name("x"), NA, as.name("x"))error_pkg::ffi_vec_rep_each: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_rep_each(as.name("x"), NULL, function(...) FALSE)error_pkg::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_rep_each(as.name("x"), NULL, list())error_pkg::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_rep_each(as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), character(0))error_pkg::ffi_vec_rep_each: 'rho' must be an environment not character: detected in C-level eval
ffi_vec_rep_each(function(...) as.name("x"), as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_rep_each: 'rho' must be an environment not externalptr: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_rep_each(r_obj* x, r_obj* times, r_obj* frame) {
  struct r_lazy error_call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.times_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy times_arg_lazy = { .x = syms.times_arg, .env = frame };
  struct vctrs_arg times_arg = new_lazy_arg(&times_arg_lazy);

  return vec_rep_each(x, times, error_call, &x_arg, &times_arg);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:109

ffi_vec_replace_values typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, LGL, LGL, any_sexp] -> any_sexp
timing: 0.313 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: LGL, x5: LGL, x6: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_replace_values(as.raw(c(0, 0)), new.env(), list(NULL, new.env()), c(FALSE, NA), TRUE, function(...) quote(f(x)))error_pkg::abort: could not find function "abort"
ffi_vec_replace_values(as.name("x"), function(...) function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c(NA, TRUE, FALSE, TRUE, TRUE), TRUE, as.name("x"))error_pkg::abort: could not find function "abort"
ffi_vec_replace_values(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), as.name("x"), NA, logical(0), 1000000)error_pkg::abort: could not find function "abort"
ffi_vec_replace_values(NULL, NULL, as.name("x"), NA, logical(0), function(...) function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
ffi_vec_replace_values(NULL, new.env(), NULL, NA, NA, list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkg::abort: could not find function "abort"
ffi_vec_replace_values(NULL, list(quote(f(x)), quote(f(x))), list(list(), function(...) NULL), logical(0), logical(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::abort: could not find function "abort"
and 2 more
source
r_obj* ffi_vec_replace_values(
  r_obj* ffi_x,
  r_obj* ffi_from,
  r_obj* ffi_to,
  r_obj* ffi_from_as_list_of_vectors,
  r_obj* ffi_to_as_list_of_vectors,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy from_arg_lazy = { .x = syms.from_arg, .env = ffi_frame };
  struct vctrs_arg from_arg = new_lazy_arg(&from_arg_lazy);

  struct r_lazy to_arg_lazy = { .x = syms.to_arg, .env = ffi_frame };
  struct vctrs_arg to_arg = new_lazy_arg(&to_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  const bool from_as_list_of_vectors = r_arg_as_bool(ffi_from_as_list_of_vectors, "from_as_list_of_vectors");
  const bool to_as_list_of_vectors = r_arg_as_bool(ffi_to_as_list_of_vectors, "to_as_list_of_vectors");

  return vec_replace_values(
    ffi_x,
    ffi_from,
    ffi_to,
    from_as_list_of_vectors,
    to_as_list_of_vectors,
    &x_arg,
    &from_arg,
    &to_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:346

ffi_vec_replace_when typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.095 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_replace_when(function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) NULL, quote(f(x)))error_pkg::ffi_vec_replace_when: 'rho' must be an environment not language: detected in C-level eval
ffi_vec_replace_when(quote(f(x)), quote(f(x)), list(list()), as.name("x"))error_pkg::ffi_vec_replace_when: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_replace_when(as.name("x"), as.name("x"), list(list(as.raw(c(255, 0, 0, 255, 0)))), as.raw(c(0, 255)))error_pkg::ffi_vec_replace_when: 'rho' must be an environment not raw: detected in C-level eval
ffi_vec_replace_when(NULL, as.raw(c(255)), as.name("x"), list(NULL))error_pkg::ffi_vec_replace_when: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_replace_when(as.name("x"), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)))error_pkg::ffi_vec_replace_when: 'rho' must be an environment not language: detected in C-level eval
ffi_vec_replace_when(function(...) NULL, NULL, quote(f(x)), list())error_pkg::ffi_vec_replace_when: 'rho' must be an environment not list: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_replace_when(
  r_obj* ffi_x,
  r_obj* ffi_conditions,
  r_obj* ffi_values,
  r_obj* ffi_frame
) {
  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = ffi_frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy conditions_arg_lazy = { .x = syms.conditions_arg, .env = ffi_frame };
  struct vctrs_arg conditions_arg = new_lazy_arg(&conditions_arg_lazy);

  struct r_lazy values_arg_lazy = { .x = syms.values_arg, .env = ffi_frame };
  struct vctrs_arg values_arg = new_lazy_arg(&values_arg_lazy);

  struct r_lazy error_call = { .x = r_syms.error_call, .env = ffi_frame };

  return vec_replace_when(
    ffi_x,
    ffi_conditions,
    ffi_values,
    &x_arg,
    &conditions_arg,
    &values_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/case-when.c:132

ffi_vec_restore typed entry .Call accepts outside

[any_sexp, <> | null | p(CHR) | sym] -> any_sexp
timing: 0.015 s
fuzzing: 7 inside (7 ok) · 8 outside (6 rejected, 1 accepted, 1 crash)
type drawn from: (x1: any_sexp, x2: p(CHR) | <> | sym | null) -> any_sexp

Accepted outside the domain x2: 1

parameterchangecallreturned
x2class:addffi_vec_restore(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), structure(list(), class = "fuzz_cls"))externalptr(empty)<fuzz_cls> with { }
source
r_obj* ffi_vec_restore(r_obj* x, r_obj* to) {
  // Never own user objects, so foreign ownership.
  // Hooked to `vec_restore()`, which is called after an R level non-recursive
  // `vec_proxy()`, so not recursively proxied.
  struct vec_restore_opts opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };
  return vec_restore_opts(x, to, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:5

ffi_vec_restore_default typed entry .Call fuzz ok

[any_sexp, any_sexp] -> any_sexp
timing: 0.006 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> any_sexp
source
r_obj* ffi_vec_restore_default(r_obj* x, r_obj* to) {
  // Never own user objects
  return vec_restore_default(x, to, VCTRS_OWNERSHIP_foreign);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:177

ffi_vec_restore_recurse typed entry .Call accepts outside

[any_sexp, <> | null | p(CHR) | sym] -> any_sexp
timing: 0.015 s
fuzzing: 8 inside (8 ok) · 6 outside (5 rejected, 1 accepted)
type drawn from: (x1: any_sexp, x2: p(CHR) | <> | sym | null) -> any_sexp

Accepted outside the domain x2: 1

parameterchangecallreturned
x2class:addffi_vec_restore_recurse(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), structure(quote(f(x)), class = "fuzz_cls"))externalptr(empty)<fuzz_cls> with { }
source
r_obj* ffi_vec_restore_recurse(r_obj* x, r_obj* to) {
  // Never own user objects, but we are restoring recursively here for testing purposes
  struct vec_restore_opts opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = true
  };
  return vec_restore_opts(x, to, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:17

ffi_vec_run_sizes typed entry .Call fuzz ok

[any_sexp, any_sexp] -> INT
timing: 0.015 s
fuzzing: 8 inside (3 ok, 5 error pkg) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> INT

Other calls inside the domain

callverdicterror
ffi_vec_run_sizes(NULL, NULL)error_pkg`x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_run_sizes(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_vec_run_sizes(as.name("x"), as.name("x"))error_pkgrlang::abort: `call` must be a call or environment, not a symbol.
ffi_vec_run_sizes(NULL, list(list(function(...) NULL, new.env()), as.name("x")))error_pkgrlang::abort: When a list, `call` must have "call" and "frame" names.
ffi_vec_run_sizes(NULL, function(...) quote(f(x)))error_pkgrlang::abort: `call` must be a call or environment, not a function.

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
r_obj* ffi_vec_run_sizes(r_obj* x, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  return vec_run_sizes(x, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:111

ffi_vec_set_difference typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.063 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_set_difference(as.name("x"), NULL, list(), -Inf)error_pkg::ffi_vec_set_difference: 'rho' must be an environment not double: detected in C-level eval
ffi_vec_set_difference(function(...) new.env(), list(new.env(), new.env()), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))error_pkg::ffi_vec_set_difference: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_difference(-2147483647L, as.name("x"), NULL, as.name("x"))error_pkg::ffi_vec_set_difference: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_difference(quote(f(x)), list(list(as.name("x"))), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) quote(f(x))), as.name("x"))error_pkg::ffi_vec_set_difference: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_difference(as.name("x"), NULL, function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_set_difference(quote(f(x)), NA_integer_, list(), function(...) list(new.env()))error_pkg::ffi_vec_set_difference: 'rho' must be an environment not closure: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_set_difference(r_obj* x,
                              r_obj* y,
                              r_obj* ptype,
                              r_obj* frame) {
  struct r_lazy call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy y_arg_lazy = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_lazy);

  return vec_set_difference(x, y, ptype, &x_arg, &y_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:166

ffi_vec_set_intersect typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.057 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_set_intersect(function(...) NULL, quote(f(x)), function(...) NA_complex_, as.name("x"))error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_intersect(FALSE, new.env(), NA_complex_, function(...) quote(f(x)))error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_set_intersect(as.name("x"), new.env(), quote(f(x)), complex(0))error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not complex: detected in C-level eval
ffi_vec_set_intersect(quote(f(x)), NULL, function(...) complex(real = 0, imaginary = 0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not externalptr: detected in C-level eval
ffi_vec_set_intersect(NULL, NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) NULL)error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_set_intersect(new.env(), logical(0), quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_set_intersect: 'rho' must be an environment not externalptr: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_set_intersect(r_obj* x,
                             r_obj* y,
                             r_obj* ptype,
                             r_obj* frame) {
  struct r_lazy call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy y_arg_lazy = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_lazy);

  return vec_set_intersect(x, y, ptype, &x_arg, &y_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:12

ffi_vec_set_symmetric_difference typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.058 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_set_symmetric_difference(-2.5, list(function(...) quote(f(x))), quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::ffi_vec_set_symmetric_difference: 'rho' must be an environment not externalptr: detected in C-level eval
ffi_vec_set_symmetric_difference(NULL, as.name("x"), character(0), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_set_symmetric_difference(complex(real = 1, imaginary = -2), new.env(), list(), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_set_symmetric_difference(as.raw(c(0)), quote(f(x)), new.env(), function(...) new.env())error_pkg::ffi_vec_set_symmetric_difference: 'rho' must be an environment not closure: detected in C-level eval
ffi_vec_set_symmetric_difference(logical(0), function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c(1L, NA_integer_, 2L, 2147483647L, 1000000L))error_pkg::ffi_vec_set_symmetric_difference: 'rho' must be an environment not integer: detected in C-level eval
ffi_vec_set_symmetric_difference(as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), function(...) NULL)error_pkg::ffi_vec_set_symmetric_difference: 'rho' must be an environment not closure: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_set_symmetric_difference(r_obj* x,
                                        r_obj* y,
                                        r_obj* ptype,
                                        r_obj* frame) {
  struct r_lazy call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy y_arg_lazy = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_lazy);

  return vec_set_symmetric_difference(x, y, ptype, &x_arg, &y_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:573

ffi_vec_set_union typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.057 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_set_union(as.name("x"), "é", quote(f(x)), NULL)error_pkg::abort: could not find function "abort"
ffi_vec_set_union(NULL, function(...) NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list())error_pkg::ffi_vec_set_union: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_set_union(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL, quote(f(x)), list(as.name("x"), list(list(as.raw(c(0, 255))))))error_pkg::ffi_vec_set_union: 'rho' must be an environment not list: detected in C-level eval
ffi_vec_set_union(as.name("x"), NULL, quote(f(x)), as.name("x"))error_pkg::ffi_vec_set_union: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_union(as.name("x"), NULL, c(TRUE, TRUE, NA, FALSE, TRUE), as.name("x"))error_pkg::ffi_vec_set_union: 'rho' must be an environment not symbol: detected in C-level eval
ffi_vec_set_union(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)), list())error_pkg::ffi_vec_set_union: 'rho' must be an environment not list: detected in C-level eval
and 2 more
source
r_obj* ffi_vec_set_union(r_obj* x,
                         r_obj* y,
                         r_obj* ptype,
                         r_obj* frame) {
  struct r_lazy call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy y_arg_lazy = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_lazy);

  return vec_set_union(x, y, ptype, &x_arg, &y_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:323

ffi_vec_shape2 typed entry .Call fuzz ok

[any_sexp, any_sexp, any_sexp] -> any_sexp
timing: 0.072 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp, x3: any_sexp) -> any_sexp
source
r_obj* ffi_vec_shape2(r_obj* x, r_obj* y, r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  return vec_shape2(x, y, &x_arg, &y_arg);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:39

ffi_vec_shaped_ptype typed entry .Call fuzz ok

∀'a. [any_sexp & 'a, any_sexp, any_sexp, any_sexp] -> any_sexp & 'a
timing: 0.080 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: (x1: 'I65363 & any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp) -> any_sexp & 'I65363
source
r_obj* ffi_vec_shaped_ptype(r_obj* ptype, r_obj* x, r_obj* y, r_obj* frame) {
  struct r_lazy x_arg_ = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_);

  struct r_lazy y_arg_ = { .x = syms.y_arg, .env = frame };
  struct vctrs_arg y_arg = new_lazy_arg(&y_arg_);

  return vec_shaped_ptype(ptype, x, y, &x_arg, &y_arg);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:4

ffi_vec_unrep typed entry .Call fuzz ok

[any_sexp, any_sexp] -> any_sexp
timing: 0.015 s
fuzzing: 8 inside (3 ok, 5 error pkg) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp, x2: any_sexp) -> any_sexp

Other calls inside the domain

callverdicterror
ffi_vec_unrep(new.env(), quote(f(x)))error_pkg::f: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_unrep(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env())error_pkg`x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_unrep(quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgrlang::abort: `call` must be a call or environment, not a pointer.
ffi_vec_unrep(NULL, NULL)error_pkg`x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
ffi_vec_unrep(new.env(), list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x))))error_pkgrlang::abort: When a list, `call` must have "call" and "frame" names.
source
r_obj* ffi_vec_unrep(r_obj* x, r_obj* frame) {
  struct r_lazy error_call = { .x = frame, .env = r_null };
  return vec_unrep(x, error_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:378

FILL typed any: arg 1, arg 2, arg 3, arg 4, arg 6

[any, any, any, any, c_int_na, any] -> ()
timing: 0.831 s
(definition not located in src/)

fill_arg_buffer typed

([c_null, c_string, c_int_na, c_int_na] -> empty)&([*struct vctrs_arg, c_string, c_int_na, c_int_na] \ [c_null, c_string, c_int_na, c_int_na] -> c_int_na)
timing: 0.605 s
source
int fill_arg_buffer(struct vctrs_arg* arg,
                    char* buf,
                    r_ssize cur_size,
                    r_ssize tot_size) {
  if (arg->parent) {
    cur_size = fill_arg_buffer(arg->parent, buf, cur_size, tot_size);

    if (cur_size < 0) {
      return cur_size;
    }
  }

  r_ssize written = arg->fill(arg->data, buf + cur_size, tot_size - cur_size);

  if (written < 0) {
    return written;
  } else {
    return cur_size + written;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:61

find_offset typed

([any_sexp, ^INT1] -> c_int)&([any_sexp, ((CLX | LGL | RAW) | (~vec)<...>) | null | sym] -> empty)&([any_sexp, DBL] | [any_sexp, INT] -> c_int_na)
timing: 7.96 s
source
int find_offset(SEXP x, SEXP index) {
  if (Rf_length(index) != 1) {
    Rf_errorcall(R_NilValue, "Invalid index: must have length 1");
  }

  int n = Rf_length(x);

  if (TYPEOF(index) == INTSXP) {
    int val = INTEGER(index)[0];

    if (val == NA_INTEGER)
      Rf_errorcall(R_NilValue, "Invalid index: NA_integer_");

    val--;
    if (val < 0 || val >= n)
      Rf_errorcall(R_NilValue, "Invalid index: out of bounds");

    return val;
  } else if (TYPEOF(index) == REALSXP) {
    double val = REAL(index)[0];

    if (R_IsNA(val))
      Rf_errorcall(R_NilValue, "Invalid index: NA_real_");

    val--;
    if (val < 0 || val >= n)
      Rf_errorcall(R_NilValue, "Invalid index: out of bounds");

    if (val > R_LEN_T_MAX) {
      Rf_errorcall(R_NilValue, "Invalid index: too large");
    }

    return (int) val;
  } else if (TYPEOF(index) == STRSXP) {
    SEXP names = PROTECT(Rf_getAttrib(x, R_NamesSymbol));
    if (names == R_NilValue)
      Rf_errorcall(R_NilValue, "Corrupt x: no names");

    SEXP val_0 = STRING_ELT(index, 0);
    if (val_0 == NA_STRING)
      Rf_errorcall(R_NilValue, "Invalid index: NA_character_");

    const char* val_0_chr = Rf_translateCharUTF8(val_0);
    if (val_0_chr[0] == '\0')
      Rf_errorcall(R_NilValue, "Invalid index: empty string");

    for (int j = 0; j < Rf_length(names); ++j) {
      SEXP name_j = STRING_ELT(names, j);
      if (name_j == NA_STRING)
        Rf_errorcall(R_NilValue, "Corrupt x: element %i is unnamed", j + 1);

      if (equal_string(val_0, &val_0_chr, name_j)) {
        UNPROTECT(1);
        return j;
      }
    }
    Rf_errorcall(R_NilValue, "Invalid index: field name '%s' not found", val_0_chr);
  } else {
    Rf_errorcall(R_NilValue, "Invalid index: must be a character or numeric vector");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:20

fn_hash typed

[arrow] -> c_int_na
timing: 0.035 s
source
static inline uint32_t fn_hash(r_obj* x) {
  uint32_t hash = 0;
  hash = hash_combine(hash, obj_hash(r_fn_body(x)));
  hash = hash_combine(hash, obj_hash(r_fn_env(x)));
  hash = hash_combine(hash, obj_hash(r_fn_formals(x)));
  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:121

generate_sys_call typed

[c_string, *(*c_int_na)] -> lang
timing: 0.039 s
source
static r_obj* generate_sys_call(const char* name, int** n_addr) {
  r_obj* sys_n = KEEP(r_int(0));
  *n_addr = r_int_begin(sys_n);

  r_obj* sys_args = KEEP(r_new_node(sys_n, r_null));
  r_obj* sys_call = KEEP(r_new_call(r_base_ns_get(name), sys_args));
  r_preserve(sys_call);

  FREE(3);
  return sys_call;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/stack.c:65

get_opts_action typed

([*struct subscript_opts] -> any_sexp)&([c_null] -> empty)
timing: 0.308 s
source
static inline SEXP get_opts_action(const struct subscript_opts* opts) {
  switch (opts->action) {
  case SUBSCRIPT_ACTION_DEFAULT: return R_NilValue;
  case SUBSCRIPT_ACTION_SUBSET: return chrs_subset;
  case SUBSCRIPT_ACTION_EXTRACT: return chrs_extract;
  case SUBSCRIPT_ACTION_ASSIGN: return chrs_assign;
  case SUBSCRIPT_ACTION_RENAME: return chrs_rename;
  case SUBSCRIPT_ACTION_REMOVE: return chrs_remove;
  case SUBSCRIPT_ACTION_NEGATE: return chrs_negate;
  }
  never_reached("get_opts_action");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.h:50

group_realloc typed empty return

[c_int_na, c_null] -> empty
timing: 0.321 s
source
void group_realloc(r_ssize size, struct group_info* p_group_info) {
  // Reallocate
  p_group_info->data = int_resize(
    p_group_info->data,
    p_group_info->data_size,
    size
  );

  // Reprotect
  REPROTECT(p_group_info->data, p_group_info->data_pi);

  // Update pointer
  p_group_info->p_data = INTEGER(p_group_info->data);

  // Update size
  p_group_info->data_size = size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:108

groups_current typed

([*struct group_infos] -> *struct group_info)&([c_null] -> empty)
timing: 0.131 s
source
struct group_info* groups_current(struct group_infos* p_group_infos) {
  return p_group_infos->p_p_group_info[p_group_infos->current];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.h:124

groups_realloc_size typed

[c_false, c_int_na] | [c_int_na \ c_false, c_int_na] -> c_int_na
timing: 0.037 s
source
r_ssize groups_realloc_size(r_ssize data_size, r_ssize max_data_size) {
  uint64_t new_data_size;

  if (data_size == 0) {
    // First allocation
    new_data_size = GROUP_DATA_SIZE_DEFAULT;
  } else {
    // Avoid potential overflow when doubling size
    new_data_size = ((uint64_t) data_size) * 2;
  }

  // Clamp maximum allocation size to the size of the input
  if (new_data_size > max_data_size) {
    return max_data_size;
  }

  // Can now safely cast back to `r_ssize`
  return (r_ssize) new_data_size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:129

groups_size_maybe_push typed

([c_false, *struct group_infos] -> ())&([c_int_na, c_null] -> empty)
timing: 0.074 s
source
void groups_size_maybe_push(r_ssize size, struct group_infos* p_group_infos) {
  if (p_group_infos->ignore_groups) {
    return;
  } else {
    groups_size_push(size, p_group_infos);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.h:138

groups_size_push typed empty return

[c_false, *struct group_infos] | [c_int_na \ c_false, c_null] -> empty
timing: 0.208 s
source
void groups_size_push(r_ssize size, struct group_infos* p_group_infos) {
  if (size == 0) {
    Rf_errorcall(R_NilValue, "Internal error: Group `size` to push should never be zero.");
  }

  struct group_info* p_group_info = groups_current(p_group_infos);

  // Extend `data` as required - reprotects itself
  if (p_group_info->data_size == p_group_info->n_groups) {
    r_ssize new_data_size = groups_realloc_size(
      p_group_info->data_size,
      p_group_infos->max_data_size
    );

    group_realloc(new_data_size, p_group_info);
  }

  // Push group size
  p_group_info->p_data[p_group_info->n_groups] = size;

  // Bump number of groups
  ++p_group_info->n_groups;

  // Update max group size
  if (p_group_info->max_group_size < size) {
    p_group_info->max_group_size = size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:73

groups_swap typed empty return

[c_null] -> empty
timing: 0.464 s
source
void groups_swap(struct group_infos* p_group_infos) {
  if (p_group_infos->ignore_groups) {
    return;
  }

  struct group_info* p_group_info_pre = groups_current(p_group_infos);

  // Make the swap
  p_group_infos->current = 1 - p_group_infos->current;

  struct group_info* p_group_info_post = groups_current(p_group_infos);

  // Clear the info from last time the swap was made
  p_group_info_post->max_group_size = 0;
  p_group_info_post->n_groups = 0;

  // Ensure the new group info is at least as big as the old group info
  if (p_group_info_post->data_size < p_group_info_pre->data_size) {
    r_ssize new_data_size = p_group_info_pre->data_size;
    group_realloc(new_data_size, p_group_info_post);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:160

growable_push_int typed empty return

[c_null, c_int_na] -> empty
timing: 2.13 s
source
static inline void growable_push_int(struct growable* g, int i) {
  if (g->n == g->capacity) {
    g->capacity *= 2;
    g->x = Rf_lengthgets(g->x, g->capacity);
    REPROTECT(g->x, g->idx);
    g->array = INTEGER(g->x);
  }

  int* p = (int*) g->array;
  p[g->n] = i;
  ++(g->n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vctrs.h:223

growable_values typed

([c_null] -> empty)&([*struct growable] \ [c_null] -> any_sexp)
timing: 1.04 s
source
SEXP growable_values(struct growable* g) {
  return Rf_lengthgets(g->x, g->n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/growable.c:15

hash_combine typed

([c_int_na, c_int] -> c_int)&([c_int_na, c_int_na] -> c_int_na)
timing: 0.067 s
source
static inline uint32_t hash_combine(uint32_t x, uint32_t y) {
  return x ^ (y + 0x9e3779b9 + (x << 6) + (x >> 2));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:23

indices_next typed

∀'a. ([*struct vctrs_chop_indices({ shelter : any_sexp ; index : any_sexp & 'a ; indices : any_sexp ; sizes : any_sexp })] -> any_sexp | 'a)&([c_null] -> empty)
timing: 1.36 s
source
r_obj* indices_next(struct vctrs_chop_indices* p_indices) {
  const r_ssize loc = p_indices->loc;
  ++(p_indices->loc);

  if (p_indices->has_indices) {
    return p_indices->v_indices[loc];
  } else if (p_indices->has_sizes) {
    const r_ssize start = p_indices->p_index[0] + p_indices->p_index[1];
    const r_ssize size = p_indices->v_sizes[loc];
    const bool increasing = true;
    init_compact_seq(p_indices->p_index, start, size, increasing);
    return p_indices->index;
  } else {
    *p_indices->p_index = loc + 1;
    return p_indices->index;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:116

indices_out_size typed

([*struct vctrs_chop_indices, any_sexp] -> c_int_na)&([c_null, any_sexp] -> empty)
timing: 2.15 s
source
r_ssize indices_out_size(struct vctrs_chop_indices* p_indices, r_obj* x) {
  if (p_indices->has_indices) {
    return r_length(p_indices->indices);
  } else if (p_indices->has_sizes) {
    return r_length(p_indices->sizes);
  } else {
    return vec_size(x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:135

INIT_ARG typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

init_bare_data_frame typed

[any_sexp, c_int_na] -> ()
timing: 0.114 s
source
void init_bare_data_frame(r_obj* x, r_ssize n) {
  if (r_length(x) == 0) {
    r_attrib_poke(x, r_syms.names, r_globals.empty_chr);
  }

  init_compact_rownames(x, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:464

INIT_CALL typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

init_chr_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : CHR })] -> ())&([c_null] -> empty)
timing: 0.091 s
source
void init_chr_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_chr_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:91

init_compact_rep typed

([*c_int_na, c_int_na, c_int_na] -> ())&([c_null, c_int_na, c_int_na] -> empty)
timing: 0.035 s
source
void init_compact_rep(int* p, R_len_t i, R_len_t n) {
  p[0] = i;
  p[1] = n;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:825

init_compact_rownames typed

[any_sexp, c_int_na] -> ()
timing: 0.025 s
source
void init_compact_rownames(r_obj* x, r_ssize n_rows) {
  r_obj* rn = KEEP(new_compact_rownames(n_rows));
  r_attrib_poke(x, r_syms.row_names, rn);
  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/df.c:43

init_compact_seq typed

([*c_int_na, c_int_na, c_int_na, c_false] | [*c_int_na, c_int_na, c_int_na, c_int_na \ c_false] -> ())&([c_null, c_int_na, c_int_na, c_false] | [c_null, c_int_na, c_int_na, c_int_na \ c_false] -> empty)
timing: 0.095 s
source
void init_compact_seq(int* p, R_len_t start, R_len_t size, bool increasing) {
  int step = increasing ? 1 : -1;

  p[0] = start;
  p[1] = size;
  p[2] = step;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:754

init_cpl_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : CLX })] -> ())&([c_null] -> empty)
timing: 0.093 s
source
void init_cpl_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_cpl_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:87

init_data_frame typed

[any_sexp, c_int_na] -> ()
timing: 0.018 s
source
void init_data_frame(r_obj* x, r_ssize n) {
  r_attrib_poke(x, r_syms.class_, classes_data_frame);
  init_bare_data_frame(x, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:453

init_dbl_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : DBL })] -> ())&([c_null] -> empty)
timing: 0.088 s
source
void init_dbl_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_dbl_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:83

init_factor typed

([INT, any_sexp] -> ())&([((CHR | CLX | DBL | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.094 s
source
static void init_factor(SEXP x, SEXP levels) {
  if (TYPEOF(x) != INTSXP) {
    r_stop_internal("Only integers can be made into factors.");
  }

  Rf_setAttrib(x, R_LevelsSymbol, levels);
  Rf_setAttrib(x, R_ClassSymbol, classes_factor);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:398

init_int_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : INT })] -> ())&([c_null] -> empty)
timing: 0.097 s
source
void init_int_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_int_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:79

init_lazy_raw typed

([*struct lazy_raw({ data : <...> | p(CHR) | sym ; self : any_sexp })] -> c_ptr)&([c_null] -> empty)
timing: 0.935 s
source
void* init_lazy_raw(struct lazy_raw* p_x) {
  if (p_x->data != R_NilValue) {
    return p_x->p_data;
  }

  p_x->data = Rf_allocVector(RAWSXP, p_x->size);
  REPROTECT(p_x->data, p_x->data_pi);

  p_x->p_data = (void*) RAW(p_x->data);

  return p_x->p_data;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/lazy.h:50

init_lgl_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : LGL })] -> ())&([c_null] -> empty)
timing: 0.092 s
source
void init_lgl_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_lgl_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:75

init_list_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : list })] -> ())&([c_null] -> empty)
timing: 0.086 s
source
void init_list_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_list_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:99

init_nil_poly_vec typed

[*struct poly_vec] -> ()
timing: 0.027 s
source
void init_nil_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:71

init_ordered typed

([INT, any_sexp] -> ())&([((CHR | CLX | DBL | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.095 s
source
static void init_ordered(SEXP x, SEXP levels) {
  if (TYPEOF(x) != INTSXP) {
    r_stop_internal("Only integers can be made into ordered factors.");
  }

  Rf_setAttrib(x, R_LevelsSymbol, levels);
  Rf_setAttrib(x, R_ClassSymbol, classes_ordered);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:407

init_raw_poly_vec typed

([*struct poly_vec({ shelter : any_sexp ; vec : raw })] -> ())&([c_null] -> empty)
timing: 0.091 s
source
void init_raw_poly_vec(struct poly_vec* p_poly_vec) {
  p_poly_vec->p_vec = (const void*) r_raw_cbegin(p_poly_vec->vec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:95

INIT_STRING typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

int_adjust typed

[c_false, c_false, c_int_na, c_ptr] | [c_int_na \ c_false, c_false, c_int_na, c_ptr] -> ()
timing: 0.495 s
source
void int_adjust(
  const bool decreasing,
  const bool na_last,
  const r_ssize size,
  void* p_x
) {
  const int direction = decreasing ? -1 : 1;
  const uint32_t na_u32 = na_last ? UINT32_MAX : 0;
  const int na_shift = na_last ? -1 : 0;

  const int* p_x_int = (const int*) p_x;
  uint32_t* p_x_u32 = (uint32_t*) p_x;

  for (r_ssize i = 0; i < size; ++i) {
    int elt = p_x_int[i];

    if (elt == NA_INTEGER) {
      p_x_u32[i] = na_u32;
      continue;
    }

    elt = elt * direction + na_shift;

    p_x_u32[i] = int_map_to_uint32(elt);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:846

int_as_double typed

([INT, *c_bool] -> DBL)&([INT1, *c_bool] -> DBL1)
timing: 0.467 s
source
r_obj* int_as_double(r_obj* x, bool* lossy) {
  int* data = r_int_begin(x);
  r_ssize n = r_length(x);

  r_obj* out = KEEP(r_alloc_double(n));
  double* out_data = r_dbl_begin(out);

  for (r_ssize i = 0; i < n; ++i, ++data, ++out_data) {
    int elt = *data;
    *out_data = (elt == r_globals.na_int) ? r_globals.na_dbl : elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:168

int_as_logical typed

([INT, *c_bool] -> LGL | null)&([INT1, *c_bool] -> LGL1 | null)
timing: 1.01 s
source
r_obj* int_as_logical(r_obj* x, bool* lossy) {
  int* data = r_int_begin(x);
  r_ssize n = r_length(x);

  r_obj* out = KEEP(r_alloc_logical(n));
  int* out_data = r_lgl_begin(out);

  for (r_ssize i = 0; i < n; ++i, ++data, ++out_data) {
    int elt = *data;

    if (elt == r_globals.na_int) {
      *out_data = r_globals.na_lgl;
      continue;
    }

    if (elt != 0 && elt != 1) {
      *lossy = true;
      FREE(1);
      return r_null;
    }

    *out_data = elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:3

int_assign typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.548 s
source
r_obj* int_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN(int, r_int_begin, INTEGER_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:498

int_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.608 s
source
static inline SEXP int_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_SHAPED(int, INTEGER, INTEGER_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:253

int_cmp typed

∀'a. ([c_na, c_int, c_int_na, c_int_na & 'a] -> c_int_na & 'a)&([c_na, c_na, c_int_na, c_int_na & 'a] -> c_false)&([c_int, c_int, c_int, c_int_na & 'a] | [c_int, c_na, c_int_na, c_int & 'a] -> c_int)&([c_int, c_int, c_int_na, c_int_na & 'a] | [c_int, c_na, c_int_na, c_int_na & 'a] -> c_int_na)
timing: 0.086 s
source
int int_cmp(int x, int y, const int direction, const int na_order) {
  if (x == NA_INTEGER) {
    if (y == NA_INTEGER) {
      return 0;
    } else {
      return na_order;
    }
  }

  if (y == NA_INTEGER) {
    return -na_order;
  }

  int cmp = (x > y) - (x < y);

  return cmp * direction;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:298

int_col_detect_missing typed

([INT, *c_int_na, c_int_na] -> c_int)&([INT, c_null, c_int_na] -> c_false)
timing: 0.173 s
source
r_ssize int_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(int, r_int_cbegin, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:223

int_compare_na_equal typed

[c_int_na, c_int_na] -> c_int
timing: 0.007 s
source
int int_compare_na_equal(int x, int y) {
  return int_compare_scalar(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:49

int_compare_na_propagate typed

[c_int_na, c_int_na] -> c_int_na
timing: 0.027 s
source
int int_compare_na_propagate(int x, int y) {
  if (int_is_missing(x) || int_is_missing(y)) {
    return r_globals.na_int;
  } else {
    return int_compare_scalar(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:216

int_compare_scalar typed

[c_int_na, c_int_na] -> c_int
timing: 0.012 s
source
int int_compare_scalar(int x, int y) {
  return (x > y) - (x < y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:17

int_compute_skips typed

([c_null, c_int_na, *c_bool] -> empty)&([*c_int_na, c_int_na, *c_bool] \ [c_null, c_int_na, *c_bool] -> c_int_na)
timing: 0.112 s
source
uint8_t int_compute_skips(const uint32_t* p_x, r_ssize size, bool* p_skips) {
  uint8_t radix_start = PASS_TO_RADIX(0, INT_MAX_RADIX_PASS);
  uint8_t shift_start = radix_start * 8;

  for (uint8_t i = 0; i < INT_MAX_RADIX_PASS; ++i) {
    p_skips[i] = true;
  }

  uint8_t p_bytes[INT_MAX_RADIX_PASS];
  const uint32_t elt0 = p_x[0];

  // Get bytes of first element in MSD->LSD order.
  // Placed in `p_bytes` in a way that aligns with the `pass` variable
  for (uint8_t pass = 0, shift = shift_start;
       pass < INT_MAX_RADIX_PASS;
       ++pass, shift += SHIFT_ADJUSTMENT) {
    p_bytes[pass] = int_extract_uint32_byte(elt0, shift);
  }

  // Check to see which passes are skippable
  for (r_ssize i = 1; i < size; ++i) {
    uint8_t n_skips = INT_MAX_RADIX_PASS;
    const uint32_t elt = p_x[i];

    for (uint8_t pass = 0, shift = shift_start;
         pass < INT_MAX_RADIX_PASS;
         ++pass, shift += SHIFT_ADJUSTMENT) {
      bool skip = p_skips[pass];

      if (skip) {
        p_skips[pass] = (p_bytes[pass] == int_extract_uint32_byte(elt, shift));
      } else {
        --n_skips;
      }
    }

    // No passes are skippable
    if (n_skips == 0) {
      break;
    }
  }

  uint8_t pass = 0;

  // Shift forward to the first pass with varying bytes
  while (pass < INT_MAX_RADIX_PASS && p_skips[pass]) {
    ++pass;
  }

  return pass;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1383

int_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t int_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return int_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:165

int_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.007 s
source
uint32_t int_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_int_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:122

int_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.118 s
source
bool int_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_int_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:208

int_equal typed

([INT, INT, c_int, c_false, c_false, c_false] | [INT, INT, c_int, c_false, c_false, c_int_na \ c_false] | [INT, INT, c_int, c_false, c_int_na \ c_false, c_false] | [INT, INT, c_int, c_false, c_int_na \ c_false, c_int_na \ c_false] | [INT, INT, c_int, c_int_na \ c_false, c_false, c_false] | [INT, INT, c_int, c_int_na \ c_false, c_false, c_int_na \ c_false] | [INT, INT, c_int, c_int_na \ c_false, c_int_na \ c_false, c_false] | [INT, INT, c_int, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL)&([INT, INT, c_true, c_false, c_false, c_false] | [INT, INT, c_true, c_false, c_false, c_int_na \ c_false] | [INT, INT, c_true, c_false, c_int_na \ c_false, c_false] | [INT, INT, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false] | [INT, INT, c_true, c_int_na \ c_false, c_false, c_false] | [INT, INT, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false] | [INT, INT, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false] | [INT, INT, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL1)
timing: 6.72 s
source
SEXP int_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(int, INTEGER_RO, int_equal_na_equal, int_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:139

int_equal_na_equal typed

[c_int_na, c_int_na] -> c_bool
timing: 0.007 s
source
static inline int int_equal_na_equal(int x, int y) {
  return x == y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:27

int_equal_na_propagate typed

[c_int_na, c_int_na] -> c_lgl
timing: 0.022 s
source
static inline int int_equal_na_propagate(int x, int y) {
  if (int_is_missing(x) || int_is_missing(y)) {
    return NA_LOGICAL;
  } else {
    return int_equal_na_equal(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:139

int_filter_missing typed

[any_sexp, c_int_na] -> any_sexp
timing: 0.011 s
source
r_obj* int_filter_missing(r_obj* subscript, r_ssize n_missing) {
  return int_filter(subscript, n_missing, r_globals.na_int);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:336

int_filter_zero typed

[any_sexp, c_int_na] -> any_sexp
timing: 0.014 s
source
r_obj* int_filter_zero(r_obj* subscript, r_ssize n_zero) {
  return int_filter(subscript, n_zero, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:332

int_first_missing typed

[INT] -> c_int
timing: 0.339 s
source
r_ssize int_first_missing(r_obj* x) {
  FIRST_MISSING(int, r_int_cbegin, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:320

int_hash typed

[INT] -> c_int_na
timing: 0.234 s
source
static inline uint32_t int_hash(r_obj* x) {
  HASH(int, r_int_cbegin, int_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:80

int_hash_scalar typed

[c_int_na] -> c_int
timing: 0.006 s
source
static inline uint32_t int_hash_scalar(int x) {
  return uint32_hash(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:57

int_incr typed

[c_int_na, *c_int_na] -> ()
timing: 0.138 s
source
void int_incr(r_ssize size, int* p_x) {
  for (r_ssize i = 0; i < size; ++i) {
    p_x[i] = i + 1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:461

int_invert_location typed

[INT, c_int, c_null] -> any_sexp
timing: 3.61 s
source
r_obj* int_invert_location(r_obj* subscript,
                           r_ssize n,
                           const struct location_opts* opts) {
  const int* data = r_int_cbegin(subscript);
  r_ssize loc_n = r_length(subscript);

  r_obj* sel = KEEP(r_alloc_logical(n));
  r_lgl_fill(sel, 1, n);

  int* sel_data = r_lgl_begin(sel);

  for (r_ssize i = 0; i < loc_n; ++i, ++data) {
    int j = *data;

    if (j == r_globals.na_int) {
      // Following base R by erroring on `missing = "propagate"`, e.g. `1[c(NA, -1)]`.
      // Doesn't make sense to invert an `NA`, so we can't meaningfully propagate.
      switch (opts->missing) {
      case SUBSCRIPT_MISSING_PROPAGATE: stop_location_negative_missing(subscript, opts);
      case SUBSCRIPT_MISSING_REMOVE: continue;
      case SUBSCRIPT_MISSING_ERROR: stop_location_negative_missing(subscript, opts);
      }
    }

    if (j >= 0) {
      if (j == 0) {
        switch (opts->loc_zero) {
        case LOC_ZERO_REMOVE: continue;
        case LOC_ZERO_IGNORE: continue;
        case LOC_ZERO_ERROR: stop_location_zero(subscript, opts);
        }
      } else {
        stop_location_negative_positive(subscript, opts);
      }
    }

    j = -j;
    if (j > n) {
      switch (opts->loc_oob) {
      case LOC_OOB_REMOVE: {
        continue;
      }
      case LOC_OOB_EXTEND:
      case LOC_OOB_ERROR: {
        // Setting `oob` to `"error"` and `"extend"` result in errors here,
        // because extending with a negative subscript is nonsensical
        stop_subscript_negative_oob_location(subscript, n, opts);
      }
      }
    }

    sel_data[j - 1] = 0;
  }

  r_obj* out = lgl_as_location(sel, n, opts);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:234

int_is_missing typed

[c_int_na] -> c_bool
timing: 0.007 s
source
bool int_is_missing(int x) {
  return x == r_globals.na_int;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:20

int_locate_lower_duplicate typed

∀'a. ([c_int_na, *c_int_na, *c_int_na, c_int, c_int] -> c_int)&([c_int_na, *c_int_na, c_null, c_int & 'a, c_int] | [c_int_na, c_null, *c_int_na, c_int & 'a, c_int] -> c_int & 'a)
timing: 0.118 s
source
r_ssize int_locate_lower_duplicate(int val_needle,
                                   const int* v_haystack,
                                   const int* v_o_haystack,
                                   r_ssize loc_lower_bound_o_haystack,
                                   r_ssize loc_upper_bound_o_haystack) {
  while (loc_lower_bound_o_haystack <= loc_upper_bound_o_haystack) {
    const r_ssize loc_mid_bound_o_haystack = midpoint(loc_lower_bound_o_haystack, loc_upper_bound_o_haystack);
    const r_ssize loc_mid_bound_haystack = v_o_haystack[loc_mid_bound_o_haystack] - 1;
    const int val_haystack = v_haystack[loc_mid_bound_haystack];

    if (int_equal_na_equal(val_needle, val_haystack)) {
      loc_upper_bound_o_haystack = loc_mid_bound_o_haystack - 1;
    } else {
      loc_lower_bound_o_haystack = loc_mid_bound_o_haystack + 1;
    }
  }

  return loc_lower_bound_o_haystack;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1112

int_locate_match typed

[c_int_na, *c_int_na, *c_int_na, c_int, c_int] -> struct vctrs_match_bounds
timing: 0.246 s
source
struct vctrs_match_bounds int_locate_match(int val_needle,
                                           const int* v_haystack,
                                           const int* v_o_haystack,
                                           r_ssize loc_lower_bound_o_haystack,
                                           r_ssize loc_upper_bound_o_haystack) {
  while (loc_lower_bound_o_haystack <= loc_upper_bound_o_haystack) {
    const r_ssize loc_mid_bound_o_haystack = midpoint(loc_lower_bound_o_haystack, loc_upper_bound_o_haystack);
    const r_ssize loc_mid_bound_haystack = v_o_haystack[loc_mid_bound_o_haystack] - 1;
    const int val_haystack = v_haystack[loc_mid_bound_haystack];

    const int cmp = int_compare_na_equal(val_needle, val_haystack);

    if (cmp == 1) {
      loc_lower_bound_o_haystack = loc_mid_bound_o_haystack + 1;
    } else if (cmp == -1) {
      loc_upper_bound_o_haystack = loc_mid_bound_o_haystack - 1;
    } else {
      // Hit!
      // Find lower and upper duplicate bounds for the haystack value
      loc_lower_bound_o_haystack = int_locate_lower_duplicate(
        val_haystack,
        v_haystack,
        v_o_haystack,
        loc_lower_bound_o_haystack,
        loc_mid_bound_o_haystack
      );
      loc_upper_bound_o_haystack = int_locate_upper_duplicate(
        val_haystack,
        v_haystack,
        v_o_haystack,
        loc_mid_bound_o_haystack,
        loc_upper_bound_o_haystack
      );
      break;
    }
  }

  return (struct vctrs_match_bounds) {
    loc_lower_bound_o_haystack,
    loc_upper_bound_o_haystack
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1164

int_locate_upper_duplicate typed

∀'a. ([c_int_na, *c_int_na, *c_int_na, c_int, c_int] -> c_int)&([c_int_na, *c_int_na, c_null, c_int, c_int & 'a] | [c_int_na, c_null, *c_int_na, c_int, c_int & 'a] -> c_int & 'a)
timing: 0.119 s
source
r_ssize int_locate_upper_duplicate(int val_needle,
                                   const int* v_haystack,
                                   const int* v_o_haystack,
                                   r_ssize loc_lower_bound_o_haystack,
                                   r_ssize loc_upper_bound_o_haystack) {
  while (loc_lower_bound_o_haystack <= loc_upper_bound_o_haystack) {
    const r_ssize loc_mid_bound_o_haystack = midpoint(loc_lower_bound_o_haystack, loc_upper_bound_o_haystack);
    const r_ssize loc_mid_bound_haystack = v_o_haystack[loc_mid_bound_o_haystack] - 1;
    const int val_haystack = v_haystack[loc_mid_bound_haystack];

    if (int_equal_na_equal(val_needle, val_haystack)) {
      loc_lower_bound_o_haystack = loc_mid_bound_o_haystack + 1;
    } else {
      loc_upper_bound_o_haystack = loc_mid_bound_o_haystack - 1;
    }
  }

  return loc_upper_bound_o_haystack;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1138

int_locate_upper_incomplete typed

∀'a. ([*(c_int_na \ c_false), *c_int_na, c_int, c_int] -> c_int)&([*c_false, *c_int_na, c_int, c_int & 'a] | [*c_int_na, c_null, c_int, c_int & 'a] -> c_int & 'a)
timing: 0.168 s
source
r_ssize int_locate_upper_incomplete(const int* v_haystack_complete,
                                    const int* v_o_haystack,
                                    r_ssize loc_lower_bound_o_haystack,
                                    r_ssize loc_upper_bound_o_haystack) {
  while (loc_lower_bound_o_haystack <= loc_upper_bound_o_haystack) {
    const r_ssize loc_mid_bound_o_haystack = midpoint(loc_lower_bound_o_haystack, loc_upper_bound_o_haystack);
    const r_ssize loc_mid_bound_haystack = v_o_haystack[loc_mid_bound_o_haystack] - 1;
    const int haystack_is_complete = v_haystack_complete[loc_mid_bound_haystack];

    if (haystack_is_complete) {
      loc_upper_bound_o_haystack = loc_mid_bound_o_haystack - 1;
    } else {
      loc_lower_bound_o_haystack = loc_mid_bound_o_haystack + 1;
    }
  }

  return loc_upper_bound_o_haystack;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1087

int_map_to_uint32 typed

[c_int_na] -> c_int
timing: 0.004 s
source
static inline uint32_t int_map_to_uint32(int x) {
  return ((uint32_t) x) ^ HEX_UINT32_SIGN_BIT;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:877

int_order_chunk typed empty return

[c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> empty
timing: 0.434 s
source
void int_order_chunk(
  bool decreasing,
  bool na_last,
  r_ssize size,
  int* p_o,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  void* p_x_chunk = p_lazy_x_chunk->p_data;

  const enum vctrs_sortedness sortedness = int_sortedness(
    p_x_chunk,
    size,
    decreasing,
    na_last,
    p_group_infos
  );

  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    ord_resolve_sortedness_chunk(sortedness, size, p_o);
    return;
  }

  if (size <= ORDER_INSERTION_BOUNDARY) {
    int_adjust(decreasing, na_last, size, p_x_chunk);
    int_order_insertion(size, p_x_chunk, p_o, p_group_infos);
    return;
  }

  int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);

  uint32_t range;
  int x_min;

  int_compute_range(p_x_chunk, size, &x_min, &range);

  /*
   * If in counting order range and on the second or higher column, we will
   * need `p_o_aux` as working memory. At this point, `p_o` will have been
   * initialized from ordering the first column.
   */
  if (range < INT_ORDER_COUNTING_RANGE_BOUNDARY) {
    const bool initialized = true;

    int_order_counting(
      p_x_chunk,
      size,
      x_min,
      range,
      initialized,
      decreasing,
      na_last,
      p_o,
      p_o_aux,
      p_group_infos
    );

    return;
  }

  uint32_t* p_x_aux = (uint32_t*) init_lazy_raw(p_lazy_x_aux);

  uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

  r_ssize* p_counts = (r_ssize*) init_lazy_raw(p_lazy_counts);
  r_memset(p_counts, 0, p_lazy_counts->size);

  int_adjust(decreasing, na_last, size, p_x_chunk);

  int_order_radix(
    size,
    p_x_chunk,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:629

int_order_compare_na_equal typed

[c_int_na, c_int_na, c_int_na] -> c_int
timing: 0.008 s
source
int int_order_compare_na_equal(int x, int y, bool nan_distinct) {
  return int_compare_na_equal(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:30

int_order_insertion typed

([c_false, *c_int_na, *c_int_na, *struct group_infos] -> ())&([c_int_na \ c_false, *c_int_na, *c_int_na, c_null] | [c_int_na \ c_false, c_null, *c_int_na, *struct group_infos] -> empty)
timing: 19.68 s
source
void int_order_insertion(
  const r_ssize size,
  uint32_t* p_x,
  int* p_o,
  struct group_infos* p_group_infos
) {
  // Don't think this can occur, but safer this way
  if (size == 0) {
    return;
  }

  for (r_ssize i = 1; i < size; ++i) {
    const uint32_t x_elt = p_x[i];
    const int o_elt = p_o[i];

    r_ssize j = i - 1;

    while (j >= 0) {
      const uint32_t x_cmp_elt = p_x[j];

      if (x_elt >= x_cmp_elt) {
        break;
      }

      int o_cmp_elt = p_o[j];

      // Swap
      p_x[j + 1] = x_cmp_elt;
      p_o[j + 1] = o_cmp_elt;

      // Next
      --j;
    }

    // Place original elements in new location
    // closer to start of the vector
    p_x[j + 1] = x_elt;
    p_o[j + 1] = o_elt;
  }

  // We've ordered a small chunk, we need to push at least one group size.
  // Depends on the post-ordered results so we have to do this
  // in a separate loop.
  r_ssize group_size = 1;
  uint32_t previous = p_x[0];

  for (r_ssize i = 1; i < size; ++i) {
    const uint32_t current = p_x[i];

    // Continue the current group run
    if (current == previous) {
      ++group_size;
      continue;
    }

    // Push current run size and reset size tracker
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;

    previous = current;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1102

int_order_radix typed

([c_int_na, c_null, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *struct group_infos] -> empty)&([c_false, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *struct group_infos] | [c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, c_null] -> ())
timing: 0.052 s
source
void int_order_radix(
  const r_ssize size,
  uint32_t* p_x,
  int* p_o,
  uint32_t* p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  r_ssize* p_counts,
  struct group_infos* p_group_infos
) {
  bool p_skips[INT_MAX_RADIX_PASS];

  uint8_t pass = int_compute_skips(p_x, size, p_skips);

  // Skipped all passes - Happens when `x` is 1 value repeated
  if (pass == INT_MAX_RADIX_PASS) {
    groups_size_maybe_push(size, p_group_infos);
    return;
  }

  int_order_radix_recurse(
    size,
    pass,
    p_x,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_skips,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1180

int_slice_shaped typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.348 s
source
static SEXP int_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_SHAPED(INTSXP, int, INTEGER, INTEGER_RO, NA_INTEGER);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:122

int_sortedness typed

([*c_int_na, c_false, c_false, c_false, *struct group_infos] | [*c_int_na, c_false, c_false, c_int_na \ c_false, *struct group_infos] | [*c_int_na, c_false, c_int_na \ c_false, c_false, *struct group_infos] | [*c_int_na, c_false, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> c_true)&([*c_int_na, c_int_na \ c_bool, c_false, c_false, c_null] | [*c_int_na, c_int_na \ c_bool, c_false, c_int_na \ c_false, c_null] | [*c_int_na, c_int_na \ c_bool, c_int_na \ c_false, c_false, c_null] | [*c_int_na, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, c_null] -> c_false | c(2))&([*c_int_na, c_true, c_false, c_false, c_null] | [*c_int_na, c_true, c_false, c_int_na \ c_false, c_null] | [*c_int_na, c_true, c_int_na \ c_false, c_false, c_null] | [*c_int_na, c_true, c_int_na \ c_false, c_int_na \ c_false, c_null] | [c_null, c_int_na \ c_bool, c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_false, c_int_na \ c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_false, *struct group_infos] | [c_null, c_int_na \ c_bool, c_int_na \ c_false, c_int_na \ c_false, *struct group_infos] -> empty)
timing: 8.90 s
source
enum vctrs_sortedness int_sortedness(const int* p_x,
                                     r_ssize size,
                                     bool decreasing,
                                     bool na_last,
                                     struct group_infos* p_group_infos) {
  if (size == 0) {
    return VCTRS_SORTEDNESS_sorted;
  }

  if (size == 1) {
    groups_size_maybe_push(1, p_group_infos);
    return VCTRS_SORTEDNESS_sorted;
  }

  const int direction = decreasing ? -1 : 1;
  const int na_order = na_last ? 1 : -1;

  int previous = p_x[0];

  r_ssize count = 0;

  // Check for strictly opposite of expected order
  // (ties are not allowed so we can reverse the vector stably)
  for (r_ssize i = 1; i < size; ++i, ++count) {
    int current = p_x[i];

    int cmp = int_cmp(
      current,
      previous,
      direction,
      na_order
    );

    if (cmp >= 0) {
      break;
    }

    previous = current;
  }

  // Was in strictly opposite of expected order.
  if (count == size - 1) {
    // Each group is size 1 since this is strict ordering
    for (r_ssize j = 0; j < size; ++j) {
      groups_size_maybe_push(1, p_group_infos);
    }

    return VCTRS_SORTEDNESS_reversed;
  }

  // Was partially in expected order. Need to sort.
  if (count != 0) {
    return VCTRS_SORTEDNESS_unsorted;
  }

  // Retain the original `n_groups` to be able to reset the group sizes if
  // it turns out we don't have expected ordering
  struct group_info* p_group_info = groups_current(p_group_infos);
  r_ssize original_n_groups = p_group_info->n_groups;

  r_ssize group_size = 1;

  // Check for expected ordering - allowing ties since we don't have to
  // reverse the ordering.
  for (r_ssize i = 1; i < size; ++i) {
    int current = p_x[i];

    int cmp = int_cmp(
      current,
      previous,
      direction,
      na_order
    );

    // Not expected ordering
    if (cmp < 0) {
      p_group_info->n_groups = original_n_groups;
      return VCTRS_SORTEDNESS_unsorted;
    }

    previous = current;

    // Continue group run
    if (cmp == 0) {
      ++group_size;
      continue;
    }

    // Expected ordering
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);

  // Expected ordering
  return VCTRS_SORTEDNESS_sorted;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:196

int64_pack typed

[c_double, c_double] -> c_int_na
timing: 0.012 s
source
int64_t int64_pack(double left, double right) {
  const uint32_t left_u32 = (uint32_t) left;
  const uint32_t right_u32 = (uint32_t) right;

  const uint64_t out_u64 = ((uint64_t) left_u32) << 32 | right_u32;

  const int64_t out = (int64_t) (out_u64 + INT64_MIN);

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-integer64.c:147

int64_unpack typed

([c_int_na, c_int_na, *c_double, *c_double] -> ())&([c_int_na, c_int_na, *c_double, c_null] | [c_int_na, c_int_na, c_null, *c_double] -> empty)
timing: 0.021 s
source
void int64_unpack(int64_t x, r_ssize i, double* v_left, double* v_right) {
  const uint64_t x_u64 = ((uint64_t) x) - INT64_MIN;

  const uint32_t left_u32 = (uint32_t) (x_u64 >> 32);
  const uint32_t right_u32 = (uint32_t) x_u64;

  v_left[i] = (double) left_u32;
  v_right[i] = (double) right_u32;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-integer64.c:136

interval_order typed

[any_sexp, any_sexp, any_sexp, any_sexp, c_int_na] -> any_sexp
timing: 0.044 s
source
r_obj* interval_order(r_obj* start,
                      r_obj* end,
                      r_obj* direction,
                      r_obj* na_value,
                      r_ssize size) {
  // Put them in a data frame to compute joint ordering
  r_obj* df = KEEP(r_new_list(2));
  r_list_poke(df, 0, start);
  r_list_poke(df, 1, end);

  r_obj* df_names = r_new_character(2);
  r_attrib_poke_names(df, df_names);
  r_chr_poke(df_names, 0, r_str("start"));
  r_chr_poke(df_names, 1, r_str("end"));

  r_init_data_frame(df, size);

  const bool nan_distinct = false;
  r_obj* chr_proxy_collate = r_null;

  r_obj* out = vec_order(
    df,
    direction,
    na_value,
    nan_distinct,
    chr_proxy_collate
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:885

is_bare_data_frame typed

[<> | null | p(CHR) | sym] -> c_false
timing: 0.012 s
source
bool is_bare_data_frame(r_obj* x) {
  return class_type(x) == VCTRS_CLASS_bare_data_frame;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:19

is_compact_condition typed

[any_sexp] -> c_bool
timing: 0.008 s
source
bool is_compact_condition(r_obj* x) {
  return r_inherits(x, compact_condition_class_string);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:894

is_compact_rep typed

[any_sexp] -> c_bool
timing: 0.008 s
source
bool is_compact_rep(SEXP x) {
  return r_inherits(x, compact_rep_class_string);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:848

is_compact_seq typed

[any_sexp] -> c_bool
timing: 0.008 s
source
bool is_compact_seq(SEXP x) {
  return r_inherits(x, compact_seq_class_string);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:799

is_condition_index typed

([<...>] -> c_false)&([<> | null | p(CHR) | sym] -> c_bool)
timing: 0.035 s
source
bool is_condition_index(r_obj* index) {
  if (r_typeof(index) != R_TYPE_logical) {
    return false;
  }
  if (has_dim(index)) {
    return false;
  }
  if (r_is_object(index)) {
    return false;
  }
  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:929

is_data_frame typed

[<> | null | p(CHR) | sym] -> c_false
timing: 0.021 s
source
bool is_data_frame(r_obj* x) {
  return
    r_typeof(x) == R_TYPE_list &&
    class_type_is_data_frame(class_type(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:6

is_integer64 typed

([DBL<integer64, ...>] -> c_true)&([DBL<~integer64, ...>] | [((CHR | CLX | INT | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym] -> c_false)
timing: 0.142 s
source
bool is_integer64(SEXP x) {
  return TYPEOF(x) == REALSXP && Rf_inherits(x, "integer64");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1025

is_unique_names typed

[CHR] -> c_bool
timing: 0.364 s
source
bool is_unique_names(r_obj* names) {
  if (r_typeof(names) != R_TYPE_character) {
    r_abort("`names` must be a character vector");
  }

  r_ssize n = r_length(names);
  r_obj* const * v_names = r_chr_cbegin(names);

  if (duplicated_any(names)) {
    return false;
  }

  for (r_ssize i = 0; i < n; ++i) {
    if (needs_suffix(v_names[i])) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:244

KEEP_N typed

∀'a. (['a, c_null] -> empty)&(['a, *(*any)] | ['a, *c_double] | ['a, *c_int_na] | ['a, *c_string] -> 'a)
timing: 0.295 s
(definition not located in src/)

KEEP2 typed any: arg 1

∀'a. [any, 'a] -> 'a
timing: 0.005 s
(definition not located in src/)

lgl_any_na typed

([LGL] -> c_bool)&([^LGL1] -> c_false)
timing: 0.538 s
source
bool lgl_any_na(SEXP x) {
  R_xlen_t size = Rf_xlength(x);
  const int* p_x = LOGICAL_RO(x);

  for (R_xlen_t i = 0; i < size; ++i) {
    if (p_x[i] == NA_LOGICAL) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1030

lgl_as_double typed

([LGL, *c_bool] -> DBL)&([LGL1, *c_bool] -> DBL1)
timing: 0.650 s
source
r_obj* lgl_as_double(r_obj* x, bool* lossy) {
  int* data = r_lgl_begin(x);
  r_ssize n = r_length(x);

  r_obj* out = KEEP(r_alloc_double(n));
  double* out_data = r_dbl_begin(out);

  for (r_ssize i = 0; i < n; ++i, ++data, ++out_data) {
    int elt = *data;
    *out_data = (elt == r_globals.na_lgl) ? r_globals.na_dbl : elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:152

lgl_as_integer typed

[any_sexp, *c_bool] -> p(INT)
timing: 0.010 s
source
r_obj* lgl_as_integer(r_obj* x, bool* lossy) {
  return Rf_coerceVector(x, INTSXP);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-bare.c:112

lgl_as_location typed

([null, c_int_na, c_null] -> empty)&([any_sexp, c_int_na, *struct location_opts] \ [null, c_int_na, c_null] -> any_sexp)
timing: 4.61 s
source
r_obj* lgl_as_location(r_obj* subscript,
                       r_ssize n,
                       const struct location_opts* opts) {
  r_ssize subscript_n = r_length(subscript);

  if (subscript_n == n) {
    bool na_propagate = false;

    switch (opts->missing) {
    case SUBSCRIPT_MISSING_PROPAGATE: na_propagate = true; break;
    case SUBSCRIPT_MISSING_REMOVE: break;
    case SUBSCRIPT_MISSING_ERROR: {
      if (lgl_any_na(subscript)) {
        stop_subscript_missing(subscript, opts);
      }
      break;
    }
    }

    return r_lgl_which(subscript, na_propagate);
  }

  /* A single `TRUE` or `FALSE` index is recycled to the full vector
   * size. This means `TRUE` is synonym for missing index (subscript.e. no
   * subsetting) and `FALSE` is synonym for empty index.
   *
   * We could return the missing argument as sentinel to avoid
   * materialising the index vector for the `TRUE` case but this would
   * make `vec_as_location()` an option type just to optimise a rather
   * uncommon case.
   */
  if (subscript_n == 1) {
    int elt = r_lgl_get(subscript, 0);

    r_ssize recycle_size = n;

    r_obj* out = r_null;
    r_keep_loc out_shelter;
    KEEP_HERE(out, &out_shelter);

    if (elt == r_globals.na_lgl) {
      switch (opts->missing) {
      case SUBSCRIPT_MISSING_PROPAGATE: {
        out = r_alloc_integer(n);
        KEEP_AT(out, out_shelter);
        r_int_fill(out, r_globals.na_int, n);
        break;
      }
      case SUBSCRIPT_MISSING_REMOVE: {
        out = r_copy(r_globals.empty_int);
        KEEP_AT(out, out_shelter);
        recycle_size = 0;
        break;
      }
      case SUBSCRIPT_MISSING_ERROR: {
        stop_subscript_missing(subscript, opts);
      }
      }
    } else if (elt) {
      out = r_alloc_integer(n);
      KEEP_AT(out, out_shelter);
      r_int_fill_seq(out, 1, n);
    } else {
      out = r_copy(r_globals.empty_int);
      KEEP_AT(out, out_shelter);
      recycle_size = 0;
    }

    r_obj* nms = KEEP(r_names(subscript));
    if (nms != R_NilValue) {
      r_obj* recycled_nms = r_alloc_character(recycle_size);
      r_attrib_poke_names(out, recycled_nms);
      r_chr_fill(recycled_nms, r_chr_get(nms, 0), recycle_size);
    }

    FREE(2);
    return out;
  }

  r_obj* n_obj = KEEP(r_int(n));
  stop_indicator_size(subscript, n_obj, opts);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:60

lgl_assign typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.528 s
source
r_obj* lgl_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN(int, LOGICAL, LOGICAL_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:487

lgl_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.660 s
source
static inline SEXP lgl_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_SHAPED(int, LOGICAL, LOGICAL_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:243

lgl_col_detect_missing typed

([LGL, *c_int_na, c_int_na] -> c_int)&([LGL, c_null, c_int_na] -> c_false)
timing: 0.169 s
source
r_ssize lgl_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(int, r_lgl_cbegin, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:217

lgl_compare_na_equal typed

[c_int_na, c_int_na] -> c_int
timing: 0.008 s
source
int lgl_compare_na_equal(int x, int y) {
  return int_compare_scalar(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:45

lgl_compare_na_propagate typed

[c_int_na, c_int_na] -> c_int_na
timing: 0.026 s
source
int lgl_compare_na_propagate(int x, int y) {
  if (lgl_is_missing(x) || lgl_is_missing(y)) {
    return r_globals.na_int;
  } else {
    return int_compare_scalar(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:208

lgl_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t lgl_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return lgl_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:161

lgl_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.007 s
source
uint32_t lgl_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_lgl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:118

lgl_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_bool)&([c_null, c_int_na] -> empty)
timing: 0.120 s
source
bool lgl_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_lgl_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:204

lgl_equal typed

([LGL, LGL, c_int, c_false, c_false, c_false] | [LGL, LGL, c_int, c_false, c_false, c_int_na \ c_false] | [LGL, LGL, c_int, c_false, c_int_na \ c_false, c_false] | [LGL, LGL, c_int, c_false, c_int_na \ c_false, c_int_na \ c_false] | [LGL, LGL, c_int, c_int_na \ c_false, c_false, c_false] | [LGL, LGL, c_int, c_int_na \ c_false, c_false, c_int_na \ c_false] | [LGL, LGL, c_int, c_int_na \ c_false, c_int_na \ c_false, c_false] | [LGL, LGL, c_int, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL)&([LGL, LGL, c_true, c_false, c_false, c_false] | [LGL, LGL, c_true, c_false, c_false, c_int_na \ c_false] | [LGL, LGL, c_true, c_false, c_int_na \ c_false, c_false] | [LGL, LGL, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false] | [LGL, LGL, c_true, c_int_na \ c_false, c_false, c_false] | [LGL, LGL, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false] | [LGL, LGL, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false] | [LGL, LGL, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL1)
timing: 6.97 s
source
SEXP lgl_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(int, LOGICAL_RO, lgl_equal_na_equal, lgl_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:135

lgl_equal_na_equal typed

[c_int_na, c_int_na] -> c_bool
timing: 0.006 s
source
static inline int lgl_equal_na_equal(int x, int y) {
  return x == y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:24

lgl_equal_na_propagate typed

[c_int_na, c_int_na] -> c_lgl
timing: 0.022 s
source
static inline int lgl_equal_na_propagate(int x, int y) {
  if (lgl_is_missing(x) || lgl_is_missing(y)) {
    return NA_LOGICAL;
  } else {
    return lgl_equal_na_equal(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:132

lgl_first_missing typed

[LGL] -> c_int
timing: 0.347 s
source
r_ssize lgl_first_missing(r_obj* x) {
  FIRST_MISSING(int, r_lgl_cbegin, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:316

lgl_hash typed

[LGL] -> c_int_na
timing: 0.237 s
source
static inline uint32_t lgl_hash(r_obj* x) {
  HASH(int, r_lgl_cbegin, lgl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:77

lgl_hash_scalar typed

[c_int_na] -> c_int
timing: 0.005 s
source
static inline uint32_t lgl_hash_scalar(int x) {
  return uint32_hash(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:53

lgl_is_missing typed

[c_int_na] -> c_bool
timing: 0.007 s
source
bool lgl_is_missing(int x) {
  return x == r_globals.na_int;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:16

lgl_is_unspecified typed

([null] -> c_false)&([LGL | null] -> c_bool)
timing: 0.236 s
source
bool lgl_is_unspecified(SEXP x) {
  const r_ssize size = r_length(x);

  if (size == 0) {
    // We declare `logical()` to be <logical>, not <unspecified>
    return false;
  }

  const int* p_x = r_lgl_cbegin(x);

  for (r_ssize i = 0; i < size; ++i) {
    if (p_x[i] != r_globals.na_lgl) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:63

lgl_order typed

[any_sexp, c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na, *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ()
timing: 0.115 s
source
void lgl_order(
  SEXP x,
  bool decreasing,
  bool na_last,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  int_order(
    x,
    decreasing,
    na_last,
    size,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1477

lgl_order_chunk typed empty return

[c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na, *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> empty
timing: 0.110 s
source
void lgl_order_chunk(
  bool decreasing,
  bool na_last,
  r_ssize size,
  int* p_o,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  int_order_chunk(
    decreasing,
    na_last,
    size,
    p_o,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1450

lgl_order_compare_na_equal typed

[c_int_na, c_int_na, c_int_na] -> c_int
timing: 0.007 s
source
int lgl_order_compare_na_equal(int x, int y, bool nan_distinct) {
  return lgl_compare_na_equal(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:26

lgl_slice_shaped typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.359 s
source
static SEXP lgl_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_SHAPED(LGLSXP, int, LOGICAL, LOGICAL_RO, NA_LOGICAL);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:119

list_all_have_class typed

[list, any_sexp] -> c_bool
timing: 0.166 s
source
bool list_all_have_class(r_obj* xs, r_obj* class) {
  r_ssize size = r_length(xs);
  r_obj* const* v_xs = r_list_cbegin(xs);

  for (r_ssize i = 0; i < size; ++i) {
    r_obj* x = v_xs[i];

    if (x == r_null) {
      // Allow `NULL`s
      continue;
    }

    if (!obj_has_class(x, class)) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1064

list_as_locations typed

∀'a. [list & 'a, c_int_na, any_sexp, c_false] | [list & 'a, c_int_na, any_sexp, c_int_na \ c_false] -> list & 'a
timing: 0.533 s
source
r_obj* list_as_locations(r_obj* indices, r_ssize n, r_obj* names, bool allow_compact) {
  if (r_typeof(indices) != R_TYPE_list) {
    r_abort_lazy_call(r_lazy_null, "`indices` must be a list of index values, or `NULL`.");
  }

  indices = KEEP(r_clone_referenced(indices));

  const r_ssize size = r_length(indices);
  r_obj* const* v_indices = r_list_cbegin(indices);

  // Restrict index values to positive integer locations
  // Also, notably, the `index` vector can't change size, i.e. `0` and `NA` aren't dropped.
  const struct location_opts opts = {
    .subscript_opts = {
      .logical = SUBSCRIPT_TYPE_ACTION_ERROR,
      .numeric = SUBSCRIPT_TYPE_ACTION_CAST,
      .character = SUBSCRIPT_TYPE_ACTION_ERROR
    },
    .missing = SUBSCRIPT_MISSING_PROPAGATE,
    .loc_negative = LOC_NEGATIVE_ERROR,
    .loc_oob = LOC_OOB_ERROR,
    .loc_zero = LOC_ZERO_ERROR
  };

  for (r_ssize i = 0; i < size; ++i) {
    r_obj* index = v_indices[i];

    if (is_compact_seq(index)) {
      if (allow_compact) {
        // Allow `compact_seq` to pass through untouched,
        // assume caller can handle them natively
        continue;
      } else {
        // We don't want them to slip through when not handled natively
        r_stop_internal("`compact_seq` are not allowed.");
      }
    }

    index = vec_as_location_opts(index, n, names, &opts);
    r_list_poke(indices, i, index);
  }

  FREE(1);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:505

list_assign typed

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_bool] -> ([list, c_int, any_sexp] -> ())
timing: 0.012 s
source
r_obj* list_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_BARRIER(r_obj*, r_list_cbegin, r_list_poke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:730

list_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.598 s
source
static SEXP list_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  const enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_BARRIER_SHAPED(SEXP, VECTOR_PTR_RO, SET_VECTOR_ELT);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:551

list_col_detect_missing typed

[any_sexp, *c_int_na, c_int_na] -> ([null] -> c_true) & ([<...> | p(CHR) | sym] -> c_false)
timing: 0.011 s
source
r_ssize list_col_detect_missing(r_obj* x,
                                r_ssize* v_loc,
                                r_ssize loc_size) {
  COL_DETECT_MISSING(r_obj*, r_list_cbegin, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:253

list_col_detect_run_bounds_bool typed

[any_sexp, c_int_na, c_bool, *c_bool] -> ()
timing: 0.005 s
source
void list_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(r_obj*, r_list_cbegin, list_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:335

list_combine_for_vec_c typed

[any_sexp, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.027 s
source
r_obj* list_combine_for_vec_c(
  r_obj* xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  r_obj* indices = r_null;

  return list_combine_for_list_unchop(
    xs,
    indices,
    ptype,
    name_spec,
    p_name_repair_opts,
    p_xs_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:129

list_combine_homogeneous_fallback typed

[any_sexp, c_false, any_sexp, c_bool, c_int_na, c_int_na, any_sexp, c_bool, c_bool, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.078 s
source
r_obj* list_combine_homogeneous_fallback(
  r_obj* xs,
  bool has_indices,
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  bool has_default,
  r_obj* default_,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* name_spec,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call
) {
  return base_list_combine_fallback(
    xs,
    has_indices,
    indices,
    indices_style,
    size,
    has_default,
    default_,
    multiple,
    slice_xs,
    name_spec,
    p_xs_arg,
    p_default_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1031

list_combine_impl typed

([list<>, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_false, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] | [list<>, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_true, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] | [list<>, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_false, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] | [list<>, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_true, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] | [list<>, c_int_na \ c_false, <> | null | p(CHR) | sym, c_bool, c_int_na, c_false, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, c_null, *struct vctrs_arg, struct r_lazy, c_bool] | [list<>, c_int_na \ c_false, <> | null | p(CHR) | sym, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, c_null, *struct vctrs_arg, struct r_lazy, c_bool] -> empty)&([any_sexp, c_int_na, any_sexp, c_bool, c_int_na, c_int_na, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_false, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_false, any_sexp, c_bool, c_int_na, c_false, any_sexp, c_bool, c_true, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_false, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_false, any_sexp, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_true, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_int_na \ c_false, <> | null | p(CHR) | sym, c_bool, c_int_na, c_false, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, c_null, *struct vctrs_arg, struct r_lazy, c_bool] & ~[list<>, c_int_na \ c_false, <> | null | p(CHR) | sym, c_bool, c_int_na, c_int_na \ c_false, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, c_null, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp)
timing: 1.14 s
source
r_obj* list_combine_impl(
  r_obj* xs,
  bool has_indices,
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  bool has_default,
  r_obj* default_,
  enum list_combine_unmatched unmatched,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_indices_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call,
  enum s3_fallback s3_fallback
) {
  int n_protect = 0;

  obj_check_list(xs, p_xs_arg, error_call);

  r_obj* const* v_xs = r_list_cbegin(xs);
  r_ssize xs_size = vec_size(xs);

  // This is impossible with the exposed API, but let's sanity check
  if (!has_indices) {
    switch (multiple) {
    case LIST_COMBINE_MULTIPLE_last: break;
    case LIST_COMBINE_MULTIPLE_first: r_stop_internal("`multiple = 'first'` can't be set with sequential combination."); break;
    default: r_stop_unreachable();
    }
  }

  if (has_indices) {
    // Apply size/type checking to `indices` before possibly early exiting from
    // needing to apply a fallback
    obj_check_list(indices, p_indices_arg, error_call);
    vec_check_size(indices, xs_size, VCTRS_ALLOW_NULL_no, p_indices_arg, error_call);
  }

  // Sizes are reused by the sequential path when advancing the compact-seq index.
  // It's more efficient to build them once even though it requires an allocation.
  r_obj* xs_sizes = NULL;
  r_ssize* v_xs_sizes = NULL;

  if (!has_indices) {
    // Infer `size` from `xs` for `vec_c()` and `list_unchop(indices = NULL)`
    // sequential approach
    size = 0;

    xs_sizes = KEEP_N(r_alloc_raw(xs_size * sizeof(r_ssize)), &n_protect);
    v_xs_sizes = r_raw_begin(xs_sizes);

    for (r_ssize i = 0; i < xs_size; ++i) {
      r_obj* x = v_xs[i];
      r_ssize x_size = vec_size(x);
      size += x_size;
      v_xs_sizes[i] = x_size;
    }
  }

  if (has_indices && indices_style == VCTRS_INDEX_STYLE_location) {
    // Validate and convert `indices` if they exist.
    //
    // Note that we don't allow an individual `index` vector to change size
    // during validation. This is the only reason we can "infer" the output
    // size from the sum of the lengths of the `indices` before doing validation
    // and conversion. In particular:
    // - `NULL` indices become `integer()` (both size `0`).
    // - We don't allow character or logical indices.
    // - We don't allow negative or zero indices (these change the size).
    // - We don't allow oob indices (makes no sense since we inferred the size from lengths).
    // - Numeric `NA` propagates.
    //
    // Note that `compact_seq()` objects are valid `index` values for
    // `list_combine()`. We have tests to ensure it can handle them!
    //
    // There is nothing to validate for condition indices, they are logical vectors
    // where all 3 possible values are handled and we've already checked their sizes
    // match `size` in `compute_indices_style()`.
    const bool allow_compact = true;
    indices = KEEP_N(list_as_locations(indices, size, r_null, allow_compact), &n_protect);
  }

  // Perform `unmatched` check
  // (before fallback cases!)
  switch (unmatched) {
  case LIST_COMBINE_UNMATCHED_default: {
    // Will use `default` in unmatched locations
    break;
  }
  case LIST_COMBINE_UNMATCHED_error: {
    if (default_ != r_null) {
      r_abort_lazy_call(
        error_call,
        "Can't set %s when `unmatched = \"error\"`.",
        vec_arg_format(p_default_arg)
      );
    }
    if (!has_indices) {
      r_stop_internal("`indices` should have been required if `unmatched` was set.");
    }
    check_any_unmatched(indices, indices_style, size, error_call);
    break;
  }
  default: {
    r_stop_unreachable();
  }
  }

  ptype = KEEP_N(
    ptype_common_with_default(
      ptype,
      xs,
      has_default,
      default_,
      p_xs_arg,
      p_default_arg,
      error_call,
      s3_fallback
    ),
    &n_protect
  );

  if (needs_list_combine_common_class_fallback(ptype)) {
    r_obj* out = list_combine_common_class_fallback(
      xs,
      has_indices,
      indices,
      indices_style,
      size,
      has_default,
      default_,
      multiple,
      slice_xs,
      ptype,
      name_spec,
      p_name_repair_opts,
      p_xs_arg,
      p_indices_arg,
      p_default_arg,
      error_call
    );
    FREE(n_protect);
    return out;
  }

  if (needs_list_combine_homogeneous_fallback(xs, has_default, default_, ptype)) {
    r_obj* out = list_combine_homogeneous_fallback(
      xs,
      has_indices,
      indices,
      indices_style,
      size,
      has_default,
      default_,
      multiple,
      slice_xs,
      name_spec,
      p_xs_arg,
      p_default_arg,
      error_call
    );
    FREE(n_protect);
    return out;
  }

  if (ptype == r_null) {
    // Even when there are no inputs and we can't determine a `ptype`, the user
    // will have supplied a `size`, so as an invariant we should return
    // something with this `size`. Our size preserving identity type is
    // `<unspecified[size]>`, so we use that.
    //
    // We catch `<unspecified[0]>` in `vec_c()` and `list_unchop()` and return
    // `NULL` in those cases instead, because that is what they have historically
    // returned and you can't supply `size` there, so this only happens in the
    // empty input cases of those functions.
    //
    // Assuming `NULL` is roughly equivalent to `unspecified(0)`, this gives us:
    //
    // ```
    // vec_c()
    // #> NULL
    // list_unchop(list(), indices = list())
    // #> NULL
    // list_combine(list(), indices = list(), size = 0)
    // #> unspecified[0] # Consistent with size != 0 case.
    // list_combine(list(), indices = list(), size = 5)
    // #> unspecified[5] # Preserves size, good.
    // ```
    //
    // The most theoretically correct thing may be to return `unspecified(0)`
    // from `vec_c()` and `list_unchop()` as well, but we make a concious effort
    // to avoid exposing this type to users when we can. Since those functions
    // don't have the `size` invariant issue, `NULL` seems to be a good
    // alternative.
    // https://github.com/r-lib/vctrs/issues/1980
    ptype = vctrs_shared_empty_uns;
  }

  const bool assign_names = !r_inherits(name_spec, "rlang_zap");
  r_obj* xs_names = KEEP_N(r_names(xs), &n_protect);
  const bool xs_is_named = xs_names != r_null && !is_data_frame(ptype);

  r_keep_loc out_pi;
  r_obj* out = vec_init(ptype, size);
  KEEP_HERE(out, &out_pi);
  ++n_protect;

  out = vec_proxy_recurse(out);
  KEEP_AT(out, out_pi);

  // - We own the `proxy` container
  // - We own `proxy` recursively
  // - We call `vec_proxy_recurse()` so must restore recursively
  const struct vec_restore_opts restore_opts = {
    .ownership = VCTRS_OWNERSHIP_deep,
    .recursively_proxied = true
  };
 const struct vec_proxy_assign_opts proxy_assign_opts = {
    .ownership = VCTRS_OWNERSHIP_deep,
    .recursively_proxied = true,
    .slice_value = slice_xs,
    .index_style = indices_style,
    .assign_names = assign_names,
    .ignore_outer_names = true,
    .call = error_call
  };

  r_keep_loc out_names_pi;
  r_obj* out_names = r_null;
  KEEP_HERE(out_names, &out_names_pi);
  ++n_protect;

  r_ssize xs_i = 0;

  struct vctrs_arg* p_x_arg = new_subscript_arg(
    p_xs_arg,
    xs_names,
    xs_size,
    &xs_i
  );
  KEEP_N(p_x_arg->shelter, &n_protect);

  struct cast_opts cast_opts = {
    .to = ptype,
    .p_x_arg = p_x_arg,
    .call = error_call,
    .s3_fallback = s3_fallback
  };

  r_keep_loc x_pi;
  r_obj* x = r_null;
  KEEP_HERE(x, &x_pi);
  ++n_protect;

  r_keep_loc index_pi;
  r_obj* index = r_null;
  KEEP_HERE(index, &index_pi);
  ++n_protect;

  // For the sequential path
  r_ssize start = 0;
  int* v_index = NULL;

  if (!has_indices) {
    // Sequential path reuses the same compact sequence `index`
    index = compact_seq(0, 0, true);
    KEEP_AT(index, index_pi);
    v_index = r_int_begin(index);
  }

  for (r_ssize i = 0; i < xs_size; ++i) {
    switch (multiple) {
    case LIST_COMBINE_MULTIPLE_last: xs_i = i; break;
    case LIST_COMBINE_MULTIPLE_first: xs_i = xs_size - 1 - i; break;
    default: r_stop_unreachable();
    }

    x = v_xs[xs_i];

    if (x == r_null) {
      continue;
    }

    r_ssize index_size;

    // Advance `index`
    if (has_indices) {
      index = r_list_get(indices, xs_i);
      index_size = vec_subscript_size(index);
    } else {
      index_size = v_xs_sizes[xs_i];
      init_compact_seq(v_index, start, index_size, true);
    }

    // When we have `indices`, `x`'s size must be compatible with the `index`'s
    // size. This is dependent on `slice_xs` and `indices_style`.
    //
    // When we don't have `indices`, we derive the index sizes from
    // `x` itself so there is no reason to recheck the size.
    //
    // We don't actually recycle `x` because both `vec_proxy_assign_opts()` and
    // `chr_assign()` efficiently recycle size 1 inputs.
    if (has_indices) {
      check_recyclable_against_index(
        x,
        index,
        size,
        slice_xs,
        indices_style,
        p_x_arg,
        error_call
      );
    }

    // Handle optional names assignment
    if (assign_names) {
      r_obj* outer = xs_is_named ? r_chr_get(xs_names, xs_i) : r_null;
      r_obj* inner = KEEP(vec_names(x));
      r_obj* x_names = KEEP(apply_name_spec(name_spec, outer, inner, index_size));

      if (has_indices && x_names == r_null && out_names != r_null) {
        // We don't have names on this element, but `out_names` will exist.
        // Someone before us may have written to `out_names` at this `index` by
        // providing an overlapping `index`, so we must clear that.
        x_names = r_chrs.empty_string;
      }

      if (x_names != r_null) {
        R_LAZY_ALLOC(out_names, out_names_pi, R_TYPE_character, size);
        out_names = chr_assign(
          out_names,
          index,
          x_names,
          VCTRS_OWNERSHIP_deep,
          slice_xs,
          indices_style
        );
        KEEP_AT(out_names, out_names_pi);
      }

      FREE(2);
    }

    cast_opts.x = x;
    x = vec_cast_opts(&cast_opts);
    KEEP_AT(x, x_pi);

    out = vec_proxy_assign_opts(out, index, x, &proxy_assign_opts);
    KEEP_AT(out, out_pi);

    if (!has_indices) {
      start += index_size;
    }
  }

  if (has_default) {
    // `default` uses a slightly modified form of `proxy_assign_opts` and
    // `cast_opts`
    // - `default` is size 1 or size of the output, so uses
    //   `ASSIGNMENT_SLICE_VALUE_yes`.
    // - `default`'s index is always built using a special compact condition
    //   vector, so uses `VCTRS_INDEX_STYLE_condition`.
    // - `default` has its own special `p_default_arg`.
    struct vec_proxy_assign_opts default_proxy_assign_opts = proxy_assign_opts;
    default_proxy_assign_opts.index_style = VCTRS_INDEX_STYLE_condition;
    default_proxy_assign_opts.slice_value = ASSIGNMENT_SLICE_VALUE_yes;

    struct cast_opts default_cast_opts = cast_opts;
    default_cast_opts.p_x_arg = p_default_arg;

    // Compute `default` compact condition index
    index = compute_default_index(indices, indices_style, size);
    KEEP_AT(index, index_pi);

    // `default` recycles against the output size, not the `index`
    vec_check_recyclable(default_, size, VCTRS_ALLOW_NULL_no, p_default_arg, error_call);

    // Handle optional names assignment
    if (assign_names) {
      // `outer` names don't exist, but `name_spec` could still `zap()` any `inner` names
      r_obj* outer = r_null;
      r_obj* inner = KEEP(vec_names(default_));
      r_obj* x_names = KEEP(apply_name_spec(name_spec, outer, inner, size));

      if (x_names != r_null) {
        R_LAZY_ALLOC(out_names, out_names_pi, R_TYPE_character, size);
        out_names = chr_assign(
          out_names,
          index,
          x_names,
          VCTRS_OWNERSHIP_deep,
          default_proxy_assign_opts.slice_value,
          default_proxy_assign_opts.index_style
        );
        KEEP_AT(out_names, out_names_pi);
      }

      FREE(2);
    }

    default_cast_opts.x = default_;
    x = vec_cast_opts(&default_cast_opts);
    KEEP_AT(x, x_pi);

    out = vec_proxy_assign_opts(out, index, x, &default_proxy_assign_opts);
    KEEP_AT(out, out_pi);
  }

  if (
    s3_fallback == S3_FALLBACK_true &&
      is_data_frame(out) &&
      needs_df_list_combine_common_class_fallback(out)
  ) {
    // Perform the common class fallback on any columns of the
    // data frame that require it
    df_list_combine_common_class_fallback(
      out,
      xs,
      has_indices,
      indices,
      indices_style,
      size,
      has_default,
      default_,
      multiple,
      slice_xs,
      ptype,
      name_spec,
      p_name_repair_opts,
      p_indices_arg,
      error_call
    );
  }

  out = vec_restore_opts(out, ptype, &restore_opts);
  KEEP_AT(out, out_pi);

  if (out_names != r_null) {
    out_names = KEEP(vec_as_names(out_names, p_name_repair_opts));
    out = vec_set_names(out, out_names, restore_opts.ownership);
    FREE(1);
  } else if (!assign_names) {
    // FIXME: `vec_ptype2()` doesn't consistently zaps names, so `out`
    // might have been initialised with names. This branch can be
    // removed once #1020 is resolved.
    out = vec_set_names(out, r_null, restore_opts.ownership);
  }

  FREE(n_protect);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:269

list_condition_to_location_indices typed

∀'a. [list & 'a] -> list & 'a
timing: 0.117 s
source
r_obj* list_condition_to_location_indices(r_obj* indices) {
  // We probably don't own these, the user provides them.
  indices = KEEP(r_clone_referenced(indices));

  const r_ssize indices_size = r_length(indices);
  r_obj* const* v_indices = r_list_cbegin(indices);

  // Because we want `c(FALSE, NA, TRUE)` to become `c(NA, TRUE)`
  // for assignment and size checking purposes
  const bool na_propagate = true;

  for (r_ssize i = 0; i < indices_size; ++i) {
    r_obj* index = v_indices[i];
    r_list_poke(indices, i, r_lgl_which(index, na_propagate));
  }

  FREE(1);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1545

list_detect_missing typed

[any_sexp] -> ([null] -> c_true) & ([<...> | p(CHR) | sym] -> c_false)
timing: 0.008 s
source
r_obj* list_detect_missing(r_obj* x) {
  DETECT_MISSING(r_obj*, r_list_cbegin, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:82

list_detect_run_bounds_bool typed

[any_sexp, c_int_na, c_bool, *c_bool] -> ()
timing: 0.005 s
source
void list_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(r_obj*, r_list_cbegin, list_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:236

list_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t list_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return list_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:185

list_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.007 s
source
uint32_t list_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_list_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:142

list_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_false)&([c_null, c_int_na] -> empty)
timing: 0.116 s
source
bool list_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_list_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:228

list_equal typed

([list, list, c_int, c_false, c_false, c_false] | [list, list, c_int, c_false, c_false, c_int_na \ c_false] | [list, list, c_int, c_false, c_int_na \ c_false, c_false] | [list, list, c_int, c_false, c_int_na \ c_false, c_int_na \ c_false] | [list, list, c_int, c_int_na \ c_false, c_false, c_false] | [list, list, c_int, c_int_na \ c_false, c_false, c_int_na \ c_false] | [list, list, c_int, c_int_na \ c_false, c_int_na \ c_false, c_false] | [list, list, c_int, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL)&([list, list, c_true, c_false, c_false, c_false] | [list, list, c_true, c_false, c_false, c_int_na \ c_false] | [list, list, c_true, c_false, c_int_na \ c_false, c_false] | [list, list, c_true, c_false, c_int_na \ c_false, c_int_na \ c_false] | [list, list, c_true, c_int_na \ c_false, c_false, c_false] | [list, list, c_true, c_int_na \ c_false, c_false, c_int_na \ c_false] | [list, list, c_true, c_int_na \ c_false, c_int_na \ c_false, c_false] | [list, list, c_true, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false] -> LGL1)
timing: 2.14 s
source
SEXP list_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(SEXP, VECTOR_PTR_RO, list_equal_na_equal, list_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:159

list_equal_na_equal typed

[any_sexp, any_sexp] -> c_bool
timing: 0.009 s
source
static inline int list_equal_na_equal(SEXP x, SEXP y) {
  return obj_equal_utf8(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:47

list_equal_na_propagate typed

([<...> | p(CHR) | sym, <...> | p(CHR) | sym] -> c_bool)&([null, any_sexp] | [<...> | p(CHR) | sym, null] -> c_na)
timing: 0.060 s
source
static inline int list_equal_na_propagate(SEXP x, SEXP y) {
  if (list_is_missing(x) || list_is_missing(y)) {
    return NA_LOGICAL;
  } else {
    return list_equal_na_equal(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:175

list_first_missing typed

[any_sexp] -> ([null] -> c_true) & ([<...> | p(CHR) | sym] -> c_false)
timing: 0.013 s
source
r_ssize list_first_missing(r_obj* x) {
  FIRST_MISSING(r_obj*, r_list_cbegin, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:340

list_first_non_null typed

∀'a. [{ null | 'a }, *c_int_na \ c_null] | [{ null | 'a }, c_null] -> null | 'a
timing: 0.274 s
source
SEXP list_first_non_null(SEXP xs, R_len_t* non_null_i) {
  SEXP x = R_NilValue;
  R_len_t n = Rf_length(xs);

  R_len_t i = 0;
  for (; i < n; ++i) {
    x = VECTOR_ELT(xs, i);
    if (x != R_NilValue) {
      break;
    }
  }

  if (non_null_i) {
    *non_null_i = i;
  }
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:649

list_hash typed

[any_sexp] -> ([any_sexp] -> c_int_na)
timing: 0.006 s
source
static inline uint32_t list_hash(r_obj* x) {
  HASH(r_obj*, r_list_cbegin, list_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:95

list_hash_fill_na_equal typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.006 s
source
static inline void list_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(r_obj*, r_list_cbegin, list_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:244

list_hash_fill_na_propagate typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.006 s
source
static inline void list_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(r_obj*, r_list_cbegin, list_hash_scalar, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:266

list_hash_scalar typed

[any_sexp] -> c_int_na
timing: 0.006 s
source
static inline uint32_t list_hash_scalar(r_obj* x) {
  return obj_hash(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:103

list_interleave_indices typed

[*(<...> | p(CHR) | sym), c_int_na, c_int_na, c_int] | [*null, c_int_na, c_int_na, c_int_na] -> list
timing: 1.17 s
source
r_obj* list_interleave_indices(
  r_obj* const* v_x,
  r_ssize x_size,
  r_ssize x_size_used,
  r_ssize elt_size
) {
  r_obj* indices = KEEP(r_alloc_list(x_size));

  r_ssize start = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    r_obj* elt = v_x[i];

    if (elt == r_null) {
      // Insert `integer()` index for `NULL`, don't advance `start`
      r_list_poke(indices, i, r_globals.empty_int);
      continue;
    }

    ++start;

    r_obj* index = r_alloc_integer(elt_size);
    r_list_poke(indices, i, index);
    int* v_index = r_int_begin(index);

    for (r_ssize j = 0; j < elt_size; ++j) {
      v_index[j] = start + x_size_used * j;
    }
  }

  FREE(1);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-interleave.c:130

list_interleave_x_size_used typed

([*(<...> | p(CHR) | sym), c_int_na] -> c_int)&([*null, c_int_na] -> c_false)
timing: 0.188 s
source
r_ssize list_interleave_x_size_used(r_obj* const* v_x, r_ssize x_size) {
  r_ssize x_size_used = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    r_obj* elt = v_x[i];

    if (elt == r_null) {
      continue;
    }

    ++x_size_used;
  }

  return x_size_used;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-interleave.c:113

list_is_missing typed

([null] -> c_true)&([<...> | p(CHR) | sym] -> c_false)
timing: 0.009 s
source
bool list_is_missing(r_obj* x) {
  return x == r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:40

list_slice_shaped typed

([list, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [list, any_sexp, c_null] -> any_sexp)
timing: 0.528 s
source
static SEXP list_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_BARRIER_SHAPED(VECSXP, SEXP, VECTOR_PTR_RO, SET_VECTOR_ELT, R_NilValue);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:265

list_unchop typed

[any_sexp, any_sexp, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.034 s
source
r_obj* list_unchop(
  r_obj* xs,
  r_obj* indices,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* name_repair,
  struct vctrs_arg* p_error_arg,
  struct r_lazy error_call
) {
  return list_combine_for_list_unchop(
    xs,
    indices,
    ptype,
    name_spec,
    name_repair,
    p_error_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-unchop.c:47

load_with_haystack typed

([*struct dictionary, c_int_na] -> ())&([c_null, c_int_na] -> empty)
timing: 1.93 s
source
void load_with_haystack(struct dictionary* d, R_len_t n_haystack) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: LOAD_WITH_HAYSTACK(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: LOAD_WITH_HAYSTACK(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: LOAD_WITH_HAYSTACK(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: LOAD_WITH_HAYSTACK(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: LOAD_WITH_HAYSTACK(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: LOAD_WITH_HAYSTACK(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: LOAD_WITH_HAYSTACK(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: LOAD_WITH_HAYSTACK(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: LOAD_WITH_HAYSTACK(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vec_match_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:722

map typed

∀'a. [{ 'a }, ([any_sexp] --> any_sexp) & (['a] --> any)] -> any_sexp
timing: 0.260 s
source
SEXP map(SEXP x, SEXP (*fn)(SEXP)) {
  R_len_t n = Rf_length(x);
  SEXP out = PROTECT(Rf_allocVector(VECSXP, n));

  for (R_len_t i = 0; i < n; ++i) {
    SET_VECTOR_ELT(out, i, fn(VECTOR_ELT(x, i)));
  }

  SEXP nms = PROTECT(Rf_getAttrib(x, R_NamesSymbol));
  Rf_setAttrib(out, R_NamesSymbol, nms);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:259

midpoint typed

([c_int, c_int] -> c_int)&([c_int_na, c_int_na] -> any)
timing: 0.021 s
source
r_ssize midpoint(r_ssize lhs, r_ssize rhs) {
  return lhs + (rhs - lhs) / 2;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2650

multiply_would_overflow typed

[c_int_na, c_int_na] -> c_bool
timing: 0.008 s
source
bool multiply_would_overflow(r_ssize x, r_ssize y) {
  return (double) x * y > R_LEN_T_MAX;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:219

name_repair_arg_as_c_string typed

([c(2)] -> c("unique"))&([c(3)] -> c("universal"))&([c(4)] -> c("check_unique"))&([c(99)] -> c("custom"))&([c_false] -> c("none"))&([c_true] -> c("minimal"))
timing: 0.232 s
source
const char* name_repair_arg_as_c_string(enum name_repair_type type) {
  switch (type) {
  case NAME_REPAIR_none: return "none";
  case NAME_REPAIR_minimal: return "minimal";
  case NAME_REPAIR_unique: return "unique";
  case NAME_REPAIR_universal: return "universal";
  case NAME_REPAIR_check_unique: return "check_unique";
  case NAME_REPAIR_custom: return "custom";
  }
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:977

name_spec_is_inner typed

([null] -> c_false)&([CHR | null] -> c_bool)
timing: 0.083 s
source
bool name_spec_is_inner(r_obj* name_spec) {
  if (!r_is_string(name_spec)) {
    return false;
  }

  const char* name_spec_c_string = r_chr_get_c_string(name_spec, 0);

  return !strcmp(name_spec_c_string, "inner");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:658

needs_suffix typed

[p(CHR)] -> c_bool
timing: 0.045 s
source
static bool needs_suffix(r_obj* str) {
  return
    str == r_globals.na_str ||
    str == strings_dots ||
    str == strings_empty ||
    is_dotdotint(r_str_c_string(str));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:440

never_reached typed empty return

[c_string] -> empty
timing: 0.005 s
source
inline void never_reached(const char* fn) {
  Rf_error("Internal error in `%s()`: Reached the unreachable.", fn);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:381

new_cast_opts typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, any_sexp] -> struct cast_opts
timing: 0.011 s
source
struct cast_opts new_cast_opts(r_obj* x,
                               r_obj* to,
                               struct vctrs_arg* p_x_arg,
                               struct vctrs_arg* p_to_arg,
                               struct r_lazy call,
                               r_obj* opts) {
  return (struct cast_opts) {
    .x = x,
    .to = to,
    .p_x_arg = p_x_arg,
    .p_to_arg = p_to_arg,
    .call = call,
    .s3_fallback = s3_fallback_from_opts(opts)
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:381

new_compact_condition typed

([c(..-1)] -> empty)&([c(0..)] -> raw)
timing: 0.029 s
source
r_obj* new_compact_condition(R_xlen_t size) {
  if (size < 0) {
    r_stop_internal("Negative `size` in `compact_condition()`.");
  }

  r_obj* out = KEEP(r_alloc_raw(size * sizeof(bool)));

  r_attrib_poke_class(out, compact_condition_classes);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:881

new_compact_rownames typed

[c_int_na] -> any_sexp
timing: 0.100 s
source
r_obj* new_compact_rownames(r_ssize n_rows) {
  if (n_rows <= 0) {
    return r_globals.empty_int;
  }

  r_obj* out = r_alloc_integer(2);
  int* p_out = r_int_begin(out);
  p_out[0] = r_globals.na_int;
  p_out[1] = -n_rows;

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/df.c:50

new_counter_arg typed

[*struct vctrs_arg, *struct arg_data_counter] -> struct vctrs_arg
timing: 0.009 s
source
struct vctrs_arg new_counter_arg(struct vctrs_arg* parent,
                                 struct arg_data_counter* data) {
  return (struct vctrs_arg) {
    .parent = parent,
    .fill = &counter_arg_fill,
    .data = (void*) data
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:233

new_counter_arg_data typed

[*struct vctrs_arg, *c_int_na, *any_sexp] -> struct arg_data_counter
timing: 0.012 s
source
struct arg_data_counter new_counter_arg_data(struct vctrs_arg* p_parent,
                                             r_ssize* i,
                                             r_obj** names) {
  return (struct arg_data_counter) {
    .p_parent = p_parent,
    .i = i,
    .names = names
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:242

new_data_frame typed

∀'a. [any_sexp & 'a, c_int_na] -> any_sexp & 'a
timing: 0.018 s
source
r_obj* new_data_frame(r_obj* x, r_ssize n) {
  x = KEEP(r_clone_referenced(x));
  init_data_frame(x, n);

  FREE(1);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:27

new_date typed empty return

[((CHR | CLX | INT | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym] -> empty
timing: 0.053 s
source
static SEXP new_date(SEXP x) {
  if (TYPEOF(x) != REALSXP) {
    Rf_errorcall(R_NilValue, "`x` must be a double vector.");
  }

  SEXP names = PROTECT(r_names(x));

  SEXP out = PROTECT(r_clone_referenced(x));

  r_attrib_zap_all(out);
  r_attrib_poke_names(out, names);
  r_attrib_poke_class(out, classes_date);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:270

new_datetime typed empty return

[DBL, (clx | (~vec)<...>) | sym] | [((CHR | CLX | INT | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym, any_sexp] -> empty
timing: 0.408 s
source
static SEXP new_datetime(SEXP x, SEXP tzone) {
  if (TYPEOF(x) != REALSXP) {
    Rf_errorcall(R_NilValue, "`x` must be a double vector.");
  }

  // Convenience special case where we allow a
  // null `tzone` to represent local time
  if (tzone == R_NilValue) {
    tzone = chrs_empty;
  }

  if (TYPEOF(tzone) != STRSXP) {
    Rf_errorcall(R_NilValue, "`tzone` must be a character vector or `NULL`.");
  }

  SEXP names = PROTECT(r_names(x));

  SEXP out = PROTECT(r_clone_referenced(x));

  r_attrib_zap_all(out);
  r_attrib_poke_names(out, names);
  r_attrib_poke_class(out, classes_posixct);
  r_attrib_poke(out, syms_tzone, tzone);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:293

new_df_short_circuit_info typed

[c_int, c_false] | [c_int_na, c_int_na \ c_false] -> struct df_short_circuit_info
timing: 0.161 s
source
static inline struct df_short_circuit_info new_df_short_circuit_info(R_len_t size, bool lazy) {
  SEXP row_known;
  bool* p_row_known;

  if (lazy) {
    row_known = PROTECT(R_NilValue);
    p_row_known = NULL;
  } else {
    row_known = PROTECT(Rf_allocVector(RAWSXP, size * sizeof(bool)));
    p_row_known = (bool*) RAW(row_known);

    // To begin with, no rows have a known comparison value
    r_memset(p_row_known, false, size * sizeof(bool));
  }

  struct df_short_circuit_info info = {
    .row_known = row_known,
    .p_row_known = p_row_known,
    .remaining = size,
    .size = size
  };

  UNPROTECT(1);
  return info;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vctrs.h:142

new_dictionary typed

[any_sexp] -> *struct dictionary
timing: 0.019 s
source
struct dictionary* new_dictionary(SEXP x) {
  struct dictionary_opts opts = {
    .partial = false,
    .na_equal = true
  };
  return new_dictionary_opts(x, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:40

new_dictionary_params typed

[any_sexp, c_false, c_false] | [any_sexp, c_false, c_int_na \ c_false] | [any_sexp, c_int_na \ c_false, c_false] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false] -> *struct dictionary
timing: 0.065 s
source
static struct dictionary* new_dictionary_params(SEXP x, bool partial, bool na_equal) {
  struct dictionary_opts opts;
  opts.partial = partial;
  opts.na_equal = na_equal;
  return new_dictionary_opts(x, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:55

new_dictionary_partial typed

[any_sexp] -> *struct dictionary
timing: 0.009 s
source
struct dictionary* new_dictionary_partial(SEXP x) {
  struct dictionary_opts opts = {
    .partial = true,
    .na_equal = true
  };
  return new_dictionary_opts(x, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:47

new_empty_datetime typed empty return

[(~CHR)<...> | sym] -> empty
timing: 0.027 s
source
static SEXP new_empty_datetime(SEXP tzone) {
  return new_datetime(r_globals.empty_dbl, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:322

new_empty_factor typed

∀'a,'b. ([(CHR & v('b)) & 'a] -> INT with { levels: 'a & (CHR & v('b)), any })&([p(CHR) & 'a] -> INT with { levels: 'a & p(CHR), any })&(['a & ((clx & v('b) | (~vec)<...>) | null | sym)] -> empty)
timing: 0.218 s
source
SEXP new_empty_factor(SEXP levels) {
  if (TYPEOF(levels) != STRSXP) {
    r_stop_internal("`level` must be a character vector.");
  }

  SEXP out = PROTECT(Rf_allocVector(INTSXP, 0));

  Rf_setAttrib(out, R_LevelsSymbol, levels);
  Rf_setAttrib(out, R_ClassSymbol, classes_factor);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:687

new_empty_ordered typed

∀'a. [any_sexp & 'a] -> INT with { levels: 'a & any_sexp, any }
timing: 0.046 s
source
SEXP new_empty_ordered(SEXP levels) {
  SEXP out = PROTECT(Rf_allocVector(INTSXP, 0));

  Rf_setAttrib(out, R_LevelsSymbol, levels);
  Rf_setAttrib(out, R_ClassSymbol, classes_ordered);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:702

new_error_subscript_type typed

([any_sexp, c_null, any_sexp] -> empty)&([any_sexp, *struct subscript_opts, any_sexp] \ [any_sexp, c_null, any_sexp] -> any_sexp)
timing: 0.645 s
source
r_obj* new_error_subscript_type(r_obj* subscript,
                                const struct subscript_opts* opts,
                                r_obj* body) {
  r_obj* logical = subscript_type_action_chr(opts->logical);
  r_obj* numeric = subscript_type_action_chr(opts->numeric);
  r_obj* character = subscript_type_action_chr(opts->character);

  subscript = KEEP(expr_protect(subscript));
  r_obj* subscript_arg = KEEP(vctrs_arg(opts->subscript_arg));
  r_obj* ffi_call = r_lazy_eval_protect(opts->call);

  r_obj* syms[] = {
    syms_i,
    syms_subscript_arg,
    syms_subscript_action,
    syms_call,
    syms_logical,
    syms_numeric,
    syms_character,
    syms_body,
    NULL
  };
  r_obj* args[] = {
    subscript,
    subscript_arg,
    get_opts_action(opts),
    ffi_call,
    logical,
    numeric,
    character,
    body,
    NULL
  };

  r_obj* call = KEEP(r_call_n(syms_new_error_subscript_type, syms, args));
  r_obj* out = r_eval(call, vctrs_ns_env);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:306

new_group_info typed

() -> *struct group_info
timing: 0.120 s
source
struct group_info* new_group_info(void) {
  SEXP self = PROTECT(r_new_raw(sizeof(struct group_info)));
  struct group_info* p_group_info = (struct group_info*) RAW(self);

  p_group_info->self = self;
  p_group_info->data_size = 0;
  p_group_info->data = r_globals.empty_int;
  p_group_info->n_groups = 0;
  p_group_info->max_group_size = 0;

  UNPROTECT(1);
  return p_group_info;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:18

new_group_infos typed

[*struct group_info, *struct group_info, c_int_na, c_false, c_false] | [*struct group_info, *struct group_info, c_int_na, c_false, c_int_na \ c_false] | [*struct group_info, *struct group_info, c_int_na, c_int_na \ c_false, c_false] | [*struct group_info, *struct group_info, c_int_na, c_int_na \ c_false, c_int_na \ c_false] -> *struct group_infos
timing: 1.00 s
source
struct group_infos* new_group_infos(struct group_info* p_group_info0,
                                    struct group_info* p_group_info1,
                                    r_ssize max_data_size,
                                    bool force_groups,
                                    bool ignore_groups) {
  SEXP self = PROTECT(r_new_raw(sizeof(struct group_infos)));
  struct group_infos* p_group_infos = (struct group_infos*) RAW(self);

  SEXP p_p_group_info_data = PROTECT(r_new_raw(2 * sizeof(struct group_info*)));
  struct group_info** p_p_group_info = (struct group_info**) RAW(p_p_group_info_data);

  p_p_group_info[0] = p_group_info0;
  p_p_group_info[1] = p_group_info1;

  p_group_infos->self = self;
  p_group_infos->p_p_group_info_data = p_p_group_info_data;
  p_group_infos->p_p_group_info = p_p_group_info;
  p_group_infos->max_data_size = max_data_size;
  p_group_infos->current = 0;
  p_group_infos->force_groups = force_groups;
  p_group_infos->ignore_groups = ignore_groups;

  UNPROTECT(2);
  return p_group_infos;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-groups.c:34

new_group_rle typed

[any_sexp, any_sexp, c_int_na] -> <...>
timing: 0.167 s
source
SEXP new_group_rle(SEXP g, SEXP l, R_len_t n) {
  SEXP out = PROTECT(Rf_allocVector(VECSXP, 2));

  SET_VECTOR_ELT(out, 0, g);
  SET_VECTOR_ELT(out, 1, l);

  SEXP names = PROTECT(Rf_allocVector(STRSXP, 2));
  SET_STRING_ELT(names, 0, strings_group);
  SET_STRING_ELT(names, 1, strings_length);
  Rf_setAttrib(out, R_NamesSymbol, names);

  SEXP n_groups = PROTECT(Rf_ScalarInteger(n));
  Rf_setAttrib(out, syms_n, n_groups);

  Rf_setAttrib(out, R_ClassSymbol, classes_vctrs_group_rle);

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:168

new_growable typed

([list, c_int_na] | [p(CHR | CLX | DBL | LGL | RAW), c_int] -> empty)&([any, c_int_na] & ~[list, c_int_na] & ~[p(CHR | CLX | DBL | LGL | RAW), c_int] -> struct growable)
timing: 0.223 s
source
struct growable new_growable(SEXPTYPE type, int capacity) {
  struct growable g;

  g.x = Rf_allocVector(type, capacity);
  g.type = type;
  g.array = r_vec_unwrap(type, g.x);
  g.n = 0;
  g.capacity = capacity;

  return g;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/growable.c:3

new_lazy_arg typed

[*struct r_lazy] -> struct vctrs_arg
timing: 0.006 s
source
struct vctrs_arg new_lazy_arg(struct r_lazy* arg) {
  return (struct vctrs_arg) {
    .parent = NULL,
    .fill = &lazy_arg_fill,
    .data = arg
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:118

new_lazy_raw typed

[c_int_na, c_int_na] -> *struct lazy_raw
timing: 0.098 s
source
struct lazy_raw* new_lazy_raw(r_ssize size, size_t n_bytes) {
  SEXP self = PROTECT(r_new_raw(sizeof(struct lazy_raw)));
  struct lazy_raw* p_out = (struct lazy_raw*) RAW(self);

  p_out->self = self;
  p_out->data = R_NilValue;
  p_out->size = size * n_bytes;

  UNPROTECT(1);
  return p_out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/lazy.h:33

new_location_opts_assign typed

() -> struct location_opts
timing: 0.002 s
source
struct location_opts new_location_opts_assign(void) {
  return (struct location_opts) {
    .subscript_opts = new_subscript_opts_assign()
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.h:38

new_matches_result typed

[any_sexp, any_sexp] -> list
timing: 0.050 s
source
r_obj* new_matches_result(r_obj* needles, r_obj* haystack) {
  r_obj* out = KEEP(r_alloc_list(2));

  r_list_poke(out, 0, needles);
  r_list_poke(out, 1, haystack);

  r_obj* names = r_alloc_character(2);
  r_attrib_poke_names(out, names);

  r_chr_poke(names, 0, strings_needles);
  r_chr_poke(names, 1, strings_haystack);

  r_init_data_frame(out, r_length(needles));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1572

new_name_repair_opts typed

[CHR, struct r_lazy, c_false, struct r_lazy] | [CHR, struct r_lazy, c_int_na \ c_false, struct r_lazy] | [null, struct r_lazy, c_false, struct r_lazy] | [null, struct r_lazy, c_int_na \ c_false, struct r_lazy] -> struct name_repair_opts
timing: 4.69 s
source
struct name_repair_opts new_name_repair_opts(r_obj* name_repair,
                                             struct r_lazy name_repair_arg,
                                             bool quiet,
                                             struct r_lazy call) {
  struct name_repair_opts opts = {
    .shelter = r_null,
    .type = 0,
    .fn = r_null,
    .name_repair_arg = name_repair_arg,
    .quiet = quiet,
    .call = call
  };

  switch (r_typeof(name_repair)) {
  case R_TYPE_character: {
    if (!r_length(name_repair)) {
      stop_name_repair(&opts);
    }

    r_obj* c = r_chr_get(name_repair, 0);

    if (c == strings_none) {
      opts.type = NAME_REPAIR_none;
    } else if (c == strings_minimal) {
      opts.type = NAME_REPAIR_minimal;
    } else if (c == strings_unique) {
      opts.type = NAME_REPAIR_unique;
    } else if (c == strings_universal) {
      opts.type = NAME_REPAIR_universal;
    } else if (c == strings_check_unique) {
      opts.type = NAME_REPAIR_check_unique;
    } else if (c == strings_unique_quiet) {
      opts.type = NAME_REPAIR_unique;
      opts.quiet = true;
    } else if (c == strings_universal_quiet) {
      opts.type = NAME_REPAIR_universal;
      opts.quiet = true;
    } else {
      struct repair_error_info info = new_repair_error_info(&opts);
      KEEP(info.shelter);
      r_abort_call(info.input_error_call,
                   "%s can't be \"%s\". See `?vctrs::vec_as_names`.",
                   r_format_error_arg(info.input_error_repair_arg),
                   r_str_c_string(c));
    }

    return opts;
  }

  case R_TYPE_call:
    opts.fn = r_as_function(name_repair, ".name_repair");
    opts.shelter = opts.fn;
    opts.type = NAME_REPAIR_custom;
    return opts;

  case R_TYPE_closure:
    opts.fn = name_repair;
    opts.type = NAME_REPAIR_custom;
    return opts;

  default:
    stop_name_repair(&opts);
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:910

new_order typed

[c_int] -> *struct order
timing: 0.297 s
source
struct order* new_order(r_ssize size) {
  SEXP self = PROTECT(r_new_raw(sizeof(struct order)));
  struct order* p_order = (struct order*) RAW(self);

  SEXP data = PROTECT(Rf_allocVector(INTSXP, size));
  int* p_data = INTEGER(data);

  p_order->self = self;
  p_order->data = data;
  p_order->p_data = p_data;
  p_order->size = size;
  p_order->initialized = false;

  UNPROTECT(2);
  return p_order;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.h:58

new_poly_vec typed

([any_sexp, c_true | c(10) | c(255)] -> empty)&([any_sexp, c(9)] | [any_sexp, c_false] -> *struct poly_vec)
timing: 1.53 s
source
struct poly_vec* new_poly_vec(r_obj* proxy, enum vctrs_type type) {
  r_obj* shelter = KEEP(r_alloc_list(2));

  r_obj* self = r_alloc_raw(sizeof(struct poly_vec));
  r_list_poke(shelter, 0, self);
  r_list_poke(shelter, 1, proxy);

  struct poly_vec* p_poly_vec = r_raw_begin(self);

  p_poly_vec->shelter = shelter;
  p_poly_vec->vec = proxy;
  p_poly_vec->type = type;

  switch (type) {
  case VCTRS_TYPE_null: init_nil_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_logical: init_lgl_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_integer: init_int_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_double: init_dbl_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_complex: init_cpl_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_character: init_chr_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_raw: init_raw_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_list: init_list_poly_vec(p_poly_vec); break;
  case VCTRS_TYPE_dataframe: init_df_poly_vec(p_poly_vec); break;
  default: stop_unimplemented_vctrs_type("new_poly_vec", type);
  }

  FREE(1);
  return p_poly_vec;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:40

new_repair_error_info typed

([c_null] -> empty)&([*struct name_repair_opts] \ [c_null] -> struct repair_error_info)
timing: 16.92 s
source
struct repair_error_info new_repair_error_info(struct name_repair_opts* p_opts) {
  struct repair_error_info out;

  out.shelter = r_new_list(4);
  KEEP(out.shelter);

  out.repair_arg = r_lazy_eval(p_opts->name_repair_arg);
  r_list_poke(out.shelter, 0, out.repair_arg);

  out.call = r_lazy_eval(p_opts->call);
  r_list_poke(out.shelter, 1, out.call);

  // If this is NULL, the `repair` value has been hard-coded by the
  // frontend. Input errors are internal, and we provide no
  // recommendation to fix user errors by providing a different value
  // for `repair`.
  if (out.repair_arg == r_null) {
    out.input_error_repair_arg = chrs.repair;
    r_list_poke(out.shelter, 2, out.input_error_repair_arg);

    out.input_error_call = r_call(r_sym("vec_as_names"));
    r_list_poke(out.shelter, 3, out.input_error_call);
  } else {
    out.input_error_repair_arg = r_lazy_eval(p_opts->name_repair_arg);
    r_list_poke(out.shelter, 2, out.input_error_repair_arg);

    out.input_error_call = r_lazy_eval(p_opts->call);
    r_list_poke(out.shelter, 3, out.input_error_call);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:58

new_subscript_arg_vec typed

[*struct vctrs_arg, any_sexp, *c_int_na] -> *struct vctrs_arg
timing: 0.085 s
source
struct vctrs_arg* new_subscript_arg_vec(struct vctrs_arg* parent,
                                        r_obj* x,
                                        r_ssize* p_i) {
  r_obj* names = KEEP(vec_names(x));
  struct vctrs_arg* p_arg = new_subscript_arg(parent,
                                              names,
                                              vec_size(x),
                                              p_i);
  FREE(1);
  return p_arg;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:155

new_wrapper_arg typed

[*struct vctrs_arg, c_string] -> struct vctrs_arg
timing: 0.008 s
source
struct vctrs_arg new_wrapper_arg(struct vctrs_arg* parent,
                                 const char* arg) {
  return (struct vctrs_arg) {
    .parent = parent,
    .fill = &wrapper_arg_fill,
    .data = (void*) arg
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:101

nil_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t nil_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return nil_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:157

nil_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.008 s
source
uint32_t nil_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_nil_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:114

nil_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_false)&([c_null, c_int_na] -> empty)
timing: 0.121 s
source
bool nil_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_nil_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:200

node_hash typed

[lang] -> c_int_na
timing: 0.035 s
source
static inline uint32_t node_hash(r_obj* x) {
  uint32_t hash = 0;
  hash = hash_combine(hash, obj_hash(r_node_tag(x)));
  hash = hash_combine(hash, obj_hash(r_node_car(x)));
  hash = hash_combine(hash, obj_hash(r_node_cdr(x)));
  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:113

obj_attrib_count_cb typed

[any_sexp, any_sexp, c_ptr] -> c_null
timing: 0.049 s
source
static r_obj* obj_attrib_count_cb(r_obj* _tag, r_obj* _value, void* data) {
  struct attrib_count_data* p_data = (struct attrib_count_data*) data;
  p_data->y_size++;

  // Continue
  return NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:584

obj_cast_subscript typed

([any_sexp, *struct subscript_opts, *any] -> any_sexp)&([any_sexp, c_null, *any] -> empty)
timing: 0.469 s
source
r_obj* obj_cast_subscript(r_obj* subscript,
                          const struct subscript_opts* opts,
                          ERR* err) {
  struct vctrs_arg* p_subscript_arg = opts->subscript_arg;
  struct r_lazy call = opts->call;
  const enum s3_fallback s3_fallback = S3_FALLBACK_false;

  struct cast_opts cast_opts = {
    .x = subscript,
    .to = r_null,
    .p_x_arg = p_subscript_arg
  };

  cast_opts.to = r_globals.empty_lgl;
  if (vec_is_coercible(
    subscript,
    cast_opts.to,
    p_subscript_arg,
    vec_args.empty,
    call,
    s3_fallback
  )) {
    return vec_cast_opts(&cast_opts);
  }

  cast_opts.to = r_globals.empty_int;
  if (vec_is_coercible(
    subscript,
    cast_opts.to,
    p_subscript_arg,
    vec_args.empty,
    call,
    s3_fallback
  )) {
    return vec_cast_opts(&cast_opts);
  }

  cast_opts.to = r_globals.empty_chr;
  if (vec_is_coercible(
    subscript,
    cast_opts.to,
    p_subscript_arg,
    vec_args.empty,
    call,
    s3_fallback
  )) {
    return vec_cast_opts(&cast_opts);
  }

  *err = new_error_subscript_type(subscript, opts, r_null);
  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:98

obj_check_list typed

[<> | null | p(CHR) | sym, *struct vctrs_arg, struct r_lazy] -> ()
timing: 0.029 s
source
void obj_check_list(
  r_obj* x,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  if (!obj_is_list(x)) {
    stop_non_list_type(x, p_x_arg, call);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:158

obj_check_vector typed

[<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] -> ()
timing: 0.033 s
source
void obj_check_vector(
  r_obj* x,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  if (!obj_is_vector(x, allow_null)) {
    stop_scalar_type(x, p_x_arg, call);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:43

obj_equal_utf8 typed

[any_sexp, any_sexp] -> c_bool
timing: 0.186 s
source
bool obj_equal_utf8(r_obj* x, r_obj* y) {
  const enum r_type type = r_typeof(x);

  // Types must be the same
  if (type != r_typeof(y)) {
    return false;
  }

  // Every type has a chance for an "equal pointer" optimization
  if (x == y) {
    return true;
  }

  switch (type) {
  // Pure pointer comparison. If it didn't early exit in the pointer
  // comparison above, then they must not be equal.
  case R_TYPE_null:
  case R_TYPE_symbol:
  case R_TYPE_special:
  case R_TYPE_builtin:
  case R_TYPE_string:
  case R_TYPE_environment:
  case R_TYPE_pointer:
    return false;

  // Vectors
  case R_TYPE_logical:
  case R_TYPE_integer:
  case R_TYPE_double:
  case R_TYPE_character:
  case R_TYPE_raw:
  case R_TYPE_complex:
  case R_TYPE_list:
    return obj_vec_equal(x, y, type);

  // Expression vectors
  case R_TYPE_expression:
    return obj_expr_equal(x, y);

  // Node like
  case R_TYPE_dots:
  case R_TYPE_call:
  case R_TYPE_pairlist:
  case R_TYPE_bytecode:
    return obj_node_equal(x, y);

  // Functions
  case R_TYPE_closure:
    return obj_fn_equal(x, y);

  default:
    stop_unimplemented_type("obj_equal_utf8", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:343

obj_expr_equal typed

[list, list] -> c_bool
timing: 0.622 s
source
static inline bool obj_expr_equal(r_obj* x, r_obj* y) {
  const r_ssize n = r_length(x);

  // Length check
  if (n != r_length(y)) {
    return false;
  }

  // Attribute check
  if (!obj_attrib_equal(x, y)) {
    return false;
  }

  // Data check
  for (r_ssize i = 0; i < n; ++i) {
    r_obj* x_elt = r_list_get(x, i);
    r_obj* y_elt = r_list_get(y, i);

    if (!obj_equal_utf8(x_elt, y_elt)) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:445

obj_fn_equal typed

[arrow, arrow] -> c_bool
timing: 0.077 s
source
static inline bool obj_fn_equal(r_obj* x, r_obj* y) {
  // Attribute check
  if (!obj_attrib_equal(x, y)) {
    return false;
  }

  // Function body check
  if (!obj_equal_utf8(r_fn_body(x), r_fn_body(y))) {
    return false;
  }

  // Function environment check
  if (!obj_equal_utf8(r_fn_env(x), r_fn_env(y))) {
    return false;
  }

  // Function formals check
  if (!obj_equal_utf8(r_fn_formals(x), r_fn_formals(y))) {
    return false;
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:495

obj_hash typed

[any_sexp] -> c_int_na
timing: 0.023 s
source
uint32_t obj_hash(r_obj* x) {
  uint32_t hash = sexp_hash(x);

  if (r_attrib_has_any(x)) {
    hash = hash_combine(hash, attrib_hash(x));
  }

  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:19

obj_is_list typed

[<> | null | p(CHR) | sym] -> c_bool
timing: 0.069 s
source
bool obj_is_list(r_obj* x) {
  // Require `x` to be a list internally
  if (r_typeof(x) != R_TYPE_list) {
    return false;
  }

  // List arrays are not lists for vctrs purposes. We have pretty deep
  // assumptions that if an object is a list, then `r_length(x) == vec_size(x)`.
  // See `list_drop_empty()` and `list_combine()` for examples of
  // implementations that would be broken if this wasn't true.
  if (has_dim(x)) {
    return false;
  }

  // Unclassed R_TYPE_list are lists
  if (!r_is_object(x)) {
    return true;
  }

  const enum vctrs_class_type type = class_type(x);

  // Classed R_TYPE_list are only lists if the last class is explicitly `"list"`
  // or if it is a bare "AsIs" type
  return (type == VCTRS_CLASS_list) || (type == VCTRS_CLASS_bare_asis);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:131

obj_is_vector typed

[null, c_bool] | [<> | p(CHR) | sym, c_bool] -> c_bool
timing: 0.032 s
source
bool obj_is_vector(r_obj* x, enum vctrs_allow_null allow_null) {
  if (x == r_null) {
    return allow_null_as_bool(allow_null);
  }
  struct vctrs_proxy_info info = vec_proxy_info(x);
  return info.type != VCTRS_TYPE_scalar;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:34

obj_node_equal typed

[lang, lang] -> c_bool
timing: 0.077 s
source
static inline bool obj_node_equal(r_obj* x, r_obj* y) {
  // Attribute check
  if (!obj_attrib_equal(x, y)) {
    return false;
  }

  // Tag check
  if (!obj_equal_utf8(r_node_tag(x), r_node_tag(y))) {
    return false;
  }

  // Value check
  if (!obj_equal_utf8(r_node_car(x), r_node_car(y))) {
    return false;
  }

  // Check rest
  if (!obj_equal_utf8(r_node_cdr(x), r_node_cdr(y))) {
    return false;
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:471

obj_vec_equal typed

([DBL, DBL, c(14)] | [INT, INT, c(13)] | [LGL, LGL, c(10)] -> c_bool)&([any_sexp, any_sexp, c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99)] | [any_sexp, any_sexp, c(19)] -> c_false)
timing: 10.94 s
source
static inline bool obj_vec_equal(r_obj* x, r_obj* y, enum r_type type) {
  const r_ssize n = r_length(x);

  // Length check
  if (n != r_length(y)) {
    return false;
  }

  // Attribute check
  if (!obj_attrib_equal(x, y)) {
    return false;
  }

  // Data check
  switch (type) {
  case R_TYPE_logical: OBJ_VEC_EQUAL(int, r_lgl_cbegin, lgl_equal_na_equal);
  case R_TYPE_integer: OBJ_VEC_EQUAL(int, r_int_cbegin, int_equal_na_equal);
  case R_TYPE_double: OBJ_VEC_EQUAL(double, r_dbl_cbegin, dbl_equal_na_equal);
  case R_TYPE_character: OBJ_VEC_EQUAL(r_obj*, r_chr_cbegin, chr_equal_na_equal);
  case R_TYPE_raw: OBJ_VEC_EQUAL(Rbyte, r_raw_cbegin, raw_equal_na_equal);
  case R_TYPE_complex: OBJ_VEC_EQUAL(r_complex, r_cpl_cbegin, cpl_equal_na_equal);
  case R_TYPE_list: OBJ_VEC_EQUAL(r_obj*, r_list_cbegin, list_equal_na_equal);
  default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:414

ord_as_character typed

[INT<factor, ...>, *struct vctrs_arg] -> CHR
timing: 0.041 s
source
SEXP ord_as_character(SEXP x, struct vctrs_arg* x_arg) {
  return fct_as_character(x, x_arg);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:129

ord_ptype2 typed

[any_sexp, any_sexp, c_null, c_null, struct r_lazy, c_bool] -> any_sexp
timing: 0.109 s
source
r_obj* ord_ptype2(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  r_obj* x_levels = PROTECT(Rf_getAttrib(x, R_LevelsSymbol));
  r_obj* y_levels = PROTECT(Rf_getAttrib(y, R_LevelsSymbol));

  SEXP out;
  if (ord_ptype2_validate(x_levels, y_levels, x, y, p_x_arg, p_y_arg)) {
    out = new_empty_ordered(x_levels);
  } else {
    out = vec_ptype2_default(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );
  }

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:54

ord_ptype2_validate typed

([CHR, CHR, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] | [CHR, p(CHR), any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] | [p(CHR), CHR, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] | [p(CHR), p(CHR), any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> c_bool)&([CHR, (clx | (~vec)<...>) | null | sym, any_sexp, any_sexp, *struct vctrs_arg, c_null] | [p(CHR), (clx | (~vec)<...>) | null | sym, any_sexp, any_sexp, *struct vctrs_arg, c_null] | [(clx | (~vec)<...>) | null | sym, any_sexp, any_sexp, any_sexp, c_null, *struct vctrs_arg] -> empty)
timing: 0.483 s
source
bool ord_ptype2_validate(
  r_obj* x_levels,
  r_obj* y_levels,
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  if (TYPEOF(x_levels) != STRSXP) {
    stop_corrupt_ordered_levels(x, p_x_arg);
  }
  if (TYPEOF(y_levels) != STRSXP) {
    stop_corrupt_ordered_levels(y, p_y_arg);
  }

  return obj_equal(x_levels, y_levels);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:35

ord_resolve_sortedness typed

([c_false, c_int_na, *c_int_na] -> empty)&([c(2), c_int, *c_int_na] | [c_true, c_int_na, *c_int_na] -> ())
timing: 0.132 s
source
void ord_resolve_sortedness(enum vctrs_sortedness sortedness,
                            r_ssize size,
                            int* p_o) {
  switch (sortedness) {
  case VCTRS_SORTEDNESS_sorted: int_incr(size, p_o); return;
  case VCTRS_SORTEDNESS_reversed: ord_reverse(size, p_o); return;
  case VCTRS_SORTEDNESS_unsorted: Rf_errorcall(R_NilValue, "Internal error: Unsorted case should be handled elsewhere.");
  }

  never_reached("ord_resolve_sortedness");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:447

ord_resolve_sortedness_chunk typed

([c_false, c_int_na, *c_int_na] -> empty)&([c(2), c_int_na, *c_int_na] | [c_true, c_int_na, *c_int_na] -> ())
timing: 0.091 s
source
void ord_resolve_sortedness_chunk(enum vctrs_sortedness sortedness,
                                  r_ssize size,
                                  int* p_o) {
  switch (sortedness) {
  case VCTRS_SORTEDNESS_sorted: return;
  case VCTRS_SORTEDNESS_reversed: ord_reverse_chunk(size, p_o); return;
  case VCTRS_SORTEDNESS_unsorted: Rf_errorcall(R_NilValue, "Internal error: Unsorted case should be handled elsewhere.");
  }

  never_reached("ord_resolve_sortedness_chunk");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:487

ord_reverse typed

[c_int, *c_int_na] -> ()
timing: 1.47 s
source
void ord_reverse(r_ssize size, int* p_o) {
  const r_ssize half = size / 2;

  for (r_ssize i = 0; i < half; ++i) {
    r_ssize swap = size - 1 - i;
    p_o[i] = swap + 1;
    p_o[swap] = i + 1;
  }

  // Initialize center value if odd number
  if (size % 2 != 0) {
    p_o[half] = half + 1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:469

ord_reverse_chunk typed

[c_int_na, *c_int_na] -> ()
timing: 0.285 s
source
void ord_reverse_chunk(r_ssize size, int* p_o) {
  const r_ssize half = size / 2;

  for (r_ssize i = 0; i < half; ++i) {
    r_ssize swap = size - 1 - i;

    const int temp = p_o[i];

    p_o[i] = p_o[swap];
    p_o[swap] = temp;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.c:504

outer_names typed

∀'a,'b. ([null & 'a, p(CHR) & 'b, c_true] -> CHR1 & v1('b) | 'a & (CHR1 & v1('b) | null))&([any_sexp & 'a, null & 'b, c_int_na] -> any_sexp & 'a)&(['a & (<...> | null | sym), p(CHR) & 'b, c_int_na \ c_true] | ['a & (<...> | null | sym), p(CHR) & 'b, c_true] -> any_sexp)
timing: 0.290 s
source
r_obj* outer_names(r_obj* names, r_obj* outer, r_ssize n) {
  if (outer == r_null) {
    return names;
  }
  if (r_typeof(outer) != R_TYPE_string) {
    r_stop_internal("`outer` must be a scalar string.");
  }

  if (outer == strings_empty || outer == r_globals.na_str) {
    return names;
  }

  if (r_is_empty_names(names)) {
    if (n == 1) {
      return r_str_as_character(outer);
    } else {
      return r_seq_chr(r_str_c_string(outer), n);
    }
  } else {
    return r_chr_paste_prefix(names, r_str_c_string(outer), "..");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:524

p_bool_any typed

([*c_false, c_int_na] -> c_false)&([*c_true, c_int_na] -> c_bool)
timing: 0.072 s
source
bool p_bool_any(const bool* v_x, r_ssize size) {
  for (r_ssize i = 0; i < size; ++i) {
    if (v_x[i]) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:64

p_bool_fill typed

[*c_bool, c_int_na, c_false] | [*c_bool, c_int_na, c_int_na \ c_false] -> ()
timing: 0.090 s
source
void p_bool_fill(bool* v_x, r_ssize size, bool value) {
  for (r_ssize i = 0; i < size; ++i) {
    v_x[i] = value;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:50

p_bool_sum typed

([*c_bool, c_int_na] -> c_int)&([c_null, c_int_na] -> c_false)
timing: 0.236 s
source
r_ssize p_bool_sum(const bool* v_x, r_ssize size) {
  r_ssize out = 0;

  for (r_ssize i = 0; i < size; ++i) {
    out += v_x[i];
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:82

p_chr_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_null
timing: 0.005 s
source
int p_chr_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(r_obj*, chr_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:135

p_chr_is_incomplete typed

[c_ptr, c_int_na] -> c_null
timing: 0.008 s
source
bool p_chr_is_incomplete(const void* p_x, r_ssize i) {
  return p_chr_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:145

p_chr_is_missing typed

[c_ptr, c_int_na] -> c_null
timing: 0.004 s
source
bool p_chr_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(r_obj*, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:71

p_chr_order_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na, c_int_na] -> c_null
timing: 0.006 s
source
int p_chr_order_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j, bool nan_distinct) {
  P_ORDER_COMPARE_NA_EQUAL(r_obj*, chr_order_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:106

p_col_compare_na_equal typed

([c_ptr, c_int_na, c_ptr, c_int_na, c(2)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(3)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(4)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(7)] -> c_int_na)&([c_ptr, c_int_na, c_ptr, c_int_na, c(5)] | [c_ptr, c_int_na, c_ptr, c_int_na, c_true | c(9..10) | c(255)] -> empty)&([c_ptr, c_int_na, c_ptr, c_int_na, c(6)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(8)] | [c_ptr, c_int_na, c_ptr, c_int_na, c_false] -> c_null)
timing: 1.44 s
source
int p_col_compare_na_equal(
  const void* p_x,
  r_ssize i,
  const void* p_y,
  r_ssize j,
  const enum vctrs_type type
) {
  switch (type) {
  case VCTRS_TYPE_null: return p_nil_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_logical: return p_lgl_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_integer: return p_int_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_double: return p_dbl_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_complex: return p_cpl_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_character: return p_chr_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_raw: return p_raw_compare_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_list: return p_list_compare_na_equal(p_x, i, p_y, j);
  default: stop_unimplemented_vctrs_type("p_col_compare_na_equal", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:151

p_col_equal_na_equal typed

([c_ptr, c_int_na, c_ptr, c_int_na, c_bool | c(9..10) | c(255)] -> empty)&([c_ptr, c_int_na, c_ptr, c_int_na, c(2)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(3)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(4)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(5)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(6)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(7)] | [c_ptr, c_int_na, c_ptr, c_int_na, c(8)] -> c_int_na)
timing: 0.694 s
source
bool p_col_equal_na_equal(
  const void* p_x,
  r_ssize i,
  const void* p_y,
  r_ssize j,
  const enum vctrs_type type
) {
  switch (type) {
  case VCTRS_TYPE_logical: return p_lgl_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_integer: return p_int_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_double: return p_dbl_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_complex: return p_cpl_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_character: return p_chr_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_raw: return p_raw_equal_na_equal(p_x, i, p_y, j);
  case VCTRS_TYPE_list: return p_list_equal_na_equal(p_x, i, p_y, j);
  default: stop_unimplemented_vctrs_type("p_col_equal_na_equal", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:87

p_col_is_missing typed

([c_ptr, c_int_na, c_bool | c(9..10) | c(255)] -> empty)&([c_ptr, c_int_na, c(2)] | [c_ptr, c_int_na, c(3)] | [c_ptr, c_int_na, c(4)] | [c_ptr, c_int_na, c(5)] -> c_bool)&([c_ptr, c_int_na, c(6)] | [c_ptr, c_int_na, c(7)] | [c_ptr, c_int_na, c(8)] -> c_null)
timing: 0.552 s
source
bool p_col_is_missing(
  const void* p_x,
  r_ssize i,
  const enum vctrs_type type
) {
  switch (type) {
  case VCTRS_TYPE_logical: return p_lgl_is_missing(p_x, i);
  case VCTRS_TYPE_integer: return p_int_is_missing(p_x, i);
  case VCTRS_TYPE_double: return p_dbl_is_missing(p_x, i);
  case VCTRS_TYPE_complex: return p_cpl_is_missing(p_x, i);
  case VCTRS_TYPE_character: return p_chr_is_missing(p_x, i);
  case VCTRS_TYPE_raw: return p_raw_is_missing(p_x, i);
  case VCTRS_TYPE_list: return p_list_is_missing(p_x, i);
  default: stop_unimplemented_vctrs_type("p_col_is_missing", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:87

p_cpl_compare_na_equal typed empty return

[c_ptr, c_int_na, c_ptr, c_int_na] -> empty
timing: 0.021 s
source
int p_cpl_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(Rcomplex, cpl_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:131

p_cpl_is_incomplete typed

[c_ptr, c_int_na] -> c_bool
timing: 0.006 s
source
bool p_cpl_is_incomplete(const void* p_x, r_ssize i) {
  return p_cpl_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:141

p_cpl_order_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na, c_int_na] -> c_int_na
timing: 0.021 s
source
int p_cpl_order_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j, bool nan_distinct) {
  P_ORDER_COMPARE_NA_EQUAL(r_complex, cpl_order_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:102

p_dbl_is_incomplete typed

[c_ptr, c_int_na] -> c_bool
timing: 0.007 s
source
bool p_dbl_is_incomplete(const void* p_x, r_ssize i) {
  return p_dbl_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:137

p_df_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_int_na | c_null
timing: 0.521 s
source
int p_df_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  struct poly_df_data* p_x_data = (struct poly_df_data*) p_x;
  struct poly_df_data* p_y_data = (struct poly_df_data*) p_y;

  r_ssize n_col = p_x_data->n_col;
  if (n_col != p_y_data->n_col) {
    r_stop_internal("`x` and `y` must have the same number of columns.");
  }

  enum vctrs_type* v_col_type = p_x_data->v_col_type;
  const void** v_x_col_ptr = p_x_data->v_col_ptr;
  const void** v_y_col_ptr = p_y_data->v_col_ptr;

  // df-cols should already be flattened
  for (r_ssize col = 0; col < n_col; ++col) {
    const int cmp = p_col_compare_na_equal(
      v_x_col_ptr[col], i,
      v_y_col_ptr[col], j,
      v_col_type[col]
    );

    if (cmp != 0) {
      return cmp;
    }
  }

  return 0;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:172

p_df_equal_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_bool
timing: 0.554 s
source
int p_df_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  struct poly_df_data* p_x_data = (struct poly_df_data*) p_x;
  struct poly_df_data* p_y_data = (struct poly_df_data*) p_y;

  r_ssize n_col = p_x_data->n_col;
  if (n_col != p_y_data->n_col) {
    r_stop_internal("`x` and `y` must have the same number of columns.");
  }

  enum vctrs_type* v_col_type = p_x_data->v_col_type;
  const void** v_x_col_ptr = p_x_data->v_col_ptr;
  const void** v_y_col_ptr = p_y_data->v_col_ptr;

  // df-cols should already be flattened
  for (r_ssize col = 0; col < n_col; ++col) {
    if (!p_col_equal_na_equal(v_x_col_ptr[col], i, v_y_col_ptr[col], j, v_col_type[col])) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:107

p_df_is_incomplete typed

[c_ptr, c_int_na] -> c_bool
timing: 0.299 s
source
bool p_df_is_incomplete(const void* p_x, r_ssize i) {
  struct poly_df_data* p_x_data = (struct poly_df_data*) p_x;

  enum vctrs_type* v_col_type = p_x_data->v_col_type;
  const void** v_col_ptr = p_x_data->v_col_ptr;
  r_ssize n_col = p_x_data->n_col;

  // df-cols should already be flattened,
  // so we only need missingness of each column, not completeness
  for (r_ssize col = 0; col < n_col; ++col) {
    if (p_col_is_missing(v_col_ptr[col], i, v_col_type[col])) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:158

p_df_is_missing typed

[c_ptr, c_int_na] -> c_bool
timing: 0.373 s
source
bool p_df_is_missing(const void* p_x, r_ssize i) {
  struct poly_df_data* p_x_data = (struct poly_df_data*) p_x;

  enum vctrs_type* v_col_type = p_x_data->v_col_type;
  const void** v_col_ptr = p_x_data->v_col_ptr;
  r_ssize n_col = p_x_data->n_col;

  // df-cols should already be flattened
  for (r_ssize col = 0; col < n_col; ++col) {
    if (!p_col_is_missing(v_col_ptr[col], i, v_col_type[col])) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:105

p_df_order_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na, c_false] | [c_ptr, c_int_na, c_ptr, c_int_na, c_int_na \ c_false] -> c_int_na | c_null
timing: 0.811 s
source
int p_df_order_compare_na_equal(const void* x,
                                r_ssize i,
                                const void* y,
                                r_ssize j,
                                bool nan_distinct) {
  struct poly_df_data* x_data = (struct poly_df_data*) x;
  struct poly_df_data* y_data = (struct poly_df_data*) y;

  r_ssize n_col = x_data->n_col;

  enum vctrs_type* v_col_type = x_data->v_col_type;
  const void** v_x_col_ptr = x_data->v_col_ptr;
  const void** v_y_col_ptr = y_data->v_col_ptr;

  // df-cols should already be flattened
  for (r_ssize col = 0; col < n_col; ++col) {
    int cmp = p_order_compare_na_equal(
      v_x_col_ptr[col], i,
      v_y_col_ptr[col], j,
      nan_distinct,
      v_col_type[col]
    );

    if (cmp == 0) {
      // Equal values for this column
      continue;
    }

    // Difference detected
    return cmp;
  }

  // All columns were equal
  return 0;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:132

p_int_is_incomplete typed

[c_ptr, c_int_na] -> c_bool
timing: 0.006 s
source
bool p_int_is_incomplete(const void* p_x, r_ssize i) {
  return p_int_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:133

p_lgl_is_incomplete typed

[c_ptr, c_int_na] -> c_bool
timing: 0.006 s
source
bool p_lgl_is_incomplete(const void* p_x, r_ssize i) {
  return p_lgl_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:129

p_list_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_null
timing: 0.006 s
source
int p_list_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(r_obj*, list_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:143

p_list_is_incomplete typed

[c_ptr, c_int_na] -> c_null
timing: 0.008 s
source
bool p_list_is_incomplete(const void* p_x, r_ssize i) {
  return p_list_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:153

p_list_is_missing typed

[c_ptr, c_int_na] -> c_null
timing: 0.004 s
source
bool p_list_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(r_obj*, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:79

p_matches_df_compare_na_equal typed

([c_ptr, c_int_na, c_ptr, c_int_na, *c_false] -> c_false)&([c_ptr, c_int_na, c_ptr, c_int_na, *c(2)] | [c_ptr, c_int_na, c_ptr, c_int_na, *c_true] -> c_int_na)
timing: 0.697 s
source
int p_matches_df_compare_na_equal(const void* x,
                                  r_ssize i,
                                  const void* y,
                                  r_ssize j,
                                  const enum vctrs_filter* v_filters) {
  // First broken tie wins.
  // All columns are integer vectors (approximate ranks).

  const struct poly_df_data* x_data = (const struct poly_df_data*) x;
  const struct poly_df_data* y_data = (const struct poly_df_data*) y;

  const r_ssize n_col = x_data->n_col;

  const void** v_x_col_ptr = x_data->v_col_ptr;
  const void** v_y_col_ptr = y_data->v_col_ptr;

  for (r_ssize col = 0; col < n_col; ++col) {
    const enum vctrs_filter filter = v_filters[col];

    switch (filter) {
    case VCTRS_FILTER_none: {
      break;
    }
    case VCTRS_FILTER_max: {
      const int cmp = p_int_compare_na_equal(v_x_col_ptr[col], i, v_y_col_ptr[col], j);
      if (cmp != 0) {
        // Want max, new value is greater (1), signal replace (1)
        // Want max, new value is smaller (-1), signal keep (-1)
        return cmp;
      }
      break;
    }
    case VCTRS_FILTER_min: {
      const int cmp = p_int_compare_na_equal(v_x_col_ptr[col], i, v_y_col_ptr[col], j);
      if (cmp != 0) {
        // Want min, new value is smaller (-1), signal replace (1)
        // Want min, new value is larger (1), signal keep (-1)
        return -cmp;
      }
      break;
    }
    default: {
      r_stop_internal("Unknown `filter`.");
    }
    }
  }

  // All columns are equal, or no columns. No need to update anything.
  return 0;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2564

p_matches_df_equal_na_equal typed

([c_ptr, c_int_na, c_ptr, c_int_na, *c(1..2)] -> c_bool)&([c_ptr, c_int_na, c_ptr, c_int_na, *c_false] -> c_true)
timing: 0.507 s
source
bool p_matches_df_equal_na_equal(const void* x,
                                 r_ssize i,
                                 const void* y,
                                 r_ssize j,
                                 const enum vctrs_filter* v_filters) {
  // All columns are integer vectors (approximate ranks).

  const struct poly_df_data* x_data = (const struct poly_df_data*) x;
  const struct poly_df_data* y_data = (const struct poly_df_data*) y;

  const r_ssize n_col = x_data->n_col;

  const void** v_x_col_ptr = x_data->v_col_ptr;
  const void** v_y_col_ptr = y_data->v_col_ptr;

  for (r_ssize col = 0; col < n_col; ++col) {
    const enum vctrs_filter filter = v_filters[col];

    if (filter == VCTRS_FILTER_none) {
      continue;
    }

    if (!p_int_equal_na_equal(v_x_col_ptr[col], i, v_y_col_ptr[col], j)) {
      return false;
    }
  }

  // All columns are equal, or no columns.
  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2616

p_nesting_container_df_compare_fully_ge_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_bool
timing: 0.404 s
source
bool p_nesting_container_df_compare_fully_ge_na_equal(const void* x,
                                                      r_ssize i,
                                                      const void* y,
                                                      r_ssize j) {
  // Checks if EVERY column of `x` is `>=` `y`.
  // Assumes original input that `x` and `y` came from is ordered, and that
  // `x` comes after `y` in terms of row location in that original input. This
  // means that the first column of `x` is always `>=` the first column of `y`,
  // so we can ignore it in the comparison.
  // Iterates backwards to (ideally) maximize chance of hitting the fastest
  // varying column.
  // All columns are integer vectors (ranks).

  const struct poly_df_data* x_data = (const struct poly_df_data*) x;
  const struct poly_df_data* y_data = (const struct poly_df_data*) y;

  const r_ssize n_col = x_data->n_col;

  const void** v_x_col_ptr = x_data->v_col_ptr;
  const void** v_y_col_ptr = y_data->v_col_ptr;

  for (r_ssize col = n_col - 1; col > 0; --col) {
    if (p_int_compare_na_equal(v_x_col_ptr[col], i, v_y_col_ptr[col], j) < 0) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2531

p_nil_compare_na_equal typed

[c_ptr, c_int_na, c_ptr, c_int_na] -> c_null
timing: 0.007 s
source
int p_nil_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(r_obj*, nil_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:115

p_nil_equal_na_equal typed empty return

[c_ptr, c_int_na, c_ptr, c_int_na] -> empty
timing: 0.006 s
source
inline int p_nil_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  r_stop_internal("Can't compare NULL for equality.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:58

p_nil_is_incomplete typed empty return

[c_ptr, c_int_na] -> empty
timing: 0.005 s
source
bool p_nil_is_incomplete(const void* p_x, r_ssize i) {
  p_nil_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:125

p_nil_is_missing typed empty return

[c_ptr, c_int_na] -> empty
timing: 0.005 s
source
bool p_nil_is_missing(const void* p_x, r_ssize i) {
  r_stop_internal("Can't check NULL for missingness.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:51

p_order_compare_na_equal typed

([c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c(6)] -> c_null)&([c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c_bool | c(7..10) | c(255)] -> empty)&([c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c(2)] | [c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c(3)] | [c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c(4)] | [c_ptr, c_int_na, c_ptr, c_int_na, c_int_na, c(5)] -> c_int_na)
timing: 0.358 s
source
int p_order_compare_na_equal(const void* p_x,
                             r_ssize i,
                             const void* p_y,
                             r_ssize j,
                             bool nan_distinct,
                             const enum vctrs_type type) {
  switch (type) {
  case VCTRS_TYPE_logical: return p_lgl_order_compare_na_equal(p_x, i, p_y, j, nan_distinct);
  case VCTRS_TYPE_integer: return p_int_order_compare_na_equal(p_x, i, p_y, j, nan_distinct);
  case VCTRS_TYPE_double: return p_dbl_order_compare_na_equal(p_x, i, p_y, j, nan_distinct);
  case VCTRS_TYPE_complex: return p_cpl_order_compare_na_equal(p_x, i, p_y, j, nan_distinct);
  case VCTRS_TYPE_character: return p_chr_order_compare_na_equal(p_x, i, p_y, j, nan_distinct);
  default: stop_unimplemented_vctrs_type("p_order_compare_na_equal", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:115

p_raw_is_incomplete typed

[c_ptr, c_int_na] -> c_null
timing: 0.008 s
source
bool p_raw_is_incomplete(const void* p_x, r_ssize i) {
  return p_raw_is_missing(p_x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:149

p_raw_is_missing typed

[c_ptr, c_int_na] -> c_null
timing: 0.004 s
source
bool p_raw_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(unsigned char, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:75

parse_condition typed

[CHR, c_int_na, *c(0..4)] -> ()
timing: 0.285 s
source
void parse_condition(r_obj* condition, r_ssize n_cols, enum vctrs_ops* v_ops) {
  if (r_typeof(condition) != R_TYPE_character) {
    r_abort("`condition` must be a character vector.");
  }

  r_obj* const* v_condition = r_chr_cbegin(condition);
  r_ssize size_condition = vec_size(condition);

  if (size_condition == 1) {
    const char* elt = r_str_c_string(v_condition[0]);
    enum vctrs_ops op = parse_condition_one(elt);

    for (r_ssize i = 0; i < n_cols; ++i) {
      v_ops[i] = op;
    }

    return;
  }

  if (size_condition == n_cols) {
    for (r_ssize i = 0; i < n_cols; ++i) {
      const char* elt = r_str_c_string(v_condition[i]);
      v_ops[i] = parse_condition_one(elt);
    }

    return;
  }

  r_abort(
    "`condition` must be length 1, or the same "
    "length as the number of columns of the input."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1275

parse_condition_one typed

[c_string] -> c(0..4) | c_void
timing: 0.045 s
source
enum vctrs_ops parse_condition_one(const char* condition) {
  if (!strcmp(condition, "==")) { return VCTRS_OPS_eq; }
  if (!strcmp(condition, ">"))  { return VCTRS_OPS_gt; }
  if (!strcmp(condition, ">=")) { return VCTRS_OPS_gte; }
  if (!strcmp(condition, "<"))  { return VCTRS_OPS_lt; }
  if (!strcmp(condition, "<=")) { return VCTRS_OPS_lte; }

  r_abort("`condition` must only contain \"==\", \">\", \">=\", \"<\", or \"<=\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1264

parse_direction typed

[CHR, *c_bool, *c_bool] -> ()
timing: 1.93 s
source
void parse_direction(SEXP x, bool* p_down, bool* p_leading) {
  if (TYPEOF(x) != STRSXP || Rf_length(x) == 0) {
    stop_bad_direction();
  }

  const char* str = CHAR(STRING_ELT(x, 0));

  if (!strcmp(str, "down")) {
    *p_down = true;
    *p_leading = false;
    return;
  }
  if (!strcmp(str, "up")) {
    *p_down = false;
    *p_leading = false;
    return;
  }
  if (!strcmp(str, "downup")) {
    *p_down = true;
    *p_leading = true;
    return;
  }
  if (!strcmp(str, "updown")) {
    *p_down = false;
    *p_leading = true;
    return;
  }

  stop_bad_direction();
  never_reached("parse_direction");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:208

parse_filter typed

[CHR, c_int_na, *c(0..2)] -> ()
timing: 0.283 s
source
void parse_filter(r_obj* filter, r_ssize n_cols, enum vctrs_filter* v_filters) {
  if (r_typeof(filter) != R_TYPE_character) {
    r_abort("`filter` must be a character vector.");
  }

  r_obj* const* v_filter = r_chr_cbegin(filter);
  r_ssize size_filter = vec_size(filter);

  if (size_filter == 1) {
    const char* elt = r_str_c_string(v_filter[0]);
    enum vctrs_filter elt_filter = parse_filter_one(elt);

    for (r_ssize i = 0; i < n_cols; ++i) {
      v_filters[i] = elt_filter;
    }

    return;
  }

  if (size_filter == n_cols) {
    for (r_ssize i = 0; i < n_cols; ++i) {
      const char* elt = r_str_c_string(v_filter[i]);
      v_filters[i] = parse_filter_one(elt);
    }

    return;
  }

  r_abort(
    "`filter` must be length 1, or the same "
    "length as the number of columns of the input."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1433

parse_filter_one typed

[c_string] -> c(0..2) | c_void
timing: 0.027 s
source
enum vctrs_filter parse_filter_one(const char* filter) {
  if (!strcmp(filter, "none")) return VCTRS_FILTER_none;
  if (!strcmp(filter, "min")) return VCTRS_FILTER_min;
  if (!strcmp(filter, "max")) return VCTRS_FILTER_max;

  r_abort("`filter` must be one of \"none\", \"min\", or \"max\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1424

parse_incomplete typed

([CHR] -> c_bool)&([null] -> empty)
timing: 0.069 s
source
struct vctrs_incomplete parse_incomplete(r_obj* incomplete,
                                         struct r_lazy call) {
  if (r_length(incomplete) != 1) {
    r_abort_lazy_call(
      call,
      "`incomplete` must be length 1, not length %i.",
      r_length(incomplete)
    );
  }

  if (r_is_string(incomplete)) {
    const char* c_incomplete = r_chr_get_c_string(incomplete, 0);

    if (!strcmp(c_incomplete, "compare")) {
      return (struct vctrs_incomplete) {
        .action = VCTRS_INCOMPLETE_ACTION_compare,
        .value = -1
      };
    }

    if (!strcmp(c_incomplete, "match")) {
      return (struct vctrs_incomplete) {
        .action = VCTRS_INCOMPLETE_ACTION_match,
        .value = -1
      };
    }

    if (!strcmp(c_incomplete, "drop")) {
      return (struct vctrs_incomplete) {
        .action = VCTRS_INCOMPLETE_ACTION_drop,
        .value = -1
      };
    }

    if (!strcmp(c_incomplete, "error")) {
      return (struct vctrs_incomplete) {
        .action = VCTRS_INCOMPLETE_ACTION_error,
        .value = -1
      };
    }

    r_abort_lazy_call(
      call,
      "`incomplete` must be one of: \"compare\", \"match\", \"drop\", or \"error\"."
    );
  }

  incomplete = vec_cast(
    incomplete,
    r_globals.empty_int,
    args_incomplete,
    vec_args.empty,
    call
  );
  int c_incomplete = r_int_get(incomplete, 0);

  return (struct vctrs_incomplete) {
    .action = VCTRS_INCOMPLETE_ACTION_value,
    .value = c_incomplete
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1312

parse_list_combine_multiple typed

([CHR, struct r_lazy] -> c_bool)&([null, struct r_lazy] -> empty)
timing: 0.079 s
source
enum list_combine_multiple parse_list_combine_multiple(r_obj* multiple, struct r_lazy error_call) {
  if (!r_is_string(multiple)) {
    r_abort_lazy_call(
      error_call,
      "`multiple` must be a string, not %s.",
      r_obj_type_friendly(multiple)
    );
  }

  const char* c_multiple = r_chr_get_c_string(multiple, 0);

  if (!strcmp(c_multiple, "last")) return LIST_COMBINE_MULTIPLE_last;
  if (!strcmp(c_multiple, "first")) return LIST_COMBINE_MULTIPLE_first;

  r_abort_lazy_call(
    error_call,
    "`multiple` must be either \"last\" or \"first\", not \"%s\".",
    c_multiple
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1615

parse_list_combine_unmatched typed

([CHR, struct r_lazy] -> c_bool)&([null, struct r_lazy] -> empty)
timing: 0.160 s
source
enum list_combine_unmatched parse_list_combine_unmatched(r_obj* unmatched, struct r_lazy error_call) {
  if (!r_is_string(unmatched)) {
    r_abort_lazy_call(
      error_call,
      "`unmatched` must be a string, not %s.",
      r_obj_type_friendly(unmatched)
    );
  }

  const char* c_unmatched = r_chr_get_c_string(unmatched, 0);

  if (!strcmp(c_unmatched, "default")) return LIST_COMBINE_UNMATCHED_default;
  if (!strcmp(c_unmatched, "error")) return LIST_COMBINE_UNMATCHED_error;

  r_abort_lazy_call(
    error_call,
    "`unmatched` must be either \"default\" or \"error\", not \"%s\".",
    c_unmatched
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1594

parse_loc_negative typed

([CHR, struct r_lazy] -> c(0..2))&([null, struct r_lazy] -> empty)
timing: 0.141 s
source
enum num_loc_negative parse_loc_negative(r_obj* x,
                                         struct r_lazy call) {
  if (r_typeof(x) != R_TYPE_character || r_length(x) == 0) {
    stop_bad_negative(call);
  }

  const char* str = r_chr_get_c_string(x, 0);

  if (!strcmp(str, "invert")) return LOC_NEGATIVE_INVERT;
  if (!strcmp(str, "error")) return LOC_NEGATIVE_ERROR;
  if (!strcmp(str, "ignore")) return LOC_NEGATIVE_IGNORE;
  stop_bad_negative(call);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:581

parse_loc_oob typed

([CHR, struct r_lazy] -> c(0..2))&([null, struct r_lazy] -> empty)
timing: 0.140 s
source
enum num_loc_oob parse_loc_oob(r_obj* x,
                               struct r_lazy call) {
  if (r_typeof(x) != R_TYPE_character || r_length(x) == 0) {
    stop_bad_oob(call);
  }

  const char* str = r_chr_get_c_string(x, 0);

  if (!strcmp(str, "error")) return LOC_OOB_ERROR;
  if (!strcmp(str, "remove")) return LOC_OOB_REMOVE;
  if (!strcmp(str, "extend")) return LOC_OOB_EXTEND;
  stop_bad_oob(call);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:597

parse_loc_zero typed

([CHR, struct r_lazy] -> c(0..2))&([null, struct r_lazy] -> empty)
timing: 0.141 s
source
enum num_loc_zero parse_loc_zero(r_obj* x,
                                 struct r_lazy call) {
  if (r_typeof(x) != R_TYPE_character || r_length(x) == 0) {
    stop_bad_zero(call);
  }

  const char* str = r_chr_get_c_string(x, 0);

  if (!strcmp(str, "remove")) return LOC_ZERO_REMOVE;
  if (!strcmp(str, "error")) return LOC_ZERO_ERROR;
  if (!strcmp(str, "ignore")) return LOC_ZERO_IGNORE;
  stop_bad_zero(call);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:613

parse_max_fill typed

[null] -> c(-1)
timing: 0.102 s
source
int parse_max_fill(r_obj* x) {
  if (x == R_NilValue) {
    return INFINITE_FILL;
  }

  x = KEEP(vec_cast(x,
                    r_globals.empty_int,
                    vec_args.max_fill,
                    vec_args.empty,
                    r_lazy_null));

  if (!r_is_positive_number(x)) {
    r_abort("`max_fill` must be `NULL` or a single positive integer.");
  }

  int out = r_int_get(x, 0);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:246

parse_missing typed

[CHR] -> c_bool | c_void
timing: 0.067 s
source
enum vctrs_interval_missing parse_missing(r_obj* missing) {
  if (!r_is_string(missing)) {
    r_abort("`missing` must be a string.");
  }

  const char* c_missing = r_chr_get_c_string(missing, 0);

  if (!strcmp(c_missing, "group")) return VCTRS_INTERVAL_MISSING_group;
  if (!strcmp(c_missing, "drop")) return VCTRS_INTERVAL_MISSING_drop;

  r_abort("`missing` must be either \"group\" or \"drop\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:920

parse_multiple typed

([CHR, struct r_lazy] -> c(0..5))&([null, struct r_lazy] -> empty)
timing: 0.113 s
source
enum vctrs_multiple parse_multiple(r_obj* multiple, struct r_lazy call) {
  if (!r_is_string(multiple)) {
    r_abort_lazy_call(call, "`multiple` must be a string.");
  }

  const char* c_multiple = r_chr_get_c_string(multiple, 0);

  if (!strcmp(c_multiple, "all")) return VCTRS_MULTIPLE_all;
  if (!strcmp(c_multiple, "any")) return VCTRS_MULTIPLE_any;
  if (!strcmp(c_multiple, "first")) return VCTRS_MULTIPLE_first;
  if (!strcmp(c_multiple, "last")) return VCTRS_MULTIPLE_last;
  // TODO: Remove deprecated support for `multiple = "error"/"warning"`
  if (!strcmp(c_multiple, "warning")) return VCTRS_MULTIPLE_warning;
  if (!strcmp(c_multiple, "error")) return VCTRS_MULTIPLE_error;

  r_abort_lazy_call(
    call,
    "`multiple` must be one of \"all\", \"any\", \"first\", or \"last\"."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1377

parse_na_value typed

([CHR] -> LGL)&([CHR1] -> LGL1)&([(clx | (~vec)<...>) | null | sym] -> empty)
timing: 0.789 s
source
SEXP parse_na_value(SEXP na_value) {
  // Don't care about length here, checked later
  if (TYPEOF(na_value) != STRSXP) {
    Rf_errorcall(R_NilValue, "`na_value` must be a character vector.");
  }

  R_len_t size = Rf_length(na_value);
  const SEXP* p_na_value = STRING_PTR_RO(na_value);

  SEXP na_largest = PROTECT(Rf_allocVector(LGLSXP, size));
  int* p_na_largest = LOGICAL(na_largest);

  for (R_len_t i = 0; i < size; ++i) {
    p_na_largest[i] = parse_na_value_one(p_na_value[i]);
  }

  UNPROTECT(1);
  return na_largest;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3788

parse_na_value_one typed

[p(CHR)] -> c_bool
timing: 0.070 s
source
int parse_na_value_one(SEXP x) {
  if (x == NA_STRING) {
    Rf_errorcall(R_NilValue, "`na_value` can't be missing.");
  }

  const char* c_x = CHAR(x);

  if (!strcmp(c_x, "largest")) return 1;
  if (!strcmp(c_x, "smallest")) return 0;

  Rf_errorcall(
    R_NilValue,
    "`na_value` must contain only \"largest\" or \"smallest\"."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3809

parse_nan_distinct typed

([LGL] -> c_bool)&([((CHR | CLX | DBL | INT | RAW) | (~vec)<...>) | null | p(CHR) | sym] -> empty)
timing: 0.156 s
source
bool parse_nan_distinct(SEXP nan_distinct) {
  if (TYPEOF(nan_distinct) != LGLSXP) {
    Rf_errorcall(R_NilValue, "`nan_distinct` must be a logical vector.");
  }
  if (Rf_length(nan_distinct) != 1) {
    Rf_errorcall(R_NilValue, "`nan_distinct` must be length 1.");
  }

  int c_nan_distinct = LOGICAL_RO(nan_distinct)[0];

  if (c_nan_distinct == NA_LOGICAL) {
    Rf_errorcall(R_NilValue, "`nan_distinct` can't be missing.");
  }

  return (bool) c_nan_distinct;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3864

parse_no_match typed

([null, struct r_lazy] -> empty)&([any_sexp, struct r_lazy] \ [null, struct r_lazy] -> struct vctrs_no_match)
timing: 0.668 s
source
struct vctrs_no_match parse_no_match(r_obj* no_match,
                                     struct r_lazy call) {
  if (r_length(no_match) != 1) {
    r_abort_lazy_call(
      call,
      "`no_match` must be length 1, not length %i.",
      r_length(no_match)
    );
  }

  if (r_is_string(no_match)) {
    const char* c_no_match = r_chr_get_c_string(no_match, 0);

    if (!strcmp(c_no_match, "error")) {
      return (struct vctrs_no_match) {
        .action = VCTRS_NO_MATCH_ACTION_error,
        .value = -1
      };
    }

    if (!strcmp(c_no_match, "drop")) {
      return (struct vctrs_no_match) {
        .action = VCTRS_NO_MATCH_ACTION_drop,
        .value = -1
      };
    }

    r_abort_lazy_call(
      call,
      "`no_match` must be either \"drop\" or \"error\"."
    );
  }

  no_match = vec_cast(
    no_match,
    r_globals.empty_int,
    args_no_match,
    vec_args.empty,
    call
  );
  int c_no_match = r_int_get(no_match, 0);

  return (struct vctrs_no_match) {
    .action = VCTRS_NO_MATCH_ACTION_value,
    .value = c_no_match
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1470

parse_relationship typed

([CHR, struct r_lazy] -> c(0..5))&([null, struct r_lazy] -> empty)
timing: 0.105 s
source
enum vctrs_relationship parse_relationship(r_obj* relationship, struct r_lazy call) {
  if (!r_is_string(relationship)) {
    r_abort_lazy_call(call, "`relationship` must be a string.");
  }

  const char* c_relationship = r_chr_get_c_string(relationship, 0);

  if (!strcmp(c_relationship, "none")) return VCTRS_RELATIONSHIP_none;
  if (!strcmp(c_relationship, "one-to-one")) return VCTRS_RELATIONSHIP_one_to_one;
  if (!strcmp(c_relationship, "one-to-many")) return VCTRS_RELATIONSHIP_one_to_many;
  if (!strcmp(c_relationship, "many-to-one")) return VCTRS_RELATIONSHIP_many_to_one;
  if (!strcmp(c_relationship, "many-to-many")) return VCTRS_RELATIONSHIP_many_to_many;
  if (!strcmp(c_relationship, "warn-many-to-many")) return VCTRS_RELATIONSHIP_warn_many_to_many;

  r_abort_lazy_call(
    call,
    "`relationship` must be one of \"none\", \"one-to-one\", \"one-to-many\", \"many-to-one\", \"many-to-many\", or \"warn-many-to-many\"."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1401

parse_remaining typed

([null, struct r_lazy] -> empty)&([any_sexp, struct r_lazy] \ [null, struct r_lazy] -> struct vctrs_remaining)
timing: 0.888 s
source
struct vctrs_remaining parse_remaining(r_obj* remaining,
                                       struct r_lazy call) {
  if (r_length(remaining) != 1) {
    r_abort_lazy_call(
      call,
      "`remaining` must be length 1, not length %i.",
      r_length(remaining)
    );
  }

  if (r_is_string(remaining)) {
    const char* c_remaining = r_chr_get_c_string(remaining, 0);

    if (!strcmp(c_remaining, "error")) {
      return (struct vctrs_remaining) {
        .action = VCTRS_REMAINING_ACTION_error,
        .value = -1
      };
    }

    if (!strcmp(c_remaining, "drop")) {
      return (struct vctrs_remaining) {
        .action = VCTRS_REMAINING_ACTION_drop,
        .value = -1
      };
    }

    r_abort_lazy_call(
      call,
      "`remaining` must be either \"drop\" or \"error\"."
    );
  }

  remaining = vec_cast(
    remaining,
    r_globals.empty_int,
    args_remaining,
    vec_args.empty,
    call
  );
  int c_remaining = r_int_get(remaining, 0);

  return (struct vctrs_remaining) {
    .action = VCTRS_REMAINING_ACTION_value,
    .value = c_remaining
  };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1521

parse_subscript_arg_missing typed

([CHR, struct r_lazy] -> c(0..2))&([null, struct r_lazy] -> empty)
timing: 0.185 s
source
enum subscript_missing parse_subscript_arg_missing(r_obj* x,
                                                   struct r_lazy call) {
  if (r_typeof(x) != R_TYPE_character || r_length(x) == 0) {
    stop_subscript_arg_missing(call);
  }

  const char* str = r_chr_get_c_string(x, 0);

  if (!strcmp(str, "propagate")) return SUBSCRIPT_MISSING_PROPAGATE;
  if (!strcmp(str, "remove")) return SUBSCRIPT_MISSING_REMOVE;
  if (!strcmp(str, "error")) return SUBSCRIPT_MISSING_ERROR;
  stop_subscript_arg_missing(call);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:565

parse_subscript_arg_type typed

[CHR, c_string] -> c_bool
timing: 0.294 s
source
enum subscript_type_action parse_subscript_arg_type(r_obj* x,
                                                    const char* kind) {
  if (r_typeof(x) != R_TYPE_character || r_length(x) == 0) {
    stop_subscript_arg_type(kind);
  }

  const char* str = CHAR(STRING_ELT(x, 0));

  if (!strcmp(str, "cast")) return SUBSCRIPT_TYPE_ACTION_CAST;
  if (!strcmp(str, "error")) return SUBSCRIPT_TYPE_ACTION_ERROR;
  stop_subscript_arg_type(kind);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:287

parse_ties typed

([CHR] -> c(0..3))&([null] -> empty)
timing: 0.083 s
source
enum ties parse_ties(r_obj* ties) {
  if (!r_is_string(ties)) {
    r_stop_internal("`ties` must be a string.");
  }

  const char* c_ties = r_chr_get_c_string(ties, 0);

  if (!strcmp(c_ties, "min")) return TIES_min;
  if (!strcmp(c_ties, "max")) return TIES_max;
  if (!strcmp(c_ties, "sequential")) return TIES_sequential;
  if (!strcmp(c_ties, "dense")) return TIES_dense;

  r_stop_internal(
    "`ties` must be one of: \"min\", \"max\", \"sequential\", or \"dense\"."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:209

parse_vary typed

([CHR] -> c_bool)&([null] -> empty)
timing: 0.187 s
source
enum vctrs_expand_vary parse_vary(r_obj* vary) {
  if (!r_is_string(vary)) {
    r_stop_internal("`vary` must be a string.");
  }

  const char* c_vary = r_chr_get_c_string(vary, 0);

  if (!strcmp(c_vary, "slowest")) return VCTRS_EXPAND_VARY_slowest;
  if (!strcmp(c_vary, "fastest")) return VCTRS_EXPAND_VARY_fastest;

  r_stop_internal(
    "`vary` must be either \"slowest\" or \"fastest\"."
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/expand.c:120

parse_vec_parallel_missing typed

([LGL, struct r_lazy] -> c(0..2))&([null, struct r_lazy] -> empty)
timing: 0.099 s
source
enum vec_parallel_missing parse_vec_parallel_missing(r_obj* missing, struct r_lazy error_call) {
  if (!r_is_scalar_logical(missing)) {
    r_abort_lazy_call(error_call, "`.missing` must be `NA`, `FALSE`, or `TRUE`.");
  }

  const int c_missing = r_lgl_get(missing, 0);

  if (c_missing == r_globals.na_lgl) {
    return VEC_PARALLEL_MISSING_na;
  } else if (c_missing == 0) {
    return VEC_PARALLEL_MISSING_false;
  } else if (c_missing == 1) {
    return VEC_PARALLEL_MISSING_true;
  } else {
    r_stop_internal("Unexpected `missing` value, %i.", c_missing);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:336

PASS_TO_RADIX typed any: arg 1, arg 2

(tuple2 -> any)&([c_int, c_string] -> c_string)&([c_int_na, c_int_na] -> c_int_na)&([c_int, c_int] | [c_string, c_string] -> c_int)
timing: 0.054 s
(definition not located in src/)

plus_would_overflow typed

[c_int_na, c_int_na] -> c_bool
timing: 0.014 s
source
bool plus_would_overflow(r_ssize x, r_ssize y) {
  return x > R_LEN_T_MAX - y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:225

poly_p_compare_na_equal typed

([c(5)] -> ([c_ptr, c_int_na, c_ptr, c_int_na] -> empty))&([c(9)] -> ([c_ptr, c_int_na, c_ptr, c_int_na] -> c_int_na | c_null))&([c_true | c(10) | c(255)] -> empty)&([c(2)] | [c(3)] | [c(4)] | [c(7)] -> [c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na)&([c(6)] | [c(8)] | [c_false] -> ([c_ptr, c_int_na, c_ptr, c_int_na] -> c_null))
timing: 0.842 s
source
poly_binary_int_fn* poly_p_compare_na_equal(enum vctrs_type type) {
  switch (type) {
  case VCTRS_TYPE_null: return p_nil_compare_na_equal;
  case VCTRS_TYPE_logical: return p_lgl_compare_na_equal;
  case VCTRS_TYPE_integer: return p_int_compare_na_equal;
  case VCTRS_TYPE_double: return p_dbl_compare_na_equal;
  case VCTRS_TYPE_complex: return p_cpl_compare_na_equal;
  case VCTRS_TYPE_character: return p_chr_compare_na_equal;
  case VCTRS_TYPE_raw: return p_raw_compare_na_equal;
  case VCTRS_TYPE_list: return p_list_compare_na_equal;
  case VCTRS_TYPE_dataframe: return p_df_compare_na_equal;
  default: stop_unimplemented_vctrs_type("poly_p_compare_na_equal", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:7

poly_p_is_missing typed

([c(9)] -> ([c_ptr, c_int_na] -> c_bool))&([c_false] -> ([c_ptr, c_int_na] -> empty))&([c_true | c(10) | c(255)] -> empty)&([c(2)] | [c(3)] | [c(4)] | [c(5)] -> [c_ptr, c_int_na] --> c_bool)&([c(6)] | [c(7)] | [c(8)] -> ([c_ptr, c_int_na] -> c_null))
timing: 1.22 s
source
poly_unary_bool_fn* poly_p_is_missing(enum vctrs_type type) {
  switch (type) {
  case VCTRS_TYPE_null: return p_nil_is_missing;
  case VCTRS_TYPE_logical: return p_lgl_is_missing;
  case VCTRS_TYPE_integer: return p_int_is_missing;
  case VCTRS_TYPE_double: return p_dbl_is_missing;
  case VCTRS_TYPE_complex: return p_cpl_is_missing;
  case VCTRS_TYPE_character: return p_chr_is_missing;
  case VCTRS_TYPE_raw: return p_raw_is_missing;
  case VCTRS_TYPE_list: return p_list_is_missing;
  case VCTRS_TYPE_dataframe: return p_df_is_missing;
  default: stop_unimplemented_vctrs_type("poly_p_is_missing", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:25

posixct_as_date typed empty return

[any_sexp, *c_bool] -> empty
timing: 0.009 s
source
SEXP posixct_as_date(SEXP x, bool* lossy) {
  SEXP ct = PROTECT(datetime_validate(x));

  SEXP tzone = PROTECT(tzone_get(ct));
  SEXP lt = PROTECT(posixct_as_posixlt_impl(ct, tzone));

  SEXP out = posixt_as_date(ct, lt, lossy);

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:101

posixct_as_posixct typed empty return

[any_sexp, any_sexp] -> empty
timing: 0.014 s
source
SEXP posixct_as_posixct(SEXP x, SEXP to) {
  SEXP tzone = PROTECT(tzone_get(to));
  SEXP out = posixct_as_posixct_impl(x, tzone);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:167

posixct_as_posixct_impl typed empty return

[any_sexp, any_sexp] -> empty
timing: 0.008 s
source
static SEXP posixct_as_posixct_impl(SEXP x, SEXP tzone) {
  x = PROTECT(datetime_validate(x));
  SEXP out = datetime_rezone(x, tzone);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:174

posixt_as_date typed empty return

[any_sexp, any_sexp, *c_bool] -> empty
timing: 0.027 s
source
static SEXP posixt_as_date(SEXP ct, SEXP lt, bool* lossy) {
  ct = PROTECT(datetime_validate(ct));
  const double* p_ct = REAL(ct);

  SEXP out = PROTECT(r_as_date(lt));

  SEXP roundtrip = PROTECT(date_as_posixct(out, ct));
  const double* p_roundtrip = REAL(roundtrip);

  const R_len_t size = Rf_length(out);

  for (R_len_t i = 0; i < size; ++i) {
    const double ct_elt = p_ct[i];

    // `NaN` and `NA` always convert without issue
    if (isnan(ct_elt)) {
      continue;
    }

    const double roundtrip_elt = p_roundtrip[i];

    if (ct_elt != roundtrip_elt) {
      *lossy = true;
      UNPROTECT(3);
      return R_NilValue;
    }
  }

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:131

PROTECT_DF_SHORT_CIRCUIT_INFO typed any: arg 2

([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_ptr] -> ())&([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_null] | [c_null, any] -> empty)
timing: 0.812 s
(definition not located in src/)

PROTECT_DICT typed any: arg 2

([*struct dictionary \ c_null, c_null] | [c_null, any] | [~(*struct dictionary), c_null] -> empty)&([*struct dictionary \ c_null, c_ptr] | [~(*struct dictionary), c_ptr] -> ())
timing: 3.69 s
(definition not located in src/)

PROTECT_GROUP_INFO typed any: arg 2

([*{ data : any_sexp ; self : any ; data_pi : c_int_na | c_string ..}, c_ptr] -> ())&([*{ data : any_sexp ; self : any ; data_pi : c_int_na | c_string ..}, c_null] | [c_null, any] -> empty)
timing: 1.02 s
(definition not located in src/)

PROTECT_GROUP_INFOS typed

([*{ self : any ; p_p_group_info_data : any ; p_p_group_info : *(*{ data : any_sexp ; self : any ; data_pi : c_int_na | c_string ..}) ..}, c_ptr] -> ())&([*(struct group_infos({ self : any ; p_p_group_info_data : any ..}) | { self : any ; p_p_group_info_data : any ..}), c_null] | [*{ self : any ; p_p_group_info_data : any ; p_p_group_info : *c_null ..}, c_ptr] -> empty)
timing: 9.49 s
(definition not located in src/)

PROTECT_GROWABLE typed any: arg 2

([*{ x : any_sexp ; idx : c_int_na | c_string ..}, c_ptr] -> ())&([*{ x : any_sexp ; idx : c_int_na | c_string ..}, c_null] | [c_null, any] -> empty)
timing: 1.19 s
(definition not located in src/)

PROTECT_LAZY_VEC typed any: arg 2

([*{ data : any_sexp ; self : any ; data_pi : c_int_na | c_string ..}, c_ptr] -> ())&([*{ data : any_sexp ; self : any ; data_pi : c_int_na | c_string ..}, c_null] | [c_null, any] -> empty)
timing: 1.08 s
(definition not located in src/)

PROTECT_N typed

∀'a. (['a, c_null] -> empty)&(['a, *(*any)] | ['a, *c_double] | ['a, *c_int_na] | ['a, *c_string] -> 'a)
timing: 0.252 s
(definition not located in src/)

PROTECT_ORDER typed

([*(struct group_info({ data : any ; self : any ..}) | struct lazy_raw({ data : any ; self : any ..}) | struct order({ data : any ; self : any ..}) | { data : any ; self : any ..}), c_null] -> empty)&([*(struct group_info({ data : any ; self : any ..}) | struct lazy_raw({ data : any ; self : any ..}) | struct order({ data : any ; self : any ..}) | { data : any ; self : any ..}), c_ptr] -> ())
timing: 4.94 s
(definition not located in src/)

PROTECT_STRIDES_INFO typed

([*{ dim : any ; strides : any ; index : any ; steps : any ; shape_index : any ..}, c_null] -> empty)&([*{ dim : any ; strides : any ; index : any ; steps : any ; shape_index : any ..}, c_ptr] -> ())
timing: 1.18 s
(definition not located in src/)

proxy_apply_chr_proxy_collate typed

∀'a. ([any_sexp & 'a, null] -> any_sexp & 'a)&([any_sexp & 'a, <...> | p(CHR) | sym] -> any)
timing: 0.071 s
source
SEXP proxy_apply_chr_proxy_collate(SEXP proxy, SEXP chr_proxy_collate) {
  if (chr_proxy_collate == r_null) {
    return proxy;
  }

  chr_proxy_collate = PROTECT(r_as_function(chr_proxy_collate, "chr_proxy_collate"));

  SEXP out;

  switch (vec_proxy_typeof(proxy)) {
  case VCTRS_TYPE_character: out = chr_apply(proxy, chr_proxy_collate); break;
  case VCTRS_TYPE_dataframe: out = df_apply(proxy, chr_proxy_collate); break;
  default: out = proxy;
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-collate.c:21

ptype_common_with_default typed

[<...> | p(CHR) | sym, any_sexp, c_false, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] | [<...> | p(CHR) | sym, any_sexp, c_int_na \ c_false, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp
timing: 0.283 s
source
r_obj* ptype_common_with_default(
  r_obj* ptype,
  r_obj* xs,
  bool has_default,
  r_obj* default_,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call,
  enum s3_fallback s3_fallback
) {
  if (ptype != r_null) {
    // Performs scalar checks and whatnot
    return vec_ptype_final(ptype, vec_args.ptype, error_call);
  }

  // Okay `ptype` is `NULL`. We determine it from `xs` and `default`.

  // Use only `xs` and `p_xs_arg` first for best errors.
  // Not finalising `ptype` yet in case we need to incorporate `default`!
  ptype = KEEP(vec_ptype_common(
    xs,
    ptype,
    PTYPE_FINALISE_false,
    s3_fallback,
    p_xs_arg,
    error_call
  ));

  // Now incorporate `default` and `p_default_arg` if required
  if (has_default) {
    int _;
    ptype = vec_ptype2(
      ptype,
      default_,
      vec_args.empty,
      p_default_arg,
      error_call,
      s3_fallback,
      &_
    );
  }
  KEEP(ptype);

  // Now finalise after incorporating `default`
  ptype = KEEP(vec_ptype_finalise(ptype));

  FREE(3);
  return ptype;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1789

ptype_finalize typed

[<...> | p(CHR) | sym, any_sexp, any_sexp, c_false, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] | [<...> | p(CHR) | sym, any_sexp, any_sexp, c_int_na \ c_false, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.242 s
source
r_obj* ptype_finalize(
  r_obj* ptype,
  r_obj* true_,
  r_obj* false_,
  r_obj* missing,
  bool has_missing,
  struct vctrs_arg* p_true_arg,
  struct vctrs_arg* p_false_arg,
  struct vctrs_arg* p_missing_arg,
  struct r_lazy error_call
) {
  if (ptype != r_null) {
    // Performs scalar checks and whatnot
    return vec_ptype_final(ptype, vec_args.ptype, error_call);
  }

  int n_prot = 0;

  // Initialize `left` to point to `true`.
  // If we don't initialize it, there may be rare corner cases where it never
  // gets set by `vec_ptype2()`, in which case we don't want to hit the
  // unreachable error (bad user experience).
  int left = 1;

  // Common type of `true` and `false`
  ptype = KEEP_N(
    vec_ptype2(
      true_,
      false_,
      p_true_arg,
      p_false_arg,
      error_call,
      S3_FALLBACK_false,
      &left
    ),
    &n_prot
  );

  // Mix in `missing` if needed
  if (has_missing) {
    // Same logic as `vec_ptype_common()`
    // 1 = `x` won
    // 0 = `y` won
    // -1 = same type, stick with `x`
    struct vctrs_arg* p_ptype_arg;
    switch (left) {
    case 1: p_ptype_arg = p_true_arg; break;
    case 0: p_ptype_arg = p_false_arg; break;
    case -1: p_ptype_arg = p_true_arg; break;
    default: r_stop_unreachable();
    }

    ptype = KEEP_N(
      vec_ptype2(
        ptype,
        missing,
        p_ptype_arg,
        p_missing_arg,
        error_call,
        S3_FALLBACK_false,
        &left
      ),
      &n_prot
    );
  }

  // Finalize on the way out
  ptype = vec_ptype_finalise(ptype);

  FREE(n_prot);
  return ptype;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:532

ptype_is_atomic typed

([<...>] -> c_false)&([<> | null | p(CHR) | sym] -> c_bool)
timing: 0.026 s
source
bool ptype_is_atomic(r_obj* ptype) {
  if (r_is_object(ptype)) {
    return false;
  }
  if (has_dim(ptype)) {
    return false;
  }
  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:521

ptype2_common typed

([any_sexp, any_sexp, *struct counters, c_ptr] -> any_sexp)&([any_sexp, any_sexp, c_null, c_ptr] -> empty)
timing: 0.302 s
source
r_obj* ptype2_common(r_obj* current,
                     r_obj* next,
                     struct counters* counters,
                     void* p_data) {
  int left = -1;

  struct ptype_common_reduce_opts* p_reduce_opts = (struct ptype_common_reduce_opts*) p_data;

  current = vec_ptype2(
    current,
    next,
    counters->curr_arg,
    counters->next_arg,
    p_reduce_opts->call,
    p_reduce_opts->s3_fallback,
    &left
  );

  // Update current if RHS is the common type. Otherwise the previous
  // counter stays in effect.
  if (!left) {
    counters_shift(counters);
  }

  return current;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype-common.c:117

qsort_int_compare_scalar typed

[c_ptr, c_ptr] -> c_int
timing: 0.063 s
source
int qsort_int_compare_scalar(const void* x, const void* y) {
  return int_compare_scalar(*((int*) x), *((int*) y));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:34

r__dyn_increment typed

([c_null] -> empty)&([*struct r_dyn_array] \ [c_null] -> c_int_na)
timing: 0.446 s
source
r_ssize r__dyn_increment(struct r_dyn_array* p_arr) {
  r_ssize loc = p_arr->count++;

  if (p_arr->count > p_arr->capacity) {
    r_ssize new_capacity = r_ssize_mult(p_arr->capacity, p_arr->growth_factor);
    r_dyn_resize(p_arr, new_capacity);
  }

  return loc;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:150

r__intmax_add typed any: arg 1

∀'a. ([c_int, c_false] -> c_int)&([c_int_na, c_int_na \ (c(..-1) | c(1..))] -> c_int_na)&([c_string, c_false] -> c_string)&([any, ~(c(..-1) | c(1..))] -> any)&([c_double, c_double] -> c_double)&([c_char, c_false | c_char] -> c_char)&([*('a \ c_string), c_int_na \ (c(..-1) | c(1..))] | [c_int_na, *('a \ c_string)] -> *('a \ c_string))
timing: 0.393 s
source
intmax_t r__intmax_add(intmax_t x, intmax_t y) {
  if ((y > 0 && x > (INTMAX_MAX - y)) ||
      (y < 0 && x < (INTMAX_MIN - y))) {
    r_stop_internal("Values too large to be added.");
  }

  return x + y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:54

r__intmax_subtract typed any: arg 1

([c_int_na, c_int_na \ (c(..-1) | c(1..))] -> c_int_na)&([c_string, c_false] -> c_string)&([any, ~(c(..-1) | c(1..))] -> any)&([c_double, c_double] -> c_double)&([c_int, c_false] | [c_string, c_string] -> c_int)
timing: 0.200 s
source
intmax_t r__intmax_subtract(intmax_t x, intmax_t y) {
  if ((y > 0 && x < (INTMAX_MIN + y)) ||
      (y < 0 && x > (INTMAX_MAX + y))) {
    r_stop_internal("Subtraction resulted in overflow or underflow.");
  }

  return x - y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:63

r_abort_lazy_call typed empty return

[struct r_lazy] -> empty
timing: 0.010 s
(definition not located in src/)

r_alloc_character typed

([c_int] -> CHR)&([c_true] -> CHR1)
timing: 0.032 s
source
r_obj* r_alloc_character(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_character, n);
#else
  return Rf_allocVector(R_TYPE_character, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:234

r_alloc_complex typed

([c_int] -> CLX)&([c_true] -> CLX1)
timing: 0.034 s
source
r_obj* r_alloc_complex(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_complex, n);
#else
  return Rf_allocVector(R_TYPE_complex, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:218

r_alloc_df_list typed

[c_int_na, any_sexp, *(c(1..10) | c(13..25) | c(30..31) | c(99)), c_int_na] | [c_int_na, any_sexp, *c_false, c_int_na] -> list
timing: 0.278 s
source
r_obj* r_alloc_df_list(r_ssize n_rows,
                       r_obj* names,
                       const enum r_type* v_types,
                       r_ssize types_size) {
  r_obj* out = KEEP(r_alloc_list(types_size));

  if (r_typeof(names) != R_TYPE_character) {
    r_abort("`names` must be a character vector.");
  }
  if (r_length(names) != types_size) {
    r_abort("`names` must match the number of columns.");
  }
  r_attrib_poke_names(out, names);

  for (r_ssize i = 0; i < types_size; ++i) {
    // A nil type stands for no column allocation
    enum r_type type = v_types[i];
    if (type != R_TYPE_null) {
      r_obj* col = r_alloc_vector(type, n_rows);
      r_list_poke(out, i, col);
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/df.c:5

r_alloc_double typed

([c_int] -> DBL)&([c_true] -> DBL1)
timing: 0.023 s
source
r_obj* r_alloc_double(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_double, n);
#else
  return Rf_allocVector(R_TYPE_double, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:210

r_alloc_empty_environment typed

[env] -> env
timing: 0.008 s
source
r_obj* r_alloc_empty_environment(r_obj* parent) {
  // Non-hashed environment.
  // Very fast and useful when you aren't getting/setting from the result.
#if R_VERSION >= R_Version(4, 1, 0)
  const int hash = 0;
  const int size = 0; // Not used when `hash = 0`
  return R_NewEnv(parent, hash, size);
#else
  r_obj* env = Rf_allocSExp(R_TYPE_environment);
  SET_ENCLOS(env, parent);
  return env;
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.h:91

r_alloc_environment typed

[c_int, env] -> env
timing: 0.011 s
source
r_obj* r_alloc_environment(r_ssize size, r_obj* parent) {
#if R_VERSION < R_Version(4, 1, 0)
  parent = parent ? parent : r_envs.empty;
  r_node_poke_car(new_env__parent_node, parent);

  size = size ? size : 29;
  r_node_poke_car(new_env__size_node, r_int(size));

  r_obj* env = r_eval(new_env_call, r_envs.base);

  // Free for gc
  r_node_poke_car(new_env__parent_node, r_null);

  return env;
#else
  const int hash = 1;
  return R_NewEnv(parent, hash, size);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.c:23

r_alloc_integer typed

([c_int] -> INT)&([c_true] -> INT1)
timing: 0.028 s
source
r_obj* r_alloc_integer(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_integer, n);
#else
  return Rf_allocVector(R_TYPE_integer, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:202

r_alloc_list typed

[c_int_na] -> list
timing: 0.010 s
source
r_obj* r_alloc_list(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_list, n);
#else
  return Rf_allocVector(R_TYPE_list, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:242

r_alloc_logical typed

([c_int] -> LGL)&([c_true] -> LGL1)
timing: 0.026 s
source
r_obj* r_alloc_logical(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_logical, n);
#else
  return Rf_allocVector(R_TYPE_logical, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:194

r_alloc_raw typed

([c_int] -> raw)&([c_true] -> raw1)
timing: 0.023 s
source
r_obj* r_alloc_raw(r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(R_TYPE_raw, n);
#else
  return Rf_allocVector(R_TYPE_raw, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:226

r_alloc_raw0 typed

([c_int] -> raw)&([c_true] -> raw1)
timing: 0.152 s
source
r_obj* r_alloc_raw0(r_ssize n) {
  r_obj* out = r_alloc_raw(n);

  unsigned char* p_out = (unsigned char*) r_raw_begin(out);
  r_memset(p_out, 0, n);

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:251

r_arg_as_bool typed

([LGL, c_string] -> c_lgl)&([^LGL1, c_string] -> c_bool)
timing: 0.055 s
source
bool r_arg_as_bool(r_obj* x, const char* arg) {
  if (!r_is_bool(x)) {
    r_abort("`%s` must be `TRUE` or `FALSE`.", arg);
  }
  return r_lgl_get(x, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:379

r_arg_as_int typed

([INT, c_string] -> c_int_na)&([^INT1, c_string] -> c_int)
timing: 0.068 s
source
int r_arg_as_int(r_obj* x, const char* arg) {
  if (!r_is_int(x)) {
    r_abort("`%s` must be a single integer value.", arg);
  }
  return r_int_get(x, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:391

R_ARR_SIZEOF typed

([c_null] -> empty)&([c_ptr] -> c_int)
timing: 0.023 s
(definition not located in src/)

r_as_bool typed

([LGL] -> c_lgl)&([^LGL1] -> c_bool)
timing: 0.030 s
source
bool r_as_bool(r_obj* x) {
  return r_arg_as_bool(x, "x");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:386

r_as_int typed

([INT] -> c_int_na)&([^INT1] -> c_int)
timing: 0.032 s
source
int r_as_int(r_obj* x) {
  return r_arg_as_int(x, "x");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:398

r_attrib_clone_from typed

[any_sexp, any_sexp] -> ()
timing: 0.007 s
source
void r_attrib_clone_from(r_obj* to, r_obj* from) {
  SHALLOW_DUPLICATE_ATTRIB(to, from);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:37

r_attrib_get_cb typed

∀'a. [any_sexp, any_sexp & 'a, c_ptr] -> c_null | 'a & (<...> | c_null | null | p(CHR) | sym)
timing: 0.018 s
source
static r_obj* r_attrib_get_cb(r_obj* tag, r_obj* val, void* data) {
  if (tag == *(r_obj**) data) {
    return val;
  }
  return NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.c:3

r_attrib_has_any typed

[any_sexp] -> c_int
timing: 0.006 s
source
bool r_attrib_has_any(r_obj* x) {
  return ANY_ATTRIB(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:11

r_attrib_map typed

[any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] -> any_sexp
timing: 0.020 s
source
r_obj* r_attrib_map(r_obj* x, r_attrib_map_fn* fn, void* data) {
  return R_mapAttrib(x, fn, data);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:23

r_attrib_poke typed any: arg 2

[any_sexp, any, any_sexp] -> <...>
timing: 0.006 s
(definition not located in src/)

r_attrib_poke_class typed

[any_sexp, any_sexp] -> <...>
timing: 0.006 s
(definition not located in src/)

r_attrib_poke_dim typed

[any_sexp, any_sexp] -> <...>
timing: 0.005 s
(definition not located in src/)

r_attrib_poke_dim_names typed

[any_sexp, any_sexp] -> <...>
timing: 0.005 s
(definition not located in src/)

r_attrib_poke_names typed

[any_sexp, any_sexp] -> <...>
timing: 0.006 s
(definition not located in src/)

r_attrib_zap_all typed

[any_sexp] -> ()
timing: 0.007 s
source
void r_attrib_zap_all(r_obj* x) {
  CLEAR_ATTRIB(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:32

r_bool_as_int typed

([LGL] -> c_lgl)&([^LGL1] -> c_bool)&([null] -> empty)
timing: 0.036 s
source
int r_bool_as_int(SEXP x) {
  if (!r_is_bool(x)) {
    Rf_errorcall(R_NilValue, "Input must be a single `TRUE` or `FALSE`.");
  }
  return LOGICAL(x)[0];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1275

r_c_str_format_error_arg typed

[c_string] -> c_string
timing: 0.082 s
source
const char* r_c_str_format_error_arg(const char* x) {
  r_obj* ffi_x = KEEP(r_chr(x));
  const char* out = r_format_error_arg(ffi_x);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang-dev.h:7

r_call_n typed

([any_sexp, *any_sexp, *any_sexp] -> lang)&([any_sexp, *any_sexp, c_null] -> empty)
timing: 0.021 s
source
SEXP r_call_n(SEXP fn, SEXP* tags, SEXP* cars) {
  return Rf_lcons(fn, _r_pairlist(tags, cars));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1325

r_chr typed

[c_string] -> CHR1
timing: 0.026 s
source
r_obj* r_chr(const char* c_string) {
  r_obj* out = KEEP(r_alloc_character(1));
  r_chr_poke(out, 0, r_str(c_string));
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:285

r_chr_cbegin typed

[CHR] -> *p(CHR)
timing: 0.009 s
source
r_obj* const * r_chr_cbegin(r_obj* x) {
  return STRING_PTR_RO(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:56

r_chr_fill typed

[CHR, p(CHR), c_int_na] -> ()
timing: 0.033 s
source
void r_chr_fill(r_obj* chr, r_obj* value, r_ssize n) {
  for (r_ssize i = 0; i < n; ++i) {
    r_chr_poke(chr, i, value);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec-chr.c:39

r_chr_get typed

∀'a. [CHR & v('a), c_int] -> 'a
timing: 0.019 s
source
r_obj* r_chr_get(r_obj* x, r_ssize i) {
  return STRING_ELT(x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:141

r_chr_get_c_string typed

[CHR, c_int] -> c_string
timing: 0.037 s
source
const char* r_chr_get_c_string(r_obj* x, r_ssize i) {
  return CHAR(r_chr_get(x, i));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:145

r_chr_has_string typed

[CHR, any_sexp] -> c_bool
timing: 0.538 s
source
bool r_chr_has_string(SEXP x, SEXP str) {
  R_len_t n = Rf_length(x);
  const SEXP* xp = STRING_PTR_RO(x);

  for (R_len_t i = 0; i < n; ++i, ++xp) {
    if (*xp == str) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1409

r_chr_iota typed

([c_int, c_string, c_int_na, c_string] -> CHR | null)&([c_true, c_string, c_int_na, c_string] -> CHR1 | null)
timing: 11.79 s
source
SEXP r_chr_iota(R_len_t n, char* buf, int len, const char* prefix) {
  int prefix_len = strlen(prefix);
  if (len - 1 < prefix_len) {
    r_stop_internal("Prefix is larger than iota buffer.");
  }

  r_memcpy(buf, prefix, prefix_len);
  len -= prefix_len;
  char* beg = buf + prefix_len;

  SEXP out = PROTECT(Rf_allocVector(STRSXP, n));

  for (R_len_t i = 0; i < n; ++i) {
    int written = snprintf(beg, len, "%d", i + 1);

    if (written >= len) {
      UNPROTECT(1);
      return R_NilValue;
    }

    SET_STRING_ELT(out, i, Rf_mkChar(buf));
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1237

r_chr_max_len typed

[CHR] -> c_int_na
timing: 0.355 s
source
int r_chr_max_len(SEXP x) {
  R_len_t n = Rf_length(x);
  SEXP const* p = STRING_PTR_RO(x);

  int max = 0;
  for (R_len_t i = 0; i < n; ++i, ++p) {
    int len = strlen(CHAR(*p));
    max = len > max ? len : max;
  }

  return max;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1216

r_chr_n typed

([*(c_string | c_null), c_int] -> CHR)&([*(c_string | c_null), c_true] -> CHR1)
timing: 0.114 s
source
r_obj* r_chr_n(const char* const * strings, r_ssize n) {
  r_obj* out = KEEP(r_alloc_character(n));

  for (r_ssize i = 0; i < n; ++i) {
    r_chr_poke(out, i, r_str(strings[i]));
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:6

r_chr_poke typed

[CHR, c_int, p(CHR)] -> ()
timing: 0.045 s
source
void r_chr_poke(r_obj* x, r_ssize i, r_obj* y) {
  SET_STRING_ELT(x, i, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:174

r_chr_poke typed

[CHR, c_int, p(CHR)] -> ()
timing: 0.042 s
source
void r_chr_poke(r_obj* x, r_ssize i, r_obj* y) {
  SET_STRING_ELT(x, i, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:174

r_clone typed

∀'a. [any_sexp & 'a] -> 'a
timing: 0.007 s
source
r_obj* r_clone(r_obj* x) {
  return Rf_shallow_duplicate(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:73

r_clone_referenced typed

∀'a. [any_sexp & 'a] -> 'a
timing: 0.019 s
source
SEXP r_clone_referenced(SEXP x) {
  if (MAYBE_REFERENCED(x)) {
    return Rf_shallow_duplicate(x);
  } else {
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1383

r_copy typed

∀'a. [any_sexp & 'a] -> 'a
timing: 0.007 s
source
r_obj* r_copy(r_obj* x) {
  return Rf_duplicate(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:69

r_cpl_begin typed

[CLX] -> *s({ r: c_double, i: c_double })
timing: 0.011 s
source
r_complex* r_cpl_begin(r_obj* x) {
  return COMPLEX(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:27

r_cpl_cbegin typed

[CLX] -> *any
timing: 0.011 s
source
const r_complex* r_cpl_cbegin(r_obj* x) {
  return (const r_complex*) COMPLEX(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:48

r_dbl typed

[c_double] -> DBL1
timing: 0.009 s
source
r_obj* r_dbl(double x) {
  return Rf_ScalarReal(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:269

r_dbl_begin typed

[DBL] -> *c_double
timing: 0.011 s
source
double* r_dbl_begin(r_obj* x) {
  return REAL(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:23

r_dbl_cbegin typed

[DBL] -> *c_double
timing: 0.011 s
source
const double* r_dbl_cbegin(r_obj* x) {
  return (const double*) REAL(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:44

r_dbl_get typed

[DBL, c_int_na] -> c_double
timing: 0.020 s
source
double r_dbl_get(r_obj* x, r_ssize i) {
  return REAL(x)[i];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:129

r_dyn_begin typed

([*struct r_dyn_array] -> any)&([c_null] -> empty)
timing: 0.015 s
source
void* r_dyn_begin(struct r_dyn_array* p_arr) {
  return r_dyn_pointer(p_arr, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:51

r_dyn_cbegin typed

([*struct r_dyn_array] -> any)&([c_null] -> empty)
timing: 0.015 s
source
const void* r_dyn_cbegin(struct r_dyn_array* p_arr) {
  return r_dyn_cpointer(p_arr, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:69

r_dyn_cpointer typed

([*struct r_dyn_array, c_int_na] -> any)&([c_null, c_int_na] -> empty)
timing: 0.096 s
source
const void* r_dyn_cpointer(struct r_dyn_array* p_arr, r_ssize i) {
  r_ssize offset = i * p_arr->elt_byte_size;
  return ((const unsigned char*) p_arr->v_data_const) + offset;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:64

r_dyn_int_get typed

[*struct r_dyn_array, c_int_na] -> c_int_na
timing: 0.041 s
source
int r_dyn_int_get(struct r_dyn_array* p_vec, r_ssize i) {
  return ((const int*) p_vec->v_data_const)[i];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:89

r_dyn_int_poke typed

[*struct r_dyn_array, c_int_na, c_int_na] -> ()
timing: 0.052 s
source
void r_dyn_int_poke(struct r_dyn_array* p_vec, r_ssize i, int value) {
  ((int*) p_vec->v_data)[i] = value;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:118

r_dyn_int_push_back typed

([*struct r_dyn_array, c_int_na] -> ())&([c_null, c_int_na] -> empty)
timing: 0.026 s
source
void r_dyn_int_push_back(struct r_dyn_array* p_vec, int elt) {
  r_ssize loc = r__dyn_increment(p_vec);
  r_dyn_int_poke(p_vec, loc, elt);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:167

r_dyn_last typed

([*struct r_dyn_array] -> any)&([c_null] -> empty)
timing: 0.061 s
source
void* r_dyn_last(struct r_dyn_array* p_arr) {
  return r_dyn_pointer(p_arr, p_arr->count - 1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:55

r_dyn_list_poke typed

([*struct r_dyn_array({ shelter : any_sexp ; data : list }), c_int, any_sexp] -> ())&([c_null, c_int_na, any_sexp] -> empty)
timing: 0.293 s
source
void r_dyn_list_poke(struct r_dyn_array* p_vec, r_ssize i, r_obj* value) {
  r_list_poke(p_vec->data, i, value);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:138

r_dyn_list_push_back typed empty return

[c_null, any_sexp] -> empty
timing: 0.028 s
source
void r_dyn_list_push_back(struct r_dyn_array* p_vec, r_obj* elt) {
  KEEP(elt);
  r_ssize loc = r__dyn_increment(p_vec);
  r_dyn_list_poke(p_vec, loc, elt);
  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:194

r_dyn_pointer typed

([*struct r_dyn_array, c_int_na] -> any)&([c_null, c_int_na] -> empty)
timing: 0.165 s
source
void* r_dyn_pointer(struct r_dyn_array* p_arr, r_ssize i) {
  if (p_arr->barrier_set) {
    r_abort("Can't take mutable pointer of barrier vector.");
  }
  r_ssize offset = i * p_arr->elt_byte_size;
  return ((unsigned char*) p_arr->v_data) + offset;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.h:43

r_dyn_push_back typed empty return

[c_null, c_ptr] -> empty
timing: 0.904 s
source
void r_dyn_push_back(struct r_dyn_array* p_arr,
                     const void* p_elt) {
  r_ssize loc = r__dyn_increment(p_arr);

  if (p_arr->barrier_set) {
    r_obj* value = *((r_obj* const *) p_elt);
    p_arr->barrier_set(p_arr->data, loc, value);
  } else if (p_elt) {
    r_memcpy(r_dyn_last(p_arr), p_elt, p_arr->elt_byte_size);
  } else {
    r_memset(r_dyn_last(p_arr), 0, p_arr->elt_byte_size);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.c:70

r_dyn_resize typed empty return

[c_null, c_int_na] -> empty
timing: 0.279 s
source
void r_dyn_resize(struct r_dyn_array* p_arr,
                  r_ssize capacity) {
  enum r_type type = p_arr->type;

  r_ssize capacity_multiplier = p_arr->type == R_TYPE_raw ?
    r_ssize_mult(p_arr->elt_byte_size, capacity) :
    capacity;

  r_obj* data = r_vec_resize0(type,
                              r_list_get(p_arr->shelter, 1),
                              capacity_multiplier);
  r_list_poke(p_arr->shelter, 1, data);

  p_arr->count = r_ssize_min(p_arr->count, capacity);
  p_arr->capacity = capacity;
  p_arr->data = data;

  switch (type) {
  case R_TYPE_character:
  case R_TYPE_list:
    break;
  default:
    p_arr->v_data = r_vec_begin0(type, data);
    break;
  }
  p_arr->v_data_const = r_vec_cbegin0(type, data);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.c:84

r_dyn_unwrap typed

([*struct r_dyn_array] -> any)&([c_null] -> empty)
timing: 2.48 s
source
r_obj* r_dyn_unwrap(struct r_dyn_array* p_arr) {
  if (p_arr->type == R_TYPE_raw) {
    return r_raw_resize(p_arr->data, p_arr->count * p_arr->elt_byte_size);
  } else {
    return r_vec_resize0(p_arr->type, p_arr->data, p_arr->count);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.c:50

r_env_bind typed

[env, sym, any_sexp] -> ()
timing: 0.019 s
source
void r_env_bind(r_obj* env, r_obj* sym, r_obj* value) {
  // See rchk concerns in https://github.com/r-lib/rlang/commit/28ce7b01
  KEEP(value);
  Rf_defineVar(sym, value, env);
  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env-binding.h:26

r_env_binding_type typed

[env, sym] -> c_false
timing: 0.012 s
source
enum r_env_binding_type r_env_binding_type(r_obj* env, r_obj* sym) {
#if RLANG_HAS_R_BINDING_API
  switch (R_GetBindingType(sym, env)) {
  case R_BindingTypeUnbound: return R_ENV_BINDING_TYPE_unbound;
  case R_BindingTypeValue:   return R_ENV_BINDING_TYPE_value;
  case R_BindingTypeMissing: return R_ENV_BINDING_TYPE_missing;
  case R_BindingTypeDelayed: return R_ENV_BINDING_TYPE_delayed;
  case R_BindingTypeForced:  return R_ENV_BINDING_TYPE_forced;
  case R_BindingTypeActive:  return R_ENV_BINDING_TYPE_active;
  }
  r_stop_unreachable();
#else
  // Active binding check must come first since `r_env_find()` triggers them
  if (R_BindingIsActive(sym, env)) {
    return R_ENV_BINDING_TYPE_active;
  }

  r_obj* value = env_find(env, sym);

  if (value == R_UnboundValue) {
    return R_ENV_BINDING_TYPE_unbound;
  }

  if (value == r_missing_arg) {
    return R_ENV_BINDING_TYPE_missing;
  }

  if (r_typeof(value) == R_TYPE_promise) {
    bool forced;
    rlang_promise_unwrap(value, &forced);
    if (forced) {
      return R_ENV_BINDING_TYPE_forced;
    }

    return R_ENV_BINDING_TYPE_delayed;
  }

  return R_ENV_BINDING_TYPE_value;
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env-binding.c:121

r_env_get typed

[env, sym] -> any_sexp
timing: 0.030 s
source
r_obj* r_env_get(r_obj* env, r_obj* sym) {
  enum r_env_binding_type type = r_env_binding_type(env, sym);

  if (type == R_ENV_BINDING_TYPE_unbound) {
    r_abort("object '%s' not found", r_sym_c_string(sym));
  }
  if (type == R_ENV_BINDING_TYPE_missing) {
    return r_missing_arg;
  }

#if R_VERSION >= R_Version(4, 5, 0)
  return R_getVar(sym, env, FALSE);
#else
  r_obj* value = env_find(env, sym);
  if (r_typeof(value) == R_TYPE_dots) {
    return value;
  }

  // Handles value, delayed, forced, and active bindings
  return Rf_eval(sym, env);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env-binding.c:162

r_env_has typed

[any_sexp, any_sexp] -> c_bool
timing: 0.008 s
source
bool r_env_has(r_obj* env, r_obj* sym) {
#if RLANG_USE_R_EXISTS
  bool r__env_has(r_obj*, r_obj*);
  return r__env_has(env, sym);
#else
  return R_existsVarInFrame(env, sym);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.h:58

r_eval typed

[any_sexp, env] -> any_sexp
timing: 0.013 s
source
r_obj* r_eval(r_obj* expr, r_obj* env) {
  return Rf_eval(expr, env);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.h:11

r_exec_mask_n typed

[any_sexp, any_sexp, *struct r_pair, c_int, env] -> any_sexp
timing: 0.056 s
source
r_obj* r_exec_mask_n(r_obj* fn_sym,
                     r_obj* fn,
                     const struct r_pair* args,
                     int n,
                     r_obj* parent) {
  r_obj* mask = KEEP(r_alloc_environment(n + 1, parent));
  r_obj* call = KEEP(r_exec_mask_n_call_poke(fn_sym, fn, args, n, mask));

  r_obj* out = r_eval(call, mask);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:103

r_exec_n typed

[any_sexp, any_sexp, *struct r_pair, c_int_na, env] -> any_sexp
timing: 0.029 s
source
r_obj* r_exec_n(r_obj* fn_sym,
                r_obj* fn,
                const struct r_pair* args,
                int n,
                r_obj* env) {
  r_obj* call = KEEP(r_exec_mask_n_call_poke(fn_sym, fn, args, n, env));
  r_obj* out = r_eval(call, env);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:117

r_expr_protect typed

∀'a. [any_sexp & 'a] -> lang | any_sexp & 'a
timing: 0.018 s
source
r_obj* r_expr_protect(r_obj* x) {
  switch (r_typeof(x)) {
  case R_TYPE_symbol:
  case R_TYPE_call:
  case R_TYPE_promise:
    return r_call2(quote_prim, x);
  default:
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/call.c:22

r_fn_body typed

[arrow] -> lang
timing: 0.008 s
source
r_obj* r_fn_body(r_obj* fn) {
  return R_ClosureExpr(fn);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.h:21

r_fn_env typed

[arrow] -> env
timing: 0.009 s
source
r_obj* r_fn_env(r_obj* fn) {
#if R_VERSION >= R_Version(4, 5, 0)
  return R_ClosureEnv(fn);
#else
  return CLOENV(fn);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.h:26

r_fn_formals typed

[arrow] -> lang | null
timing: 0.008 s
source
r_obj* r_fn_formals(r_obj* fn) {
#if R_VERSION >= R_Version(4, 5, 0)
  return R_ClosureFormals(fn);
#else
  return FORMALS(fn);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.h:10

r_inherits typed

[any_sexp, c_string] -> c_bool
timing: 0.009 s
source
bool r_inherits(r_obj* x, const char* tag) {
  return Rf_inherits(x, tag);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:64

r_init_data_frame typed

[any_sexp, c_int_na] -> ()
timing: 0.017 s
source
void r_init_data_frame(r_obj* x, r_ssize n_rows) {
  init_compact_rownames(x, n_rows);
  r_attrib_poke(x, r_syms.class_, r_classes.data_frame);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/df.c:33

r_init_library_arg typed

() -> ()
timing: 0.006 s
source
void r_init_library_arg(void) {
  r_arg_match = (int (*)(r_obj*, r_obj*, struct r_lazy, struct r_lazy))
    r_peek_c_callable("rlang", "rlang_arg_match_2");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/arg.c:8

r_init_library_call typed

() -> ()
timing: 0.004 s
source
void r_init_library_call(void) {
  quote_prim = r_base_ns_get("quote");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/call.c:65

r_init_library_dyn_array typed

() -> ()
timing: 0.010 s
source
void r_init_library_dyn_array(void) {
  r_preserve_global(dyn_array_class = r_chr("rlang_dyn_array"));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.c:113

r_init_library_eval typed

() -> ()
timing: 0.003 s
source
void r_init_library_eval(void) {
  r_lazy_missing_arg = (struct r_lazy) { .x = r_missing_arg, .env = r_null };
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:171

r_init_library_obj typed

[env] -> ()
timing: 0.070 s
source
void r_init_library_obj(r_obj* ns) {
  p_precious_dict = r_new_dict(PRECIOUS_DICT_INIT_SIZE);
  KEEP(p_precious_dict->shelter);
  r_env_bind(ns,
             r_sym(".__rlang_lib_precious_dict__."),
             p_precious_dict->shelter);
  FREE(1);

  // The Microsoft C library doesn't implement the hexadecimal
  // formatter correctly
  const char* null_addr = r_str_c_string(r_obj_address(r_null));
  if (null_addr[0] != '0' || null_addr[1] != 'x') {
    obj_address_formatter = "0x%p";
  }

  r_obj_encode_utf8 = (r_obj* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_obj_encode_utf8");

  as_label_call = r_parse("as_label(x)");
  r_preserve_global(as_label_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.c:127

r_init_library_quo typed

() -> ()
timing: 0.012 s
source
void r_init_library_quo(void) {
  r_quo_get_expr = (r_obj* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_quo_get_expr");
  r_quo_set_expr = (r_obj* (*)(r_obj*, r_obj*)) r_peek_c_callable("rlang", "rlang_quo_set_expr");
  r_quo_get_env = (r_obj* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_quo_get_env");
  r_quo_set_env = (r_obj* (*)(r_obj*, r_obj*)) r_peek_c_callable("rlang", "rlang_quo_set_env");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/quo.c:8

r_init_library_session typed

() -> ()
timing: 0.007 s
source
void r_init_library_session(void) {
  is_installed_call = r_parse("requireNamespace(x, quietly = TRUE)");
  r_preserve(is_installed_call);

  has_colour_call = r_parse("crayon::has_color()");
  r_preserve(has_colour_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/session.c:28

r_init_library_sym typed

() -> ()
timing: 0.007 s
source
void r_init_library_sym(void) {
  r_sym_as_utf8_character = (r_obj* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_sym_as_character");
  r_sym_as_utf8_string = (r_obj* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_sym_as_string");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/sym.c:56

r_init_library_vendor typed

() -> ()
timing: 0.004 s
source
void r_init_library_vendor(void) {
  r_xxh3_64bits = (uint64_t (*)(const void*, size_t)) r_peek_c_callable("rlang", "rlang_xxh3_64bits");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vendor.c:5

r_init_rlang_ns_env typed

() -> ()
timing: 0.005 s
source
void r_init_rlang_ns_env(void) {
  rlang_ns_env = r_ns_env("rlang");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.c:251

r_int typed

∀'a. ([c_int & c_int_na('a)] -> ^INT1('a))&([c_int_na \ c_int | c_int_na & c_int_na('a)] -> INT1('a))
timing: 0.030 s
source
r_obj* r_int(int x) {
  return Rf_ScalarInteger(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:265

r_int_begin typed

([INT] -> *c_int_na)&([^INT1] -> *c_int)
timing: 0.029 s
source
int* r_int_begin(r_obj* x) {
  return INTEGER(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:19

r_int_cbegin typed

[INT] -> *c_int_na
timing: 0.022 s
source
const int* r_int_cbegin(r_obj* x) {
  return (const int*) INTEGER(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:36

r_int_count_complete typed

[INT] -> c_int
timing: 0.352 s
source
r_ssize r_int_count_complete(r_obj* x) {
  const int* v_x = r_int_cbegin(x);
  const r_ssize size = r_length(x);

  r_ssize out = 0;

  for (r_ssize i = 0; i < size; ++i) {
    out += (v_x[i] != r_globals.na_int);
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-int.h:7

r_int_fill typed

[INT, c_int_na, c_int_na] -> ()
timing: 0.026 s
source
void r_int_fill(SEXP x, int value, R_len_t n) {
  r_p_int_fill(INTEGER(x), value, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1123

r_int_fill_seq typed

[INT, c_int_na, c_int_na] -> ()
timing: 0.113 s
source
void r_int_fill_seq(SEXP x, int start, R_len_t n) {
  int* data = INTEGER(x);

  for (R_len_t i = 0; i < n; ++i, ++data, ++start) {
    *data = start;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1128

r_int_get typed

([INT, c_int_na] -> c_int_na)&([^INT1, c_int_na] -> c_int)
timing: 0.032 s
source
int r_int_get(r_obj* x, r_ssize i) {
  return INTEGER(x)[i];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:125

r_is_bool typed

([LGL] -> c_bool)&([null] -> c_false)
timing: 0.106 s
source
bool r_is_bool(r_obj* x) {
  return
    r_typeof(x) == R_TYPE_logical &&
    r_length(x) == 1 &&
    r_lgl_get(x, 0) != r_globals.na_lgl;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:349

r_is_empty_names typed

([CHR] -> c_bool)&([null] -> c_true)&([(clx | (~vec)<...>) | sym] -> c_false)
timing: 1.02 s
source
bool r_is_empty_names(SEXP x) {
  if (TYPEOF(x) != STRSXP) {
    if (x == R_NilValue) {
      return true;
    } else {
      return false;
    }
  }

  R_len_t n = Rf_length(x);
  const SEXP* p = STRING_PTR_RO(x);

  for (R_len_t i = 0; i < n; ++i, ++p) {
    SEXP elt = *p;
    if (elt != NA_STRING && elt != strings_empty) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1361

r_is_function typed

[any_sexp] -> c_bool
timing: 0.013 s
source
bool r_is_function(r_obj* x) {
  switch (r_typeof(x)) {
  case R_TYPE_closure:
  case R_TYPE_builtin:
  case R_TYPE_special:
    return true;
  default:
    return false;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.h:50

r_is_int typed

([INT] -> c_bool)&([null] -> c_false)
timing: 0.137 s
source
bool r_is_int(r_obj* x) {
  return
    r_typeof(x) == R_TYPE_integer &&
    r_length(x) == 1 &&
    r_int_get(x, 0) != r_globals.na_int;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:356

r_is_minimal_names typed

([CHR] -> c_bool)&([(clx | (~vec)<...>) | null | sym] -> c_false)
timing: 1.30 s
source
bool r_is_minimal_names(SEXP x) {
  if (TYPEOF(x) != STRSXP) {
    return false;
  }

  R_len_t n = Rf_length(x);
  const SEXP* p = STRING_PTR_RO(x);

  for (R_len_t i = 0; i < n; ++i, ++p) {
    SEXP elt = *p;
    if (elt == NA_STRING || elt == strings_empty) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1343

r_is_number typed

([INT] -> c_bool)&([^INT1] -> c_true)&([((CHR | CLX | DBL | LGL | RAW) | (~vec)<...>) | null | p(CHR) | sym] -> c_false)
timing: 0.254 s
source
bool r_is_number(SEXP x) {
  return TYPEOF(x) == INTSXP &&
    Rf_length(x) == 1 &&
    INTEGER(x)[0] != NA_INTEGER;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1282

r_is_object typed

([<...>] -> c_true)&([<> | null | p(CHR) | sym] -> c_false)
timing: 0.017 s
source
bool r_is_object(r_obj* x) {
  return Rf_isObject(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:59

r_is_positive_number typed

([any_sexp] -> c_bool)&([(~INT)<...> | null | p(CHR) | sym] -> c_false)
timing: 0.110 s
source
bool r_is_positive_number(SEXP x) {
  return r_is_number(x) && INTEGER(x)[0] > 0;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1287

r_is_s4 typed

[any_sexp] -> c_bool
timing: 0.007 s
source
static inline bool r_is_s4(SEXP x) {
  return Rf_isS4(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:266

r_is_scalar_logical typed

([null] -> c_false)&([any_sexp] -> c_bool)
timing: 0.031 s
source
bool r_is_scalar_logical(r_obj* x) {
  return r_typeof(x) == R_TYPE_logical && r_length(x) == 1;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:331

r_is_string typed

([CHR] -> c_bool)&([null] -> c_false)
timing: 0.101 s
source
bool r_is_string(r_obj* x) {
  return
    r_typeof(x) == R_TYPE_character &&
    r_length(x) == 1 &&
    r_chr_get(x, 0) != R_NaString;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:371

r_is_true typed

([null] -> c_false)&([LGL | null] -> c_bool)
timing: 0.057 s
source
bool r_is_true(r_obj* x) {
  return r_is_bool(x) && r_lgl_get(x, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:363

R_LAZY_ALLOC typed any: arg 4, arg 2, arg 3

[null, c_int, list, any] | [null, c_int, prim, c_int] | [~null, any, any, any] -> ()
timing: 0.195 s
(definition not located in src/)

r_lazy_eval_protect typed

[struct r_lazy] -> any_sexp
timing: 0.020 s
source
r_obj* r_lazy_eval_protect(struct r_lazy lazy) {
  r_obj* out = KEEP(r_lazy_eval(lazy));
  out = r_expr_protect(out);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.h:171

r_length typed

([null] -> c_false)&([any_sexp] -> c_int)&([(externalptr | vec1 | arrow) | sym] -> c_true)
timing: 0.046 s
source
r_ssize r_length(r_obj* x) {
  return Rf_xlength(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:13

r_lgl typed

([c(..-1) | c(1..)] -> tt)&([c_false] -> ff)&([c_na] -> LGL1 \ ^LGL1)
timing: 0.125 s
source
r_obj* r_lgl(bool x) {
  return Rf_ScalarLogical(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:261

r_lgl_all typed

[LGL] -> c_bool
timing: 0.111 s
source
bool r_lgl_all(r_obj* x) {
  if (r_typeof(x) != R_TYPE_logical) {
    r_stop_internal("`x` must be a logical vector.");
  }

  const int* v_x = r_lgl_cbegin(x);
  r_ssize size = r_length(x);

  for (r_ssize i = 0; i < size; ++i) {
    if (!v_x[i]) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:248

r_lgl_begin typed

([LGL] -> *c_lgl)&([^LGL1] -> *c_bool)
timing: 0.028 s
source
int* r_lgl_begin(r_obj* x) {
  return LOGICAL(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:15

r_lgl_cbegin typed

[LGL] -> *c_int_na
timing: 0.022 s
source
const int* r_lgl_cbegin(r_obj* x) {
  return (const int*) LOGICAL(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:40

r_lgl_fill typed

[LGL, c_int_na, c_int_na] -> ()
timing: 0.027 s
source
void r_lgl_fill(SEXP x, int value, R_len_t n) {
  r_p_lgl_fill(LOGICAL(x), value, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1120

r_lgl_get typed

([LGL, c_int_na] -> c_lgl)&([^LGL1, c_int_na] -> c_bool)
timing: 0.035 s
source
int r_lgl_get(r_obj* x, r_ssize i) {
  return LOGICAL(x)[i];
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:121

r_lgl_invert typed

([LGL] -> LGL)&([LGL1] -> LGL1)
timing: 0.373 s
source
r_obj* r_lgl_invert(r_obj* x) {
  const r_ssize size = r_length(x);
  const int* v_x = r_lgl_cbegin(x);

  r_obj* out = KEEP(r_alloc_logical(size));
  int* v_out = r_lgl_begin(out);

  for (r_ssize i = 0; i < size; ++i) {
    const int elt = v_x[i];
    v_out[i] = (elt == r_globals.na_lgl) ? r_globals.na_lgl : !elt;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1200

r_lgl_sum typed

[LGL, c_false] | [LGL, c_int_na \ c_false] -> c_int
timing: 1.29 s
source
r_ssize r_lgl_sum(r_obj* x, bool na_true) {
  if (r_typeof(x) != R_TYPE_logical) {
    r_abort("Internal error: Excepted logical vector in `r_lgl_sum()`");
  }

  const r_ssize n = r_length(x);
  const int* v_x = r_lgl_cbegin(x);

  // This can't overflow since `sum` is necessarily smaller or equal
  // to the vector length expressed in `r_ssize`
  r_ssize sum = 0;

  if (na_true) {
    for (r_ssize i = 0; i < n; ++i) {
      sum += (bool) v_x[i];
    }
  } else {
    for (r_ssize i = 0; i < n; ++i) {
      sum += (v_x[i] == 1);
    }
  }

  return sum;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec-lgl.c:4

r_list typed

[any_sexp] -> list
timing: 0.016 s
source
r_obj* r_list(r_obj* x) {
  r_obj* out = r_alloc_list(1);
  r_list_poke(out, 0, x);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:292

r_list_cbegin typed

[list] -> *any_sexp
timing: 0.009 s
source
r_obj* const * r_list_cbegin(r_obj* x) {
#if (R_VERSION >= R_Version(4, 5, 0))
  return VECTOR_PTR_RO(x);
#else
  return ((r_obj* const *) DATAPTR_RO(x));
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:60

r_list_get typed

∀'a. [{ 'a }, c_int] -> 'a
timing: 0.013 s
source
r_obj* r_list_get(r_obj* x, r_ssize i) {
  return VECTOR_ELT(x, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:149

r_list_poke typed

[list, c_int, any_sexp] -> ()
timing: 0.080 s
source
void r_list_poke(r_obj* x, r_ssize i, r_obj* y) {
  SET_VECTOR_ELT(x, i, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:178

r_list_poke typed

∀'a. ([list, c_int, 'a] -> 'a)&([expr, c_int, 'a & (lang | sym)] -> 'a & (lang | sym))
timing: 0.067 s
source
void r_list_poke(r_obj* x, r_ssize i, r_obj* y) {
  SET_VECTOR_ELT(x, i, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:178

r_mark_shared typed

[any_sexp] -> ()
timing: 0.005 s
source
void r_mark_shared(r_obj* x) {
  MARK_NOT_MUTABLE(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:39

r_memcpy typed

[c_ptr, c_ptr, c_false] | [c_ptr, c_ptr, c_int_na \ c_false] -> ()
timing: 0.019 s
source
void r_memcpy(void* dest, const void* src, size_t count) {
  if (count) {
    memcpy(dest, src, count);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:180

r_memset typed

[c_ptr, c_int_na, c_false] | [c_ptr, c_int_na, c_int_na \ c_false] -> ()
timing: 0.022 s
source
void r_memset(void* dest, int value, size_t count) {
  if (count) {
    memset(dest, value, count);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:190

r_new_character typed

([c_int] -> CHR)&([c_true] -> "")
timing: 0.038 s
source
SEXP r_new_character(R_len_t n) {
  return Rf_allocVector(STRSXP, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:247

r_new_dyn_vector typed

[c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99), c_int_na] -> *struct r_dyn_array
timing: 0.768 s
source
struct r_dyn_array* r_new_dyn_vector(enum r_type type,
                                     r_ssize capacity) {
  r_obj* shelter = KEEP(r_alloc_list(2));
  r_attrib_poke_class(shelter, dyn_array_class);

  r_obj* vec_raw = r_alloc_raw(sizeof(struct r_dyn_array));
  r_list_poke(shelter, 0, vec_raw);

  r_obj* vec_data = r_alloc_vector(type, capacity);
  r_list_poke(shelter, 1, vec_data);

  struct r_dyn_array* p_vec = r_raw_begin(vec_raw);
  p_vec->shelter = shelter;
  p_vec->count = 0;
  p_vec->capacity = capacity;
  p_vec->growth_factor = R_DYN_ARRAY_GROWTH_FACTOR;
  p_vec->type = type;
  p_vec->elt_byte_size = r_vec_elt_sizeof0(type);
  p_vec->data = vec_data;

  switch (type) {
  case R_TYPE_character:
    p_vec->v_data = NULL;
    p_vec->barrier_set = &r_chr_poke;
    break;
  case R_TYPE_list:
    p_vec->v_data = NULL;
    p_vec->barrier_set = &r_list_poke;
    break;
  default:
    p_vec->barrier_set = NULL;
    p_vec->v_data = r_vec_begin0(type, vec_data);
    break;
  }
  p_vec->v_data_const = r_vec_cbegin0(type, vec_data);

  FREE(1);
  return p_vec;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dyn-array.c:10

r_new_function typed

[lang | null, any_sexp, env] -> (any -> any)
timing: 0.017 s
source
r_obj* r_new_function(r_obj* formals, r_obj* body, r_obj* env) {
#if R_VERSION >= R_Version(4, 5, 0)
  return R_mkClosure(formals, body, env);
#else
  SEXP fn = Rf_allocSExp(R_TYPE_closure);
  SET_FORMALS(fn, formals);
  SET_BODY(fn, body);
  SET_CLOENV(fn, env);
  return fn;
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.h:35

r_new_integer typed

([c_int] -> INT)&([c_true] -> INT1)
timing: 0.033 s
source
SEXP r_new_integer(R_len_t n) {
  return Rf_allocVector(INTSXP, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:243

r_new_list typed

[c_int_na] -> list
timing: 0.018 s
source
SEXP r_new_list(R_len_t n) {
  return Rf_allocVector(VECSXP, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:255

r_new_logical typed

([c_int] -> LGL)&([c_true] -> LGL1)
timing: 0.032 s
source
SEXP r_new_logical(R_len_t n) {
  return Rf_allocVector(LGLSXP, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:239

r_new_node typed

[any_sexp, lang | null] -> lang
timing: 0.012 s
source
r_obj* r_new_node(r_obj* car, r_obj* cdr) {
  return Rf_cons(car, cdr);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:25

r_new_pairlist typed

[*struct r_pair, c_false, *any_sexp] | [*struct r_pair, c_int_na \ c_false, *any_sexp \ c_null] | [*struct r_pair, c_int_na \ c_false, c_null] -> lang | null
timing: 0.852 s
source
r_obj* r_new_pairlist(const struct r_pair* args,
                      int n,
                      r_obj** tail) {
  r_obj* shelter = KEEP(r_new_node(R_NilValue, R_NilValue));
  r_obj* node = shelter;

  for (int i = 0; i < n; ++i) {
    struct r_pair arg = args[i];
    r_obj* tag = arg.x;
    r_obj* car = arg.y;

    r_obj* cdr = r_new_node(car, r_null);
    r_node_poke_tag(cdr, tag);

    r_node_poke_cdr(node, cdr);
    node = cdr;
  }

  if (n && tail) {
    *tail = node;
  }

  FREE(1);
  return r_node_cdr(shelter);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.c:4

r_new_raw typed

([c_int] -> raw)&([c_true] -> raw1)
timing: 0.037 s
source
SEXP r_new_raw(R_len_t n) {
  return Rf_allocVector(RAWSXP, n);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:251

r_new_shared_character typed

∀'a. [c_string('a)] -> ^CHR1('a)
timing: 0.015 s
source
SEXP r_new_shared_character(const char* name) {
  SEXP out = Rf_mkString(name);
  R_PreserveObject(out);
  MARK_NOT_MUTABLE(out);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1708

r_new_shared_vector typed

∀'a. ([list & 'a, c_int_na] -> list)&([p(CHR) & 'a, c_true] -> "" & v1('a))&([prim & 'a, c_int] -> v('a))&([prim & 'a, c_true] -> v1('a))
timing: 0.094 s
source
SEXP r_new_shared_vector(SEXPTYPE type, R_len_t n) {
  SEXP out = Rf_allocVector(type, n);
  R_PreserveObject(out);
  MARK_NOT_MUTABLE(out);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1702

r_new_vector_bool typed

[c_int] -> *struct r_vector_bool
timing: 0.104 s
source
struct r_vector_bool* r_new_vector_bool(r_ssize n) {
  r_obj* shelter = KEEP(r_alloc_list(2));

  r_obj* vec = r_alloc_raw(sizeof(struct r_vector_bool));
  r_list_poke(shelter, 0, vec);

  r_obj* data = r_alloc_raw(n * sizeof(bool));
  r_list_poke(shelter, 1, data);

  struct r_vector_bool* p_vec = r_raw_begin(vec);
  p_vec->shelter = shelter;
  p_vec->data = data;
  p_vec->v_data = r_raw_begin(data);
  p_vec->n = n;

  FREE(1);
  return p_vec;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:16

r_node_cadr typed

[lang] -> any_sexp
timing: 0.010 s
source
static inline r_obj* r_node_cadr(r_obj* x) { return CADR(x); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:12

r_node_car typed

[lang] -> any_sexp
timing: 0.009 s
source
static inline r_obj* r_node_car(r_obj* x) { return CAR(x); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:8

r_node_cddr typed

[lang] -> lang | null
timing: 0.009 s
source
static inline r_obj* r_node_cddr(r_obj* x) { return CDDR(x); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:14

r_node_cdr typed

[lang] -> lang | null
timing: 0.008 s
source
static inline r_obj* r_node_cdr(r_obj* x) { return CDR(x); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:9

r_node_poke_car typed

[lang, any_sexp] -> ()
timing: 0.011 s
source
static inline void r_node_poke_car(r_obj* x, r_obj* newcar) { SETCAR(x, newcar); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:16

r_node_poke_cdr typed

[lang, any_sexp] -> ()
timing: 0.011 s
source
static inline void r_node_poke_cdr(r_obj* x, r_obj* newcdr) { SETCDR(x, newcdr); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:17

r_node_poke_tag typed

[lang, any_sexp] -> ()
timing: 0.010 s
source
static inline void r_node_poke_tag(r_obj* x, r_obj* tag) { SET_TAG(x, tag); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:18

r_node_tag typed

[lang] -> any_sexp
timing: 0.009 s
source
static inline r_obj* r_node_tag(r_obj* x) { return TAG(x); }
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/node.h:10

r_ns_env typed

[c_string] -> env
timing: 0.025 s
source
r_obj* r_ns_env(const char* pkg) {
  r_obj* pkg_str = KEEP(r_chr(pkg));
  r_obj* ns = R_FindNamespace(pkg_str);
  FREE(1);
  return ns;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.c:8

r_obj_address typed

[any_sexp] -> p(^CHR)
timing: 0.015 s
source
r_obj* r_obj_address(r_obj* x) {
  static char buf[1000];
  snprintf(buf, 1000, obj_address_formatter, (void*) x);
  return Rf_mkChar(buf);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.c:113

r_obj_print typed

[any_sexp] -> ()
timing: 0.014 s
source
void r_obj_print(r_obj* x) {
  Rf_PrintValue(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:110

r_obj_type_friendly typed

[any_sexp] -> c_string
timing: 0.009 s
source
const char* r_obj_type_friendly(r_obj* x) {
  return r_obj_type_friendly_full(x, true, false);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/cnd.h:29

r_obj_type_friendly_length typed

[any_sexp] -> c_string
timing: 0.010 s
source
const char* r_obj_type_friendly_length(r_obj* x) {
  return r_obj_type_friendly_full(x, true, true);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang-dev.c:4

r_parse_eval typed

[c_string, env] -> any_sexp
timing: 0.013 s
source
r_obj* r_parse_eval(const char* str, r_obj* env) {
  r_obj* out = r_eval(KEEP(r_parse(str)), env);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/parse.c:29

r_peek_c_callable typed

[c_string, c_string] -> any
timing: 0.007 s
source
r_void_fn r_peek_c_callable(const char* pkg, const char* callable) {
  return R_GetCCallable(pkg, callable);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/export.h:11

r_peek_frame typed

() -> any
timing: 0.010 s
source
r_obj* r_peek_frame(void) {
  return r_eval(peek_frame_call, r_envs.base);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/stack.c:19

r_peek_option typed

[c_string] -> any_sexp
timing: 0.012 s
source
r_obj* r_peek_option(const char* name) {
  return Rf_GetOption1(Rf_install(name));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/state.h:14

r_protect typed

[any_sexp] -> lang
timing: 0.007 s
source
SEXP r_protect(SEXP x) {
  return Rf_lang2(fns_quote, x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1270

r_raw_begin typed

[raw] -> *c_int
timing: 0.010 s
source
void* r_raw_begin(r_obj* x) {
  return RAW(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:31

r_raw_cbegin typed

[raw] -> c_ptr
timing: 0.010 s
source
const void* r_raw_cbegin(r_obj* x) {
  return (const void*) RAW(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:52

r_result_get typed

∀'a. [any_sexp & 'a, <...> | c_false | c_null | null | p(CHR) | sym] -> any_sexp & 'a
timing: 0.025 s
source
static inline SEXP r_result_get(SEXP x, ERR err) {
  if (err) {
    r_cnd_signal(err);
  }

  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:344

r_seq typed

[c_int, c_int] -> INT
timing: 0.069 s
source
SEXP r_seq(R_len_t from, R_len_t to) {
  R_len_t n = to - from;
  if (n < 0) {
    r_stop_internal("Negative length.");
  }

  SEXP seq = PROTECT(Rf_allocVector(INTSXP, n));
  r_int_fill_seq(seq, from, n);

  UNPROTECT(1);
  return seq;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1136

r_ssize_add typed

[c_int_na, c_int_na \ (c(..-1) | c(1..))] -> c_int_na
timing: 0.025 s
source
r_ssize r_ssize_add(r_ssize x, r_ssize y) {
  intmax_t out = r__intmax_add(x, y);

  if (out > R_SSIZE_MAX) {
    r_stop_internal("Result too large for an `r_ssize`.");
  }

  return (r_ssize) out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:73

r_ssize_as_double typed

[c_int_na] -> c_double
timing: 0.014 s
source
double r_ssize_as_double(r_ssize x) {
  if (x > DBL_MAX || x < -DBL_MAX) {
    r_stop_internal("Result can't be represented as `double`.");
  }

  return (double) x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:140

r_ssize_as_integer typed

[c_int_na] -> c_int_na
timing: 0.012 s
source
int r_ssize_as_integer(r_ssize x) {
  if (x > INT_MAX || x < INT_MIN) {
    r_stop_internal("Result can't be represented as `int`.");
  }

  return (int) x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:132

r_ssize_max typed

∀'a,'b. [c_int_na & 'a, c_int_na & 'b] -> c_int_na & 'a | c_int_na & 'b
timing: 0.009 s
source
r_ssize r_ssize_max(r_ssize x, r_ssize y) {
  return (y < x) ? x : y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:127

r_ssize_min typed

∀'a,'b. [c_int_na & 'a, c_int_na & 'b] -> c_int_na & 'a | c_int_na & 'b
timing: 0.008 s
source
r_ssize r_ssize_min(r_ssize x, r_ssize y) {
  return (y < x) ? y : x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:123

r_ssize_mult typed

([c(..-1), c(..0)] | [c(1..), c(1..)] | [c_false, c(..0)] -> c_int)&([c_false, c_int_na \ c(1..)] | [c_int_na \ c(0..), c_int_na \ c(1..)] -> c_int_na)
timing: 0.288 s
source
r_ssize r_ssize_mult(r_ssize x, r_ssize y) {
  if (x > 0) {
    if (y > 0) {
      if (x > (R_SSIZE_MAX / y)) {
        goto error;
      }
    } else {
      if (y < (R_SSIZE_MIN / x)) {
        goto error;
      }
    }
  } else {
    if (y > 0) {
      if (x < (R_SSIZE_MIN / y)) {
        goto error;
      }
    } else {
      if ( (x != 0) && (y < (R_SSIZE_MAX / x))) {
        goto error;
      }
    }
  }

  return x * y;

 error:
  r_stop_internal("Result too large for an `r_ssize`.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:84

r_stop_internal typed empty return

() -> empty
timing: 0.004 s
(definition not located in src/)

r_stop_unreachable typed empty return

() -> empty
timing: 0.004 s
(definition not located in src/)

r_str typed

∀'a. [c_string('a)] -> p(^CHR('a))
timing: 0.014 s
source
r_obj* r_str(const char* c_string) {
  return Rf_mkCharCE(c_string, CE_UTF8);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:281

r_str_as_character typed

∀'a. [p(CHR) & 'a] -> CHR1 & v1('a)
timing: 0.012 s
source
r_obj* r_str_as_character(r_obj* x) {
  return Rf_ScalarString(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec-chr.h:23

r_str_c_string typed

[p(CHR)] -> c_string
timing: 0.020 s
source
const char* r_str_c_string(r_obj* str) {
  return CHAR(str);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec-chr.h:11

r_sym typed

[c_string] -> sym
timing: 0.006 s
source
r_obj* r_sym(const char* c_string) {
  return Rf_install(c_string);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/sym.h:16

r_sym_c_string typed

[sym] -> c_string
timing: 0.014 s
source
const char* r_sym_c_string(r_obj* sym) {
  return CHAR(PRINTNAME(sym));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/sym.h:25

r_sym_string typed

[sym] -> p(CHR)
timing: 0.006 s
source
r_obj* r_sym_string(r_obj* sym) {
  return PRINTNAME(sym);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/sym.h:21

r_try_catch typed

[[c_ptr] --> c_void, c_ptr, any_sexp, [c_ptr] --> c_void, c_ptr] -> any
timing: 0.118 s
source
ERR r_try_catch(void (*fn)(void*),
                void* fn_data,
                SEXP cnd_sym,
                void (*hnd)(void*),
                void* hnd_data) {

  struct r_try_catch_data data = {
    .fn = fn,
    .fn_data = fn_data,
    .cnd_sym = cnd_sym,
    .hnd = hnd,
    .hnd_data = hnd_data,
    .err = NULL
  };
  SEXP xptr = PROTECT(R_MakeExternalPtr(&data, R_NilValue, R_NilValue));
  SEXP hnd_fn = PROTECT(try_catch_hnd(xptr));

  SEXP syms[3] = {
    syms_data,
    cnd_sym,
    NULL
  };
  SEXP args[3] = {
    xptr,
    hnd_fn,
    NULL
  };

  SEXP call = PROTECT(r_call_n(syms_try_catch_impl, syms, args));
  Rf_eval(call, vctrs_ns_env);

  UNPROTECT(3);
  return data.err;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1471

r_typeof typed

[any_sexp] -> c(0..10) | c(13..25) | c(30..31) | c(99)
timing: 0.034 s
source
enum r_type r_typeof(r_obj* x) {
  return (enum r_type) TYPEOF(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:18

r_vec_begin0 typed

([c(0..9) | c(16..23) | c(30..31) | c(25) | c(99), any_sexp] -> any)&([c(10), LGL] -> *c_lgl)&([c(10), ^LGL1] -> *c_bool)&([c(13), INT] -> *c_int_na)&([c(14), DBL] -> *c_double)&([c(15), CLX] -> *s({ r: c_double, i: c_double }))&([c(13), ^INT1] | [c(24), raw] -> *c_int)
timing: 0.818 s
source
void* r_vec_begin0(enum r_type type, r_obj* x) {
  switch (type) {
  case R_TYPE_logical: return r_lgl_begin(x);
  case R_TYPE_integer: return r_int_begin(x);
  case R_TYPE_double: return r_dbl_begin(x);
  case R_TYPE_complex: return r_cpl_begin(x);
  case R_TYPE_raw: return r_raw_begin(x);
  default: r_stop_unimplemented_type(type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:69

r_vec_cbegin0 typed

([c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99), any_sexp] -> any)&([c(14), DBL] -> *c_double)&([c(15), CLX] -> *any)&([c(16), CHR] -> *p(CHR))&([c(19), list] -> *any_sexp)&([c(24), raw] -> c_ptr)&([c(10), LGL] | [c(13), INT] -> *c_int_na)
timing: 1.19 s
source
const void* r_vec_cbegin0(enum r_type type, r_obj* x) {
  switch (type) {
  case R_TYPE_logical: return r_lgl_cbegin(x);
  case R_TYPE_integer: return r_int_cbegin(x);
  case R_TYPE_double: return r_dbl_cbegin(x);
  case R_TYPE_complex: return r_cpl_cbegin(x);
  case R_TYPE_raw: return r_raw_cbegin(x);
  case R_TYPE_character: return r_chr_cbegin(x);
  case R_TYPE_list: return r_list_cbegin(x);
  default: r_stop_unimplemented_type(type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:85

r_vec_elt_sizeof0 typed

([c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99)] -> any)&([c(10)] | [c(13)] | [c(14)] | [c(16)] | [c(19)] | [c(24)] -> c_int)
timing: 1.37 s
source
int r_vec_elt_sizeof0(enum r_type type) {
  switch (type) {
  case R_TYPE_logical: return sizeof(int);
  case R_TYPE_integer: return sizeof(int);
  case R_TYPE_double: return sizeof(double);
  case R_TYPE_complex: return sizeof(r_complex);
  case R_TYPE_raw: return sizeof(char);
  case R_TYPE_character: return sizeof(r_obj*);
  case R_TYPE_list: return sizeof(r_obj*);
  default: r_stop_unimplemented_type(type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:103

r_vec_resize0 typed

([c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99), any_sexp, c_int_na] -> any)&([c(10), any_sexp, c_int_na] | [c(13), any_sexp, c_int_na] | [c(14), any_sexp, c_int_na] | [c(15), any_sexp, c_int_na] | [c(16), any_sexp, c_int_na] | [c(19), any_sexp, c_int_na] | [c(24), any_sexp, c_int_na] -> any_sexp)
timing: 1.52 s
source
r_obj* r_vec_resize0(enum r_type type, r_obj* x, r_ssize new_size) {
  switch (type) {
  case R_TYPE_logical: return r_lgl_resize(x, new_size);
  case R_TYPE_integer: return r_int_resize(x, new_size);
  case R_TYPE_double: return r_dbl_resize(x, new_size);
  case R_TYPE_complex: return r_cpl_resize(x, new_size);
  case R_TYPE_raw: return r_raw_resize(x, new_size);
  case R_TYPE_character: return r_chr_resize(x, new_size);
  case R_TYPE_list: return r_list_resize(x, new_size);
  default: r_stop_unimplemented_type(type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:448

r_vec_unwrap typed

([p(INT), INT] -> c_ptr)&([~p(INT), any_sexp] -> empty)
timing: 0.050 s
source
static inline void* r_vec_unwrap(SEXPTYPE type, SEXP x) {
  switch (type) {
  case INTSXP: return (void*) INTEGER(x);
  default: stop_unimplemented_type("r_vec_unwrap", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:297

r_vector_bool_begin typed

([*struct r_vector_bool] -> *c_bool)&([c_null] -> empty)
timing: 0.029 s
source
bool* r_vector_bool_begin(struct r_vector_bool* p_vec) {
  return p_vec->v_data;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:36

r_vector_bool_cbegin typed

[*struct r_vector_bool] -> *c_bool
timing: 0.029 s
source
const bool* r_vector_bool_cbegin(struct r_vector_bool* p_vec) {
  return (const bool*) p_vec->v_data;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:40

r_vector_bool_length typed

([*struct r_vector_bool] -> c_int_na)&([c_null] -> empty)
timing: 0.040 s
source
r_ssize r_vector_bool_length(struct r_vector_bool* p_vec) {
  return p_vec->n;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:45

raw_assign typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.408 s
source
r_obj* raw_assign(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN(Rbyte, RAW, RAW_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:531

raw_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_false] | [any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_true] -> empty
timing: 0.546 s
source
static inline SEXP raw_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  ASSIGN_SHAPED(Rbyte, RAW, RAW_RO);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:283

raw_col_detect_missing typed

[any_sexp, *c_int_na, c_int_na] -> ([c_char] -> c_false)
timing: 0.008 s
source
r_ssize raw_col_detect_missing(r_obj* x,
                               r_ssize* v_loc,
                               r_ssize loc_size) {
  COL_DETECT_MISSING(unsigned char, r_uchar_cbegin, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:241

raw_compare_na_equal typed empty return

[c_int_na, c_int_na] -> empty
timing: 0.005 s
source
int raw_compare_na_equal(Rbyte x, Rbyte y) {
  r_stop_internal("Can't compare raw types.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:100

raw_detect_complete typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.006 s
source
void raw_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(unsigned char, RAW_RO, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:160

raw_detect_missing typed

[any_sexp] -> ([c_char] -> c_false)
timing: 0.006 s
source
r_obj* raw_detect_missing(r_obj* x) {
  DETECT_MISSING(unsigned char, r_uchar_cbegin, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:74

raw_dict_hash_scalar typed

[*struct dictionary, c_int_na] -> any
timing: 0.013 s
source
uint32_t raw_dict_hash_scalar(struct dictionary* d, R_len_t i) {
  return raw_dict_hash_with(d, d, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:181

raw_dict_hash_with typed

[*struct dictionary, *struct dictionary, c_int_na] -> any
timing: 0.008 s
source
uint32_t raw_dict_hash_with(struct dictionary* d, struct dictionary* x, R_len_t i) {
  DICT_HASH_WITH(p_raw_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:138

raw_dict_is_incomplete typed

([*struct dictionary, c_int_na] -> c_false)&([c_null, c_int_na] -> empty)
timing: 0.119 s
source
bool raw_dict_is_incomplete(struct dictionary* d, R_len_t i) {
  return dict_hash_is_missing(d, i) && p_raw_is_incomplete(d->p_poly_vec->p_vec, i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.h:224

raw_equal_na_equal typed

[c_int_na, c_int_na] -> c_bool
timing: 0.006 s
source
static inline int raw_equal_na_equal(Rbyte x, Rbyte y) {
  return x == y;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:44

raw_equal_na_propagate typed

[c_int_na, c_int_na] -> c_bool
timing: 0.007 s
source
static inline int raw_equal_na_propagate(Rbyte x, Rbyte y) {
  return raw_equal_na_equal(x, y);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:172

raw_first_missing typed

[any_sexp] -> ([c_char] -> c_false)
timing: 0.008 s
source
r_ssize raw_first_missing(r_obj* x) {
  FIRST_MISSING(unsigned char, r_uchar_cbegin, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:332

raw_hash_scalar typed

[c_int_na] -> c_int
timing: 0.005 s
source
static inline uint32_t raw_hash_scalar(Rbyte x) {
  return uint32_hash(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:95

raw_is_missing typed

[c_char] -> c_false
timing: 0.003 s
source
bool raw_is_missing(unsigned char x) {
  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:36

raw_slice typed

([any_sexp, INT, c_true] -> empty)&([any_sexp, any_sexp, c_bool] \ [any_sexp, INT, c_true] -> any_sexp)
timing: 0.408 s
source
r_obj* raw_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE(R_TYPE_raw, char, (char*) r_raw_begin, (char*) r_raw_cbegin, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:87

raw_slice_shaped typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct strides_info] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.411 s
source
static SEXP raw_slice_shaped(SEXP x, SEXP index, struct strides_info* p_info) {
  SLICE_SHAPED(RAWSXP, Rbyte, RAW, RAW_RO, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:131

rownames_size typed

[^INT1] -> c(0..)
timing: 0.141 s
source
r_ssize rownames_size(r_obj* rn) {
  switch (rownames_type(rn)) {
  case ROWNAMES_TYPE_identifiers:
  case ROWNAMES_TYPE_automatic:
    return r_length(rn);
  case ROWNAMES_TYPE_automatic_compact:
    return compact_rownames_length(rn);
  }

  never_reached("rownames_size");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:440

s3_bare_class typed

([null] -> empty)&([CHR] | [CLX] | [DBL] | [INT] | [LGL] | [any -> any] | [list & ~{ lang | sym }] | [null<...>] | [p(CHR)] | [raw] | [expr] -> any_sexp)
timing: 2.60 s
source
SEXP s3_bare_class(SEXP x) {
  switch (TYPEOF(x)) {
  case NILSXP: return chrs_null;
  case LGLSXP: return chrs_logical;
  case INTSXP: return chrs_integer;
  case REALSXP: return chrs_double;
  case CPLXSXP: return chrs_complex;
  case STRSXP: return chrs_character;
  case RAWSXP: return chrs_raw;
  case VECSXP: return chrs_list;
  case EXPRSXP: return chrs_expression;
  case CLOSXP:
  case SPECIALSXP:
  case BUILTINSXP: return chrs_function;
  default: stop_unimplemented_vctrs_type("base_dispatch_class_str", vec_typeof(x));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:558

s3_class_find_method typed

([c_string, CHR, env] -> any_sexp)&([c_string, null, any_sexp] -> null)
timing: 0.198 s
source
SEXP s3_class_find_method(const char* generic, SEXP cls, SEXP table) {
  // Avoid corrupt objects where `x` passes `r_is_object()`, but the class is NULL
  if (cls == R_NilValue) {
    return R_NilValue;
  }

  SEXP const* p_cls = STRING_PTR_RO(cls);
  int n_cls = Rf_length(cls);

  for (int i = 0; i < n_cls; ++i) {
    SEXP method = s3_get_method(generic, CHAR(p_cls[i]), table);
    if (method != R_NilValue) {
      return method;
    }
  }

  return R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:464

s3_fallback_from_opts typed

[{ INT }] -> c_bool
timing: 0.030 s
source
enum s3_fallback s3_fallback_from_opts(r_obj* opts) {
  return (enum s3_fallback) r_int_get(r_list_get(opts, 0), 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:389

s3_find_method typed

([c_string, <...>, env] -> any_sexp)&([c_string, <> | null | p(CHR) | sym, any_sexp] -> null)
timing: 0.065 s
source
SEXP s3_find_method(const char* generic, SEXP x, SEXP table) {
  if (!r_is_object(x)) {
    return R_NilValue;
  }

  SEXP cls = PROTECT(Rf_getAttrib(x, R_ClassSymbol));
  SEXP method = s3_class_find_method(generic, cls, table);

  UNPROTECT(1);
  return method;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:451

s3_find_method_xy typed

([c_string, null, any_sexp, any_sexp, *any_sexp] -> empty)&([c_string, any_sexp, any_sexp, any_sexp, *any_sexp] \ [c_string, null, any_sexp, any_sexp, *any_sexp] -> any_sexp)
timing: 0.024 s
source
SEXP s3_find_method_xy(const char* generic,
                       SEXP x,
                       SEXP y,
                       SEXP table,
                       SEXP* method_sym_out) {
  SEXP x_class = PROTECT(s3_get_class0(x));
  SEXP y_class = PROTECT(s3_get_class0(y));

  SEXP method_sym = R_NilValue;
  method_sym = s3_paste_method_sym(generic, CHAR(x_class));
  method_sym = s3_paste_method_sym(CHAR(PRINTNAME(method_sym)), CHAR(y_class));

  SEXP method = s3_sym_get_method(method_sym, table);

  if (method == R_NilValue) {
    *method_sym_out = R_NilValue;
  } else {
    *method_sym_out = method_sym;
  }

  UNPROTECT(2);
  return method;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:512

s3_find_method2 typed

([c_string, null, any_sexp, *any_sexp] -> empty)&([c_string, any_sexp, any_sexp, *any_sexp] \ [c_string, null, any_sexp, *any_sexp] -> any_sexp)
timing: 0.023 s
source
SEXP s3_find_method2(const char* generic,
                     SEXP x,
                     SEXP table,
                     SEXP* method_sym_out) {
  SEXP cls = PROTECT(s3_get_class0(x));

  SEXP method_sym = s3_paste_method_sym(generic, CHAR(cls));
  SEXP method = s3_sym_get_method(method_sym, table);

  if (method == R_NilValue) {
    *method_sym_out = R_NilValue;
  } else {
    *method_sym_out = method_sym;
  }

  UNPROTECT(1);
  return method;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:537

s3_get_class typed

([null] -> empty)&([null<...> | CHR<...> | CLX<...> | DBL<...> | INT<...> | LGL<...> | (list & ~{ lang | sym })<...> | raw<...> | expr<...> | (any -> any)<...>] | [null | (null<> | CHR<> | CLX<> | DBL<> | INT<> | LGL<> | (list & ~{ lang | sym })<> | raw<> | expr<> | (any -> any)<>) | p(CHR)] -> any_sexp)
timing: 0.849 s
source
SEXP s3_get_class(SEXP x) {
  SEXP cls = R_NilValue;

  if (r_is_object(x)) {
    cls = Rf_getAttrib(x, R_ClassSymbol);
  }

  // This handles unclassed objects as well as gremlins objects where
  // `x` passes `r_is_object()`, but the class is NULL
  if (cls == R_NilValue) {
    cls = s3_bare_class(x);
  }

  if (!Rf_length(cls)) {
    r_stop_internal("Class must have length.");
  }

  return cls;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:484

s3_get_class0 typed empty return

[null] -> empty
timing: 0.151 s
source
SEXP s3_get_class0(SEXP x) {
  SEXP cls = PROTECT(s3_get_class(x));
  SEXP out = STRING_ELT(cls, 0);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:504

s3_get_method typed

[c_string, c_string, env] -> any_sexp
timing: 0.019 s
source
SEXP s3_get_method(const char* generic, const char* cls, SEXP table) {
  SEXP sym = s3_paste_method_sym(generic, cls);
  return s3_sym_get_method(sym, table);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:407

s3_get_table typed

[any_sexp] -> any
timing: 0.013 s
source
static inline SEXP s3_get_table(SEXP env) {
  if (r_env_has(env, syms_s3_methods_table)) {
    return r_env_get(env, syms_s3_methods_table);
  } else {
    return r_null;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:152

s3_paste_method_sym typed

[c_string, c_string] -> sym
timing: 0.265 s
source
SEXP s3_paste_method_sym(const char* generic, const char* cls) {
  int gen_len = strlen(generic);
  int cls_len = strlen(cls);
  int dot_len = 1;
  if (gen_len + cls_len + dot_len >= sizeof(s3_buf)) {
    r_stop_internal("Generic or class name is too long.");
  }

  char* buf = s3_buf;

  r_memcpy(buf, generic, gen_len); buf += gen_len;
  *buf = '.'; ++buf;
  r_memcpy(buf, cls, cls_len); buf += cls_len;
  *buf = '\0';

  return Rf_install(s3_buf);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:388

s3_ptype typed

([<> | null | p(CHR) | sym, *struct vctrs_arg, struct r_lazy] -> empty)&([any_sexp, *struct vctrs_arg, struct r_lazy] \ [<> | null | p(CHR) | sym, *struct vctrs_arg, struct r_lazy] -> any_sexp)
timing: 0.052 s
source
r_obj* s3_ptype(r_obj* x,
               struct vctrs_arg* x_arg,
               struct r_lazy call) {
  switch (class_type(x)) {
  case VCTRS_CLASS_bare_tibble:
    return df_ptype(x, true);

  case VCTRS_CLASS_data_frame:
    return df_ptype(x, false);

  case VCTRS_CLASS_bare_data_frame:
    r_stop_internal("Bare data frames should be handled by `vec_ptype()`.");

  case VCTRS_CLASS_none:
    r_stop_internal("Non-S3 classes should be handled by `vec_ptype()`.");

  default:
    break;
  }

  r_obj* method = KEEP(vec_ptype_method(x));

  r_obj* out;

  if (method == r_null) {
    obj_check_vector(x, VCTRS_ALLOW_NULL_no, x_arg, call);
    out = vec_slice(x, r_null);
  } else {
    out = vec_ptype_invoke(x, method);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:47

s3_sym_get_method typed

[sym, env] -> any_sexp
timing: 0.057 s
source
SEXP s3_sym_get_method(SEXP sym, SEXP table) {
  // `r_env_get()` errors on missing bindings,
  // so we have to check with `r_env_has()`

  if (r_env_has(R_GlobalEnv, sym)) {
    SEXP method = r_env_get(R_GlobalEnv, sym);
    if (r_is_function(method)) {
      return method;
    }
  }

  if (r_env_has(table, sym)) {
    SEXP method = r_env_get(table, sym);
    if (r_is_function(method)) {
      return method;
    }
  }

  return R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:411

s4_class_find_method typed

([CHR, env] -> any_sexp)&([null, any_sexp] -> null)
timing: 0.237 s
source
SEXP s4_class_find_method(SEXP cls, SEXP table) {
  // Avoid corrupt objects where `x` passes `r_is_object()`, but the class is NULL
  if (cls == R_NilValue) {
    return R_NilValue;
  }

  SEXP const* p_class = STRING_PTR_RO(cls);
  int n_class = Rf_length(cls);

  for (int i = 0; i < n_class; ++i) {
    SEXP method = s4_get_method(CHAR(p_class[i]), table);
    if (method != R_NilValue) {
      return method;
    }
  }

  return R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:603

s4_find_method typed

[any_sexp, env] -> any_sexp
timing: 0.036 s
source
SEXP s4_find_method(SEXP x, SEXP table) {
  if (!r_is_s4(x)) {
    return R_NilValue;
  }

  SEXP cls = PROTECT(Rf_getAttrib(x, R_ClassSymbol));
  SEXP out = s4_class_find_method(cls, table);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:592

s4_get_method typed

[c_string, env] -> any_sexp
timing: 0.031 s
source
static SEXP s4_get_method(const char* cls, SEXP table) {
  SEXP sym = Rf_install(cls);

  // `r_env_get()` errors on missing bindings,
  // so we have to check with `r_env_has()`
  if (r_env_has(table, sym)) {
    SEXP method = r_env_get(table, sym);
    if (r_is_function(method)) {
      return method;
    }
  }

  return R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:576

sexp_hash typed

([null<...>] -> c_false)&([CHR] | [p(CHR)] -> ([any_sexp] -> c_int_na))&([(env | externalptr | sym)<...>] | [CLX] | [DBL] | [INT] | [LGL] | [any -> any] | [list & ~{ lang | sym }] | [raw] | [expr] | [(~(env | externalptr | list | null | sym | vec | (any -> any)))<...> | null | sym] -> c_int_na)
timing: 4.48 s
source
static inline uint32_t sexp_hash(r_obj* x) {
  switch (TYPEOF(x)) {
  // `NULL`
  case NILSXP: return 0;

  // Atomics
  case LGLSXP: return lgl_hash(x);
  case INTSXP: return int_hash(x);
  case REALSXP: return dbl_hash(x);
  case CPLXSXP: return cpl_hash(x);
  case RAWSXP: return raw_hash(x);
  case STRSXP: return chr_hash(x);
  case VECSXP: return list_hash(x);

  // Expressions
  case EXPRSXP: return expr_hash(x);

  // Node-like
  case DOTSXP:
  case LANGSXP:
  case LISTSXP:
  case BCODESXP: return node_hash(x);

  // Functions
  case CLOSXP: return fn_hash(x);

  // Pointer based hashing
  case SYMSXP:
  case SPECIALSXP:
  case BUILTINSXP:
  case ENVSXP:
  case EXTPTRSXP: return uint64_hash((uintptr_t) x);

  default: Rf_errorcall(R_NilValue, "Unsupported type %s", Rf_type2char(TYPEOF(x)));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:29

should_finalise typed

([c_false] -> c_false)&([c_true] -> c_true)
timing: 0.006 s
source
bool should_finalise(enum ptype_finalise finalise) {
  return finalise == PTYPE_FINALISE_true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.h:17

should_slice_value typed

([c_false] -> c_false)&([c_true] -> c_true)
timing: 0.006 s
source
bool should_slice_value(enum assignment_slice_value slice_value) {
  return slice_value == ASSIGNMENT_SLICE_VALUE_yes;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.h:135

size_round_power_2 typed

[c_int_na] -> c_int
timing: 0.006 s
source
size_t size_round_power_2(size_t size) {
    size_t out = 1;
    while (out < size) {
      out <<= 1;
    }
    return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dict.c:95

size2_common typed

([any_sexp, any_sexp, *struct counters, c_null] | [any_sexp, any_sexp, c_null, (*(~(c_string | struct size_common_reduce_opts)) | c_string) \ c_null] | [any_sexp, any_sexp, c_null, *struct size_common_reduce_opts \ c_null] -> empty)&([any_sexp, any_sexp, *struct counters, c_ptr] & ~[any_sexp, any_sexp, *struct counters, c_null] & ~[any_sexp, any_sexp, c_null, (*(~(c_string | struct size_common_reduce_opts)) | c_string) \ c_null] & ~[any_sexp, any_sexp, c_null, *struct size_common_reduce_opts \ c_null] -> any_sexp)
timing: 0.555 s
source
r_obj* size2_common(
  r_obj* x,
  r_obj* y,
  struct counters* counters,
  void* data
) {
  struct size_common_reduce_opts* reduce_opts = data;

  const r_ssize x_size = reduce_opts->current_size;
  const r_ssize y_size = vec_size_params(y, counters->next_arg, reduce_opts->call);

  int left = -1;

  r_obj* out = vec_size2_impl(
    x,
    y,
    x_size,
    y_size,
    counters->curr_arg,
    counters->next_arg,
    reduce_opts->call,
    &left
  );

  if (!left) {
    counters_shift(counters);
    reduce_opts->current_size = y_size;
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size-common.c:165

slice_names typed

∀'a. ([null & 'a, any_sexp] -> null & 'a)&(['a & (<...> | p(CHR) | sym), any_sexp] -> any_sexp)
timing: 0.027 s
source
r_obj* slice_names(r_obj* names, r_obj* subscript) {
  if (names == r_null) {
    return names;
  } else {
    // Ensures `NA_integer_` subscripts utilize `""` as the name
    return chr_names_slice(names, subscript, VCTRS_MATERIALIZE_false);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:274

slice_rownames typed

∀'a. [null & 'a, any_sexp] -> null & 'a
timing: 0.057 s
source
r_obj* slice_rownames(r_obj* names, r_obj* subscript) {
  if (names == r_null) {
    return names;
  }

  names = KEEP(chr_slice(names, subscript, VCTRS_MATERIALIZE_false));

  // Rownames can't contain `NA` or duplicates
  names = vec_as_unique_names(names, true);

  FREE(1);
  return names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:282

stop_assert_size typed empty return

[c_int_na, c_int_na, c_null, struct r_lazy] -> empty
timing: 0.714 s
source
void stop_assert_size(r_ssize actual,
                      r_ssize required,
                      struct vctrs_arg* arg,
                      struct r_lazy call) {
  r_obj* ffi_call = KEEP(r_lazy_eval(call));
  ffi_call = KEEP(r_expr_protect(ffi_call));

  r_obj* syms[5] = {
   syms_actual,
   syms_required,
   r_syms.arg,
   r_syms.call,
   NULL
  };
  r_obj* args[5] = {
    KEEP(r_int(actual)),
    KEEP(r_int(required)),
    KEEP(vctrs_arg(arg)),
    ffi_call,
    NULL
  };

  r_obj* stop_call = KEEP(r_call_n(syms_stop_assert_size, syms, args));
  r_eval(stop_call, vctrs_ns_env);

  never_reached("stop_assert_size");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:20

stop_bad_direction typed

() -> ()
timing: 0.002 s
source
void stop_bad_direction(void) {
  r_abort("`direction` must be one of \"down\", \"up\", \"downup\", or \"updown\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:241

stop_bad_negative typed empty return

[struct r_lazy] -> empty
timing: 0.006 s
source
void stop_bad_negative(struct r_lazy call) {
  r_abort_call(call.env, "`negative` must be one of \"invert\", \"error\", or \"ignore\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:634

stop_bad_oob typed empty return

[struct r_lazy] -> empty
timing: 0.006 s
source
void stop_bad_oob(struct r_lazy call) {
  r_abort_call(call.env, "`oob` must be one of \"error\", \"remove\", or \"extend\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:638

stop_bad_zero typed empty return

[struct r_lazy] -> empty
timing: 0.006 s
source
void stop_bad_zero(struct r_lazy call) {
  r_abort_call(call.env, "`zero` must be one of \"remove\", \"error\", or \"ignore\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:642

stop_combine_unmatched typed empty return

[any_sexp, struct r_lazy] -> empty
timing: 0.059 s
source
void stop_combine_unmatched(r_obj* loc, struct r_lazy error_call) {
  r_obj* syms[3] = {
    syms_loc,
    syms_call,
    NULL
  };
  r_obj* args[3] = {
    loc,
    KEEP(r_lazy_eval_protect(error_call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_combine_unmatched, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_combine_unmatched");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1689

stop_corrupt_factor_levels typed empty return

[any_sexp, c_null] -> empty
timing: 0.035 s
source
void stop_corrupt_factor_levels(SEXP x, struct vctrs_arg* arg) {
  SEXP call = PROTECT(Rf_lang3(Rf_install("stop_corrupt_factor_levels"),
                               PROTECT(r_protect(x)),
                               PROTECT(vctrs_arg(arg))));
  Rf_eval(call, vctrs_ns_env);
  never_reached("stop_corrupt_factor_levels");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:169

stop_corrupt_ordered_levels typed empty return

[any_sexp, c_null] -> empty
timing: 0.035 s
source
void stop_corrupt_ordered_levels(SEXP x, struct vctrs_arg* arg) {
  SEXP call = PROTECT(Rf_lang3(Rf_install("stop_corrupt_ordered_levels"),
                               PROTECT(r_protect(x)),
                               PROTECT(vctrs_arg(arg))));
  Rf_eval(call, vctrs_ns_env);
  never_reached("stop_corrupt_ordered_levels");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:177

stop_incompatible_size typed empty return

[any_sexp, any_sexp, c_int_na, c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.982 s
source
void stop_incompatible_size(r_obj* x,
                            r_obj* y,
                            r_ssize x_size,
                            r_ssize y_size,
                            struct vctrs_arg* x_arg,
                            struct vctrs_arg* y_arg,
                            struct r_lazy call) {
  r_obj* syms[8] = {
    syms_x,
    syms_y,
    syms_x_size,
    syms_y_size,
    syms_x_arg,
    syms_y_arg,
    r_syms.call,
    NULL
  };
  r_obj* args[8] = {
    KEEP(r_protect(x)),
    KEEP(r_protect(y)),
    KEEP(r_int(x_size)),
    KEEP(r_int(y_size)),
    KEEP(vctrs_arg(x_arg)),
    KEEP(vctrs_arg(y_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_incompatible_size,
                                  syms,
                                  args));
  r_eval(ffi_call, vctrs_ns_env);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:78

stop_indicator_size typed empty return

[any_sexp, any_sexp, c_null] -> empty
timing: 0.059 s
source
void stop_indicator_size(r_obj* i,
                         r_obj* n,
                         const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask5(r_sym("stop_indicator_size"),
                   syms_i, i,
                   syms_n, n,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:758

stop_large_name typed

() -> ()
timing: 0.003 s
source
static void stop_large_name(void) {
  r_abort("Can't tidy up name because it is too large.");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:436

stop_location_negative typed empty return

[any_sexp, c_null] -> empty
timing: 0.047 s
source
void stop_location_negative(r_obj* i,
                            const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask4(r_sym("stop_location_negative"),
                   syms_i, i,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:732

stop_location_negative_missing typed empty return

[any_sexp, c_null] -> empty
timing: 0.048 s
source
void stop_location_negative_missing(r_obj* i,
                                    const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask4(r_sym("stop_location_negative_missing"),
                   syms_i, i,
                   syms_subscript_arg, arg,
                   syms_call, call,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts));
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:667

stop_location_negative_positive typed empty return

[any_sexp, c_null] -> empty
timing: 0.049 s
source
void stop_location_negative_positive(r_obj* i,
                                     const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask4(r_sym("stop_location_negative_positive"),
                   syms_i, i,
                   syms_subscript_arg, arg,
                   syms_call, call,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts));
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:679

stop_location_oob_non_consecutive typed empty return

[any_sexp, c_int_na, c_null] -> empty
timing: 0.163 s
source
void stop_location_oob_non_consecutive(r_obj* i,
                                       r_ssize size,
                                       const struct location_opts* opts) {
  r_obj* size_obj = KEEP(r_int(size));
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask5(r_sym("stop_location_oob_non_consecutive"),
                   syms_i, i,
                   syms_size, size_obj,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);

  FREE(1);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:773

stop_location_zero typed empty return

[any_sexp, c_null] -> empty
timing: 0.046 s
source
void stop_location_zero(r_obj* i,
                        const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask4(r_sym("stop_location_zero"),
                   syms_i, i,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:745

stop_matches_incomplete typed empty return

[c_int_na, c_null, struct r_lazy] -> empty
timing: 0.096 s
source
void stop_matches_incomplete(r_ssize i,
                             struct vctrs_arg* needles_arg,
                             struct r_lazy call) {
  r_obj* syms[4] = {
    syms_i,
    syms_needles_arg,
    syms_call,
    NULL
  };
  r_obj* args[4] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_incomplete, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_incomplete");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2728

stop_matches_multiple typed empty return

[c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.154 s
source
void stop_matches_multiple(r_ssize i,
                           struct vctrs_arg* needles_arg,
                           struct vctrs_arg* haystack_arg,
                           struct r_lazy call) {
  r_obj* syms[5] = {
    syms_i,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_multiple, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_multiple");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2751

stop_matches_nothing typed empty return

[c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.115 s
source
void stop_matches_nothing(r_ssize i,
                          struct vctrs_arg* needles_arg,
                          struct vctrs_arg* haystack_arg,
                          struct r_lazy call) {
  r_obj* syms[5] = {
    syms_i,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_nothing, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_nothing");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2676

stop_matches_overflow typed empty return

[c_double, struct r_lazy] -> empty
timing: 0.054 s
source
void stop_matches_overflow(double size, struct r_lazy call) {
  r_obj* syms[3] = {
    syms_size,
    syms_call,
    NULL
  };
  r_obj* args[3] = {
    KEEP(r_dbl(size)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_overflow, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_overflow");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2657

stop_matches_relationship_many_to_one typed empty return

[c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.127 s
source
void stop_matches_relationship_many_to_one(r_ssize i,
                                           struct vctrs_arg* needles_arg,
                                           struct vctrs_arg* haystack_arg,
                                           struct r_lazy call) {
  r_obj* syms[5] = {
    syms_i,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_relationship_many_to_one, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_relationship_many_to_one");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2857

stop_matches_relationship_one_to_many typed empty return

[c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.120 s
source
void stop_matches_relationship_one_to_many(r_ssize i,
                                           struct vctrs_arg* needles_arg,
                                           struct vctrs_arg* haystack_arg,
                                           struct r_lazy call) {
  r_obj* syms[5] = {
   syms_i,
   syms_needles_arg,
   syms_haystack_arg,
   syms_call,
   NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_relationship_one_to_many, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_relationship_one_to_many");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2831

stop_matches_relationship_one_to_one typed empty return

[c_int_na, c_string, c_null, c_null, struct r_lazy] -> empty
timing: 0.188 s
source
void stop_matches_relationship_one_to_one(r_ssize i,
                                          const char* which,
                                          struct vctrs_arg* needles_arg,
                                          struct vctrs_arg* haystack_arg,
                                          struct r_lazy call) {
  r_obj* syms[6] = {
    syms_i,
    syms_which,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[6] = {
    KEEP(r_int((int)i + 1)),
    KEEP(r_chr(which)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_relationship_one_to_one, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_relationship_one_to_one");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2802

stop_matches_remaining typed empty return

[c_int_na, c_null, c_null, struct r_lazy] -> empty
timing: 0.121 s
source
void stop_matches_remaining(r_ssize i,
                            struct vctrs_arg* needles_arg,
                            struct vctrs_arg* haystack_arg,
                            struct r_lazy call) {
  r_obj* syms[5] = {
    syms_i,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_stop_matches_remaining, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);

  never_reached("stop_matches_remaining");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2702

stop_name_repair typed empty return

[*struct name_repair_opts] -> empty
timing: 0.035 s
source
void stop_name_repair(struct name_repair_opts* p_opts) {
  struct repair_error_info info = new_repair_error_info(p_opts);
  KEEP(info.shelter);

  r_abort_call(info.input_error_call,
               "%s must be a string or a function. See `?vctrs::vec_as_names`.",
               r_format_error_arg(info.input_error_repair_arg));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:901

stop_not_comparable typed

[any_sexp, any_sexp, c_string] -> ()
timing: 0.005 s
source
void stop_not_comparable(r_obj* x, r_obj* y, const char* message) {
  r_abort("`x` and `y` are not comparable: %s", message);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:7

stop_recycle_incompatible_size typed empty return

[c_int_na, c_int_na, c_null, struct r_lazy] -> empty
timing: 0.759 s
source
void stop_recycle_incompatible_size(r_ssize x_size,
                                    r_ssize size,
                                    struct vctrs_arg* x_arg,
                                    struct r_lazy call) {
  r_obj* syms[5] = {
    r_sym("x_size"),
    r_sym("size"),
    r_sym("x_arg"),
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int(x_size)),
    KEEP(r_int(size)),
    KEEP(vctrs_arg(x_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* stop_call = KEEP(r_call_n(r_sym("stop_recycle_incompatible_size"), syms, args));
  r_eval(stop_call, vctrs_ns_env);

  never_reached("stop_recycle_incompatible_size");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:114

stop_rep_each_times_missing typed empty return

[c_int_na, struct r_lazy, c_null] -> empty
timing: 0.017 s
source
void stop_rep_each_times_missing(r_ssize i, struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(call,
                    "%s can't be missing. Location %i is missing.",
                    vec_arg_format(p_times_arg),
                    i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:302

stop_rep_each_times_negative typed empty return

[c_int_na, struct r_lazy, c_null] -> empty
timing: 0.017 s
source
void stop_rep_each_times_negative(r_ssize i, struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(call,
                    "%s must be a vector of positive numbers. Location %i is negative.",
                    vec_arg_format(p_times_arg),
                    i);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:294

stop_rep_each_times_oob typed empty return

[c_int_na, c_int_na, struct r_lazy, c_null] -> empty
timing: 0.018 s
source
void stop_rep_each_times_oob(int times, r_ssize i, struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(
    call,
    "%s must be less than %i, not %i. ",
    "Location %i is too large.",
    vec_arg_format(p_times_arg),
    R_LEN_T_MAX,
    times,
    i
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:312

stop_rep_size_oob typed empty return

[struct r_lazy] -> empty
timing: 0.008 s
source
void stop_rep_size_oob(struct r_lazy call) {
  r_abort_lazy_call(
    call,
    "Long vectors are not yet supported. "
    "Requested output size must be less than %i.",
    R_LEN_T_MAX
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:325

stop_rep_times_missing typed empty return

[struct r_lazy, c_null] -> empty
timing: 0.016 s
source
void stop_rep_times_missing(struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(call,
                    "%s can't be missing.",
                    vec_arg_format(p_times_arg));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:255

stop_rep_times_negative typed empty return

[struct r_lazy, c_null] -> empty
timing: 0.015 s
source
void stop_rep_times_negative(struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(call,
                    "%s must be a positive number.",
                    vec_arg_format(p_times_arg));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:248

stop_rep_times_oob typed empty return

[c_int_na, struct r_lazy, c_null] -> empty
timing: 0.016 s
source
void stop_rep_times_oob(int times, struct r_lazy call, struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(
    call,
    "%s must be less than %i, not %i.",
    vec_arg_format(p_times_arg),
    R_LEN_T_MAX,
    times
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:264

stop_rep_times_size typed empty return

[struct r_lazy, c_null] -> empty
timing: 0.009 s
source
void stop_rep_times_size(struct r_lazy call,
                         struct vctrs_arg* p_times_arg) {
  r_abort_lazy_call(call,
                    "%s must be a single number.",
                    vec_arg_format(p_times_arg));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:335

stop_scalar_type typed empty return

[any_sexp, c_null, struct r_lazy] -> empty
timing: 0.041 s
source
void stop_scalar_type(r_obj* x,
                      struct vctrs_arg* arg,
                      struct r_lazy call) {
  r_obj* ffi_call = KEEP(r_lazy_eval(call));
  ffi_call = KEEP(r_expr_protect(ffi_call));

  r_obj* stop_call = KEEP(r_call4(r_sym("stop_scalar_type"),
                                  KEEP(r_protect(x)),
                                  KEEP(vctrs_arg(arg)),
                                  ffi_call));
  r_eval(stop_call, vctrs_ns_env);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:5

stop_subscript_arg_missing typed empty return

[struct r_lazy] -> empty
timing: 0.006 s
source
void stop_subscript_arg_missing(struct r_lazy call) {
  r_abort_call(call.env, "`missing` must be one of \"propagate\", \"remove\", or \"error\".");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:630

stop_subscript_arg_type typed

[c_string] -> ()
timing: 0.003 s
source
void stop_subscript_arg_type(const char* kind) {
  r_abort("`%s` must be one of \"cast\" or \"error\".", kind);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:283

stop_subscript_empty typed empty return

[any_sexp, c_null] -> empty
timing: 0.066 s
source
void stop_subscript_empty(r_obj* i,
                          const struct location_opts* opts) {
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask2(r_sym("stop_subscript_empty"),
                   syms_i, i,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:657

stop_subscript_missing typed empty return

[any_sexp, c_null] -> empty
timing: 0.064 s
source
void stop_subscript_missing(r_obj* i,
                            const struct location_opts* opts) {
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask2(r_sym("stop_subscript_missing"),
                   syms_i, i,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:647

stop_subscript_negative_oob_location typed empty return

[any_sexp, c_int_na, c_null] -> empty
timing: 0.067 s
source
void stop_subscript_negative_oob_location(r_obj* i,
                                          r_ssize size,
                                          const struct location_opts* opts) {
  struct location_opts error_opts = *opts;
  error_opts.subscript_opts.action = SUBSCRIPT_ACTION_NEGATE;
  stop_subscript_oob_location(i, size, &error_opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:708

stop_subscript_oob_location typed empty return

[any_sexp, c_int_na, c_null] -> empty
timing: 0.166 s
source
void stop_subscript_oob_location(r_obj* i,
                                 r_ssize size,
                                 const struct location_opts* opts) {
  r_obj* size_obj = KEEP(r_int(size));
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask6(r_sym("stop_subscript_oob"),
                   syms_i, i,
                   syms_subscript_type, chrs_numeric,
                   syms_size, size_obj,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:692

stop_subscript_oob_name typed empty return

[any_sexp, any_sexp, c_null] -> empty
timing: 0.051 s
source
void stop_subscript_oob_name(r_obj* i,
                             r_obj* names,
                             const struct location_opts* opts) {
  r_obj* arg = KEEP(vctrs_arg(opts->subscript_opts.subscript_arg));
  r_obj* call = KEEP(r_lazy_eval(opts->subscript_opts.call));
  vctrs_eval_mask6(r_sym("stop_subscript_oob"),
                   syms_i, i,
                   syms_subscript_type, chrs_character,
                   syms_names, names,
                   syms_subscript_action, get_opts_action(&opts->subscript_opts),
                   syms_subscript_arg, arg,
                   syms_call, call);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:716

str_as_utf8 typed

[p(CHR)] -> p(^CHR)
timing: 0.013 s
source
static inline r_obj* str_as_utf8(r_obj* x) {
  return Rf_mkCharCE(Rf_translateCharUTF8(x), CE_UTF8);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.h:51

str_cmp typed

([c_string, c_string, c_int] -> c_int)&([c_string, c_string, c_int_na] -> c_int_na)
timing: 0.024 s
source
int str_cmp(
  const char* x,
  const char* y,
  const int direction
) {
  // Same pointer
  // In our research it seems like `strcmp()` doesn't optimize this check,
  // since it would be rare for most `strcmp()` usage. But for R's interned
  // strings it definitely matters for us.
  if (x == y) {
    return 0;
  } else {
    return direction * strcmp(x, y);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.h:97

str_cmp_maybe_na typed

∀'a. ([any_sexp, any_sexp, c_string, c_string, c_int_na, c_int_na & 'a] -> c_int_na)&([any_sexp, <...> | null | sym, c_string, c_string, c_int, c_int_na & 'a] -> c_int | c_int_na & 'a)&([any_sexp, any_sexp, c_string, c_string, c_int, c_int & 'a] | [<...> | null | sym, <...> | null | sym, c_string, c_string, c_int, c_int_na & 'a] -> c_int)
timing: 0.435 s
source
 int str_cmp_maybe_na(
  SEXP x,
  SEXP y,
  const char* x_string,
  const char* y_string,
  const int direction,
  const int na_order
) {
  // Same pointer - including `NA`s
  if (x == y) {
    return 0;
  }

  if (x == NA_STRING) {
    return na_order;
  }

  if (y == NA_STRING) {
    return -na_order;
  }

  return direction * strcmp(x_string, y_string);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.h:67

str_ge typed

[c_string, c_string, c_int_na] -> c_bool
timing: 0.017 s
source
bool str_ge(
  const char* x,
  const char* y,
  const int direction
) {
  return str_cmp(x, y, direction) >= 0;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order-sortedness.h:114

str_is_ascii_or_utf8 typed

[p(CHR)] -> c_bool
timing: 0.022 s
source
static inline bool str_is_ascii_or_utf8(r_obj* x) {
#if (R_VERSION >= R_Version(4, 5, 0))
  return Rf_charIsASCII(x) || (Rf_getCharCE(x) == CE_UTF8) || (x == r_globals.na_str);
#else
  const int mask_ascii = 8;
  const int mask_utf8 = 64;
  const int levels = LEVELS(x);
  return (levels & mask_ascii) || (levels & mask_utf8) || (x == r_globals.na_str);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.h:40

subscript_type_action_chr typed

[c_false] | [c_true] -> any_sexp
timing: 0.027 s
source
static inline SEXP subscript_type_action_chr(enum subscript_type_action action) {
  switch (action) {
  case SUBSCRIPT_TYPE_ACTION_CAST: return chrs_cast;
  case SUBSCRIPT_TYPE_ACTION_ERROR: return chrs_error;
  }
  never_reached("subscript_type_action_chr");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.h:42

suffix_pos typed

[c_string] -> c_int
timing: 0.660 s
source
ptrdiff_t suffix_pos(const char* name) {
  int n = strlen(name);

  const char* suffix_end = NULL;
  int in_dots = 0;
  bool in_digits = false;

  for (const char* ptr = name + n - 1; ptr >= name; --ptr) {
    char c = *ptr;

    if (in_digits) {
      if (c == '.') {
        in_digits = false;
        in_dots = 1;
        continue;
      }

      if (isdigit(c)) {
        continue;
      }

      goto done;
    }

    switch (in_dots) {
    case 0:
      if (isdigit(c)) {
        in_digits = true;
        continue;
      }
      goto done;
    case 1:
    case 2:
      if (c == '.') {
        ++in_dots;
        continue;
      }
      goto done;
    case 3:
      suffix_end = ptr + 1;
      if (isdigit(c)) {
        in_dots = 0;
        in_digits = true;
        continue;
      }
      goto done;

    default:
      r_stop_internal("Unexpected state.");
    }}

 done:
  if (suffix_end) {
    return suffix_end - name;
  } else {
    return -1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:377

tib_cast typed

[*struct cast_opts] -> <...>
timing: 0.014 s
source
SEXP tib_cast(const struct cast_opts* opts) {
  SEXP out = PROTECT(df_cast_opts(opts));

  Rf_setAttrib(out, R_ClassSymbol, classes_tibble);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-tibble.c:47

tib_ptype2 typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp
timing: 0.031 s
source
r_obj* tib_ptype2(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  r_obj* out = KEEP(df_ptype2(
    x,
    y,
    p_x_arg,
    p_y_arg,
    call,
    s3_fallback
  ));
  r_attrib_poke_class(out, classes_tibble);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-tibble.c:4

times_is_oob typed

[c_int_na] -> c_bool
timing: 0.005 s
source
bool times_is_oob(int times) {
  return times > R_LEN_T_MAX;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:213

try_catch_hnd typed

[any_sexp] -> any
timing: 0.010 s
source
static inline SEXP try_catch_hnd(SEXP ptr) {
  SEXP call = PROTECT(Rf_lang2(syms_try_catch_hnd, ptr));
  SEXP out = Rf_eval(call, vctrs_ns_env);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1431

tzone_equal typed

[CHR, CHR] -> c_bool
timing: 0.207 s
source
static bool tzone_equal(SEXP x_tzone, SEXP y_tzone) {
  // Equal objects?
  if (x_tzone == y_tzone) {
    return true;
  }

  // Equal CHARSXPs?
  SEXP x_string = STRING_ELT(x_tzone, 0);
  SEXP y_string = STRING_ELT(y_tzone, 0);

  if (x_string == y_string) {
    return true;
  }

  // Equal C char?
  const char* x_tzone_char = CHAR(x_string);
  const char* y_tzone_char = CHAR(y_string);

  return !strcmp(x_tzone_char, y_tzone_char);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:455

tzone_get typed

[any_sexp] -> any_sexp
timing: 0.115 s
source
static SEXP tzone_get(SEXP x) {
  SEXP tzone = PROTECT(Rf_getAttrib(x, syms_tzone));

  if (tzone == R_NilValue) {
    UNPROTECT(1);
    return chrs_empty;
  }

  R_len_t size = Rf_length(tzone);

  if (size == 1) {
    UNPROTECT(1);
    return tzone;
  }

  if (size == 0) {
    Rf_errorcall(R_NilValue, "Corrupt datetime with 0-length `tzone` attribute");
  }

  // If there are multiple, only take the first
  SEXP out = PROTECT(Rf_allocVector(STRSXP, 1));
  SET_STRING_ELT(out, 0, STRING_ELT(tzone, 0));

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:414

tzone_is_local typed

[CHR] -> c_bool
timing: 0.019 s
source
static inline bool tzone_is_local(SEXP tzone) {
  return STRING_ELT(tzone, 0) == strings_empty;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:442

tzone_union typed

∀'a,'b. [CHR & 'a, any_sexp & 'b] -> CHR & 'a | any_sexp & 'b
timing: 0.020 s
source
static SEXP tzone_union(SEXP x_tzone, SEXP y_tzone) {
  if (tzone_is_local(x_tzone)) {
    return y_tzone;
  } else {
    return x_tzone;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:446

u32_safe_ceil2 typed

[c_false] | [c_int_na \ c_false] -> c_int
timing: 0.209 s
source
uint32_t u32_safe_ceil2(uint32_t x) {
  // Return 2^0 when `x` is 0
  x += (x == 0);

  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;

  if (x == 0) {
    // INT32_MAX+2 <= x <= UINT32_MAX (i.e. 2^31+1 <= x <= 2^32-1) would attempt
    // to ceiling to 2^32, which is 1 greater than `UINT32_MAX`, resulting in
    // overflow wraparound to 0.
    r_stop_internal("`x` results in an `uint32_t` overflow.");
  }

  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:12

uint32_hash typed

[c_int_na] -> c_int
timing: 0.017 s
source
static inline uint32_t uint32_hash(uint32_t x) {
  x ^= x >> 16;
  x *= 0x85ebca6b;
  x ^= x >> 13;
  x *= 0xc2b2ae35;
  x ^= x >> 16;

  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:29

vctrs_arg typed

[c_null] -> any_sexp
timing: 0.096 s
source
r_obj* vctrs_arg(struct vctrs_arg* arg) {
  if (!arg) {
    return chrs_empty;
  }

  r_ssize next_size = DEFAULT_ARG_BUF_SIZE;
  r_ssize size;

  r_obj* buf_holder = KEEP(r_null);
  char* buf;

  do {
    size = next_size;

    FREE(1);
    buf_holder = KEEP(r_alloc_raw(size));
    buf = (char*) r_raw_begin(buf_holder);

    // Reallocate a larger buffer at the next iteration if the current
    // buffer turns out too small
    next_size *= 1.5;
  } while (fill_arg_buffer(arg, buf, 0, size) < 0);

  r_obj* out = r_chr(buf);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:16

vctrs_as_unique_names typed entry .Call fuzz crash

[CHR, LGL] -> any_sexp
timing: 0.028 s
fuzzing: 8 inside (7 ok, 1 crash) · 8 outside (8 rejected)
type drawn from: (x1: CHR, x2: LGL) -> any_sexp

Other calls inside the domain

callverdicterror
vctrs_as_unique_names("a", logical(0))crash
source
r_obj* vctrs_as_unique_names(r_obj* names, r_obj* quiet) {
  r_obj* out = KEEP(vec_as_unique_names(names, r_lgl_get(quiet, 0)));
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:345

VCTRS_ASSERT typed any: arg 1

tuple1 -> c_void
timing: 0.003 s
(definition not located in src/)

vctrs_count_loop typed

([*struct dictionary, c_int_na, *c_int_na] -> ())&([c_null, c_int_na, *c_int_na] -> empty)
timing: 1.26 s
source
void vctrs_count_loop(struct dictionary* d, R_len_t n, int* p_count) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_COUNT_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VCTRS_COUNT_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VCTRS_COUNT_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VCTRS_COUNT_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VCTRS_COUNT_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VCTRS_COUNT_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VCTRS_COUNT_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VCTRS_COUNT_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VCTRS_COUNT_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vctrs_count_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:806

vctrs_datetime_validate typed entry .Call empty return

[any_sexp] -> empty
timing: 0.004 s
source
SEXP vctrs_datetime_validate(SEXP x) {
  return datetime_validate(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:349

vctrs_df_size typed entry .Call accepts outside

[{ any_sexp }] -> INT1
timing: 0.027 s
fuzzing: 7 inside (3 ok, 4 error pkg) · 7 outside (6 rejected, 1 accepted)
type drawn from: (x1: { any_sexp }) -> INT1

Accepted outside the domain x1: 1

parameterchangecallreturned
x1kind:nullvctrs_df_size(NULL)0L<> with { }

Other calls inside the domain

callverdicterror
vctrs_df_size(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) quote(f(x))))error_pkg::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_df_size(list(function(...) quote(f(x))))error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_df_size(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkg::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_df_size(list(function(...) new.env(), integer(0)))error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
SEXP vctrs_df_size(SEXP x) {
  return r_int(df_raw_size(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:152

vctrs_dim_n typed entry .Call fuzz ok

[any_sexp] -> INT1
timing: 0.012 s
fuzzing: 4 inside (4 ok) · 5 outside (5 rejected)
type drawn from: (x1: any_sexp) -> INT1
source
SEXP vctrs_dim_n(SEXP x) {
  return r_int(vec_dim_n(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.c:9

vctrs_duplicated_any typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.012 s
fuzzing: 7 inside (2 ok, 5 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1

Other calls inside the domain

callverdicterror
vctrs_duplicated_any(function(...) quote(f(x)))error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_duplicated_any(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkg::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_duplicated_any(function(...) as.name("x"))error_pkg::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_duplicated_any(quote(f(x)))error_pkg::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vctrs_duplicated_any(new.env())error_pkg::vec_size: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
SEXP vctrs_duplicated_any(SEXP x) {
  bool out = duplicated_any(x);
  return Rf_ScalarLogical(out);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:217

vctrs_duplicated_loop typed

([*struct dictionary, c_int_na, *c_int_na, *c_int_na] -> ())&([c_null, c_int_na, *c_int_na, *c_int_na] -> empty)
timing: 1.90 s
source
void vctrs_duplicated_loop(struct dictionary* d, R_len_t n, uint32_t* p_hashes, int* p_out) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_DUPLICATED_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VCTRS_DUPLICATED_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VCTRS_DUPLICATED_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VCTRS_DUPLICATED_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VCTRS_DUPLICATED_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VCTRS_DUPLICATED_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VCTRS_DUPLICATED_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VCTRS_DUPLICATED_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VCTRS_DUPLICATED_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vctrs_duplicated_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:878

VCTRS_DUPLICATED_LOOP typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

vctrs_eval_mask_n typed

[any_sexp, *any_sexp, *any_sexp] -> any
timing: 0.013 s
source
SEXP vctrs_eval_mask_n(SEXP fn, SEXP* syms, SEXP* args) {
  return vctrs_eval_mask_n_impl(R_NilValue, fn, syms, args, vctrs_ns_env);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:62

vctrs_eval_mask_n_impl typed

([null, any_sexp, *any_sexp, c_null, env] | [null, any_sexp, *sym, *any_sexp, env] | [sym, any_sexp, *any_sexp, c_null, env] | [sym, any_sexp, *sym, *any_sexp, env] -> any_sexp)&([null, any_sexp, c_null, *any_sexp, env] | [sym, any_sexp, c_null, *any_sexp, env] -> empty)
timing: 0.902 s
source
static SEXP vctrs_eval_mask_n_impl(SEXP fn_sym, SEXP fn, SEXP* syms, SEXP* args, SEXP env) {
  SEXP mask = PROTECT(r_alloc_empty_environment(env));

  if (fn_sym != R_NilValue) {
    Rf_defineVar(fn_sym, fn, mask);
    fn = fn_sym;
  }

  SEXP body = PROTECT(r_call_n(fn, syms, syms));
  SEXP call_fn = PROTECT(r_new_function(R_NilValue, body, mask));
  SEXP call = PROTECT(Rf_lang1(call_fn));

  while (*syms) {
    Rf_defineVar(*syms, *args, mask);
    ++syms; ++args;
  }

  SEXP out = Rf_eval(call, env);

  UNPROTECT(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:204

vctrs_fast_c typed entry .Call fuzz ok

∀'a,'b. ([CHR & 'a, null & 'b] -> 'a & (<...> | p(CHR) | sym) | null & 'b)&([CHR1 & 'a, null & 'b] -> 'a & ((externalptr | vec1 | arrow) | sym))&([p(CHR) & 'a, null & 'b] -> p(CHR) & 'a | null & 'b)&(['a & ((clx | (~vec)<...>) | null | sym), any_sexp & 'b] -> empty)
timing: 0.489 s
fuzzing: 12 inside (5 ok, 7 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: 'I83653 & ((clx | (~vec)<...>) | sym | null), x2: 'I83654 & any_sexp) -> empty) & ((x1: 'I83653 & CHR, x2: 'I83654 & null) -> 'I83653 & (<...> | p(CHR) | sym) | null & 'I83654) & ((x1: 'I83653 & CHR1, x2: 'I83654 & null) -> 'I83653 & ((externalptr | vec1 | arrow) | sym)) & ((x1: 'I83653 & p(CHR), x2: 'I83654 & null) -> p(CHR) & 'I83653 | null & 'I83654)

Other calls inside the domain

callverdicterror
vctrs_fast_c(character(0), NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
vctrs_fast_c("NA", NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
vctrs_fast_c(c("é", "é", "x y", "x y", NA_character_), NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
vctrs_fast_c("é", NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
vctrs_fast_c(c("NA", "x y", "NA", NA_character_, "x y"), NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
vctrs_fast_c("a", NULL)error_pkg::vctrs_fast_c: `x` and `y` must have the same types.
and 1 more
source
SEXP vctrs_fast_c(SEXP x, SEXP y) {
  SEXPTYPE x_type = TYPEOF(x);

  if (x_type != TYPEOF(y)) {
    Rf_error("`x` and `y` must have the same types.");
  }

  switch (x_type) {
  case STRSXP: return chr_c(x, y);
  default: stop_unimplemented_type("vctrs_fast_c", x_type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1539

vctrs_field_get typed entry .Call fuzz ok

∀'a. ([{ 'a }, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym] -> 'a)&([(env | externalptr | lang | list | vec | arrow) | null | p(CHR) | sym, (~(CHR | DBL | INT))<...> | null | sym] | [(env | externalptr | lang | vec | arrow) | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.076 s
fuzzing: 19 inside (19 ok) · 8 outside (8 rejected)
type drawn from: ((x1: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, x2: (~(CHR | DBL | INT))<...> | sym | null) | (x1: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, x2: any_sexp) -> empty) & ((x1: { 'I66519 }, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null) -> 'I66519)
source
SEXP vctrs_field_get(SEXP x, SEXP index) {
  check_rcrd(x);
  return vctrs_list_get(x, index);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:121

vctrs_field_set typed entry .Call fuzz ok

∀'a,'b. ([{ 'b }, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym, 'a & (<> | null | p(CHR) | sym)] -> { 'b | 'a })&([expr, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym, 'a & (lang<> | sym)] -> expr)&([(env | externalptr | lang | list | vec | arrow) | null | p(CHR) | sym, (~(CHR | DBL | INT))<...> | null | sym, 'a & (<> | null | p(CHR) | sym)] | [(env | externalptr | lang | vec | arrow) | null | p(CHR) | sym, any_sexp, any_sexp & 'a] -> empty)
timing: 0.267 s
fuzzing: 20 inside (19 ok, 1 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: expr, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, x3: 'I66526 & (lang<> | sym)) -> expr) & ((x1: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, x2: (~(CHR | DBL | INT))<...> | sym | null, x3: 'I66526 & (p(CHR) | <> | sym | null)) | (x1: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, x2: any_sexp, x3: 'I66526 & any_sexp) -> empty) & ((x1: { 'I66555 }, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, x3: 'I66526 & (p(CHR) | <> | sym | null)) -> { 'I66555 | 'I66526 })

Other calls inside the domain

callverdicterror
vctrs_field_set(list(), 1000000L, 1L)error_pkgCorrupt rcrd: length 0
source
SEXP vctrs_field_set(SEXP x, SEXP index, SEXP value) {
  check_rcrd(x);

  if (!obj_is_vector(value, VCTRS_ALLOW_NULL_no)) {
    Rf_errorcall(R_NilValue, "Invalid value: not a vector.");
  }

  if (vec_size(value) != vec_size(x)) {
    Rf_errorcall(R_NilValue, "Invalid value: incorrect length.");
  }

  return vctrs_list_set(x, index, value);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:126

vctrs_fields typed entry .Call fuzz ok

([(env | externalptr | lang | list | vec | arrow) | null | p(CHR) | sym] -> CHR | null)&([(env | externalptr | lang | vec | arrow) | null | p(CHR) | sym] -> empty)
timing: 0.026 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
type drawn from: ((x1: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null) -> CHR | null) & ((x1: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null) -> empty)
source
SEXP vctrs_fields(SEXP x) {
  check_rcrd(x);

  return Rf_getAttrib(x, R_NamesSymbol);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:109

vctrs_fill_missing typed entry .Call fuzz ok

[any_sexp, CHR, null] -> any_sexp
timing: 0.030 s
fuzzing: 8 inside (8 error pkg) · 7 outside (7 rejected)
type drawn from: (x1: any_sexp, x2: CHR, x3: null) -> any_sexp

Other calls inside the domain

callverdicterror
vctrs_fill_missing(NULL, "é", NULL)error_pkg::abort: could not find function "abort"
vctrs_fill_missing(function(...) NULL, character(0), NULL)error_pkg::abort: could not find function "abort"
vctrs_fill_missing(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "a", NULL)error_pkg::abort: could not find function "abort"
vctrs_fill_missing(as.name("x"), c("é", NA_character_), NULL)error_pkg::abort: could not find function "abort"
vctrs_fill_missing(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), character(0), NULL)error_pkg::abort: could not find function "abort"
vctrs_fill_missing(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), c("x y", "é"), NULL)error_pkg::abort: could not find function "abort"
and 2 more
source
SEXP vctrs_fill_missing(SEXP x, SEXP direction, SEXP max_fill) {
  bool down;
  bool leading;
  parse_direction(direction, &down, &leading);

  int c_max_fill = parse_max_fill(max_fill);

  return vec_fill_missing(x, down, leading, c_max_fill);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:10

vctrs_group_id_loop typed

([*struct dictionary, c_int_na, *c_int_na] -> ())&([c_null, c_int_na, *c_int_na] -> empty)
timing: 2.02 s
source
void vctrs_group_id_loop(struct dictionary* d, R_len_t n, int* p_out) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_GROUP_ID_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VCTRS_GROUP_ID_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VCTRS_GROUP_ID_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VCTRS_GROUP_ID_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VCTRS_GROUP_ID_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VCTRS_GROUP_ID_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VCTRS_GROUP_ID_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VCTRS_GROUP_ID_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VCTRS_GROUP_ID_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vctrs_group_id_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:50

vctrs_group_rle_loop typed

([*struct dictionary, c_int_na, *c_int_na, *c_int_na] -> any)&([c_null, c_int_na, *c_int_na, *c_int_na] -> empty)
timing: 2.20 s
source
R_len_t vctrs_group_rle_loop(struct dictionary* d, R_len_t n, int* p_g, int* p_l) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_GROUP_RLE_LOOP(nil_dict_hash_scalar, p_nil_equal_na_equal); break;
  case VCTRS_TYPE_logical: VCTRS_GROUP_RLE_LOOP(lgl_dict_hash_scalar, p_lgl_equal_na_equal); break;
  case VCTRS_TYPE_integer: VCTRS_GROUP_RLE_LOOP(int_dict_hash_scalar, p_int_equal_na_equal); break;
  case VCTRS_TYPE_double: VCTRS_GROUP_RLE_LOOP(dbl_dict_hash_scalar, p_dbl_equal_na_equal); break;
  case VCTRS_TYPE_complex: VCTRS_GROUP_RLE_LOOP(cpl_dict_hash_scalar, p_cpl_equal_na_equal); break;
  case VCTRS_TYPE_character: VCTRS_GROUP_RLE_LOOP(chr_dict_hash_scalar, p_chr_equal_na_equal); break;
  case VCTRS_TYPE_raw: VCTRS_GROUP_RLE_LOOP(raw_dict_hash_scalar, p_raw_equal_na_equal); break;
  case VCTRS_TYPE_list: VCTRS_GROUP_RLE_LOOP(list_dict_hash_scalar, p_list_equal_na_equal); break;
  case VCTRS_TYPE_dataframe: VCTRS_GROUP_RLE_LOOP(df_dict_hash_scalar, p_df_equal_na_equal); break;
  default: stop_unimplemented_vctrs_type("vctrs_group_rle_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:150

VCTRS_GROUP_RLE_LOOP typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vctrs_has_dim typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.011 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1
source
SEXP vctrs_has_dim(SEXP x) {
  return r_lgl(has_dim(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.c:14

vctrs_id_loop typed

([*struct dictionary, c_int_na, *c_int_na] -> ())&([c_null, c_int_na, *c_int_na] -> empty)
timing: 1.22 s
source
void vctrs_id_loop(struct dictionary* d, R_len_t n, int* p_out) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_ID_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VCTRS_ID_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VCTRS_ID_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VCTRS_ID_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VCTRS_ID_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VCTRS_ID_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VCTRS_ID_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VCTRS_ID_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VCTRS_ID_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vctrs_id_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:356

vctrs_implements_ptype2 typed entry .Call accepts outside

[LGL<> | null] -> ^LGL1
timing: 0.016 s
fuzzing: 5 inside (5 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: (x1: LGL<> | null) -> ^LGL1

Accepted outside the domain x1: 6

parameterchangecallreturned
x1kind:listvctrs_implements_ptype2(list())tt<> with { }
x1kind:symvctrs_implements_ptype2(as.name("x"))ff<> with { }
x1retype:lgl>clxvctrs_implements_ptype2(complex(real = 1, imaginary = -2))tt<> with { }
x1retype:lgl>intvctrs_implements_ptype2(2147483647L)tt<> with { }
x1retype:lgl>intvctrs_implements_ptype2(NA_integer_)tt<> with { }
x1wrapvctrs_implements_ptype2(list(NULL))tt<> with { }
source
SEXP vctrs_implements_ptype2(SEXP x) {
  return r_lgl(vec_implements_ptype2(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:644

vctrs_in typed entry .Call fuzz ok

([any_sexp, any_sexp, null, any_sexp] -> empty)&([any_sexp, any_sexp, LGL | null, any_sexp] -> any_sexp)
timing: 0.116 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: LGL | null, x4: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: null, x4: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
vctrs_in(function(...) 2147483647, NULL, logical(0), list(NULL))error_pkgInput must be a single `TRUE` or `FALSE`.
vctrs_in(NULL, c(42L, 2147483647L, -2147483647L, 1L, 1L), c(TRUE, NA), quote(f(x)))error_pkgInput must be a single `TRUE` or `FALSE`.
vctrs_in(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.raw(c(255, 255, 0, 0, 0)), FALSE, list())error_pkg::vctrs_in: 'rho' must be an environment not list: detected in C-level eval
source
SEXP vctrs_in(SEXP needles, SEXP haystack, SEXP na_equal_, SEXP frame) {
  struct r_lazy needles_arg_ = { .x = syms.needles_arg, .env = frame };
  struct vctrs_arg needles_arg = new_lazy_arg(&needles_arg_);

  struct r_lazy haystack_arg_ = { .x = syms.haystack_arg, .env = frame };
  struct vctrs_arg haystack_arg = new_lazy_arg(&haystack_arg_);

  struct r_lazy call = { .x = frame, .env = r_null };

  return vec_in(
    needles,
    haystack,
    r_bool_as_int(na_equal_),
    &needles_arg,
    &haystack_arg,
    call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:546

vctrs_init_bind typed

[any_sexp] -> ()
timing: 0.006 s
source
void vctrs_init_bind(r_obj* ns) {
  syms_vec_cbind_frame_ptype = r_sym("vec_cbind_frame_ptype");
  fns_vec_cbind_frame_ptype = r_env_get(ns, syms_vec_cbind_frame_ptype);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:789

vctrs_init_cast typed

[any_sexp] -> ()
timing: 0.009 s
source
void vctrs_init_cast(r_obj* ns) {
  syms.vec_default_cast = r_sym("vec_default_cast");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:398

vctrs_init_data typed

[any_sexp] -> ()
timing: 0.015 s
source
void vctrs_init_data(r_obj* ns) {
  syms_vec_proxy = r_sym("vec_proxy");

  syms_vec_proxy_equal = r_sym("vec_proxy_equal");
  syms_vec_proxy_equal_array = r_sym("vec_proxy_equal.array");

  syms_vec_proxy_compare = r_sym("vec_proxy_compare");
  syms_vec_proxy_compare_array = r_sym("vec_proxy_compare.array");

  syms_vec_proxy_order = r_sym("vec_proxy_order");
  syms_vec_proxy_order_array = r_sym("vec_proxy_order.array");

  fns_vec_proxy_equal_array = r_env_get(ns, syms_vec_proxy_equal_array);
  fns_vec_proxy_compare_array = r_env_get(ns, syms_vec_proxy_compare_array);
  fns_vec_proxy_order_array = r_env_get(ns, syms_vec_proxy_order_array);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:255

vctrs_init_dictionary typed

[any_sexp] -> ()
timing: 0.012 s
source
void vctrs_init_dictionary(SEXP ns) {
  args_needles = new_wrapper_arg(NULL, "needles");
  args_haystack = new_wrapper_arg(NULL, "haystack");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:895

vctrs_init_interval typed

[any_sexp] -> ()
timing: 0.027 s
source
void vctrs_init_interval(r_obj* ns) {
  args_start_ = new_wrapper_arg(NULL, "start");
  args_end_ = new_wrapper_arg(NULL, "end");
  args_lower_ = new_wrapper_arg(NULL, "lower");
  args_upper_ = new_wrapper_arg(NULL, "upper");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:935

vctrs_init_match typed

[any_sexp] -> ()
timing: 0.021 s
source
void vctrs_init_match(r_obj* ns) {
  args_incomplete_ = new_wrapper_arg(NULL, "incomplete");
  args_no_match_ = new_wrapper_arg(NULL, "no_match");
  args_remaining_ = new_wrapper_arg(NULL, "remaining");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2912

vctrs_init_names typed

[any_sexp] -> ()
timing: 0.045 s
source
void vctrs_init_names(r_obj* ns) {
  syms_set_rownames_dispatch = r_sym("set_rownames_dispatch");
  syms_set_names_dispatch = r_sym("set_names_dispatch");
  syms_as_universal_names = r_sym("as_universal_names");
  syms_check_unique_names = r_sym("validate_unique");

  fns_set_rownames_dispatch = r_env_get(ns, syms_set_rownames_dispatch);
  fns_set_names_dispatch = r_env_get(ns, syms_set_names_dispatch);
  fns_as_universal_names = r_env_get(ns, syms_as_universal_names);
  fns_check_unique_names = r_env_get(ns, syms_check_unique_names);

  syms_glue_as_name_spec = r_sym("glue_as_name_spec");
  fns_glue_as_name_spec = r_env_get(ns, syms_glue_as_name_spec);
  syms_internal_spec = r_sym("_spec");

  name_spec_inner = r_chr("inner");
  r_preserve(name_spec_inner);

  unique_repair_default_opts.type = NAME_REPAIR_unique;
  unique_repair_default_opts.fn = r_null;
  unique_repair_default_opts.quiet = false;

  unique_repair_silent_opts.type = NAME_REPAIR_unique;
  unique_repair_silent_opts.fn = r_null;
  unique_repair_silent_opts.quiet = true;

  no_repair_opts.type = NAME_REPAIR_none;
  no_repair_opts.fn = r_null;
  no_repair_opts.quiet = true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:1030

vctrs_init_proxy_restore typed

[any_sexp] -> ()
timing: 0.008 s
source
void vctrs_init_proxy_restore(r_obj* ns) {
  syms_vec_restore_dispatch = r_sym("vec_restore_dispatch");
  fns_vec_restore_dispatch = r_eval(syms_vec_restore_dispatch, ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:275

vctrs_init_ptype typed

[any_sexp] -> ()
timing: 0.003 s
source
void vctrs_init_ptype(r_obj* ns) {
  syms_vec_ptype = r_sym("vec_ptype");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:120

vctrs_init_ptype2 typed

[any_sexp] -> ()
timing: 0.004 s
source
void vctrs_init_ptype2(r_obj* ns) { }
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:394

vctrs_init_ptype2_dispatch typed

[any_sexp] -> ()
timing: 0.004 s
source
void vctrs_init_ptype2_dispatch(r_obj* ns) {
  syms_vec_ptype2_default = r_sym("vec_default_ptype2");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:269

vctrs_init_rep typed

[any_sexp] -> ()
timing: 0.004 s
source
void vctrs_init_rep(r_obj* ns) { }
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:385

vctrs_init_slice typed

[env] -> ()
timing: 0.065 s
source
void vctrs_init_slice(r_obj* ns) {
  syms.vec_slice_altrep = r_sym("vec_slice_altrep");
  syms.vec_slice_dispatch_integer64 = r_sym("vec_slice_dispatch_integer64");
  syms.vec_slice_fallback = r_sym("vec_slice_fallback");
  syms.vec_slice_fallback_integer64 = r_sym("vec_slice_fallback_integer64");

  fns.vec_slice_altrep = r_eval(syms.vec_slice_altrep, ns);
  fns.vec_slice_dispatch_integer64 = r_eval(syms.vec_slice_dispatch_integer64, ns);
  fns.vec_slice_fallback = r_eval(syms.vec_slice_fallback, ns);
  fns.vec_slice_fallback_integer64 = r_eval(syms.vec_slice_fallback_integer64, ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:533

vctrs_init_slice_assign typed

[any_sexp] -> ()
timing: 0.006 s
source
void vctrs_init_slice_assign(r_obj* ns) {
  syms_vec_assign_fallback = r_sym("vec_assign_fallback");
  fns_vec_assign_fallback = r_eval(syms_vec_assign_fallback, ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:1186

vctrs_init_subscript typed

[env] -> ()
timing: 0.011 s
source
void vctrs_init_subscript(r_obj* ns) {
  syms_new_error_subscript_type = r_sym("new_error_subscript_type");
  syms_new_dbl_cast_subscript_body = r_sym("new_cnd_bullets_subscript_lossy_cast");
  syms_lossy_err = r_sym("lossy_err");

  fns_cnd_body_subscript_dim = r_eval(r_sym("cnd_body_subscript_dim"), ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:350

vctrs_init_subscript_loc typed

[any_sexp] -> ()
timing: 0.003 s
source
void vctrs_init_subscript_loc(r_obj* ns) { }
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:790

vctrs_init_type_data_frame typed

[any_sexp] -> ()
timing: 0.005 s
source
void vctrs_init_type_data_frame(r_obj* ns) {
  syms_df_lossy_cast = r_sym("df_lossy_cast");
  fns_df_lossy_cast = r_eval(syms_df_lossy_cast, ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:1040

vctrs_init_type_date_time typed

[any_sexp] -> ()
timing: 0.021 s
source
void vctrs_init_type_date_time(SEXP ns) {
  syms_tz = Rf_install("tz");

  syms_as_date = Rf_install("as.Date");
  syms_as_posixct = Rf_install("as.POSIXct");
  syms_as_posixlt = Rf_install("as.POSIXlt");
  syms_date_as_character = Rf_install("date_as_character");
  syms_chr_date_as_posixct = Rf_install("chr_date_as_posixct");
  syms_chr_date_as_posixlt = Rf_install("chr_date_as_posixlt");

  fns_as_date = r_env_get(R_BaseEnv, syms_as_date);
  fns_as_posixct = r_env_get(R_BaseEnv, syms_as_posixct);
  fns_as_posixlt = r_env_get(R_BaseEnv, syms_as_posixlt);
  fns_date_as_character = r_env_get(ns, syms_date_as_character);
  fns_chr_date_as_posixct = r_env_get(ns, syms_chr_date_as_posixct);
  fns_chr_date_as_posixlt = r_env_get(ns, syms_chr_date_as_posixlt);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:524

vctrs_init_type_info typed

[any_sexp] -> ()
timing: 0.003 s
source
void vctrs_init_type_info(r_obj* ns) {

}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:139

vctrs_init_unspecified typed

[any_sexp] -> ()
timing: 0.050 s
source
void vctrs_init_unspecified(SEXP ns) {
  {
    vctrs_unspecified_class = Rf_allocVector(STRSXP, 1);
    R_PreserveObject(vctrs_unspecified_class);
    SET_STRING_ELT(vctrs_unspecified_class, 0, Rf_mkChar("vctrs_unspecified"));
  }

  vctrs_shared_empty_uns = vec_unspecified(0);
  R_PreserveObject(vctrs_shared_empty_uns);
  MARK_NOT_MUTABLE(vctrs_shared_empty_uns);

  syms_vec_ptype_finalise_dispatch = r_sym("vec_ptype_finalise_dispatch");
  fns_vec_ptype_finalise_dispatch = r_eval(syms_vec_ptype_finalise_dispatch, ns);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:145

vctrs_integer64_restore typed entry .Call empty return

[<> | null | p(CHR) | sym] -> empty
timing: 0.029 s
source
r_obj* vctrs_integer64_restore(r_obj* x) {
  if (!is_data_frame(x)) {
    r_stop_internal("`x` must be a data frame.");
  }
  if (r_length(x) != 2) {
    r_stop_internal("`x` must have two columns.");
  }

  r_obj* left = r_list_get(x, INTEGER64_PROXY_DF_LOCS_left);
  r_obj* right = r_list_get(x, INTEGER64_PROXY_DF_LOCS_right);

  const double* v_left = r_dbl_cbegin(left);
  const double* v_right = r_dbl_cbegin(right);

  r_ssize size = r_length(left);

  r_obj* out = KEEP(r_alloc_double(size));
  // See above comment about UB in this cast
  long long* v_out = (long long*) r_dbl_begin(out);

  r_attrib_poke_class(out, r_chr("integer64"));

  for (r_ssize i = 0; i < size; ++i) {
    const double left = v_left[i];
    const double right = v_right[i];

    if (isnan(left)) {
      v_out[i] = r_na_llong;
      continue;
    }

    v_out[i] = (long long) int64_pack(left, right);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-integer64.c:77

vctrs_is_altrep typed entry .Call fuzz ok

[any_sexp] -> ^LGL1
timing: 0.012 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
type drawn from: (x1: any_sexp) -> ^LGL1
source
r_obj* vctrs_is_altrep(r_obj* x) {
  return r_lgl(ALTREP(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/altrep.c:4

vctrs_is_unspecified typed entry .Call accepts outside

([null] -> ff)&([(LGL<> | <...>) | null] -> ^LGL1)
timing: 0.045 s
fuzzing: 2 inside (2 ok) · 7 outside (2 rejected, 5 accepted)
type drawn from: ((x1: (LGL<> | <...>) | null) -> ^LGL1) & ((x1: null) -> ff)

Accepted outside the domain x1: 5

parameterchangecallreturned
x1kind:envvctrs_is_unspecified(new.env())ff<> with { }
x1kind:symvctrs_is_unspecified(as.name("x"))ff<> with { }
x1retype:lgl>intvctrs_is_unspecified(integer(0))ff<> with { }
x1wrapvctrs_is_unspecified(list(NULL))ff<> with { }
x1wrapvctrs_is_unspecified(list(logical(0)))ff<> with { }
source
SEXP vctrs_is_unspecified(SEXP x) {
  return Rf_ScalarLogical(vec_is_unspecified(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:83

vctrs_list_get typed entry .Call accepts outside

∀'a. ([{ 'a }, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym] -> 'a)&([any_sexp, (~(CHR | DBL | INT))<...> | null | sym] -> empty)
timing: 0.104 s
fuzzing: 16 inside (16 ok) · 8 outside (7 rejected, 1 accepted)
type drawn from: ((x1: any_sexp, x2: (~(CHR | DBL | INT))<...> | sym | null) -> empty) & ((x1: { 'I66451 }, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null) -> 'I66451)

Accepted outside the domain x2: 1

parameterchangecallreturned
x2kind:dblvctrs_list_get(list(NA_real_), 1.5)(DBL1 \ ^DBL1)<> with { }
source
SEXP vctrs_list_get(SEXP x, SEXP index) {
  int idx = find_offset(x, index);

  return VECTOR_ELT(x, idx);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:84

vctrs_list_set typed entry .Call fuzz ok

∀'a,'b. ([{ 'b }, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym, any_sexp & 'a] -> { 'b | 'a })&([any_sexp, (~(CHR | DBL | INT))<...> | null | sym, any_sexp & 'a] -> empty)&([expr, (~((CHR | DBL | INT) & ~^INT1))<...> | null | sym, 'a & (lang | sym)] -> expr)
timing: 0.220 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: (~(CHR | DBL | INT))<...> | sym | null, x3: 'I66458 & any_sexp) -> empty) & ((x1: expr, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, x3: 'I66458 & (lang | sym)) -> expr) & ((x1: { 'I66470 }, x2: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, x3: 'I66458 & any_sexp) -> { 'I66470 | 'I66458 })
source
SEXP vctrs_list_set(SEXP x, SEXP index, SEXP value) {
  int idx = find_offset(x, index);

  SEXP out = PROTECT(Rf_shallow_duplicate(x));
  SET_VECTOR_ELT(out, idx, value);
  UNPROTECT(1);

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:90

vctrs_locate_sorted_groups typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp)&([any_sexp, any_sexp, any_sexp, (~LGL)<...> | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.028 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: p(CHR) | (~LGL)<...> | sym | null, x5: any_sexp) -> empty)
source
SEXP vctrs_locate_sorted_groups(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  SEXP nan_distinct,
  SEXP chr_proxy_collate
) {
  bool c_nan_distinct = parse_nan_distinct(nan_distinct);

  return vec_locate_sorted_groups(
    x,
    direction,
    na_value,
    c_nan_distinct,
    chr_proxy_collate
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:186

vctrs_match typed entry .Call fuzz ok

([any_sexp, any_sexp, null, any_sexp] -> empty)&([any_sexp, any_sexp, LGL | null, any_sexp] -> any_sexp)
timing: 0.085 s
fuzzing: 8 inside (5 ok, 3 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: LGL | null, x4: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: null, x4: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
vctrs_match(as.name("x"), NULL, logical(0), list())error_pkgInput must be a single `TRUE` or `FALSE`.
vctrs_match(NULL, list(function(...) function(...) new.env()), logical(0), as.name("x"))error_pkgInput must be a single `TRUE` or `FALSE`.
vctrs_match(as.name("x"), NA_complex_, c(FALSE, NA, NA, TRUE, FALSE), quote(f(x)))error_pkgInput must be a single `TRUE` or `FALSE`.
source
SEXP vctrs_match(SEXP needles, SEXP haystack, SEXP na_equal,
                 SEXP frame) {
  struct r_lazy call = { .x = frame, .env = r_null };

  struct r_lazy needles_arg_ = { .x = syms.needles_arg, .env = frame };
  struct vctrs_arg needles_arg = new_lazy_arg(&needles_arg_);

  struct r_lazy haystack_arg_ = { .x = syms.haystack_arg, .env = frame };
  struct vctrs_arg haystack_arg = new_lazy_arg(&haystack_arg_);

  return vec_match_params(needles,
                          haystack,
                          r_bool_as_int(na_equal),
                          &needles_arg,
                          &haystack_arg,
                          call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:374

vctrs_n_distinct_loop typed

([*struct dictionary, c_int_na] -> ())&([c_null, c_int_na] -> empty)
timing: 1.27 s
source
void vctrs_n_distinct_loop(struct dictionary* d, R_len_t n) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_N_DISTINCT_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VCTRS_N_DISTINCT_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VCTRS_N_DISTINCT_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VCTRS_N_DISTINCT_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VCTRS_N_DISTINCT_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VCTRS_N_DISTINCT_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VCTRS_N_DISTINCT_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VCTRS_N_DISTINCT_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VCTRS_N_DISTINCT_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vctrs_n_distinct_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:304

vctrs_n_fields typed entry .Call fuzz ok

([(env | externalptr | lang | list | vec | arrow) | null | p(CHR) | sym] -> ^INT1)&([(env | externalptr | lang | vec | arrow) | null | p(CHR) | sym] -> empty)
timing: 0.088 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
type drawn from: ((x1: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null) -> ^INT1) & ((x1: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null) -> empty)
source
SEXP vctrs_n_fields(SEXP x) {
  check_rcrd(x);

  return Rf_ScalarInteger(Rf_length(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fields.c:115

vctrs_new_date typed entry .Call empty return

[(~DBL)<...> | null | p(CHR) | sym] -> empty
timing: 0.010 s
source
SEXP vctrs_new_date(SEXP x) {
  return new_date(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:266

vctrs_new_datetime typed entry .Call empty return

[any_sexp, (~CHR)<...> | sym] | [(~DBL)<...> | null | p(CHR) | sym, any_sexp] -> empty
timing: 0.021 s
source
SEXP vctrs_new_datetime(SEXP x, SEXP tzone) {
  return new_datetime(x, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:289

vctrs_order typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp)&([any_sexp, any_sexp, any_sexp, (~LGL)<...> | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.025 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: p(CHR) | (~LGL)<...> | sym | null, x5: any_sexp) -> empty)
source
SEXP vctrs_order(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  SEXP nan_distinct,
  SEXP chr_proxy_collate
) {
  bool c_nan_distinct = parse_nan_distinct(nan_distinct);
  return vec_order(x, direction, na_value, c_nan_distinct, chr_proxy_collate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:159

vctrs_order_info typed entry .Call fuzz ok

([any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] -> any_sexp)&([any_sexp, any_sexp, any_sexp, (~LGL)<...> | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.030 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: any_sexp, x5: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: any_sexp, x3: any_sexp, x4: p(CHR) | (~LGL)<...> | sym | null, x5: any_sexp) -> empty)
source
SEXP vctrs_order_info(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  SEXP nan_distinct,
  SEXP chr_proxy_collate
) {
  bool c_nan_distinct = parse_nan_distinct(nan_distinct);
  return vec_order_info(x, direction, na_value, c_nan_distinct, chr_proxy_collate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:294

vctrs_rank typed entry .Call fuzz ok

([any_sexp, CHR | null, CHR | null, any_sexp, any_sexp, LGL, any_sexp] -> any_sexp)&([any_sexp, null, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp] | [any_sexp, CHR | null, null, any_sexp, any_sexp, any_sexp, any_sexp] -> empty)
timing: 0.090 s
fuzzing: 8 inside (6 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: any_sexp, x2: CHR | null, x3: CHR | null, x4: any_sexp, x5: any_sexp, x6: LGL, x7: any_sexp) -> any_sexp) & ((x1: any_sexp, x2: null, x3: any_sexp, x4: any_sexp, x5: any_sexp, x6: any_sexp, x7: any_sexp) | (x1: any_sexp, x2: CHR | null, x3: null, x4: any_sexp, x5: any_sexp, x6: any_sexp, x7: any_sexp) -> empty)

Other calls inside the domain

callverdicterror
vctrs_rank(NULL, character(0), "a", new.env(), NULL, c(TRUE, FALSE), quote(f(x)))error_pkg::vctrs_rank: `ties` must be a string. ℹ In file 'rank.c' at line 211. ℹ This is an internal error, please report it to the package authors.
vctrs_rank(new.env(), c("é", "a", NA_character_, "a", "x y"), character(0), list(NULL, as.name("x")), NULL, c(NA, NA), as.name("x"))error_pkg::vctrs_rank: `ties` must be a string. ℹ In file 'rank.c' at line 211. ℹ This is an internal error, please report it to the package authors.
source
r_obj* vctrs_rank(r_obj* x,
                  r_obj* ties,
                  r_obj* incomplete,
                  r_obj* direction,
                  r_obj* na_value,
                  r_obj* nan_distinct,
                  r_obj* chr_proxy_collate) {
  const enum ties c_ties = parse_ties(ties);
  const enum incomplete c_incomplete = parse_incomplete(incomplete);
  const bool c_nan_distinct = r_as_bool(nan_distinct);

  return vec_rank(
    x,
    c_ties,
    c_incomplete,
    direction,
    na_value,
    c_nan_distinct,
    chr_proxy_collate
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:18

vctrs_s3_find_method typed entry .Call fuzz ok

([CHR, any_sexp, env] -> any_sexp)&([CHR, <> | null | p(CHR) | sym, any_sexp] -> null)
timing: 0.026 s
fuzzing: 8 inside (7 ok, 1 error pkg) · 8 outside (8 rejected)
type drawn from: ((x1: CHR, x2: any_sexp, x3: env) -> any_sexp) & ((x1: CHR, x2: p(CHR) | <> | sym | null, x3: any_sexp) -> null)

Other calls inside the domain

callverdicterror
vctrs_s3_find_method(character(0), 0L, new.env())error_pkg::vctrs_s3_find_method: attempt access index 0/0 in STRING_ELT
source
SEXP vctrs_s3_find_method(SEXP generic, SEXP x, SEXP table) {
  return s3_find_method(r_chr_get_c_string(generic, 0), x, table);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:433

vctrs_try_catch_callback typed entry .Call fuzz crash

[externalptr, null] | [externalptr, <...> | p(CHR) | sym] -> null
timing: 0.251 s
fuzzing: 5 inside (5 crash) · 8 outside (8 rejected)
type drawn from: (x1: externalptr, x2: null) | (x1: externalptr, x2: p(CHR) | <...> | sym) -> null

Other calls inside the domain

callverdicterror
vctrs_try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), quote(f(x)))crash
vctrs_try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list())crash
vctrs_try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))crash
vctrs_try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL)crash
vctrs_try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), list(as.name("x"), as.name("x")))crash
source
SEXP vctrs_try_catch_callback(SEXP ptr, SEXP cnd) {
  struct r_try_catch_data* data = (struct r_try_catch_data*) R_ExternalPtrAddr(ptr);

  if (cnd == R_NilValue) {
    if (data->fn) {
      data->fn(data->fn_data);
    }
  } else {
    data->err = cnd;
    if (data->hnd) {
      data->hnd(data->hnd_data);
    }
  }

  return R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1451

vctrs_typeof typed entry .Call accepts outside

[LGL<> | null, LGL] -> "character" | "complex" | "dataframe" | "double" | "integer" | "list" | "logical" | "null" | "raw" | "s3" | "scalar" | "unspecified"
timing: 0.670 s
fuzzing: 8 inside (6 ok, 2 crash) · 8 outside (5 rejected, 2 accepted, 1 crash)
type drawn from: (x1: LGL<> | null, x2: LGL) -> "character" | "complex" | "dataframe" | "double" | "integer" | "list" | "logical" | "null" | "raw" | "s3" | "scalar" | "unspecified"

Accepted outside the domain x1: 2

parameterchangecallreturned
x1kind:langvctrs_typeof(quote(f(x)), c(TRUE, FALSE, NA, NA, TRUE))"scalar"<> with { }
x1retype:lgl>rawvctrs_typeof(raw(0), TRUE)"raw"<> with { }

Other calls inside the domain

callverdicterror
vctrs_typeof(NULL, logical(0))crash
vctrs_typeof(TRUE, logical(0))crash
source
r_obj* vctrs_typeof(r_obj* x, r_obj* dispatch) {
  enum vctrs_type type;
  if (r_lgl_get(dispatch, 0)) {
    type = vec_proxy_info(x).type;
  } else {
    type = vec_typeof(x);
  }
  return r_chr(vec_type_as_str(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:84

vctrs_unique_loc_loop typed

([*struct dictionary, *struct growable, c_int_na] -> ())&([c_null, *struct growable, c_int_na] -> empty)
timing: 2.01 s
source
void vctrs_unique_loc_loop(struct dictionary* d, struct growable* g, R_len_t n) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VCTRS_UNIQUE_LOC_LOOP(nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VCTRS_UNIQUE_LOC_LOOP(lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VCTRS_UNIQUE_LOC_LOOP(int_dict_hash_with); break;
  case VCTRS_TYPE_double: VCTRS_UNIQUE_LOC_LOOP(dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VCTRS_UNIQUE_LOC_LOOP(cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VCTRS_UNIQUE_LOC_LOOP(chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VCTRS_UNIQUE_LOC_LOOP(raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VCTRS_UNIQUE_LOC_LOOP(list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VCTRS_UNIQUE_LOC_LOOP(df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vctrs_unique_loc_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:192

vctrs_unspecified typed entry .Call accepts outside

([^INT1] -> LGL)&([null] -> empty)
timing: 1.27 s
fuzzing: 4 inside (3 ok, 1 error pkg) · 7 outside (5 rejected, 2 accepted)
type drawn from: ((x1: ^INT1) -> LGL) & ((x1: null) -> empty)

Accepted outside the domain x1: 2

parameterchangecallreturned
x1retype:int>lglvctrs_unspecified(TRUE)(LGL1 \ ^LGL1)<vctrs_unspecified> with { }
x1retype:int>lglvctrs_unspecified(FALSE)(LGL & ~vec1)<vctrs_unspecified> with { }

Other calls inside the domain

callverdicterror
vctrs_unspecified(-2147483647L)error_pkg::vctrs_unspecified: negative length vectors are not allowed

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
SEXP vctrs_unspecified(SEXP n) {
  if (Rf_length(n) != 1) {
    Rf_errorcall(R_NilValue, "`n` must be a single number");
  }
  if (TYPEOF(n) != INTSXP) {
    n = vec_cast(n,
                 r_globals.empty_int,
                 vec_args.empty,
                 vec_args.empty,
                 r_lazy_null);
  }
  int len = INTEGER(n)[0];
  return vec_unspecified(len);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:25

vctrs_validate_minimal_names typed entry .Call accepts outside

∀'a. ([null & 'a, INT] | [null & 'a, null] -> empty)&(['a & (CHR | null), INT] | ['a & (CHR | null), null] -> 'a & (CHR | null))
timing: 0.141 s
fuzzing: 11 inside (8 ok, 3 error pkg) · 8 outside (7 rejected, 1 accepted)
type drawn from: ((x1: 'I80485 & (CHR | null), x2: INT) | (x1: 'I80485 & (CHR | null), x2: null) -> 'I80485 & (CHR | null)) & ((x1: 'I80485 & null, x2: INT) | (x1: 'I80485 & null, x2: null) -> empty)

Accepted outside the domain x2: 1

parameterchangecallreturned
x2wrapvctrs_validate_minimal_names(character(0), list(2147483647L))(CHR & ~vec1)<> with { }

Other calls inside the domain

callverdicterror
vctrs_validate_minimal_names(c("x y", NA_character_), 0L)error_pkg::abort: could not find function "abort"
vctrs_validate_minimal_names(character(0), 2147483647L)error_pkg::abort: could not find function "abort"
vctrs_validate_minimal_names("a", integer(0))error_pkg::vctrs_validate_minimal_names: `n` must be a single number. ℹ In file 'names.c' at line 1015. ℹ This is an internal error, please report it to the package authors.
source
r_obj* vctrs_validate_minimal_names(r_obj* names, r_obj* n_) {
  r_ssize n = -1;

  if (r_typeof(n_) == R_TYPE_integer) {
    if (r_length(n_) != 1) {
      r_stop_internal("`n` must be a single number.");
    }
    n = r_int_get(n_, 0);
  }

  vec_validate_minimal_names(names, n, r_lazy_null);
  return names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:1010

vctrs_validate_name_repair_arg typed entry .Call fuzz ok

[CHR | null] -> any_sexp
timing: 0.126 s
fuzzing: 7 inside (7 error pkg) · 8 outside (8 rejected)
type drawn from: (x1: CHR | null) -> any_sexp

Other calls inside the domain

callverdicterror
vctrs_validate_name_repair_arg(c("x y", "NA", NA_character_, "x y", "NA"))error_pkg::abort: could not find function "abort"
vctrs_validate_name_repair_arg(NULL)error_pkg::abort: could not find function "abort"
vctrs_validate_name_repair_arg(c("", "x y"))error_pkg::abort: could not find function "abort"
vctrs_validate_name_repair_arg(c(NA_character_, "é", NA_character_, "NA", ""))error_pkg::abort: could not find function "abort"
vctrs_validate_name_repair_arg(character(0))error_pkg::abort: could not find function "abort"
vctrs_validate_name_repair_arg("NA")error_pkg::abort: could not find function "abort"
and 1 more
source
r_obj* vctrs_validate_name_repair_arg(r_obj* arg) {
  struct name_repair_opts opts = new_name_repair_opts(arg,
                                                      r_lazy_null,
                                                      true,
                                                      r_lazy_null);
  if (opts.type == NAME_REPAIR_custom) {
    return opts.fn;
  } else if (r_length(arg) != 1) {
    return r_str_as_character(r_str(name_repair_arg_as_c_string(opts.type)));
  } else {
    return arg;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:887

vec_any_missing typed

[any_sexp] -> c_bool
timing: 0.011 s
source
bool vec_any_missing(r_obj* x) {
  return vec_first_missing(x) != vec_size(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:267

vec_arg_format typed

[c_null] -> c_string
timing: 0.048 s
source
const char* vec_arg_format(struct vctrs_arg* p_arg) {
  r_obj* arg = KEEP(vctrs_arg(p_arg));
  const char* out = r_format_error_arg(arg);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:46

vec_as_arg typed

[CHR] | [null] -> struct vctrs_arg
timing: 0.063 s
source
static inline struct vctrs_arg vec_as_arg(SEXP x) {
  if (x == R_NilValue) {
    return *vec_args.empty;
  }

  if (!r_is_string(x)) {
    Rf_errorcall(R_NilValue, "Argument tag must be a string.");
  }
  return new_wrapper_arg(NULL, r_chr_get_c_string(x, 0));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:352

vec_as_custom_names typed

[CHR, *struct name_repair_opts] -> any_sexp
timing: 0.249 s
source
r_obj* vec_as_custom_names(r_obj* names, const struct name_repair_opts* opts) {
  names = KEEP(ffi_as_minimal_names(names));

  // Don't use vctrs dispatch utils because we match argument positionally
  r_obj* call = KEEP(r_call2(syms_repair, syms_names));
  r_obj* mask = KEEP(r_alloc_empty_environment(R_GlobalEnv));
  r_env_bind(mask, syms_repair, opts->fn);
  r_env_bind(mask, syms_names, names);
  r_obj* out = KEEP(r_eval(call, mask));

  vec_validate_minimal_names(out, r_length(names), opts->call);

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:120

vec_as_df_col typed

[any_sexp, p(CHR)] -> list
timing: 0.053 s
source
r_obj* vec_as_df_col(r_obj* x, r_obj* outer) {
  r_obj* out = KEEP(r_alloc_list(1));
  r_list_poke(out, 0, x);

  if (outer != strings_empty) {
    r_obj* names = KEEP(r_str_as_character(outer));
    r_attrib_poke_names(out, names);
    FREE(1);
  }

  init_data_frame(out, r_length(x));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:741

vec_as_location_ctxt typed

[any_sexp, c_int_na, any_sexp, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.023 s
source
r_obj* vec_as_location_ctxt(r_obj* subscript,
                            r_ssize n,
                            r_obj* names,
                            struct vctrs_arg* arg,
                            struct r_lazy call) {
  struct location_opts opts = {
    .subscript_opts = {
      .subscript_arg = arg,
      .call = call
    }
  };
  return vec_as_location_opts(subscript,
                              n,
                              names,
                              &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:13

vec_as_location_opts typed

([any_sexp, c_int_na, any_sexp, c_null] -> empty)&([any_sexp, c_int_na, any_sexp, *struct location_opts] \ [any_sexp, c_int_na, any_sexp, c_null] -> any_sexp)
timing: 0.060 s
source
r_obj* vec_as_location_opts(r_obj* subscript,
                            r_ssize n,
                            r_obj* names,
                            const struct location_opts* opts) {

  ERR err = NULL;
  subscript = vec_as_subscript_opts(subscript, &opts->subscript_opts, &err);
  KEEP2(subscript, err);

  if (err) {
    r_cnd_signal(err);
    r_stop_unreachable();
  }

  r_obj* out = r_null;
  switch (r_typeof(subscript)) {
  case R_TYPE_null: out = r_globals.empty_int; break;
  case R_TYPE_logical: out = lgl_as_location(subscript, n, opts); break;
  case R_TYPE_integer: out = int_as_location(subscript, n, opts); break;
  case R_TYPE_double: out = dbl_as_location(subscript, n, opts); break;
  case R_TYPE_character: out = chr_as_location(subscript, names, opts); break;
  default: r_stop_unimplemented_type(r_typeof(subscript));
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:30

vec_as_names typed

∀'a. ([CHR & 'a, *struct name_repair_opts \ c_null] -> any_sexp | 'a)&([any_sexp & 'a, c_null] -> any_sexp & 'a)
timing: 0.798 s
source
r_obj* vec_as_names(r_obj* names, const struct name_repair_opts* opts) {
  if (!opts) {
    return names;
  }
  switch (opts->type) {
  case NAME_REPAIR_none: return names;
  case NAME_REPAIR_minimal: return ffi_as_minimal_names(names);
  case NAME_REPAIR_unique: return vec_as_unique_names(names, opts->quiet);
  case NAME_REPAIR_universal: return vec_as_universal_names(names, opts->quiet);
  case NAME_REPAIR_check_unique: return check_unique_names(names, opts);
  case NAME_REPAIR_custom: return vec_as_custom_names(names, opts);
  }
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:10

vec_as_short_length typed

[any_sexp, c_null, struct r_lazy] -> c_int_na
timing: 0.047 s
source
r_ssize vec_as_short_length(r_obj* n,
                            struct vctrs_arg* p_arg,
                            struct r_lazy call) {
  r_ssize out = vec_as_ssize(n, p_arg, call);

  if (out < 0) {
    r_abort_lazy_call(call,
                      "%s must be a positive number or zero.",
                      vec_arg_format(p_arg));
  }

  if (out > INT_MAX) {
    // Ideally we'd mention long vector support in an info bullets
    r_abort_lazy_call(call,
                      "%s is too large a number and long vectors are not supported.",
                      vec_arg_format(p_arg));
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:245

vec_as_unique_names typed

[CHR, c_int_na] -> any_sexp
timing: 0.048 s
source
r_obj* vec_as_unique_names(r_obj* names, bool quiet) {
  if (is_unique_names(names) && !any_has_suffix(names)) {
    return names;
  } else {
    return(as_unique_names_impl(names, quiet));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:235

vec_assign_shaped typed empty return

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_bool] -> empty
timing: 0.177 s
source
SEXP vec_assign_shaped(
  SEXP proxy,
  SEXP index,
  SEXP value,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  switch (vec_proxy_typeof(proxy)) {
  case VCTRS_TYPE_logical:   return lgl_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_integer:   return int_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_double:    return dbl_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_complex:   return cpl_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_character: return chr_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_raw:       return raw_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  case VCTRS_TYPE_list:      return list_assign_shaped(proxy, index, value, ownership, slice_value, index_style);
  default:                   stop_unimplemented_vctrs_type("vec_assign_shaped", vec_proxy_typeof(proxy));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign-array.c:574

vec_assign_switch typed

([LGL<> | null, any_sexp, any_sexp, *struct vec_proxy_assign_opts] -> ([CHR, c_int, p(CHR)] -> ()))&([LGL<> | null, any_sexp, any_sexp, c_null] -> empty)
timing: 16.00 s
source
r_obj* vec_assign_switch(
  r_obj* proxy,
  r_obj* index,
  r_obj* value,
  const struct vec_proxy_assign_opts* p_opts
) {
  switch (vec_proxy_typeof(proxy)) {
  case VCTRS_TYPE_logical:   return lgl_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_integer:   return int_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_double:    return dbl_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_complex:   return cpl_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_character: return chr_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_raw:       return raw_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_list:      return list_assign(proxy, index, value, p_opts->ownership, p_opts->slice_value, p_opts->index_style);
  case VCTRS_TYPE_dataframe: return df_assign(proxy, index, value, p_opts);
  case VCTRS_TYPE_scalar:    stop_scalar_type(proxy, vec_args.empty, r_lazy_null);
  default:                   stop_unimplemented_vctrs_type("vec_assign_switch", vec_typeof(proxy));
  }
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:162

vec_bare_df_restore typed

([any_sexp, LGL<> | null, *struct vec_restore_opts] -> empty)&([any_sexp, any_sexp, *struct vec_restore_opts] \ [any_sexp, LGL<> | null, *struct vec_restore_opts] -> any_sexp)
timing: 0.213 s
source
r_obj* vec_bare_df_restore(r_obj* x,
                           r_obj* to,
                           const struct vec_restore_opts* p_opts) {
  if (r_typeof(x) != R_TYPE_list) {
    r_stop_internal("Attempt to restore data frame from a %s.",
                    r_type_as_c_string(r_typeof(x)));
  }

  int n_prot = 0;

  if (!is_data_frame(to)) {
    to = KEEP_N(vec_proxy(to), &n_prot);
    if (!is_data_frame(to)) {
      r_stop_internal("Expected restoration target to have a df proxy.");
    }
  }

  if (p_opts->recursively_proxied) {
    r_ssize n_cols = r_length(x);
    if (n_cols != r_length(to)) {
      r_stop_internal("Shape of `x` doesn't match `to` in recursive df restoration.");
    };

    r_obj* const * v_x = r_list_cbegin(x);
    r_obj* const * v_to = r_list_cbegin(to);

    // During restoration, if we have deep ownership over `x` we can
    // propagate that ownership to the columns, otherwise we have no
    // known ownership over the columns
    enum vctrs_ownership col_ownership;
    switch (p_opts->ownership) {
    case VCTRS_OWNERSHIP_foreign: col_ownership = VCTRS_OWNERSHIP_foreign; break;
    case VCTRS_OWNERSHIP_shallow: col_ownership = VCTRS_OWNERSHIP_foreign; break;
    case VCTRS_OWNERSHIP_deep: col_ownership = VCTRS_OWNERSHIP_deep; break;
    default: r_stop_unreachable();
    }

    const struct vec_restore_opts col_opts = {
      .ownership = col_ownership,
      .recursively_proxied = p_opts->recursively_proxied
    };

    for (r_ssize i = 0; i < n_cols; ++i) {
      r_obj* x_restored = vec_restore_opts(v_x[i], v_to[i], &col_opts);
      r_list_poke(x, i, x_restored);
    }
  }

  x = KEEP(vec_restore_default(x, to, p_opts->ownership));

  if (r_attrib_get(x, r_syms.names) == r_null) {
    r_obj* names = KEEP(r_alloc_character(r_length(x)));
    r_attrib_poke(x, r_syms.names, names);
    FREE(1);
  }

  r_obj* rownames = KEEP(df_rownames(x));

  if (rownames == r_null) {
    r_ssize size = df_raw_size(x);
    init_compact_rownames(x, size);
  } else if (rownames_type(rownames) == ROWNAMES_TYPE_identifiers) {
    rownames = KEEP(vec_as_names(rownames, p_unique_repair_silent_opts));
    x = vec_proxy_set_names(x, rownames, p_opts->ownership);
    FREE(1);
  }

  FREE(2);
  FREE(n_prot);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:192

vec_base_typeof typed

[any_sexp, c_int_na] -> c_false | c(2..7) | c(10)
timing: 0.194 s
source
enum vctrs_type vec_base_typeof(r_obj* x, bool proxied) {
  switch (r_typeof(x)) {
  // Atomic types are always vectors
  case R_TYPE_null: return VCTRS_TYPE_null;
  case R_TYPE_logical: return VCTRS_TYPE_logical;
  case R_TYPE_integer: return VCTRS_TYPE_integer;
  case R_TYPE_double: return VCTRS_TYPE_double;
  case R_TYPE_complex: return VCTRS_TYPE_complex;
  case R_TYPE_character: return VCTRS_TYPE_character;
  case R_TYPE_raw: return VCTRS_TYPE_raw;
  case R_TYPE_list:
    // Bare lists and data frames are vectors
    if (!r_is_object(x)) return VCTRS_TYPE_list;
    if (is_data_frame(x)) return VCTRS_TYPE_dataframe;
    // S3 lists are only vectors if they are proxied
    if (proxied || r_inherits(x, "list")) return VCTRS_TYPE_list;
    // fallthrough
  default: return VCTRS_TYPE_scalar;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:58

vec_c typed

[any_sexp, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.027 s
source
r_obj* vec_c(
  r_obj* xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* name_repair,
  struct vctrs_arg* p_error_arg,
  struct r_lazy error_call
) {
  return list_combine_for_vec_c(
    xs,
    ptype,
    name_spec,
    name_repair,
    p_error_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/c.c:30

vec_case_when typed

[<> | null | p(CHR) | sym, <> | null | p(CHR) | sym, any_sexp, c_bool, any_sexp, c_int_na \ c(-1), *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] | [null | { any_sexp }<>, <> | null | p(CHR) | sym, any_sexp, c_bool, any_sexp, c_int_na, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.201 s
source
r_obj* vec_case_when(
  r_obj* conditions,
  r_obj* values,
  r_obj* default_,
  enum list_combine_unmatched unmatched,
  r_obj* ptype,
  r_ssize size,
  struct vctrs_arg* p_conditions_arg,
  struct vctrs_arg* p_values_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call
) {
  obj_check_list(conditions, p_conditions_arg, error_call);
  list_check_all_condition_indices(conditions, p_conditions_arg, error_call);

  obj_check_list(values, p_values_arg, error_call);
  list_check_all_vectors(values, VCTRS_ALLOW_NULL_no, p_values_arg, error_call);

  // Infer `size` from first element of `conditions` unless specified.
  // We do this in `vec_case_when()` but not in `list_combine()`
  // because `vec_case_when()` only takes logical indices, which
  // has less ambiguity about the output size.
  size = compute_size(size, conditions);
  list_check_all_size(conditions, size, VCTRS_ALLOW_NULL_no, p_conditions_arg, error_call);

  const enum list_combine_multiple multiple = LIST_COMBINE_MULTIPLE_first;
  const enum assignment_slice_value slice_values = ASSIGNMENT_SLICE_VALUE_yes;

  return list_combine(
    values,
    conditions,
    size,
    default_,
    unmatched,
    multiple,
    slice_values,
    ptype,
    name_spec_inner,
    p_no_repair_opts,
    p_values_arg,
    p_conditions_arg,
    p_default_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/case-when.c:5

vec_cast typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.056 s
source
r_obj* vec_cast(r_obj* x,
                r_obj* to,
                struct vctrs_arg* p_x_arg,
                struct vctrs_arg* p_to_arg,
                struct r_lazy call) {
  struct cast_opts opts = {
    .x = x,
    .to = to,
    .p_x_arg = p_x_arg,
    .p_to_arg = p_to_arg,
    .call = call
  };
  return vec_cast_opts(&opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.h:25

vec_cast_common typed

[any_sexp, any_sexp, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.021 s
source
r_obj* vec_cast_common(r_obj* xs,
                       r_obj* to,
                       struct vctrs_arg* p_arg,
                       struct r_lazy call) {
  return vec_cast_common_params(xs,
                                to,
                                S3_FALLBACK_false,
                                p_arg,
                                call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:329

vec_cast_common_opts typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct cast_common_opts] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.189 s
source
r_obj* vec_cast_common_opts(r_obj* xs,
                            r_obj* to,
                            const struct cast_common_opts* opts) {
  r_obj* type = KEEP(vec_ptype_common(
    xs,
    to,
    PTYPE_FINALISE_DEFAULT,
    opts->s3_fallback,
    opts->p_arg,
    opts->call
  ));

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  r_obj* out = KEEP(r_alloc_list(xs_size));
  r_attrib_poke_names(out, xs_names);

  r_ssize i = 0;

  struct vctrs_arg* p_x_arg = new_subscript_arg(
    opts->p_arg,
    xs_names,
    xs_size,
    &i
  );
  KEEP(p_x_arg->shelter);

  for (; i < xs_size; ++i) {
    r_obj* elt = v_xs[i];
    struct cast_opts cast_opts = {
      .x = elt,
      .to = type,
      .p_x_arg = p_x_arg,
      .call = opts->call,
      .s3_fallback = opts->s3_fallback
    };
    r_list_poke(out, i, vec_cast_opts(&cast_opts));
  }

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:272

vec_cast_common_params typed

[any_sexp, any_sexp, c_bool, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.038 s
source
r_obj* vec_cast_common_params(r_obj* xs,
                              r_obj* to,
                              enum s3_fallback s3_fallback,
                              struct vctrs_arg* p_arg,
                              struct r_lazy call) {
  struct cast_common_opts opts = {
    .p_arg = p_arg,
    .call = call,
    .s3_fallback = s3_fallback
  };
  return vec_cast_common_opts(xs, to, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:316

vec_cast_default typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp
timing: 0.031 s
source
r_obj* vec_cast_default(r_obj* x,
                        r_obj* to,
                        struct vctrs_arg* p_x_arg,
                        struct vctrs_arg* p_to_arg,
                        struct r_lazy call,
                        enum s3_fallback s3_fallback) {
  return vec_cast_default_full(x, to, p_x_arg, p_to_arg, call, s3_fallback, false);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:173

vec_cast_dispatch_native typed

([c_null, c(0..10) | c(255), c(0..10) | c(255), *c_bool] -> empty)&([*struct cast_opts, c(0..10) | c(255), c(0..10) | c(255), *c_bool] \ [c_null, c(0..10) | c(255), c(0..10) | c(255), *c_bool] -> any_sexp)
timing: 3.46 s
source
r_obj* vec_cast_dispatch_native(const struct cast_opts* opts,
                                enum vctrs_type x_type,
                                enum vctrs_type to_type,
                                bool* lossy) {
  r_obj* x = opts->x;
  r_obj* to = opts->to;
  struct vctrs_arg* x_arg = opts->p_x_arg;
  struct vctrs_arg* to_arg = opts->p_to_arg;

  int dir = 0;
  enum vctrs_type2_s3 type2_s3 = vec_typeof2_s3_impl(x, to, x_type, to_type, &dir);

  switch (type2_s3) {

  case VCTRS_TYPE2_S3_character_bare_factor:
    if (dir == 0) {
      return chr_as_factor(x, to, lossy, to_arg);
    } else {
      return fct_as_character(x, x_arg);
    }

  case VCTRS_TYPE2_S3_character_bare_ordered:
    if (dir == 0) {
      return chr_as_ordered(x, to, lossy, to_arg);
    } else {
      return ord_as_character(x, x_arg);
    }

  case VCTRS_TYPE2_S3_bare_factor_bare_factor:
    return fct_as_factor(x, to, lossy, x_arg, to_arg);

  case VCTRS_TYPE2_S3_bare_ordered_bare_ordered:
    return ord_as_ordered(opts);

  case VCTRS_TYPE2_S3_bare_date_bare_posixct:
    if (dir == 0) {
      return date_as_posixct(x, to);
    } else {
      return posixct_as_date(x, lossy);
    }

  case VCTRS_TYPE2_S3_bare_date_bare_posixlt:
    if (dir == 0) {
      return date_as_posixlt(x, to);
    } else {
      return posixlt_as_date(x, lossy);
    }

  case VCTRS_TYPE2_S3_bare_posixct_bare_posixlt:
    if (dir == 0) {
      return posixct_as_posixlt(x, to);
    } else {
      return posixlt_as_posixct(x, to);
    }

  case VCTRS_TYPE2_S3_bare_date_bare_date:
    return date_as_date(x);

  case VCTRS_TYPE2_S3_bare_posixct_bare_posixct:
    return posixct_as_posixct(x, to);

  case VCTRS_TYPE2_S3_bare_posixlt_bare_posixlt:
    return posixlt_as_posixlt(x, to);

  case VCTRS_TYPE2_S3_dataframe_bare_tibble:
    if (dir == 0) {
      return tib_cast(opts);
    } else {
      return df_cast_opts(opts);
    }

  case VCTRS_TYPE2_S3_bare_tibble_bare_tibble:
    return tib_cast(opts);

  default:
    return r_null;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast-dispatch.c:6

vec_cast_e typed

[*struct cast_opts, *any] -> any_sexp
timing: 0.038 s
source
r_obj* vec_cast_e(const struct cast_opts* opts,
                  ERR* err) {
  struct cast_err_data data = {
    .opts = opts,
    .out = r_null
  };

  *err = r_try_catch(&vec_cast_e_cb,
                     &data,
                     syms_vctrs_error_incompatible_type,
                     NULL,
                     NULL);
  return data.out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:257

vec_cast_e_cb typed

[c_ptr] -> ()
timing: 0.088 s
source
void vec_cast_e_cb(void* data_) {
  struct cast_err_data* data = (struct cast_err_data*) data_;
  data->out = vec_cast_opts(data->opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:252

vec_cast_opts typed

([c_null] -> empty)&([*struct cast_opts] \ [c_null] -> any_sexp)
timing: 5.24 s
source
r_obj* vec_cast_opts(const struct cast_opts* opts) {
  r_obj* x = opts->x;
  r_obj* to = opts->to;
  struct vctrs_arg* p_x_arg = opts->p_x_arg;
  struct vctrs_arg* p_to_arg = opts->p_to_arg;
  struct r_lazy call = opts->call;

  if (x == r_null) {
    // Allow both `vec_cast(NULL, <vector>)` and `vec_cast(NULL, NULL)`
    obj_check_vector(to, VCTRS_ALLOW_NULL_yes, p_to_arg, call);
    return x;
  }
  if (to == r_null) {
    // Allow `vec_cast(<vector>, NULL)`
    obj_check_vector(x, VCTRS_ALLOW_NULL_no, p_x_arg, call);
    return x;
  }

  enum vctrs_type x_type = vec_typeof(x);
  enum vctrs_type to_type = vec_typeof(to);

  if (x_type == VCTRS_TYPE_unspecified) {
    return vec_init(to, vec_size(x));
  }

  if (x_type == VCTRS_TYPE_scalar) {
    stop_scalar_type(x, p_x_arg, call);
  }
  if (to_type == VCTRS_TYPE_scalar) {
    stop_scalar_type(to, p_to_arg, call);
  }

  r_obj* out = r_null;
  bool lossy = false;

  if (to_type == VCTRS_TYPE_s3 || x_type == VCTRS_TYPE_s3) {
    out = KEEP(vec_cast_dispatch_native(opts, x_type, to_type, &lossy));
  } else {
    out = KEEP(vec_cast_switch_native(opts, x_type, to_type, &lossy));
  }

  if (lossy || out == r_null) {
    // This broadcasts dimensions too
    FREE(1);
    return vec_cast_dispatch_s3(opts);
  }

  if (has_dim(x) || has_dim(to)) {
    r_obj* x_dim = KEEP(r_dim(x));
    r_obj* x_dim_names = KEEP(r_dim_names(x));

    r_obj* out_dim = KEEP(r_dim(out));
    r_obj* out_dim_names = KEEP(r_dim_names(out));

    // Ensure `out` has the shape of `x`.
    // Native casting doesn't propagate shape.
    if (!obj_equal(out_dim, x_dim) || !obj_equal(out_dim_names, x_dim_names)) {
      out = KEEP(r_clone_referenced(out));
      r_attrib_poke_dim(out, x_dim);
      r_attrib_poke_dim_names(out, x_dim_names);
      FREE(1);
    }
    KEEP(out);

    // Broadcast `out` to the shape of `to`
    out = vec_shape_broadcast(out, to, p_x_arg, p_to_arg, call);

    FREE(5);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:20

vec_cast_params typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp
timing: 0.066 s
source
r_obj* vec_cast_params(r_obj* x,
                       r_obj* to,
                       struct vctrs_arg* p_x_arg,
                       struct vctrs_arg* p_to_arg,
                       struct r_lazy call,
                       enum s3_fallback s3_fallback) {
  const struct cast_opts opts = {
    .x = x,
    .to = to,
    .p_x_arg = p_x_arg,
    .p_to_arg = p_to_arg,
    .call = call,
    .s3_fallback = s3_fallback
  };
  return vec_cast_opts(&opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.h:41

vec_cast_switch_native typed

[*struct cast_opts, c(0..10) | c(255), c(0..10) | c(255), *c_bool] -> any_sexp
timing: 11.51 s
source
r_obj* vec_cast_switch_native(const struct cast_opts* opts,
                              enum vctrs_type x_type,
                              enum vctrs_type to_type,
                              bool* lossy) {
  r_obj* x = opts->x;

  int dir = 0;
  enum vctrs_type2 type2 = vec_typeof2_impl(x_type, to_type, &dir);

  switch (type2) {

  case VCTRS_TYPE2_logical_logical:
  case VCTRS_TYPE2_integer_integer:
  case VCTRS_TYPE2_double_double:
  case VCTRS_TYPE2_complex_complex:
  case VCTRS_TYPE2_raw_raw:
  case VCTRS_TYPE2_character_character:
  case VCTRS_TYPE2_list_list:
    return x;

  case VCTRS_TYPE2_logical_integer:
    if (dir == 0) {
      return lgl_as_integer(x, lossy);
    } else {
      return int_as_logical(x, lossy);
    }

  case VCTRS_TYPE2_logical_double:
    if (dir == 0) {
      return lgl_as_double(x, lossy);
    } else {
      return dbl_as_logical(x, lossy);
    }

  case VCTRS_TYPE2_integer_double:
    if (dir == 0) {
      return int_as_double(x, lossy);
    } else {
      return dbl_as_integer(x, lossy);
    }

  case VCTRS_TYPE2_dataframe_dataframe:
    return df_cast_opts(opts);

  default:
    break;
  }

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:95

vec_check_recyclable typed

[null, c_int_na, c_bool, c_null, struct r_lazy] | [<> | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] -> c_int_na
timing: 0.070 s
source
r_ssize vec_check_recyclable(
  r_obj* x,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  const r_ssize x_size = vec_size_params(x, p_x_arg, call);

  if (x_size == size || x_size == 1) {
    return x_size;
  }

  // It is up to the caller to be prepared to handle this!
  if (allow_null_as_bool(allow_null) && x == r_null) {
    return 0;
  }

  stop_recycle_incompatible_size(x_size, size, p_x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:193

vec_check_size typed

[<> | null | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] -> ()
timing: 0.057 s
source
void vec_check_size(
  r_obj* x,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  if (!vec_is_size(x, size, allow_null, p_x_arg, call)) {
    const r_ssize x_size = vec_size_params(x, p_x_arg, call);
    stop_assert_size(x_size, size, p_x_arg, call);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:91

vec_chop typed

([any_sexp, <...> | p(CHR) | sym, <...> | p(CHR) | sym] -> empty)&([<> | null | p(CHR) | sym, list, null] | [<> | null | p(CHR) | sym, null, any_sexp] -> any_sexp)
timing: 0.247 s
source
r_obj* vec_chop(r_obj* x, r_obj* indices, r_obj* sizes) {
  const r_ssize n = vec_size(x);
  r_obj* names = KEEP(vec_names(x));

  if (indices != r_null && sizes != r_null) {
    r_abort_lazy_call(r_lazy_null, "Can't supply both `indices` and `sizes`.");
  }

  if (indices != r_null) {
    const bool allow_compact = false;
    indices = list_as_locations(indices, n, names, allow_compact);
  }
  KEEP(indices);

  if (sizes != r_null) {
    sizes = vec_as_chop_sizes(sizes, n);
  }
  KEEP(sizes);

  r_obj* out = vec_chop_unsafe(x, indices, sizes);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:171

vec_chop_unsafe typed

[<> | null | p(CHR) | sym, any_sexp, any_sexp] -> any_sexp
timing: 0.161 s
source
r_obj* vec_chop_unsafe(r_obj* x, r_obj* indices, r_obj* sizes) {
  struct vctrs_proxy_info info = vec_proxy_info(x);
  KEEP(info.inner);

  struct vctrs_chop_indices* p_indices = new_chop_indices(x, indices, sizes);
  KEEP(p_indices->shelter);

  r_obj* out = vec_chop_base(x, info, p_indices);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:197

vec_clone_referenced typed

∀'a. ([any_sexp & 'a, c_false] -> 'a)&([any_sexp & 'a, c(2)] | [any_sexp & 'a, c_true] -> any_sexp & 'a)
timing: 0.093 s
source
static inline SEXP vec_clone_referenced(SEXP x, const enum vctrs_ownership ownership) {
  switch (ownership) {
  case VCTRS_OWNERSHIP_foreign: return r_clone_referenced(x);
  case VCTRS_OWNERSHIP_shallow: return x;
  case VCTRS_OWNERSHIP_deep: return x;
  default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ownership.h:16

vec_compute_n_bytes_lazy_counts typed

([any_sexp, c(2..3)] -> c(4))&([any_sexp, c(4..5)] -> c(8))&([any_sexp, c(6)] -> c_false)&([any_sexp, c(9)] -> c_int_na)&([any_sexp, c_bool | c(7..8) | c(10) | c(255)] -> empty)
timing: 0.166 s
source
size_t vec_compute_n_bytes_lazy_counts(
  SEXP x,
  const enum vctrs_type type
) {
  switch (type) {
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_logical:
    return INT_MAX_RADIX_PASS;
  case VCTRS_TYPE_double:
  case VCTRS_TYPE_complex:
    return DBL_MAX_RADIX_PASS;
  case VCTRS_TYPE_character:
    return 0;
  case VCTRS_TYPE_dataframe:
    return df_compute_n_bytes_lazy_counts(x);
  default:
    Rf_errorcall(R_NilValue, "This type is not supported by `vec_order()`.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3496

vec_compute_n_bytes_lazy_raw typed

([any_sexp, c(9)] -> c_int_na)&([any_sexp, c_bool | c(7..8) | c(10) | c(255)] -> empty)&([any_sexp, c(2..3)] | [any_sexp, c(4)] | [any_sexp, c(5)] -> c_int)
timing: 0.256 s
source
size_t vec_compute_n_bytes_lazy_raw(
  SEXP x,
  const enum vctrs_type type
) {
  switch (type) {
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_logical:
    return sizeof(int);
  case VCTRS_TYPE_double:
    return sizeof(double);
  case VCTRS_TYPE_complex:
    // Complex types will be split into two double vectors
    return sizeof(double);
  case VCTRS_TYPE_character:
    // Both `SEXP` and `const char*` are written to the working memory.
    // Should be the same size (8 bytes), both are pointers, but be defensive.
    return sizeof(SEXP) > sizeof(const char*) ? sizeof(SEXP) : sizeof(const char*);
  case VCTRS_TYPE_dataframe:
    return df_compute_n_bytes_lazy_raw(x);
  default:
    Rf_errorcall(R_NilValue, "This type is not supported by `vec_order()`.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3438

vec_detect_complete_switch typed

[any_sexp, c_int_na, *c_int_na] -> ()
timing: 0.207 s
source
void vec_detect_complete_switch(SEXP x, R_len_t size, int* p_out) {
  switch (vec_proxy_typeof(x)) {
  case VCTRS_TYPE_logical: lgl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_integer: int_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_double: dbl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_complex: cpl_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_character: chr_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_raw: raw_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_list: list_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_dataframe: df_detect_complete(x, size, p_out); break;
  case VCTRS_TYPE_null: break;
  case VCTRS_TYPE_scalar: stop_scalar_type(x, vec_args.empty, r_lazy_null);
  default: stop_unimplemented_vctrs_type("vec_detect_complete", vec_proxy_typeof(x));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:81

VEC_DETECT_RUN_BOUNDS_BOOL typed any: arg 1, arg 2, arg 3

tuple3 --> any
timing: 0.000 s
(definition not located in src/)

vec_df_restore typed

([any_sexp, LGL<> | null, *struct vec_restore_opts] -> empty)&([any_sexp, any_sexp, *struct vec_restore_opts] \ [any_sexp, LGL<> | null, *struct vec_restore_opts] -> any_sexp)
timing: 0.051 s
source
r_obj* vec_df_restore(r_obj* x,
                      r_obj* to,
                      const struct vec_restore_opts* p_opts) {
  r_obj* out = KEEP(vec_bare_df_restore(x, to, p_opts));
  out = vec_restore_dispatch(out, to);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:183

vec_fill_missing_down typed

[*(c_int_na \ c_false), c_int_na, c_false, *c_int_na] | [*(c_int_na \ c_false), c_int_na, c_int_na \ c_false, *c_int_na] | [*c_false, c_int_na, c_false, *c_int_na] | [*c_false, c_int_na, c_int_na \ c_false, *c_int_na] -> ()
timing: 7.75 s
source
void vec_fill_missing_down(const int* p_na, r_ssize size, bool leading, int* p_loc) {
  r_ssize loc = 0;

  if (leading) {
    // Increment `loc` to the first non-missing value
    for (r_ssize i = 0; i < size; ++i) {
      if (!p_na[i]) {
        loc = i;
        break;
      }
    }

    // Back-fill with first non-missing value
    for (r_ssize i = loc - 1; i >= 0; --i) {
      p_loc[i] = loc + 1;
    }
  }

  for (r_ssize i = loc; i < size; ++i) {
    if (!p_na[i]) {
      loc = i;
    }

    p_loc[i] = loc + 1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:58

vec_group_loc_loop typed

([*struct dictionary, c_int_na, *c_int_na] -> ())&([c_null, c_int_na, *c_int_na] -> empty)
timing: 1.80 s
source
void vec_group_loc_loop(struct dictionary* d, R_len_t n, int* p_groups) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_GROUP_LOC_LOOP(nil_dict_hash_scalar); break;
  case VCTRS_TYPE_logical: VEC_GROUP_LOC_LOOP(lgl_dict_hash_scalar); break;
  case VCTRS_TYPE_integer: VEC_GROUP_LOC_LOOP(int_dict_hash_scalar); break;
  case VCTRS_TYPE_double: VEC_GROUP_LOC_LOOP(dbl_dict_hash_scalar); break;
  case VCTRS_TYPE_complex: VEC_GROUP_LOC_LOOP(cpl_dict_hash_scalar); break;
  case VCTRS_TYPE_character: VEC_GROUP_LOC_LOOP(chr_dict_hash_scalar); break;
  case VCTRS_TYPE_raw: VEC_GROUP_LOC_LOOP(raw_dict_hash_scalar); break;
  case VCTRS_TYPE_list: VEC_GROUP_LOC_LOOP(list_dict_hash_scalar); break;
  case VCTRS_TYPE_dataframe: VEC_GROUP_LOC_LOOP(df_dict_hash_scalar); break;
  default: stop_unimplemented_vctrs_type("vec_group_loc_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:297

vec_implements_base_c typed

([<...>] -> c_bool)&([<> | null | p(CHR) | sym] -> c_false)
timing: 0.058 s
source
bool vec_implements_base_c(r_obj* x) {
  if (!r_is_object(x)) {
    return false;
  }

  if (r_is_s4(x)) {
    return s4_find_method(x, s4_c_method_table) != r_null;
  } else {
    return s3_find_method("c", x, base_method_table) != r_null;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1567

vec_implements_ptype2 typed

[LGL<> | null] -> c_bool
timing: 0.055 s
source
bool vec_implements_ptype2(SEXP x) {
  switch (vec_typeof(x)) {
  case VCTRS_TYPE_scalar:
    return false;
  case VCTRS_TYPE_s3: {
    SEXP method_sym = R_NilValue;
    SEXP method = s3_find_method_xy("vec_ptype2", x, x, vctrs_method_table, &method_sym);

    if (method != R_NilValue) {
      return true;
    }

    method = s3_find_method2("vec_ptype2", x, vctrs_method_table, &method_sym);
    return method != R_NilValue;
  }
  default:
    return true;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:623

vec_in_loop typed

([*c_int_na, *struct dictionary, *struct dictionary, c_int_na] -> ())&([*c_int_na, c_null, *struct dictionary, c_int_na] -> empty)
timing: 1.91 s
source
void vec_in_loop(
  int* p_out,
  struct dictionary* d,
  struct dictionary* d_needles,
  R_len_t n_needle
) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_IN_LOOP(nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VEC_IN_LOOP(lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VEC_IN_LOOP(int_dict_hash_with); break;
  case VCTRS_TYPE_double: VEC_IN_LOOP(dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VEC_IN_LOOP(cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VEC_IN_LOOP(chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VEC_IN_LOOP(raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VEC_IN_LOOP(list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VEC_IN_LOOP(df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vec_in_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:651

vec_in_loop_propagate typed

([*c_int_na, *struct dictionary, *struct dictionary, c_int_na] -> ())&([*c_int_na, c_null, *struct dictionary, c_int_na] -> empty)
timing: 1.78 s
source
void vec_in_loop_propagate(
  int* p_out,
  struct dictionary* d,
  struct dictionary* d_needles,
  R_len_t n_needle
) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_IN_LOOP_PROPAGATE(nil_dict_hash_with, nil_dict_is_incomplete); break;
  case VCTRS_TYPE_logical: VEC_IN_LOOP_PROPAGATE(lgl_dict_hash_with, lgl_dict_is_incomplete); break;
  case VCTRS_TYPE_integer: VEC_IN_LOOP_PROPAGATE(int_dict_hash_with, int_dict_is_incomplete); break;
  case VCTRS_TYPE_double: VEC_IN_LOOP_PROPAGATE(dbl_dict_hash_with, dbl_dict_is_incomplete); break;
  case VCTRS_TYPE_complex: VEC_IN_LOOP_PROPAGATE(cpl_dict_hash_with, cpl_dict_is_incomplete); break;
  case VCTRS_TYPE_character: VEC_IN_LOOP_PROPAGATE(chr_dict_hash_with, chr_dict_is_incomplete); break;
  case VCTRS_TYPE_raw: VEC_IN_LOOP_PROPAGATE(raw_dict_hash_with, raw_dict_is_incomplete); break;
  case VCTRS_TYPE_list: VEC_IN_LOOP_PROPAGATE(list_dict_hash_with, list_dict_is_incomplete); break;
  case VCTRS_TYPE_dataframe: VEC_IN_LOOP_PROPAGATE(df_dict_hash_with, df_dict_is_incomplete); break;
  default: stop_unimplemented_vctrs_type("vec_in_loop_propagate", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:687

vec_is_coercible_cb typed

[c_ptr] -> ()
timing: 0.148 s
source
void vec_is_coercible_cb(void* data_) {
  struct is_coercible_data* data = (struct is_coercible_data*) data_;
  int _;
  data->out = vec_ptype2(
    data->x,
    data->y,
    data->p_x_arg,
    data->p_y_arg,
    data->call,
    data->s3_fallback,
    &_
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:276

vec_is_coercible_e typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, *any] -> ()
timing: 0.094 s
source
void vec_is_coercible_e(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback,
  ERR* err
) {
  struct is_coercible_data data = {
    .x = x,
    .y = y,
    .p_x_arg = p_x_arg,
    .p_y_arg = p_y_arg,
    .call = call,
    .s3_fallback = s3_fallback,
    .out = r_null
  };

  *err = r_try_catch(&vec_is_coercible_cb,
                     &data,
                     syms_vctrs_error_incompatible_type,
                     NULL,
                     NULL);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:291

vec_is_common_class_fallback typed

[any_sexp] -> c_bool
timing: 0.009 s
source
bool vec_is_common_class_fallback(r_obj* ptype) {
  return r_inherits(ptype, c_strs_vctrs_common_class_fallback);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype-common.h:10

vec_is_recyclable typed

[null, c_int_na, c_bool, c_null, struct r_lazy] | [<> | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] -> c_bool
timing: 0.085 s
source
bool vec_is_recyclable(
  r_obj* x,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  const r_ssize x_size = vec_size_params(x, p_x_arg, call);

  if (x_size == size || x_size == 1) {
    return true;
  }

  if (allow_null_as_bool(allow_null) && x == r_null) {
    return true;
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:172

vec_is_restored_cb typed

[any_sexp, any_sexp, c_ptr] -> c_null | null
timing: 0.017 s
source
static r_obj* vec_is_restored_cb(r_obj* tag, r_obj* _value, void* _data) {
  if (tag == r_syms.names) {
    // Keep iterating
    return NULL;
  } else {
    // Restored!
    return R_NilValue;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:407

vec_is_size typed

[null, c_int_na, c_bool, c_null, struct r_lazy] | [<> | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] -> c_bool
timing: 0.048 s
source
bool vec_is_size(
  r_obj* x,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  const r_ssize x_size = vec_size_params(x, p_x_arg, call);

  if (x_size == size) {
    return true;
  }

  if (allow_null_as_bool(allow_null) && x == r_null) {
    return true;
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.h:70

vec_is_unspecified typed

([null] -> c_false)&([<...>] | [LGL<> | null] -> c_bool)
timing: 0.079 s
source
bool vec_is_unspecified(SEXP x) {
  if (r_typeof(x) != R_TYPE_logical) {
    // Both `<vctrs_unspecified>` and `<vector-of-NA>` must be logical
    return false;
  }

  if (has_dim(x)) {
    // Disallow arrays from being unspecified
    return false;
  }

  // If it is classed, that class must be `<vctrs_unspecified>`, otherwise check
  // for all `NA`s. Notably, core attributes like `names` and extraneous
  // attributes are allowed on `x`, and it is still considered unspecified.
  if (r_is_object(x)) {
    return r_inherits(x, "vctrs_unspecified");
  } else {
    return lgl_is_unspecified(x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:41

vec_joint_proxy_order_s3 typed empty return

[<> | null | p(CHR) | sym, <> | null | p(CHR) | sym] -> empty
timing: 0.052 s
source
r_obj* vec_joint_proxy_order_s3(r_obj* x, r_obj* y) {
  const enum vctrs_class_type type = class_type(x);

  if (type != class_type(y)) {
    r_stop_internal("`x` and `y` should have the same class type.");
  }

  switch (type) {
  case VCTRS_CLASS_bare_factor:
  case VCTRS_CLASS_bare_ordered:
  case VCTRS_CLASS_bare_date:
  case VCTRS_CLASS_bare_posixct:
  case VCTRS_CLASS_bare_posixlt: {
    return vec_joint_proxy_order_independent(x, y);
  }
  case VCTRS_CLASS_bare_asis:
  case VCTRS_CLASS_list:
  case VCTRS_CLASS_unknown: {
    return vec_joint_proxy_order_dependent(x, y);
  }
  case VCTRS_CLASS_bare_tibble:
  case VCTRS_CLASS_data_frame: {
    return df_joint_proxy_order(x, y);
  }
  case VCTRS_CLASS_bare_data_frame: {
    r_stop_internal("Bare data frames should have been handled earlier.");
  }
  case VCTRS_CLASS_none: {
    r_stop_internal("Unclassed objects should have been handled earlier.");
  }
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:319

vec_locate_run_bounds typed

[any_sexp, c_false, struct r_lazy] | [any_sexp, c_true, struct r_lazy] -> INT
timing: 0.932 s
source
r_obj* vec_locate_run_bounds(r_obj* x, enum vctrs_run_bound which, struct r_lazy error_call) {
  struct r_vector_bool* p_where = vec_detect_run_bounds_bool(x, which, error_call);
  KEEP(p_where->shelter);
  const bool* v_where = r_vector_bool_cbegin(p_where);

  const r_ssize size = r_vector_bool_length(p_where);

  r_ssize n = 0;
  for (r_ssize i = 0; i < size; ++i) {
    n += v_where[i];
  }

  r_obj* out = KEEP(r_alloc_integer(n));
  int* v_out = r_int_begin(out);
  r_ssize j = compute_iter_loc(n, which);

  r_ssize loc = compute_iter_loc(size, which);
  const r_ssize step = compute_iter_step(which);

  // First/last value are always the final bound locations
  // (depending on `which`), so `j` won't ever write to OOB locations
  for (r_ssize i = 0; i < size; ++i) {
    v_out[j] = loc + 1;
    j += step * v_where[loc];
    loc += step;
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:47

vec_match typed

[any_sexp, any_sexp] -> any_sexp
timing: 0.013 s
source
SEXP vec_match(SEXP needles, SEXP haystack) {
  return vec_match_params(needles, haystack, true, NULL, NULL, r_lazy_null);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vctrs.h:91

vec_match_loop typed

([*c_int_na, *struct dictionary, *struct dictionary, c_int_na] -> ())&([*c_int_na, c_null, *struct dictionary, c_int_na] -> empty)
timing: 1.99 s
source
void vec_match_loop(
  int* p_out,
  struct dictionary* d,
  struct dictionary* d_needles,
  R_len_t n_needle
) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_MATCH_LOOP(nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VEC_MATCH_LOOP(lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VEC_MATCH_LOOP(int_dict_hash_with); break;
  case VCTRS_TYPE_double: VEC_MATCH_LOOP(dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VEC_MATCH_LOOP(cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VEC_MATCH_LOOP(chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VEC_MATCH_LOOP(raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VEC_MATCH_LOOP(list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VEC_MATCH_LOOP(df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vec_match_loop", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:481

VEC_MATCH_LOOP typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

vec_match_loop_propagate typed

([*c_int_na, *struct dictionary, *struct dictionary, c_int_na] -> ())&([*c_int_na, c_null, *struct dictionary, c_int_na] -> empty)
timing: 2.03 s
source
void vec_match_loop_propagate(
  int* p_out,
  struct dictionary* d,
  struct dictionary* d_needles,
  R_len_t n_needle
) {
  switch (d->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_MATCH_LOOP_PROPAGATE(nil_dict_hash_with, nil_dict_is_incomplete); break;
  case VCTRS_TYPE_logical: VEC_MATCH_LOOP_PROPAGATE(lgl_dict_hash_with, lgl_dict_is_incomplete); break;
  case VCTRS_TYPE_integer: VEC_MATCH_LOOP_PROPAGATE(int_dict_hash_with, int_dict_is_incomplete); break;
  case VCTRS_TYPE_double: VEC_MATCH_LOOP_PROPAGATE(dbl_dict_hash_with, dbl_dict_is_incomplete); break;
  case VCTRS_TYPE_complex: VEC_MATCH_LOOP_PROPAGATE(cpl_dict_hash_with, cpl_dict_is_incomplete); break;
  case VCTRS_TYPE_character: VEC_MATCH_LOOP_PROPAGATE(chr_dict_hash_with, chr_dict_is_incomplete); break;
  case VCTRS_TYPE_raw: VEC_MATCH_LOOP_PROPAGATE(raw_dict_hash_with, raw_dict_is_incomplete); break;
  case VCTRS_TYPE_list: VEC_MATCH_LOOP_PROPAGATE(list_dict_hash_with, list_dict_is_incomplete); break;
  case VCTRS_TYPE_dataframe: VEC_MATCH_LOOP_PROPAGATE(df_dict_hash_with, df_dict_is_incomplete); break;
  default: stop_unimplemented_vctrs_type("vec_match_loop_propagate", d->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:524

VEC_MATCH_LOOP_PROPAGATE typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vec_names typed entry .Call fuzz ok

[any_sexp] -> any_sexp
timing: 0.006 s
fuzzing as vctrs_names: 5 inside (5 ok) · 6 outside (6 rejected)
type drawn from: (x1: any_sexp) -> any_sexp
source
r_obj* vec_names(r_obj* x) {
  return vec_names_impl(x, false);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:171

vec_order_base_switch typed

([DBL, c_false, c_false, c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_false, c_int_na \ c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_int_na \ c_false, c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_false, c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(4), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(2), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(3), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(6), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ())&([any_sexp, c_false, c_false, c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_false, c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(5), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> empty)
timing: 7.34 s
source
void vec_order_base_switch(
  SEXP x,
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  const enum vctrs_type type,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  switch (type) {
  case VCTRS_TYPE_integer: {
    int_order(
      x,
      decreasing,
      na_last,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_logical: {
    lgl_order(
      x,
      decreasing,
      na_last,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_double: {
    dbl_order(
      x,
      decreasing,
      na_last,
      nan_distinct,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_complex: {
    cpl_order(
      x,
      decreasing,
      na_last,
      nan_distinct,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_character: {
    chr_order(
      x,
      decreasing,
      na_last,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_dataframe: {
    Rf_errorcall(R_NilValue, "Internal error: Data frames should have been handled by now");
  }
  default: {
    Rf_errorcall(R_NilValue, "This type is not supported by `vec_order()`.");
  }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:501

vec_order_chunk_switch typed

([c_false, c_false, c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_false, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ())&([c_false, c_false, c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_false, c_int_na \ c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_false, c_int_na \ c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_int_na \ c_false, c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_false, c_int_na \ c_false, c_int_na \ c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_false, c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_false, c_int_na \ c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(2), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(3), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(4), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(5), *c_int_na, c_null, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c(9), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [c_int_na \ c_false, c_int_na \ c_false, c_int_na \ c_false, c_true, c(6), *c_int_na, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] -> empty)
timing: 12.05 s
source
void vec_order_chunk_switch(
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  const enum vctrs_type type,
  int* p_o,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  switch (type) {
  case VCTRS_TYPE_integer: {
    int_order_chunk(
      decreasing,
      na_last,
      size,
      p_o,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_logical: {
    lgl_order_chunk(
      decreasing,
      na_last,
      size,
      p_o,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_double: {
    dbl_order_chunk(
      decreasing,
      na_last,
      nan_distinct,
      size,
      p_o,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_complex: {
    // Complex types are run in two passes, once over real then over imaginary
    dbl_order_chunk(
      decreasing,
      na_last,
      nan_distinct,
      size,
      p_o,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_character: {
    chr_order_chunk(
      decreasing,
      na_last,
      size,
      p_o,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    break;
  }
  case VCTRS_TYPE_dataframe: {
    Rf_errorcall(R_NilValue, "Internal error: df-cols should have already been flattened.");
    break;
  }
  default: {
    Rf_errorcall(R_NilValue, "This type is not supported by `vec_order()`");
  }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3320

vec_order_compute_na_last typed

([LGL, LGL] -> LGL)&([LGL1, LGL] -> LGL1)
timing: 5.10 s
source
SEXP vec_order_compute_na_last(
  SEXP na_largest,
  SEXP decreasing
) {
  const r_ssize size = r_length(na_largest);
  if (size != r_length(decreasing)) {
    r_stop_internal(
      "`na_largest` and `decreasing` should already match in size."
    );
  }

  SEXP na_last = PROTECT(r_new_logical(size));
  int* p_na_last = LOGICAL(na_last);

  const int* p_na_largest = LOGICAL_RO(na_largest);
  const int* p_decreasing = LOGICAL_RO(decreasing);

  for (r_ssize i = 0; i < size; ++i) {
    p_na_last[i] = p_decreasing[i] ? !p_na_largest[i] : p_na_largest[i];
  }

  UNPROTECT(1);
  return na_last;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3760

vec_order_expand_args typed

([<> | null | p(CHR) | sym, LGL, LGL] -> list)&([any_sexp, LGL, ((CHR | CLX | DBL | INT | RAW) | (~vec)<...>) | null | p(CHR) | sym] | [any_sexp, ((CHR | CLX | DBL | INT | RAW) | (~vec)<...>) | null | p(CHR) | sym, any_sexp] -> empty)
timing: 0.601 s
source
SEXP vec_order_expand_args(
  SEXP x,
  SEXP decreasing,
  SEXP na_largest
) {
  SEXP args = PROTECT(r_new_list(2));
  SET_VECTOR_ELT(args, 0, decreasing);
  SET_VECTOR_ELT(args, 1, na_largest);

  // Don't check length here. These might be vectorized if `x` is a data frame.
  if (TYPEOF(decreasing) != LGLSXP) {
    Rf_errorcall(R_NilValue, "Internal error: `decreasing` must be logical");
  }
  if (lgl_any_na(decreasing)) {
    Rf_errorcall(R_NilValue, "Internal error: `decreasing` can't contain missing values.");
  }

  if (TYPEOF(na_largest) != LGLSXP) {
    Rf_errorcall(R_NilValue, "Internal error: `na_largest` must be logical");
  }
  if (lgl_any_na(na_largest)) {
    Rf_errorcall(R_NilValue, "Internal error: `na_largest` can't contain missing values.");
  }

  if (is_data_frame(x)) {
    args = df_expand_args(x, args);
    UNPROTECT(1);
    return args;
  }

  if (r_length(decreasing) != 1) {
    Rf_errorcall(R_NilValue, "`direction` must be a single value when `x` is not a data frame.");
  }

  if (r_length(na_largest) != 1) {
    Rf_errorcall(R_NilValue, "`na_value` must be a single value when `x` is not a data frame.");
  }

  UNPROTECT(1);
  return args;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3562

vec_order_info typed

[any_sexp, any_sexp, any_sexp, c_false, any_sexp] | [any_sexp, any_sexp, any_sexp, c_int_na \ c_false, any_sexp] -> any_sexp
timing: 0.019 s
source
SEXP vec_order_info(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  bool nan_distinct,
  SEXP chr_proxy_collate
) {
  const bool group_sizes = true;
  return vec_order_info_impl(x, direction, na_value, nan_distinct, chr_proxy_collate, group_sizes);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:282

vec_order_switch typed

([any_sexp, LGL, LGL, c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, LGL, LGL, c_false, c_int_na, c_bool | c(7..8) | c(5) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, LGL, LGL, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, LGL, LGL, c_int_na \ c_false, c_int_na, c_bool | c(7..8) | c(5) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, c_null] | [any_sexp, null, any_sexp, c_false, c_int_na, c(0..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, null, any_sexp, c_int_na \ c_false, c_int_na, c(0..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, any_sexp, null, c_false, c_int_na, c(0..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, any_sexp, null, c_int_na \ c_false, c_int_na, c(0..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> empty)&([DBL, LGL, LGL, c_false, c_int_na, c(0..4) | c(6..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [DBL, LGL, LGL, c_int_na \ c_false, c_int_na, c(0..4) | c(6..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, LGL, LGL, c_false, c_int_na, c(0..3) | c(6..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, LGL, LGL, c_int_na \ c_false, c_int_na, c(0..3) | c(6..8) | c(10) | c(255), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, any_sexp, any_sexp, c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] | [any_sexp, any_sexp, any_sexp, c_int_na \ c_false, c_int_na, c(9), *struct order, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct lazy_raw, *struct group_infos] -> ())
timing: 17.32 s
source
void vec_order_switch(
  SEXP x,
  SEXP decreasing,
  SEXP na_last,
  bool nan_distinct,
  r_ssize size,
  const enum vctrs_type type,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  if (type == VCTRS_TYPE_dataframe) {
    df_order(
      x,
      decreasing,
      na_last,
      nan_distinct,
      size,
      p_order,
      p_lazy_x_chunk,
      p_lazy_x_aux,
      p_lazy_o_aux,
      p_lazy_bytes,
      p_lazy_counts,
      p_group_infos
    );

    return;
  }

  if (r_length(decreasing) != 1) {
    Rf_errorcall(
      R_NilValue,
      "Internal error: Size of decreasing != 1, but "
      "`vec_order_expand_args()` didn't catch it."
    );
  }

  if (r_length(na_last) != 1) {
    Rf_errorcall(
      R_NilValue,
      "Internal error: Size of na_last != 1, but "
      "`vec_order_expand_args()` didn't catch it."
    );
  }

  bool c_decreasing = LOGICAL(decreasing)[0];
  bool c_na_last = LOGICAL(na_last)[0];

  vec_order_base_switch(
    x,
    c_decreasing,
    c_na_last,
    nan_distinct,
    size,
    type,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:427

vec_pall typed

[any_sexp, c(0..2), c_int_na, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.013 s
source
r_obj* vec_pall(
  r_obj* xs,
  enum vec_parallel_missing missing,
  r_ssize size,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  return vec_parallel(xs, missing, size, p_xs_arg, error_call, VEC_PARALLEL_VARIANT_all);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:46

vec_pall_fill typed

[*(c_int_na \ c_false), c(2), c_int_na, *c_int_na] | [*c_int_na, c(2), c_int_na, *c_false] | [*c_int_na, c_false, c_int_na, c_null] | [*c_int_na, c_true, c_int_na, *c_false] | [*c_true, c_true, c_int_na, *c_int_na] | [c_null, c_false, c_int_na, *c_int_na] -> ()
timing: 0.181 s
source
void vec_pall_fill(const int* v_x, enum vec_parallel_missing missing, r_ssize size, int* v_out) {
  switch (missing) {
    case VEC_PARALLEL_MISSING_na: vec_pall_fill_missing_as_na(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_false: vec_pall_fill_missing_as_false(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_true: vec_pall_fill_missing_as_true(v_x, size, v_out); break;
    default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:160

vec_pall_fill_missing_as_false typed

[*c_int_na, c_int_na, *c_false] | [*c_true, c_int_na, *(c_int_na \ c_false)] -> ()
timing: 0.235 s
source
void vec_pall_fill_missing_as_false(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];
    v_out[i] = elt_out && (elt_x == 1);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:274

vec_pall_fill_missing_as_na typed

[*c_int_na, c_int_na, c_null] | [c_null, c_int_na, *(c_int_na \ c_false)] | [c_null, c_int_na, *c_false] -> ()
timing: 0.405 s
source
void vec_pall_fill_missing_as_na(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];

    const bool any_false = !elt_out || !elt_x;
    const bool equal = elt_out == elt_x;
    v_out[i] = !any_false * (equal * elt_out + !equal * r_globals.na_lgl);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:225

vec_pall_fill_missing_as_true typed

[*(c_int_na \ c_false), c_int_na, *(c_int_na \ c_false)] | [*c_int_na, c_int_na, *c_false] -> ()
timing: 0.166 s
source
void vec_pall_fill_missing_as_true(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];
    v_out[i] = elt_out && elt_x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:320

vec_pany typed

[any_sexp, c(0..2), c_int_na, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.013 s
source
r_obj* vec_pany(
  r_obj* xs,
  enum vec_parallel_missing missing,
  r_ssize size,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  return vec_parallel(xs, missing, size, p_xs_arg, error_call, VEC_PARALLEL_VARIANT_any);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:36

vec_pany_fill typed

[*(c_int_na \ c_true), c_true, c_int_na, *c_int_na] | [*c_false, c(2), c_int_na, *c_int_na] | [*c_int_na, c(2), c_int_na, *(c_int_na \ c_false)] | [*c_int_na, c_false, c_int_na, c_null] | [*c_int_na, c_true, c_int_na, *(c_int_na \ c_false)] | [c_null, c_false, c_int_na, *c_int_na] -> ()
timing: 0.179 s
source
void vec_pany_fill(const int* v_x, enum vec_parallel_missing missing, r_ssize size, int* v_out) {
  switch (missing) {
    case VEC_PARALLEL_MISSING_na: vec_pany_fill_missing_as_na(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_false: vec_pany_fill_missing_as_false(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_true: vec_pany_fill_missing_as_true(v_x, size, v_out); break;
    default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:150

vec_pany_fill_missing_as_false typed

[*(c_int_na \ c_true), c_int_na, *c_false] | [*c_int_na, c_int_na, *(c_int_na \ c_false)] -> ()
timing: 0.165 s
source
void vec_pany_fill_missing_as_false(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];
    v_out[i] = elt_out || (elt_x == 1);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:251

vec_pany_fill_missing_as_na typed

[*c_int_na, c_int_na, c_null] | [c_null, c_int_na, *(c_int_na \ c_true)] | [c_null, c_int_na, *c_true] -> ()
timing: 0.298 s
source
void vec_pany_fill_missing_as_na(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];

    const bool any_true = (elt_out == 1) || (elt_x == 1);
    const bool equal = elt_out == elt_x;
    v_out[i] = any_true + !any_true * (equal * elt_out + !equal * r_globals.na_lgl);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:200

vec_pany_fill_missing_as_true typed

[*c_false, c_int_na, *c_false] | [*c_int_na, c_int_na, *(c_int_na \ c_false)] -> ()
timing: 0.181 s
source
void vec_pany_fill_missing_as_true(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt_out = v_out[i];
    const int elt_x = v_x[i];
    v_out[i] = elt_out || elt_x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:297

vec_parallel_init typed

([*c_int_na, c_false, c_int_na, c_null] -> empty)&([*c_int_na, c(2), c_int_na, *c_int_na] | [*c_int_na, c_false, c_int_na, *c_int_na] | [*c_int_na, c_true, c_int_na, *c_int_na] -> ())
timing: 0.118 s
source
void vec_parallel_init(const int* v_x, enum vec_parallel_missing missing, r_ssize size, int* v_out) {
  switch (missing) {
    case VEC_PARALLEL_MISSING_na: vec_parallel_init_missing_as_na(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_false: vec_parallel_init_missing_as_false(v_x, size, v_out); break;
    case VEC_PARALLEL_MISSING_true: vec_parallel_init_missing_as_true(v_x, size, v_out); break;
    default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:115

vec_parallel_init_missing_as_false typed

[*c_int_na, c_int_na, *c_int_na] -> ()
timing: 0.072 s
source
void vec_parallel_init_missing_as_false(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    const int elt = v_x[i];
    v_out[i] = (elt != r_globals.na_lgl) * elt;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:132

vec_parallel_init_missing_as_na typed

([*c_int_na, c_int_na, *c_int_na] -> ())&([*c_int_na, c_int_na, c_null] -> empty)
timing: 0.023 s
source
void vec_parallel_init_missing_as_na(const int* v_x, r_ssize size, int* v_out) {
  r_memcpy(v_out, v_x, sizeof(*v_out) * size);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:126

vec_parallel_init_missing_as_true typed

[*c_int_na, c_int_na, *c_int_na] -> ()
timing: 0.041 s
source
void vec_parallel_init_missing_as_true(const int* v_x, r_ssize size, int* v_out) {
  for (r_ssize i = 0; i < size; ++i) {
    v_out[i] = (bool) v_x[i];
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:141

vec_posixct_restore typed empty return

[any_sexp, any_sexp, c(0..2)] -> empty
timing: 0.019 s
source
SEXP vec_posixct_restore(SEXP x, SEXP to, const enum vctrs_ownership ownership) {
  SEXP out = PROTECT(vec_restore_default(x, to, ownership));
  out = datetime_validate(out);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:248

vec_posixlt_restore typed empty return

[any_sexp, any_sexp, c(0..2)] -> empty
timing: 0.017 s
source
SEXP vec_posixlt_restore(SEXP x, SEXP to, const enum vctrs_ownership ownership) {
  SEXP out = PROTECT(vec_restore_default(x, to, ownership));
  out = datetime_validate_tzone(out);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:256

vec_proxy typed entry .Call accepts outside

∀'a. ['a & (LGL<> | null)] -> 'a & (LGL<> | null)
timing: 0.019 s
fuzzing as ffi_vec_proxy: 10 inside (10 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: (x1: 'I9393 & (LGL<> | null)) -> 'I9393 & (LGL<> | null)

Accepted outside the domain x1: 6

parameterchangecallreturned
x1kind:dblffi_vec_proxy(1.5)(^DBL1 \ (..))<> with { }
x1kind:symffi_vec_proxy(as.name("x"))sym
x1retype:lgl>chrffi_vec_proxy(c(NA_character_, ""))(CHR & ~vec1)<> with { }
x1retype:lgl>intffi_vec_proxy(integer(0))(INT & ~vec1)<> with { }
x1retype:lgl>rawffi_vec_proxy(as.raw(c(255)))raw1<> with { }
x1retype:lgl>rawffi_vec_proxy(as.raw(c(0)))raw1<> with { }
source
r_obj* vec_proxy(r_obj* x) {
  return vec_proxy_2(x, false);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:6

vec_proxy_2 typed

∀'a. ([null & 'a, c_int_na] -> null & 'a)&(['a & (LGL<> | null), c_int_na] -> 'a & (LGL<> | null))
timing: 0.042 s
source
r_obj* vec_proxy_2(r_obj* x, bool recurse) {
  switch (vec_typeof(x)) {

  case VCTRS_TYPE_s3: {
    r_obj* x_proxy_method = KEEP(vec_proxy_method(x));
    r_obj* out = KEEP(vec_proxy_invoke(x, x_proxy_method));
    if (recurse && is_data_frame(out)) {
      out = df_proxy_recurse(out);
    }
    FREE(2);
    return out;
  }

  // Avoid `KEEP()` in the most common paths (data frames and unclassed atomics)
  case VCTRS_TYPE_dataframe: {
    return recurse ? df_proxy_recurse(x) : x;
  }
  default:
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:14

vec_proxy_assign_opts typed

∀'a. ([any_sexp & 'a, any_sexp, any_sexp, c_null] -> any_sexp & 'a)&([any_sexp & 'a, any_sexp, <> | null | p(CHR) | sym, *struct vec_proxy_assign_opts] -> any_sexp)
timing: 0.437 s
source
r_obj* vec_proxy_assign_opts(r_obj* proxy,
                             r_obj* index,
                             r_obj* value,
                             const struct vec_proxy_assign_opts* p_opts) {
  int n_protect = 0;

  // Ignore vectors marked as fallback because the caller will apply a fallback
  // method instead. We can't lift this check out of `vec_proxy_assign_opts()`
  // and just apply at the call sites because we recurse through here with data
  // frames and individual columns might need the fallback even if the whole
  // data frame itself doesn't need it.
  if (vec_is_common_class_fallback(proxy)) {
    return proxy;
  }

  // We only allow `ignore_outer_names` on the "outer" call to
  // `vec_proxy_assign_opts()`. After it has been used once, it is set to
  // `false` for any recursive calls back into this function.
  struct vec_proxy_assign_opts opts_copy = *p_opts;
  const bool ignore_outer_names = opts_copy.ignore_outer_names;
  opts_copy.ignore_outer_names = false;

  struct vctrs_proxy_info value_info = vec_proxy_info(value);
  KEEP_N(value_info.inner, &n_protect);

  if (r_typeof(proxy) != r_typeof(value_info.inner)) {
    r_stop_internal("`proxy` of type `%s` incompatible with `value` proxy of type `%s`.",
                    r_type_as_c_string(r_typeof(proxy)),
                    r_type_as_c_string(r_typeof(value_info.inner)));
  }

  // If a fallback is required, the `proxy` is identical to the output container
  // because no proxy method was called
  r_obj* out = r_null;

  if (vec_requires_fallback(value, value_info)) {
    index = KEEP_N(vec_subscript_materialize(index), &n_protect);
    out = KEEP_N(vec_assign_fallback(proxy, index, value, opts_copy.slice_value, opts_copy.index_style), &n_protect);
  } else if (has_dim(proxy)) {
    out = KEEP_N(vec_assign_shaped(proxy, index, value_info.inner, opts_copy.ownership, opts_copy.slice_value, opts_copy.index_style), &n_protect);
  } else {
    out = KEEP_N(vec_assign_switch(proxy, index, value_info.inner, &opts_copy), &n_protect);
  }

  if (!ignore_outer_names && p_opts->assign_names) {
    out = vec_proxy_assign_names(out, index, value_info.inner, opts_copy.ownership, opts_copy.slice_value, opts_copy.index_style);
  }

  FREE(n_protect);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:228

vec_proxy_compare_impl typed

[any_sexp] -> any_sexp
timing: 0.012 s
source
r_obj* vec_proxy_compare_impl(r_obj* x) {
  VEC_PROXY_KIND_IMPL(vec_proxy_compare_method, vec_proxy_compare_invoke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:110

vec_proxy_compare_invoke typed

[any_sexp, any_sexp] -> any
timing: 0.018 s
source
r_obj* vec_proxy_compare_invoke(r_obj* x, r_obj* method) {
  return vec_proxy_invoke_impl(x, method, syms_vec_proxy_compare, &vec_proxy_equal_impl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:193

vec_proxy_compare_method typed

[any_sexp] -> any
timing: 0.041 s
source
r_obj* vec_proxy_compare_method(r_obj* x) {
  return vec_proxy_method_impl(x, "vec_proxy_compare", fns_vec_proxy_compare_array);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:163

vec_proxy_equal_impl typed

[any_sexp] -> any_sexp
timing: 0.013 s
source
r_obj* vec_proxy_equal_impl(r_obj* x) {
  VEC_PROXY_KIND_IMPL(vec_proxy_equal_method, vec_proxy_equal_invoke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:106

vec_proxy_equal_invoke typed

[any_sexp, any_sexp] -> any
timing: 0.014 s
source
r_obj* vec_proxy_equal_invoke(r_obj* x, r_obj* method) {
  return vec_proxy_invoke_impl(x, method, syms_vec_proxy_equal, vec_proxy);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:189

vec_proxy_equal_method typed

[any_sexp] -> any
timing: 0.042 s
source
r_obj* vec_proxy_equal_method(r_obj* x) {
  return vec_proxy_method_impl(x, "vec_proxy_equal", fns_vec_proxy_equal_array);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:159

vec_proxy_info typed

[<> | null | p(CHR) | sym] -> struct vctrs_proxy_info
timing: 0.240 s
source
struct vctrs_proxy_info vec_proxy_info(r_obj* x) {
  struct vctrs_proxy_info info;

  // Avoid `KEEP(x_proxy_method)` if not required! This does help with
  // performance, since this is called in such a tight loop.
  //
  // `vec_proxy_method()` itself may also return `r_null`
  r_obj* x_proxy_method = r_is_object(x) ? vec_proxy_method(x) : r_null;

  if (x_proxy_method == r_null) {
    info.inner = x;
    info.type = vec_base_typeof(x, false);
    info.had_proxy_method = false;
  } else {
    KEEP(x_proxy_method);
    info.inner = KEEP(vec_proxy_invoke(x, x_proxy_method));
    info.type = vec_base_typeof(info.inner, true);
    info.had_proxy_method = true;
    FREE(2);
  }

  return info;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:4

vec_proxy_invoke typed

∀'a. [any_sexp & 'a, null] -> any_sexp & 'a
timing: 0.019 s
source
r_obj* vec_proxy_invoke(r_obj* x, r_obj* method) {
  if (method == r_null) {
    return x;
  } else {
    return vctrs_dispatch1(syms_vec_proxy, method,
                           syms_x, x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:128

vec_proxy_invoke_impl typed

∀'a. ([null & 'a, null, any_sexp, [any_sexp] --> any_sexp] -> null & 'a)&(['a & (LGL<> | null), null, any_sexp, [any_sexp] --> any_sexp] -> 'a & (LGL<> | null))
timing: 0.054 s
source
r_obj* vec_proxy_invoke_impl(r_obj* x,
                             r_obj* method,
                             r_obj* vec_proxy_sym,
                             r_obj* (*vec_proxy_impl_fn)(r_obj*)) {
  if (method != r_null) {
    return vctrs_dispatch1(vec_proxy_sym, method, syms_x, x);
  }

  /* Fallback on S3 objects with no proxy */
  if (vec_typeof(x) == VCTRS_TYPE_s3) {
    return vec_proxy_impl_fn(x);
  } else {
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:172

vec_proxy_method typed

[any_sexp] -> any
timing: 0.015 s
source
r_obj* vec_proxy_method(r_obj* x) {
  return s3_find_method("vec_proxy", x, vctrs_method_table);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:121

vec_proxy_method_impl typed

∀'a. ([null, c_string, any_sexp & 'a] -> empty)&([null | (null<...> | null<> | CHR<...> | CHR<> | CLX<...> | CLX<> | DBL<...> | DBL<> | INT<...> | INT<> | LGL<...> | LGL<> | (list & ~{ lang | sym })<...> | (list & ~{ lang | sym })<> | raw<...> | raw<> | expr<...> | expr<> | (any -> any)<...> | (any -> any)<>) | p(CHR), c_string, any_sexp & 'a] -> any_sexp)
timing: 0.589 s
source
r_obj* vec_proxy_method_impl(r_obj* x, const char* generic, r_obj* fn_proxy_array) {
  r_obj* cls = KEEP(s3_get_class(x));
  r_obj* method = s3_class_find_method(generic, cls, vctrs_method_table);

  if (method != r_null) {
    FREE(1);
    return method;
  }

  /* FIXME: Stopgap check for bare arrays */
  /* which equality functions don't handle well */
  if (vec_dim_n(x) > 1) {
    FREE(1);
    return fn_proxy_array;
  }

  FREE(1);
  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:138

vec_proxy_names typed

[any_sexp] -> any_sexp
timing: 0.007 s
source
r_obj* vec_proxy_names(r_obj* x) {
  return vec_names_impl(x, true);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:174

vec_proxy_order_impl typed

[any_sexp] -> any_sexp
timing: 0.012 s
source
r_obj* vec_proxy_order_impl(r_obj* x) {
  VEC_PROXY_KIND_IMPL(vec_proxy_order_method, vec_proxy_order_invoke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:114

vec_proxy_order_invoke typed

[any_sexp, any_sexp] -> any
timing: 0.019 s
source
r_obj* vec_proxy_order_invoke(r_obj* x, r_obj* method) {
  return vec_proxy_invoke_impl(x, method, syms_vec_proxy_order, &vec_proxy_compare_impl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:197

vec_proxy_order_method typed

[any_sexp] -> any
timing: 0.042 s
source
r_obj* vec_proxy_order_method(r_obj* x) {
  return vec_proxy_method_impl(x, "vec_proxy_order", fns_vec_proxy_order_array);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:167

vec_proxy_recurse typed entry .Call accepts outside

∀'a. ['a & (LGL<> | null)] -> 'a & (LGL<> | null)
timing: 0.019 s
fuzzing as ffi_vec_proxy_recurse: 7 inside (7 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: (x1: 'I9387 & (LGL<> | null)) -> 'I9387 & (LGL<> | null)

Accepted outside the domain x1: 6

parameterchangecallreturned
x1class:addffi_vec_proxy_recurse(structure(c(NA, NA), class = "fuzz_cls"))(LGL & ~vec1)<fuzz_cls> with { }
x1kind:dblffi_vec_proxy_recurse(1.5)(^DBL1 \ (..))<> with { }
x1kind:funffi_vec_proxy_recurse(function(...) NULL)arrow<> with { }
x1kind:listffi_vec_proxy_recurse(list()){ }<> with { }
x1wrapffi_vec_proxy_recurse(list(TRUE)){ tt<> with { } }<> with { }
x1wrapffi_vec_proxy_recurse(list(c(NA, NA))){ (LGL & ~vec1)<> with { } }<> with { }
source
r_obj* vec_proxy_recurse(r_obj* x) {
  return vec_proxy_2(x, true);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:9

vec_proxy_set_names typed

[<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c(1..2)] -> any_sexp
timing: 0.023 s
source
r_obj* vec_proxy_set_names(r_obj* x, r_obj* names, const enum vctrs_ownership ownership) {
  return vec_set_names_impl(x, names, true, ownership);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:877

vec_proxy_typeof typed

[any_sexp] -> c_false | c(2..7) | c(10)
timing: 0.008 s
source
enum vctrs_type vec_proxy_typeof(r_obj* x) {
  return vec_base_typeof(x, true);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:79

vec_proxy_unwrap typed

∀'a. ([null & 'a] -> 'a \ (<...> | p(CHR) | sym))&(['a & ((externalptr | vec1 | arrow)<> | sym)] -> 'a \ ((<...> | (~(externalptr | vec1 | arrow))<...>) | null | p(CHR)))&(['a & (<> | null | p(CHR) | sym)] -> 'a \ <...>)
timing: 0.152 s
source
r_obj* vec_proxy_unwrap(r_obj* x) {
  if (r_typeof(x) == R_TYPE_list && r_length(x) == 1 && is_data_frame(x)) {
    x = vec_proxy_unwrap(r_list_get(x, 0));
  }
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:242

vec_ptype_common typed

[any_sexp, <...> | p(CHR) | sym, c_false, c_bool, *struct vctrs_arg, struct r_lazy] -> any_sexp
timing: 0.261 s
source
r_obj* vec_ptype_common(
  r_obj* dots,
  r_obj* ptype,
  enum ptype_finalise finalise,
  enum s3_fallback s3_fallback,
  struct vctrs_arg* p_arg,
  struct r_lazy call
) {
  int n_prot = 0;

  r_obj* out;

  if (ptype != r_null) {
    out = KEEP_N(vec_ptype(ptype, vec_args.dot_ptype, call), &n_prot);
  } else {
    if (r_is_true(r_peek_option("vctrs.no_guessing"))) {
      r_abort_lazy_call(r_lazy_null, "strict mode is activated; you must supply complete `.ptype`.");
    }

    struct ptype_common_reduce_opts reduce_opts = {
      .call = call,
      .s3_fallback = s3_fallback
    };

    out = KEEP_N(
      reduce(
        r_null,
        vec_args.empty,
        p_arg,
        dots,
        &ptype2_common,
        &reduce_opts
      ),
      &n_prot
    );
  }

  if (should_finalise(finalise)) {
    out = KEEP_N(vec_ptype_finalise(out), &n_prot);
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype-common.c:71

vec_ptype_finalise typed entry .Call accepts outside

∀'a. [null & 'a] -> null & 'a
timing: 0.439 s
fuzzing as vctrs_ptype_finalise: 1 inside (1 ok) · 5 outside (3 rejected, 2 accepted)
type drawn from: (x1: 'I28289 & null) -> null & 'I28289

Accepted outside the domain x1: 2

parameterchangecallreturned
x1kind:chrvctrs_ptype_finalise("fuzz")"fuzz"<> with { }
x1wrapvctrs_ptype_finalise(list(NULL)){ null }<> with { }
source
r_obj* vec_ptype_finalise(r_obj* x) {
  if (x == r_null) {
    return x;
  }

  struct r_lazy call = lazy_calls.vec_ptype_finalise;

  if (!r_is_object(x)) {
    obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.x, call);
    return x;
  }

  if (vec_is_unspecified(x)) {
    return vec_ptype_finalise_unspecified(x);
  }

  obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.x, call);

  switch (class_type(x)) {
  case VCTRS_CLASS_bare_tibble:
  case VCTRS_CLASS_bare_data_frame:
    return bare_df_map(x, &vec_ptype_finalise);

  case VCTRS_CLASS_data_frame:
    return df_map(x, &vec_ptype_finalise);

  case VCTRS_CLASS_none:
    r_stop_internal("Non-S3 classes should have returned by now.");

  default:
    return vec_ptype_finalise_dispatch(x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:88

vec_ptype_finalise_unspecified typed

([any_sexp] -> any_sexp)&([(externalptr | vec1 | arrow) | sym] -> LGL1)
timing: 0.110 s
source
r_obj* vec_ptype_finalise_unspecified(r_obj* x) {
  r_ssize size = r_length(x);

  if (size == 0) {
    return r_globals.empty_lgl;
  }

  r_obj* out = KEEP(r_alloc_logical(size));
  r_lgl_fill(out, r_globals.na_lgl, size);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:123

vec_ptype_method typed

([null] -> empty)&([null | (null<...> | null<> | CHR<...> | CHR<> | CLX<...> | CLX<> | DBL<...> | DBL<> | INT<...> | INT<> | LGL<...> | LGL<> | (list & ~{ lang | sym })<...> | (list & ~{ lang | sym })<> | raw<...> | raw<> | expr<...> | expr<> | (any -> any)<...> | (any -> any)<>) | p(CHR)] -> any_sexp)
timing: 0.781 s
source
r_obj* vec_ptype_method(r_obj* x) {
  r_obj* cls = KEEP(s3_get_class(x));
  r_obj* method = s3_class_find_method("vec_ptype", cls, vctrs_method_table);
  FREE(1);
  return method;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:83

vec_ptype_or_s3_fallback typed

[any_sexp, *struct vctrs_arg, c(0..10), struct r_lazy, c_true] | [any_sexp, *struct vctrs_arg, c(0..10) | c(255), struct r_lazy, c_false] | [any_sexp, *struct vctrs_arg, c(255), struct r_lazy, c_true] -> any_sexp
timing: 0.103 s
source
r_obj* vec_ptype_or_s3_fallback(
  r_obj* x,
  struct vctrs_arg* p_x_arg,
  enum vctrs_type x_type,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  if (s3_fallback == S3_FALLBACK_true && x_type == VCTRS_TYPE_s3) {
    int _;
    return vec_ptype2(
      x,
      x,
      p_x_arg,
      p_x_arg,
      r_lazy_null,
      s3_fallback,
      &_
    );
  }

  return vec_ptype(x, p_x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:241

vec_ptype_slice typed

[any_sexp, any_sexp] -> any_sexp
timing: 0.015 s
source
r_obj* vec_ptype_slice(r_obj* x, r_obj* empty) {
  if (r_attrib_has_any(x)) {
    // Slicing preserves attributes
    return vec_slice(x, r_null);
  } else {
    return empty;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:37

vec_ptype2 typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, *c_int_na] -> any_sexp
timing: 0.034 s
source
r_obj* vec_ptype2(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback,
  int* left
) {
  return vec_ptype2_impl(
    x,
    y,
    p_x_arg,
    p_y_arg,
    call,
    s3_fallback,
    left,
    true
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:32

vec_ptype2_default typed

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] -> any_sexp
timing: 0.026 s
source
r_obj* vec_ptype2_default(r_obj* x,
                          r_obj* y,
                          struct vctrs_arg* x_arg,
                          struct vctrs_arg* y_arg,
                          struct r_lazy call,
                          enum s3_fallback s3_fallback) {
  return vec_ptype2_default_full(x, y, x_arg, y_arg, call, s3_fallback, false);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:100

vec_ptype2_impl typed

[LGL<> | null, LGL<> | null, c_null, c_null, struct r_lazy, c_bool, *c_int_na, c_false] | [LGL<> | null, LGL<> | null, c_null, c_null, struct r_lazy, c_bool, *c_int_na, c_int_na \ c_false] -> any_sexp
timing: 2.74 s
source
r_obj* vec_ptype2_impl(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback,
  int* left,
  bool first_pass
) {
  const enum vctrs_type x_type = vec_typeof(x);
  const enum vctrs_type y_type = vec_typeof(y);

  if (x_type == VCTRS_TYPE_null) {
    // When `x` and `y` are `NULL`, keep using `x` name (1)
    // When `x` is `NULL` but `y` isn't, switch to `y` name (0)
    *left = y_type == VCTRS_TYPE_null;
    return vec_ptype_or_s3_fallback(y, p_y_arg, x_type, call, s3_fallback);
  }
  if (y_type == VCTRS_TYPE_null) {
    // When `x` and `y` are `NULL`, keep using `x` name (1)
    // When `y` is `NULL` but `x` isn't, keep using `x` name (1)
    *left = 1;
    return vec_ptype_or_s3_fallback(x, p_x_arg, x_type, call, s3_fallback);
  }

  if (x_type == VCTRS_TYPE_unspecified) {
    // When `x` and `y` are unspecified, keep using `x` name (1)
    // When `x` is unspecified by `y` isn't, switch to `y` name (0)
    *left = y_type == VCTRS_TYPE_unspecified;
    return vec_ptype_or_s3_fallback(y, p_y_arg, y_type, call, s3_fallback);
  }
  if (y_type == VCTRS_TYPE_unspecified) {
    // When `x` and `y` are unspecified, keep using `x` name (1)
    // When `y` is unspecified but `x` isn't, keep using `x` name (1)
    *left = 1;
    return vec_ptype_or_s3_fallback(x, p_x_arg, x_type, call, s3_fallback);
  }

  if (x_type == VCTRS_TYPE_scalar) {
    stop_scalar_type(x, p_x_arg, call);
  }
  if (y_type == VCTRS_TYPE_scalar) {
    stop_scalar_type(y, p_y_arg, call);
  }

  if (x_type != VCTRS_TYPE_s3 && y_type != VCTRS_TYPE_s3) {
    return vec_ptype2_switch_native(
      x,
      y,
      x_type,
      y_type,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback,
      left
    );
  }

  if (x_type == VCTRS_TYPE_s3 || y_type == VCTRS_TYPE_s3) {
    r_obj* out = KEEP(vec_ptype2_dispatch_native(
      x,
      y,
      x_type,
      y_type,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback,
      left
    ));

    if (out != r_null) {
      out = vec_shaped_ptype(out, x, y, p_x_arg, p_y_arg);
      FREE(1);
      return out;
    }

    FREE(1);
  }

  // Try native dispatch again with prototypes, in case the prototype
  // is another type. FIXME: Use R-level callback instead.
  if (first_pass) {
    x = KEEP(vec_ptype(x, p_x_arg, call));
    y = KEEP(vec_ptype(y, p_y_arg, call));

    r_obj* out = vec_ptype2_impl(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback,
      left,
      false
    );

    FREE(2);
    return out;
  }

  return vec_ptype2_dispatch_s3(
    x,
    y,
    p_x_arg,
    p_y_arg,
    call,
    s3_fallback
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:54

vec_ptype2_switch_native typed

[any_sexp, any_sexp, c(0..10) | c(255), c(0..10) | c(255), *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, *c_int_na] -> any_sexp
timing: 0.897 s
source
r_obj* vec_ptype2_switch_native(
  r_obj* x,
  r_obj* y,
  enum vctrs_type x_type,
  enum vctrs_type y_type,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback,
  int* left
) {
  enum vctrs_type2 type2 = vec_typeof2_impl(x_type, y_type, left);

  switch (type2) {
  case VCTRS_TYPE2_null_null:
    return r_null;

  case VCTRS_TYPE2_logical_logical:
    return vec_shaped_ptype(r_globals.empty_lgl, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_logical_integer:
  case VCTRS_TYPE2_integer_integer:
    return vec_shaped_ptype(r_globals.empty_int, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_logical_double:
  case VCTRS_TYPE2_integer_double:
  case VCTRS_TYPE2_double_double:
    return vec_shaped_ptype(r_globals.empty_dbl, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_integer_complex:
  case VCTRS_TYPE2_double_complex:
  case VCTRS_TYPE2_complex_complex:
    return vec_shaped_ptype(r_globals.empty_cpl, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_character_character:
    return vec_shaped_ptype(r_globals.empty_chr, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_raw_raw:
    return vec_shaped_ptype(r_globals.empty_raw, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_list_list:
    return vec_shaped_ptype(r_globals.empty_list, x, y, p_x_arg, p_y_arg);

  case VCTRS_TYPE2_dataframe_dataframe:
    return df_ptype2(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );

  default:
    return vec_ptype2_dispatch_s3(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:168

vec_rank_dense typed

[*c_int_na, *c_int_na, c_int_na, *c_int_na] -> ()
timing: 0.727 s
source
void vec_rank_dense(const int* v_order,
                    const int* v_group_sizes,
                    r_ssize n_groups,
                    int* v_rank) {
  r_ssize k = 0;
  r_ssize rank = 1;

  for (r_ssize i = 0; i < n_groups; ++i) {
    const r_ssize group_size = v_group_sizes[i];

    for (r_ssize j = 0; j < group_size; ++j) {
      r_ssize loc = v_order[k] - 1;
      v_rank[loc] = rank;
      ++k;
    }

    ++rank;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:186

vec_rank_max typed

[*c_int_na, *c_int_na, c_int_na, *c_int_na] -> ()
timing: 0.784 s
source
void vec_rank_max(const int* v_order,
                  const int* v_group_sizes,
                  r_ssize n_groups,
                  int* v_rank) {
  r_ssize k = 0;
  r_ssize rank = 0;

  for (r_ssize i = 0; i < n_groups; ++i) {
    const r_ssize group_size = v_group_sizes[i];
    rank += group_size;

    for (r_ssize j = 0; j < group_size; ++j) {
      r_ssize loc = v_order[k] - 1;
      v_rank[loc] = rank;
      ++k;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:146

vec_rank_min typed

[*c_int_na, *c_int_na, c_int_na, *c_int_na] -> ()
timing: 1.17 s
source
void vec_rank_min(const int* v_order,
                  const int* v_group_sizes,
                  r_ssize n_groups,
                  int* v_rank) {
  r_ssize k = 0;
  r_ssize rank = 1;

  for (r_ssize i = 0; i < n_groups; ++i) {
    const r_ssize group_size = v_group_sizes[i];

    for (r_ssize j = 0; j < group_size; ++j) {
      r_ssize loc = v_order[k] - 1;
      v_rank[loc] = rank;
      ++k;
    }

    rank += group_size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:125

vec_rank_sequential typed

[*c_int_na, *c_int_na, c_int_na, *c_int_na] -> ()
timing: 0.721 s
source
void vec_rank_sequential(const int* v_order,
                         const int* v_group_sizes,
                         r_ssize n_groups,
                         int* v_rank) {
  r_ssize k = 0;
  r_ssize rank = 1;

  for (r_ssize i = 0; i < n_groups; ++i) {
    const r_ssize group_size = v_group_sizes[i];

    for (r_ssize j = 0; j < group_size; ++j) {
      r_ssize loc = v_order[k] - 1;
      v_rank[loc] = rank;
      ++k;
      ++rank;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:166

vec_recycle typed

∀'a. ([null & 'a, c_int_na, *struct vctrs_arg, struct r_lazy] -> null)&(['a & (<...> | p(CHR) | sym), c(..-1), c_null, struct r_lazy] -> 'a & (<...> | p(CHR) | sym))
timing: 0.098 s
source
r_obj* vec_recycle(
  r_obj* x,
  r_ssize size,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  if (x == r_null) {
    return r_null;
  }

  r_ssize n_x = vec_size(x);

  if (n_x == size) {
    return x;
  }

  if (n_x == 1L) {
    r_obj* i = KEEP(compact_rep(1, size));
    r_obj* out = vec_slice_unsafe(x, i);

    FREE(1);
    return out;
  }

  stop_recycle_incompatible_size(n_x, size, p_x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:156

vec_recycle_common typed

∀'a. [any_sexp & 'a, c(..-1), *struct vctrs_arg, struct r_lazy] -> any_sexp & 'a
timing: 0.110 s
source
r_obj* vec_recycle_common(
  r_obj* xs,
  r_ssize size,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (size < 0) {
    return xs;
  }

  r_obj* const* v_xs = r_list_cbegin(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  const r_ssize xs_size = r_length(xs);

  r_ssize xs_index = 0;

  struct vctrs_arg* p_x_arg = new_subscript_arg(
    p_xs_arg,
    xs_names,
    xs_size,
    &xs_index
  );
  KEEP(p_x_arg->shelter);

  // If all elements are of size `size`, there is nothing to do
  // and we can avoid an allocation
  for (r_ssize i = 0; i < xs_size; ++i) {
    r_obj* x = v_xs[i];

    if (!vec_is_size(x, size, VCTRS_ALLOW_NULL_yes, p_x_arg, call)) {
      break;
    }

    ++xs_index;
  }

  if (xs_index == xs_size) {
    FREE(2);
    return xs;
  }

  // Otherwise we need a new list
  r_obj* out = KEEP(r_alloc_list(xs_size));
  r_attrib_poke_names(out, xs_names);

  // Copy over everything before `xs_index`
  for (r_ssize i = 0; i < xs_index; ++i) {
    r_obj* x = v_xs[i];
    r_list_poke(out, i, x);
  }

  // Recycle everything at and after `xs_index`
  for (r_ssize i = xs_index; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    r_list_poke(out, i, vec_recycle(x, size, p_x_arg, call));
    ++xs_index;
  }

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size-common.c:226

vec_recycle_fallback typed

[null, c_int_na, *struct vctrs_arg, struct r_lazy] -> null
timing: 0.202 s
source
r_obj* vec_recycle_fallback(r_obj* x,
                            r_ssize size,
                            struct vctrs_arg* x_arg,
                            struct r_lazy call) {
  if (x == r_null) {
    return r_null;
  }

  r_ssize x_size = vec_size(x);

  if (x_size == size) {
    return x;
  }

  if (x_size == 1) {
    r_obj* subscript = KEEP(r_alloc_integer(size));
    r_int_fill(subscript, 1, size);

    r_obj* out = vec_slice_fallback(x, subscript);

    FREE(1);
    return out;
  }

  stop_recycle_incompatible_size(x_size, size, x_arg, call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:209

vec_rep typed

∀'a. ([any_sexp & 'a, c(..-1), struct r_lazy, *struct vctrs_arg, c_null] -> empty)&([any_sexp & 'a, c_true, struct r_lazy, *struct vctrs_arg, c_null] -> any_sexp & 'a)
timing: 0.205 s
source
r_obj* vec_rep(r_obj* x,
               int times,
               struct r_lazy error_call,
               struct vctrs_arg* p_x_arg,
               struct vctrs_arg* p_times_arg) {
  check_rep_times(times, error_call, p_times_arg);

  if (times == 1) {
    return x;
  }

  const r_ssize times_ = (r_ssize) times;
  const r_ssize x_size = vec_size(x);

  if (x_size == 1) {
    return vec_recycle(x, times_, p_x_arg, error_call);
  }

  if (multiply_would_overflow(x_size, times_)) {
    stop_rep_size_oob(error_call);
  };

  const r_ssize size = x_size * times_;

  r_obj* subscript = KEEP(r_alloc_integer(size));
  int* v_subscript = r_int_begin(subscript);

  r_ssize k = 0;

  for (r_ssize i = 0; i < times_; ++i) {
    for (r_ssize j = 1; j <= x_size; ++j, ++k) {
      v_subscript[k] = j;
    }
  }

  r_obj* out = vec_slice_unsafe(x, subscript);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:6

vec_rep_each_uniform typed

([any_sexp, c(..-1), struct r_lazy, c_null] -> empty)&([any_sexp, c_int_na, struct r_lazy, *struct vctrs_arg] \ [any_sexp, c(..-1), struct r_lazy, c_null] -> any_sexp)
timing: 0.060 s
source
r_obj* vec_rep_each_uniform(r_obj* x,
                            int times,
                            struct r_lazy error_call,
                            struct vctrs_arg* p_times_arg) {
  check_rep_each_times(times, 1, error_call, p_times_arg);

  const r_ssize times_ = (r_ssize) times;
  const r_ssize x_size = vec_size(x);

  if (multiply_would_overflow(x_size, times_)) {
    stop_rep_size_oob(error_call);
  };

  const r_ssize size = x_size * times_;

  r_obj* subscript = KEEP(r_alloc_integer(size));
  int* v_subscript = r_int_begin(subscript);

  r_ssize k = 0;

  for (r_ssize i = 1; i <= x_size; ++i) {
    for (r_ssize j = 0; j < times_; ++j, ++k) {
      v_subscript[k] = i;
    }
  }

  r_obj* out = vec_slice_unsafe(x, subscript);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:125

vec_requires_fallback typed

([<...>, struct vctrs_proxy_info] -> c_bool)&([<> | null | p(CHR) | sym, struct vctrs_proxy_info] -> c_false)
timing: 0.066 s
source
bool vec_requires_fallback(r_obj* x, struct vctrs_proxy_info info) {
  return r_is_object(x) &&
    !info.had_proxy_method &&
    info.type != VCTRS_TYPE_dataframe;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:252

vec_restore_collect_cb typed

[any_sexp, any_sexp, c_ptr] -> c_null
timing: 0.140 s
source
static r_obj* vec_restore_collect_cb(r_obj* tag, r_obj* value, void* data) {
  struct vec_restore_collect_data* p_data = (struct vec_restore_collect_data*) data;

  if (tag == r_syms.names) {
    p_data->names = value;
    return NULL;
  }
  if (tag == r_syms.dim) {
    p_data->dim = value;
    return NULL;
  }
  if (tag == r_syms.dim_names) {
    p_data->dim_names = value;
    return NULL;
  }
  if (tag == r_syms.row_names) {
    p_data->row_names = value;
    return NULL;
  }

  return NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:74

vec_restore_opts typed

([any_sexp, <> | null | p(CHR) | sym, *struct vec_restore_opts] -> any_sexp)&([any_sexp, <> | null | p(CHR) | sym, c_null] -> empty)
timing: 0.178 s
source
r_obj* vec_restore_opts(
  r_obj* x,
  r_obj* to,
  const struct vec_restore_opts* p_opts
) {
  enum vctrs_class_type to_type = class_type(to);

  switch (to_type) {
  case VCTRS_CLASS_bare_factor:
  case VCTRS_CLASS_bare_ordered:
  case VCTRS_CLASS_none: return vec_restore_default(x, to, p_opts->ownership);
  case VCTRS_CLASS_bare_date: return vec_date_restore(x, to, p_opts->ownership);
  case VCTRS_CLASS_bare_posixct: return vec_posixct_restore(x, to, p_opts->ownership);
  case VCTRS_CLASS_bare_posixlt: return vec_posixlt_restore(x, to, p_opts->ownership);
  case VCTRS_CLASS_bare_data_frame:
  case VCTRS_CLASS_bare_tibble: return vec_bare_df_restore(x, to, p_opts);
  case VCTRS_CLASS_data_frame: return vec_df_restore(x, to, p_opts);
  default:
    if (p_opts->recursively_proxied && is_data_frame(x)) {
      return vec_df_restore(x, to, p_opts);
    } else {
      return vec_restore_dispatch(x, to);
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:33

vec_run_sizes typed

[any_sexp, struct r_lazy] -> INT
timing: 0.277 s
source
r_obj* vec_run_sizes(r_obj* x, struct r_lazy error_call) {
  struct r_vector_bool* p_ends = vec_detect_run_bounds_bool(x, VCTRS_RUN_BOUND_end, error_call);
  KEEP(p_ends->shelter);
  const bool* v_ends = r_vector_bool_cbegin(p_ends);

  const r_ssize size = r_vector_bool_length(p_ends);

  r_ssize n = 0;
  for (r_ssize i = 0; i < size; ++i) {
    n += v_ends[i];
  }

  r_obj* out = KEEP(r_alloc_integer(n));
  int* v_out = r_int_begin(out);
  r_ssize j = 0;

  int count = 1;

  for (r_ssize i = 0; i < size; ++i) {
    const bool end = v_ends[i];
    v_out[j] = count;
    j += end;
    count = !end * count + 1;
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:116

vec_set_df_rownames typed

∀'a. [any_sexp & 'a, <...> | p(CHR) | sym, c_int_na \ c_false, c(0..2)] -> any_sexp & 'a
timing: 0.264 s
source
r_obj* vec_set_df_rownames(r_obj* x, r_obj* names, bool proxy, const enum vctrs_ownership ownership) {
  if (names == r_null) {
    if (rownames_type(df_rownames(x)) != ROWNAMES_TYPE_identifiers) {
      return(x);
    }

    x = KEEP(vec_clone_referenced(x, ownership));
    init_compact_rownames(x, vec_size(x));

    FREE(1);
    return x;
  }

  // Repair row names silently
  if (!proxy) {
    names = vec_as_names(names, p_unique_repair_silent_opts);
  }
  KEEP(names);

  x = KEEP(vec_clone_referenced(x, ownership));
  r_attrib_poke(x, r_syms.row_names, names);

  FREE(2);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:805

vec_set_difference_loop typed

([*struct dictionary, *struct dictionary, c_int_na, c_int_na, *c_bool] -> ())&([c_null, *struct dictionary, c_int_na, c_int_na, *c_bool] -> empty)
timing: 1.27 s
source
void vec_set_difference_loop(
  struct dictionary* x_dict,
  struct dictionary* y_dict,
  r_ssize x_size,
  r_ssize y_size,
  bool* v_marked
) {
  switch (x_dict->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_SET_DIFFERENCE_LOOP(nil_dict_hash_scalar, nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VEC_SET_DIFFERENCE_LOOP(lgl_dict_hash_scalar, lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VEC_SET_DIFFERENCE_LOOP(int_dict_hash_scalar, int_dict_hash_with); break;
  case VCTRS_TYPE_double: VEC_SET_DIFFERENCE_LOOP(dbl_dict_hash_scalar, dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VEC_SET_DIFFERENCE_LOOP(cpl_dict_hash_scalar, cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VEC_SET_DIFFERENCE_LOOP(chr_dict_hash_scalar, chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VEC_SET_DIFFERENCE_LOOP(raw_dict_hash_scalar, raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VEC_SET_DIFFERENCE_LOOP(list_dict_hash_scalar, list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VEC_SET_DIFFERENCE_LOOP(df_dict_hash_scalar, df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vec_set_difference_loop", x_dict->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:298

VEC_SET_DIFFERENCE_LOOP typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vec_set_intersect_loop typed

([*struct dictionary, *struct dictionary, c_int_na, c_int_na, *c_bool] -> ())&([c_null, *struct dictionary, c_int_na, c_int_na, *c_bool] -> empty)
timing: 1.29 s
source
void vec_set_intersect_loop(
  struct dictionary* x_dict,
  struct dictionary* y_dict,
  r_ssize x_size,
  r_ssize y_size,
  bool* v_marked
) {
  switch (x_dict->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_SET_INTERSECT_LOOP(nil_dict_hash_scalar, nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VEC_SET_INTERSECT_LOOP(lgl_dict_hash_scalar, lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VEC_SET_INTERSECT_LOOP(int_dict_hash_scalar, int_dict_hash_with); break;
  case VCTRS_TYPE_double: VEC_SET_INTERSECT_LOOP(dbl_dict_hash_scalar, dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VEC_SET_INTERSECT_LOOP(cpl_dict_hash_scalar, cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VEC_SET_INTERSECT_LOOP(chr_dict_hash_scalar, chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VEC_SET_INTERSECT_LOOP(raw_dict_hash_scalar, raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VEC_SET_INTERSECT_LOOP(list_dict_hash_scalar, list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VEC_SET_INTERSECT_LOOP(df_dict_hash_scalar, df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vec_set_intersect_loop", x_dict->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:141

VEC_SET_INTERSECT_LOOP typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vec_set_names typed

[<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c(1..2)] -> any_sexp
timing: 0.023 s
source
r_obj* vec_set_names(r_obj* x, r_obj* names, const enum vctrs_ownership ownership) {
  return vec_set_names_impl(x, names, false, ownership);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:874

vec_set_names_impl typed

[<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c_false, c(1..2)] | [<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c_int_na \ c_false, c(1..2)] -> any_sexp
timing: 0.503 s
source
r_obj* vec_set_names_impl(r_obj* x, r_obj* names, bool proxy, const enum vctrs_ownership ownership) {
  check_names(x, names);

  if (is_data_frame(x)) {
    return vec_set_df_rownames(x, names, proxy, ownership);
  }

  if (has_dim(x)) {
    return vec_set_rownames(x, names, proxy, ownership);
  }

  if (!proxy && r_is_object(x)) {
    return set_names_dispatch(x, names);
  }

  // Early exit if no new names and no existing names
  if (names == r_null && r_attrib_get(x, r_syms.names) == r_null) {
    return x;
  }

  switch (ownership) {
  case VCTRS_OWNERSHIP_foreign: {
    // We likely need to clone, but to do this we will use `names<-`
    // which can perform a cheaper ALTREP shallow duplication
    x = KEEP(set_names_dispatch(x, names));
    break;
  }
  case VCTRS_OWNERSHIP_shallow:
  case VCTRS_OWNERSHIP_deep: {
    // This ends up skipping the cloning altogether
    x = KEEP(vec_clone_referenced(x, ownership));
    r_attrib_poke(x, r_syms.names, names);
    break;
  }
  default: r_stop_unreachable();
  }

  FREE(1);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:833

vec_set_symmetric_difference_loop typed

([*struct dictionary, *struct dictionary, c_int_na, c_int_na, *c_bool, *c_bool] -> any)&([c_null, *struct dictionary, c_int_na, c_int_na, *c_bool, *c_bool] -> empty)
timing: 1.27 s
source
struct r_ssize_pair vec_set_symmetric_difference_loop(
  struct dictionary* x_dict,
  struct dictionary* y_dict,
  r_ssize x_size,
  r_ssize y_size,
  bool* v_x_marked,
  bool* v_y_marked
) {
  switch (x_dict->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(nil_dict_hash_scalar, nil_dict_hash_with); break;
  case VCTRS_TYPE_logical: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(lgl_dict_hash_scalar, lgl_dict_hash_with); break;
  case VCTRS_TYPE_integer: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(int_dict_hash_scalar, int_dict_hash_with); break;
  case VCTRS_TYPE_double: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(dbl_dict_hash_scalar, dbl_dict_hash_with); break;
  case VCTRS_TYPE_complex: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(cpl_dict_hash_scalar, cpl_dict_hash_with); break;
  case VCTRS_TYPE_character: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(chr_dict_hash_scalar, chr_dict_hash_with); break;
  case VCTRS_TYPE_raw: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(raw_dict_hash_scalar, raw_dict_hash_with); break;
  case VCTRS_TYPE_list: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(list_dict_hash_scalar, list_dict_hash_with); break;
  case VCTRS_TYPE_dataframe: VEC_SET_SYMMETRIC_DIFFERENCE_LOOP(df_dict_hash_scalar, df_dict_hash_with); break;
  default: stop_unimplemented_vctrs_type("vec_set_symmetric_difference_loop", x_dict->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:778

VEC_SET_SYMMETRIC_DIFFERENCE_LOOP typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vec_set_union_x_loop typed empty return

[*struct dictionary, c_int_na, *c_bool] -> empty
timing: 5.85 s
source
r_ssize vec_set_union_x_loop(
  struct dictionary* x_dict,
  r_ssize x_size,
  bool* v_marked
) {
  switch (x_dict->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_SET_UNION_X_LOOP(nil_dict_hash_scalar);
  case VCTRS_TYPE_logical: VEC_SET_UNION_X_LOOP(lgl_dict_hash_scalar);
  case VCTRS_TYPE_integer: VEC_SET_UNION_X_LOOP(int_dict_hash_scalar);
  case VCTRS_TYPE_double: VEC_SET_UNION_X_LOOP(dbl_dict_hash_scalar);
  case VCTRS_TYPE_complex: VEC_SET_UNION_X_LOOP(cpl_dict_hash_scalar);
  case VCTRS_TYPE_character: VEC_SET_UNION_X_LOOP(chr_dict_hash_scalar);
  case VCTRS_TYPE_raw: VEC_SET_UNION_X_LOOP(raw_dict_hash_scalar);
  case VCTRS_TYPE_list: VEC_SET_UNION_X_LOOP(list_dict_hash_scalar);
  case VCTRS_TYPE_dataframe: VEC_SET_UNION_X_LOOP(df_dict_hash_scalar);
  default: stop_unimplemented_vctrs_type("vec_set_union_x_loop", x_dict->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:490

VEC_SET_UNION_X_LOOP typed any: arg 1

tuple1 --> any
timing: 0.000 s
(definition not located in src/)

vec_set_union_y_loop typed empty return

[*struct dictionary, *struct dictionary, c_int_na, c_int_na, *c_bool] -> empty
timing: 5.87 s
source
r_ssize vec_set_union_y_loop(
  struct dictionary* x_dict,
  struct dictionary* y_dict,
  r_ssize x_size,
  r_ssize y_size,
  bool* v_marked
) {
  switch (x_dict->p_poly_vec->type) {
  case VCTRS_TYPE_null: VEC_SET_UNION_Y_LOOP(nil_dict_hash_scalar, nil_dict_hash_with);
  case VCTRS_TYPE_logical: VEC_SET_UNION_Y_LOOP(lgl_dict_hash_scalar, lgl_dict_hash_with);
  case VCTRS_TYPE_integer: VEC_SET_UNION_Y_LOOP(int_dict_hash_scalar, int_dict_hash_with);
  case VCTRS_TYPE_double: VEC_SET_UNION_Y_LOOP(dbl_dict_hash_scalar, dbl_dict_hash_with);
  case VCTRS_TYPE_complex: VEC_SET_UNION_Y_LOOP(cpl_dict_hash_scalar, cpl_dict_hash_with);
  case VCTRS_TYPE_character: VEC_SET_UNION_Y_LOOP(chr_dict_hash_scalar, chr_dict_hash_with);
  case VCTRS_TYPE_raw: VEC_SET_UNION_Y_LOOP(raw_dict_hash_scalar, raw_dict_hash_with);
  case VCTRS_TYPE_list: VEC_SET_UNION_Y_LOOP(list_dict_hash_scalar, list_dict_hash_with);
  case VCTRS_TYPE_dataframe: VEC_SET_UNION_Y_LOOP(df_dict_hash_scalar, df_dict_hash_with);
  default: stop_unimplemented_vctrs_type("vec_set_union_y_loop", x_dict->p_poly_vec->type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:548

VEC_SET_UNION_Y_LOOP typed any: arg 1, arg 2

tuple2 --> any
timing: 0.000 s
(definition not located in src/)

vec_shape_elem_n typed

([*c_int, c_int_na] -> c_int)&([*c_int_na, c_int_na] -> c_int_na)&([c_null, c_int_na] -> c_true)
timing: 0.055 s
source
static inline R_len_t vec_shape_elem_n(const int* p_dim, const R_len_t dim_n) {
  R_len_t shape_elem_n = 1;
  for (int i = 1; i < dim_n; ++i) {
    shape_elem_n *= p_dim[i];
  }
  return shape_elem_n;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:158

vec_shape_index_increment typed

[*struct strides_info] -> ()
timing: 0.810 s
source
static inline void vec_shape_index_increment(struct strides_info* p_info) {
  for (int j = 0; j < p_info->shape_n; ++j) {
    p_info->p_shape_index[j]++;
    if (p_info->p_shape_index[j] < p_info->p_dim[j + 1]) {
      break;
    }
    p_info->p_shape_index[j] = 0;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:141

vec_shaped_ptype typed

∀'a. [any_sexp & 'a, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] -> any_sexp & 'a
timing: 0.061 s
source
r_obj* vec_shaped_ptype(
  r_obj* ptype,
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  r_obj* shape = vec_shape2(x, y, p_x_arg, p_y_arg);

  if (shape == r_null) {
    return ptype;
  }

  // Only `KEEP()` if we have to
  KEEP(shape);

  ptype = KEEP(r_clone_referenced(ptype));
  r_attrib_poke_dim(ptype, shape);

  FREE(2);
  return ptype;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:14

vec_size_params typed

[<> | null | p(CHR) | sym, c_null, struct r_lazy] -> c_int_na
timing: 0.175 s
source
r_ssize vec_size_params(
  r_obj* x,
  struct vctrs_arg* p_x_arg,
  struct r_lazy call
) {
  struct vctrs_proxy_info info = vec_proxy_info(x);
  KEEP(info.inner);

  r_obj* data = info.inner;

  r_ssize size;
  switch (info.type) {
  case VCTRS_TYPE_null:
    size = 0;
    break;
  case VCTRS_TYPE_logical:
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_double:
  case VCTRS_TYPE_complex:
  case VCTRS_TYPE_character:
  case VCTRS_TYPE_raw:
  case VCTRS_TYPE_list:
    size = vec_raw_size(data);
    break;

  case VCTRS_TYPE_dataframe:
    size = df_size(data);
    break;

  default:
    stop_scalar_type(x, p_x_arg, call);
  }

  FREE(1);
  return size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:15

vec_size2_impl typed

∀'a,'b. ([null & 'a, null & 'b, c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, *c_int_na] -> null & 'a)&([null & 'a, 'b & (<...> | p(CHR) | sym), c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, *c_int_na] -> 'b & (<...> | p(CHR) | sym))&(['a & (<...> | p(CHR) | sym), 'b & (<...> | p(CHR) | sym), c_true, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, *c_int_na] -> 'a & (<...> | p(CHR) | sym) | 'b & (<...> | p(CHR) | sym))&(['a & (<...> | p(CHR) | sym), null & 'b, c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, *c_int_na] | ['a & (<...> | p(CHR) | sym), 'b & (<...> | p(CHR) | sym), c_int_na \ c_true, c_int_na \ c_true, c_null, c_null, struct r_lazy, *c_int_na] | ['a & (<...> | p(CHR) | sym), 'b & (<...> | p(CHR) | sym), c_int_na \ c_true, c_true, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, *c_int_na] -> 'a & (<...> | p(CHR) | sym))
timing: 0.480 s
source
r_obj* vec_size2_impl(
  r_obj* x,
  r_obj* y,
  r_ssize x_size,
  r_ssize y_size,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  int* left
) {
  // `NULL` handling rules:
  // - If `x` and `y` are `NULL`, do nothing
  // - If `x` is `NULL`, use `y`
  // - If `y` is `NULL`, use `x`
  //
  // The first rule is important to ensure that this works
  // `vec_size_common(NULL, .absent = 5L)`
  if (x == r_null) {
    if (y == r_null) {
      *left = -1;
      return x;
    } else {
      *left = 0;
      return y;
    }
  }
  if (y == r_null) {
    if (x == r_null) {
      r_stop_unreachable();
    } else {
      *left = 1;
      return x;
    }
  }

  // Now apply common size rules
  // - Same size, use `x`
  // - Size 1 `x`, use `y`
  // - Size 1 `y`, use `x`
  if (x_size == y_size) {
    *left = -1;
    return x;
  }
  if (x_size == 1) {
    *left = 0;
    return y;
  }
  if (y_size == 1) {
    *left = 1;
    return x;
  }

  stop_incompatible_size(
    x,
    y,
    x_size,
    y_size,
    p_x_arg,
    p_y_arg,
    call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size-common.c:98

vec_slice typed

[any_sexp, any_sexp] -> any_sexp
timing: 0.013 s
source
r_obj* vec_slice(r_obj* x, r_obj* i) {
  const struct vec_slice_opts opts = { 0 };
  return vec_slice_opts(x, i, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.h:22

vec_slice_base typed

([c(2), any_sexp, any_sexp, c_bool] | [c(3), any_sexp, any_sexp, c_bool] | [c(4), any_sexp, any_sexp, c_bool] | [c(5), any_sexp, any_sexp, c_bool] | [c(6), any_sexp, any_sexp, c_bool] | [c(7), any_sexp, any_sexp, c_bool] | [c(8), any_sexp, any_sexp, c_bool] -> any_sexp)&([c(7), any_sexp, INT, c_true] | [c_bool | c(9..10) | c(255), any_sexp, any_sexp, c_bool] -> empty)
timing: 0.950 s
source
r_obj* vec_slice_base(enum vctrs_type type,
                      r_obj* x,
                      r_obj* subscript,
                      enum vctrs_materialize materialize) {
  switch (type) {
  case VCTRS_TYPE_logical:   return lgl_slice(x, subscript, materialize);
  case VCTRS_TYPE_integer:   return int_slice(x, subscript, materialize);
  case VCTRS_TYPE_double:    return dbl_slice(x, subscript, materialize);
  case VCTRS_TYPE_complex:   return cpl_slice(x, subscript, materialize);
  case VCTRS_TYPE_character: return chr_slice(x, subscript, materialize);
  case VCTRS_TYPE_raw:       return raw_slice(x, subscript, materialize);
  case VCTRS_TYPE_list:      return list_slice(x, subscript, materialize);
  default: stop_unimplemented_vctrs_type("vec_slice_base", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:258

vec_slice_opts typed

([any_sexp, any_sexp, c_null] -> empty)&([any_sexp, any_sexp, *struct vec_slice_opts] \ [any_sexp, any_sexp, c_null] -> any_sexp)
timing: 0.123 s
source
r_obj* vec_slice_opts(r_obj* x,
                      r_obj* i,
                      const struct vec_slice_opts* opts) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, opts->x_arg, opts->call);

  r_obj* names = KEEP(vec_names(x));
  i = KEEP(vec_as_location_ctxt(i,
                                vec_size(x),
                                names,
                                opts->i_arg,
                                opts->call));

  r_obj* out = vec_slice_unsafe(x, i);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:445

vec_slice_shaped_base typed

([c(2), any_sexp, any_sexp, *struct strides_info] | [c(3), any_sexp, any_sexp, *struct strides_info] | [c(4), any_sexp, any_sexp, *struct strides_info] | [c(5), any_sexp, any_sexp, *struct strides_info] | [c(6), any_sexp, any_sexp, *struct strides_info] | [c(7), any_sexp, any_sexp, *struct strides_info] | [c(8), any_sexp, any_sexp, *struct strides_info] -> any_sexp)&([c(2), any_sexp, any_sexp, c_null] | [c(3), any_sexp, any_sexp, c_null] | [c(4), any_sexp, any_sexp, c_null] | [c(5), any_sexp, any_sexp, c_null] | [c(6), CHR, any_sexp, c_null] | [c(7), any_sexp, any_sexp, c_null] | [c(8), list, any_sexp, c_null] | [c_bool | c(9..10) | c(255), any_sexp, any_sexp, *struct strides_info] -> empty)
timing: 1.41 s
source
SEXP vec_slice_shaped_base(enum vctrs_type type,
                           SEXP x,
                           SEXP index,
                           struct strides_info* p_info) {
  switch (type) {
  case VCTRS_TYPE_logical:   return lgl_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_integer:   return int_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_double:    return dbl_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_complex:   return cpl_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_character: return chr_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_raw:       return raw_slice_shaped(x, index, p_info);
  case VCTRS_TYPE_list:      return list_slice_shaped(x, index, p_info);
  default: stop_unimplemented_vctrs_type("vec_slice_shaped_base", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:274

vec_steps typed

([*c_int, c_int] | [*c_na, c_int] -> INT)&([*c_int, c_true] | [*c_na, c_true] -> INT1)
timing: 0.526 s
source
static inline SEXP vec_steps(const int* p_index, const R_len_t index_n) {
  SEXP steps = PROTECT(Rf_allocVector(INTSXP, index_n));
  int* p_steps = INTEGER(steps);

  // Indices come in 1-based
  int index_previous = 1;

  for (R_len_t i = 0; i < index_n; ++i) {
    const int index_current = p_index[i];

    if (index_current == NA_INTEGER) {
      p_steps[i] = NA_INTEGER;
      continue;
    }

    p_steps[i] = index_current - index_previous;
    index_previous = index_current;
  }

  UNPROTECT(1);
  return steps;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:100

vec_strided_loc typed

([*c_int, *c_int, c_int_na] -> c_int)&([*c_int_na, *c_int_na, c_int_na] -> c_int_na)&([*c_int_na, c_null, c_int_na] | [c_null, *c_int_na, c_int_na] -> c_false)
timing: 0.209 s
source
static inline R_len_t vec_strided_loc(const int* p_shape_index,
                                      const int* p_strides,
                                      const R_len_t shape_n) {
  R_len_t loc = 0;

  for (R_len_t i = 0; i < shape_n; ++i) {
    loc += p_strides[i] * p_shape_index[i];
  }

  return loc;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:123

vec_strides typed

([*c_int_na, c_int] -> INT)&([*c_int_na, c_true] -> INT1)
timing: 0.245 s
source
static inline SEXP vec_strides(const int* p_dim, const R_len_t shape_n) {
  SEXP strides = PROTECT(Rf_allocVector(INTSXP, shape_n));
  int* p_strides = INTEGER(strides);
  int stride = 1;

  for (int i = 0; i < shape_n; ++i) {
    stride *= p_dim[i];
    p_strides[i] = stride;
  }

  UNPROTECT(1);
  return strides;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:86

vec_subscript_size typed

[INT] -> c_int_na
timing: 0.087 s
source
R_len_t vec_subscript_size(SEXP x) {
  if (is_compact_rep(x)) {
    return r_int_get(x, 1);
  } else if (is_compact_seq(x)) {
    return r_int_get(x, 1);
  } else if (is_compact_condition(x)) {
    return compact_condition_size(x);
  } else {
    return vec_size(x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:986

vec_type_as_str typed

([c(10)] -> c("scalar"))&([c(2)] -> c("logical"))&([c(255)] -> c("s3"))&([c(3)] -> c("integer"))&([c(4)] -> c("double"))&([c(5)] -> c("complex"))&([c(6)] -> c("character"))&([c(7)] -> c("raw"))&([c(8)] -> c("list"))&([c(9)] -> c("dataframe"))&([c_false] -> c("null"))&([c_true] -> c("unspecified"))
timing: 1.44 s
source
const char* vec_type_as_str(enum vctrs_type type) {
  switch (type) {
  case VCTRS_TYPE_null:         return "null";
  case VCTRS_TYPE_unspecified:  return "unspecified";
  case VCTRS_TYPE_logical:      return "logical";
  case VCTRS_TYPE_integer:      return "integer";
  case VCTRS_TYPE_double:       return "double";
  case VCTRS_TYPE_complex:      return "complex";
  case VCTRS_TYPE_character:    return "character";
  case VCTRS_TYPE_raw:          return "raw";
  case VCTRS_TYPE_list:         return "list";
  case VCTRS_TYPE_dataframe:    return "dataframe";
  case VCTRS_TYPE_s3:           return "s3";
  case VCTRS_TYPE_scalar:       return "scalar";
  }
  never_reached("vec_type_as_str");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:120

vec_typeof typed

([null] -> c_false | c(2..7) | c(10))&([LGL<> | null] -> c(0..7) | c(10))
timing: 0.101 s
source
enum vctrs_type vec_typeof(r_obj* x) {
  // Check for unspecified vectors before `vec_base_typeof()` which
  // allows vectors of `NA` to pass through as `VCTRS_TYPE_logical`
  if (vec_is_unspecified(x)) {
    return VCTRS_TYPE_unspecified;
  }

  if (!r_is_object(x) || r_class(x) == r_null) {
    return vec_base_typeof(x, false);
  }

  // Bare data frames are treated as a base atomic type. Subclasses of
  // data frames are treated as S3 to give them a chance to be proxied
  // or implement their own methods for cast, type2, etc.
  if (is_bare_data_frame(x)) {
    return VCTRS_TYPE_dataframe;
  }

  return VCTRS_TYPE_s3;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:94

vec_typeof2 typed

[LGL<> | null, LGL<> | null] -> c(0..77)
timing: 0.032 s
source
enum vctrs_type2 vec_typeof2(r_obj* x, r_obj* y) {
  int _;
  return vec_typeof2_impl(vec_typeof(x), vec_typeof(y), &_);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2.c:221

vec_typeof2_s3 typed

[LGL<> | null, LGL<> | null] -> c(0..104)
timing: 0.046 s
source
enum vctrs_type2_s3 vec_typeof2_s3(r_obj* x, r_obj* y) {
  int _;
  return vec_typeof2_s3_impl(x, y, vec_typeof(x), vec_typeof(y), &_);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2-s3.c:325

vec_typeof2_s3_impl typed timeout → typed

[any_sexp, any_sexp, c(10), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(2), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(255), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(3), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(4), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(5), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(6), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(7), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(8), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c(9), c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c_false, c(0..10) | c(255), *c_int_na] | [any_sexp, any_sexp, c_true, c(0..10) | c(255), *c_int_na] -> c(0..104)
timing: 3.63 s
source
enum vctrs_type2_s3 vec_typeof2_s3_impl(r_obj* x,
                                        r_obj* y,
                                        enum vctrs_type type_x,
                                        enum vctrs_type type_y,
                                        int* left) {
  switch (type_x) {
  case VCTRS_TYPE_null: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_null_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_null_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_null_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_null_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_null_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_null_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_null_unknown;
    }
  }
  case VCTRS_TYPE_unspecified: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_unspecified_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_unspecified_unknown;
    }
  }
  case VCTRS_TYPE_logical: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_logical_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_logical_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_logical_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_logical_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_logical_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_logical_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_logical_unknown;
    }
  }
  case VCTRS_TYPE_integer: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_integer_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_integer_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_integer_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_integer_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_integer_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_integer_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_integer_unknown;
    }
  }
  case VCTRS_TYPE_double: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_double_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_double_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_double_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_double_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_double_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_double_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_double_unknown;
    }
  }
  case VCTRS_TYPE_complex: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_complex_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_complex_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_complex_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_complex_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_complex_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_complex_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_complex_unknown;
    }
  }
  case VCTRS_TYPE_character: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_character_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_character_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_character_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_character_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_character_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_character_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_character_unknown;
    }
  }
  case VCTRS_TYPE_raw: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_raw_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_raw_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_raw_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_raw_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_raw_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_raw_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_raw_unknown;
    }
  }
  case VCTRS_TYPE_list: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_list_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_list_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_list_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_list_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_list_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_list_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_list_unknown;
    }
  }
  case VCTRS_TYPE_dataframe: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_dataframe_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_dataframe_unknown;
    }
  }
  case VCTRS_TYPE_scalar: {
    switch (class_type(y)) {
    case VCTRS_CLASS_bare_factor:  *left = 0; return VCTRS_TYPE2_S3_scalar_bare_factor;
    case VCTRS_CLASS_bare_ordered: *left = 0; return VCTRS_TYPE2_S3_scalar_bare_ordered;
    case VCTRS_CLASS_bare_date:    *left = 0; return VCTRS_TYPE2_S3_scalar_bare_date;
    case VCTRS_CLASS_bare_posixct: *left = 0; return VCTRS_TYPE2_S3_scalar_bare_posixct;
    case VCTRS_CLASS_bare_posixlt: *left = 0; return VCTRS_TYPE2_S3_scalar_bare_posixlt;
    case VCTRS_CLASS_bare_tibble:  *left = 0; return VCTRS_TYPE2_S3_scalar_bare_tibble;
    default:                       *left = 0; return VCTRS_TYPE2_S3_scalar_unknown;
    }
  }
  case VCTRS_TYPE_s3: {
    return vec_typeof2_s3_impl2(x, y, type_y, left);
  }}

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2-s3.c:4

vec_unique_names_impl typed

[CHR, c_int_na, c_false] | [CHR, c_int_na, c_int_na \ c_false] | [null, c_int_na, c_false] | [null, c_int_na, c_int_na \ c_false] -> any_sexp
timing: 0.146 s
source
r_obj* vec_unique_names_impl(r_obj* names, r_ssize n, bool quiet) {
  r_obj* out;
  if (names == r_null) {
    out = KEEP(names_iota(n));
    if (!quiet) {
      describe_repair(names, out);
    }
  } else {
    out = KEEP(vec_as_unique_names(names, quiet));
  }

  FREE(1);
  return(out);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:466

vec_unspecified typed

([c_int] -> LGL)&([c_true] -> LGL1)
timing: 0.072 s
source
SEXP vec_unspecified(R_len_t n) {
  SEXP out = PROTECT(Rf_allocVector(LGLSXP, n));

  r_lgl_fill(out, NA_LOGICAL, n);
  r_attrib_poke_class(out, vctrs_unspecified_class);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:14

vec_validate_minimal_names typed

([CHR, c_int_na, struct r_lazy] -> ())&([null, c_int_na, struct r_lazy] -> empty)
timing: 0.175 s
source
void vec_validate_minimal_names(r_obj* names, r_ssize n, struct r_lazy call) {
  if (names == r_null) {
    r_abort_lazy_call(call, "Names repair functions can't return `NULL`.");
  }

  if (r_typeof(names) != R_TYPE_character) {
    r_abort_lazy_call(call, "Names repair functions must return a character vector.");
  }

  if (n >= 0 && r_length(names) != n) {
    r_abort_lazy_call(call,
                      "Repaired names have length %d instead of length %d.",
                      r_length(names),
                      n);
  }

  if (r_chr_has_string(names, r_globals.na_str)) {
    r_abort_lazy_call(call, "Names repair functions can't return `NA` values.");
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:990

warn_matches_multiple typed

[c_int_na, c_null, c_null, struct r_lazy] -> ()
timing: 0.121 s
source
void warn_matches_multiple(r_ssize i,
                           struct vctrs_arg* needles_arg,
                           struct vctrs_arg* haystack_arg,
                           struct r_lazy call) {
  r_obj* syms[5] = {
    syms_i,
    syms_needles_arg,
    syms_haystack_arg,
    syms_call,
    NULL
  };
  r_obj* args[5] = {
    KEEP(r_int((int)i + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_warn_matches_multiple, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);
  FREE(5);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2777

warn_matches_relationship_many_to_many typed

[c_int_na, c_int_na, c_null, c_null, struct r_lazy] -> ()
timing: 0.189 s
source
void warn_matches_relationship_many_to_many(r_ssize i,
                                            r_ssize j,
                                            struct vctrs_arg* needles_arg,
                                            struct vctrs_arg* haystack_arg,
                                            struct r_lazy call) {
  r_obj* syms[6] = {
   syms_i,
   syms_j,
   syms_needles_arg,
   syms_haystack_arg,
   syms_call,
   NULL
  };
  r_obj* args[6] = {
    KEEP(r_int((int)i + 1)),
    KEEP(r_int((int)j + 1)),
    KEEP(vctrs_arg(needles_arg)),
    KEEP(vctrs_arg(haystack_arg)),
    KEEP(r_lazy_eval_protect(call)),
    NULL
  };

  r_obj* ffi_call = KEEP(r_call_n(syms_warn_matches_relationship_many_to_many, syms, args));
  Rf_eval(ffi_call, vctrs_ns_env);
  FREE(6);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2883

as_df_col C signature

[any_sexp, any_sexp, *c_bool, struct r_lazy] --> any_sexp
unbound variable
error detail
name: shaped_as_df_col
timing: 0.037 s
source
r_obj* as_df_col(r_obj* x,
                 r_obj* outer,
                 bool* allow_pack,
                 struct r_lazy error_call) {
  if (is_data_frame(x)) {
    *allow_pack = true;
    return r_clone(x);
  }

  r_ssize ndim = vec_bare_dim_n(x);
  if (ndim > 2) {
    r_abort_lazy_call(error_call, "Can't bind arrays.");
  }
  if (ndim > 0) {
    *allow_pack = true;
    return shaped_as_df_col(x, outer);
  }

  *allow_pack = false;
  return vec_as_df_col(x, outer);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:698

as_unique_names_impl C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: vctrs_duplicated
timing: 1.58 s
source
r_obj* as_unique_names_impl(r_obj* names, bool quiet) {
  r_ssize n = r_length(names);

  r_obj* new_names = KEEP(r_clone(names));
  r_obj* const * v_new_names = r_chr_cbegin(new_names);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* elt = v_new_names[i];

    // Set `NA` and dots values to "" so they get replaced by `...n`
    // later on
    if (needs_suffix(elt)) {
      elt = strings_empty;
      r_chr_poke(new_names, i, elt);
      continue;
    }

    // Strip `...n` suffixes
    const char* nm = r_str_c_string(elt);
    int pos = suffix_pos(nm);
    if (pos >= 0) {
      elt = Rf_mkCharLenCE(nm, pos, Rf_getCharCE(elt));
      r_chr_poke(new_names, i, elt);
      continue;
    }
  }

  // Append all duplicates with a suffix

  r_obj* dups = KEEP(vctrs_duplicated(new_names));
  const int* dups_ptr = r_lgl_cbegin(dups);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* elt = v_new_names[i];

    if (elt != strings_empty && !dups_ptr[i]) {
      continue;
    }

    const char* name = r_str_c_string(elt);

    int size = strlen(name);
    int buf_size = size + MAX_IOTA_SIZE;

    R_CheckStack2(buf_size);
    char buf[buf_size];
    buf[0] = '\0';

    r_memcpy(buf, name, size);
    int remaining = buf_size - size;

    int needed = snprintf(buf + size, remaining, "...%d", (int) i + 1);
    if (needed >= remaining) {
      stop_large_name();
    }

    r_chr_poke(new_names, i, Rf_mkCharLenCE(buf, size + needed, Rf_getCharCE(elt)));
  }

  if (!quiet) {
    describe_repair(names, new_names);
  }

  FREE(2);
  return new_names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:278

ASSIGN_SHAPED_LOCATION_INDEX C signature

tuple6 --> any
unbound variable
error detail
name: proxy
timing: 0.018 s
(definition not located in src/)

atomic_if_else C signature

[any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, c_int_na, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_int_na] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.171 s
source
r_obj* atomic_if_else(
  r_obj* condition,
  r_obj* true_,
  r_obj* false_,
  r_obj* missing,
  r_obj* ptype,
  r_ssize size,
  struct vctrs_arg* p_true_arg,
  struct vctrs_arg* p_false_arg,
  struct vctrs_arg* p_missing_arg,
  struct r_lazy error_call,
  bool has_missing
) {
  int n_prot = 0;

  // `true`, `false`, and `missing` must all recycle to the size of `condition`
  const r_ssize true_size = vec_check_recyclable(true_, size, VCTRS_ALLOW_NULL_no, p_true_arg, error_call);
  const r_ssize false_size = vec_check_recyclable(false_, size, VCTRS_ALLOW_NULL_no, p_false_arg, error_call);
  const r_ssize missing_size = has_missing ? vec_check_recyclable(missing, size, VCTRS_ALLOW_NULL_no, p_missing_arg, error_call) : 0;

  // Grab names before casting as casting may drop them
  // https://github.com/r-lib/vctrs/issues/623
  r_obj* true_names = KEEP_N(r_names(true_), &n_prot);
  r_obj* false_names = KEEP_N(r_names(false_), &n_prot);
  r_obj* missing_names = KEEP_N(has_missing ? r_names(missing) : r_null, &n_prot);

  const bool has_true_names = true_names != r_null;
  const bool has_false_names = false_names != r_null;
  const bool has_missing_names = missing_names != r_null;

  true_ = KEEP_N(
    vec_cast(
      true_,
      ptype,
      p_true_arg,
      vec_args.empty,
      error_call
    ),
    &n_prot
  );

  false_ = KEEP_N(
    vec_cast(
      false_,
      ptype,
      p_false_arg,
      vec_args.empty,
      error_call
    ),
    &n_prot
  );

  if (has_missing) {
    missing = KEEP_N(
      vec_cast(
        missing,
        ptype,
        p_missing_arg,
        vec_args.empty,
        error_call
      ),
      &n_prot
    );
  }

  r_obj* out = atomic_if_else_switch(
    r_typeof(ptype),
    condition,
    true_,
    false_,
    missing,
    size,
    true_size,
    false_size,
    missing_size,
    true_names,
    false_names,
    missing_names,
    has_missing,
    has_true_names,
    has_false_names,
    has_missing_names
  );

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:188

ATOMIC_IF_ELSE_LOOP C signature

tuple6 --> any
unbound variable
error detail
name: size
timing: 0.013 s
(definition not located in src/)

ATOMIC_IF_ELSE_NAMES_LOOP C signature

tuple3 --> any
unbound variable
error detail
name: size
timing: 0.013 s
(definition not located in src/)

atomic_if_else_switch C signature

[c(0..10) | c(13..25) | c(30..31) | c(99), any_sexp, any_sexp, any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na, any_sexp, any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na] --> any_sexp
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.151 s
source
r_obj* atomic_if_else_switch(
  enum r_type type,
  r_obj* condition,
  r_obj* true_,
  r_obj* false_,
  r_obj* missing,
  r_ssize size,
  r_ssize true_size,
  r_ssize false_size,
  r_ssize missing_size,
  r_obj* true_names,
  r_obj* false_names,
  r_obj* missing_names,
  bool has_missing,
  bool has_true_names,
  bool has_false_names,
  bool has_missing_names
) {
  switch (type) {
  case R_TYPE_logical: ATOMIC_IF_ELSE(
    int,
    int* v_out = r_lgl_begin(out),
    v_out[i] = elt,
    r_lgl_cbegin,
    r_alloc_logical,
    vctrs_shared_missing_lgl
  );
  case R_TYPE_integer: ATOMIC_IF_ELSE(
    int,
    int* v_out = r_int_begin(out),
    v_out[i] = elt,
    r_int_cbegin,
    r_alloc_integer,
    vctrs_shared_missing_int
  );
  case R_TYPE_double: ATOMIC_IF_ELSE(
    double,
    double* v_out = r_dbl_begin(out),
    v_out[i] = elt,
    r_dbl_cbegin,
    r_alloc_double,
    vctrs_shared_missing_dbl
  );
  case R_TYPE_complex: ATOMIC_IF_ELSE(
    r_complex,
    r_complex* v_out = r_cpl_begin(out),
    v_out[i] = elt,
    r_cpl_cbegin,
    r_alloc_complex,
    vctrs_shared_missing_cpl
  );
  case R_TYPE_raw: ATOMIC_IF_ELSE(
    Rbyte,
    Rbyte* v_out = r_raw_begin(out),
    v_out[i] = elt,
    r_raw_cbegin,
    r_alloc_raw,
    vctrs_shared_missing_raw
  );
  case R_TYPE_character: ATOMIC_IF_ELSE(
    r_obj*,
    NULL,
    r_chr_poke(out, i, elt),
    r_chr_cbegin,
    r_alloc_character,
    vctrs_shared_missing_chr
  );
  case R_TYPE_list: ATOMIC_IF_ELSE(
    r_obj*,
    NULL,
    r_list_poke(out, i, elt),
    r_list_cbegin,
    r_alloc_list,
    vctrs_shared_missing_list
  );
  default: r_stop_unreachable();
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:424

attrib_hash C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: [any_sexp & 'I16841, [any_sexp, any_sexp, c_ptr] --> any_sexp, *c_false]
timing: 0.011 s
source
static inline uint32_t attrib_hash(r_obj* x) {
  uint32_t hash = 0;
  r_attrib_map(x, attrib_hash_cb, &hash);
  return hash;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:132

base_c_invoke C signature

[any_sexp, any_sexp, struct r_lazy] --> any_sexp
unbound variable
error detail
name: r_class
timing: 0.035 s
source
r_obj* base_c_invoke(
  r_obj* xs,
  r_obj* name_spec,
  struct r_lazy error_call
) {
  if (vctrs_debug_verbose) {
    r_obj* x = list_first_non_null(xs, NULL);
    r_printf(
      "Falling back to `base::c()` for class `%s`.\n",
      r_chr_get_c_string(r_class(x), 0)
    );
  }

  if (name_spec_is_inner(name_spec)) {
    // We don't support most `name_spec` options in the fallback,
    // but we do allow this one because it is extremely useful
    // and easy to implement
    name_spec = r_null;

    if (r_names(xs) != r_null) {
      // Remove outer names, but remember we likely don't own `xs`!
      xs = KEEP(r_clone_referenced(xs));
      r_attrib_poke_names(xs, r_null);
      FREE(1);
    }
  }
  KEEP(xs);

  if (name_spec != r_null) {
    stop_name_spec_in_fallback(xs, error_call);
  }

  r_obj* ffi_call = KEEP(r_call2(r_sym("base_c_invoke"), xs));
  r_obj* out = r_eval(ffi_call, vctrs_ns_env);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1256

build_from_flat_map C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: ([c_int] --> raw) & ([c_true] --> raw1)
argument: tuple1
timing: 0.336 s
source
r_obj* build_from_flat_map(r_obj* from, r_ssize from_size) {
  r_obj* const* v_from = r_list_cbegin(from);

  // Cache sizes rather than calling `vec_size()` again, as that's
  // a little faster
  r_obj* from_sizes = KEEP(r_alloc_raw(from_size * sizeof(r_ssize)));
  r_ssize* v_from_sizes = r_raw_begin(from_sizes);

  r_ssize from_flat_map_size = 0;

  for (r_ssize i = 0; i < from_size; ++i) {
    r_obj* elt = v_from[i];
    const r_ssize elt_size = vec_size(elt);
    v_from_sizes[i] = elt_size;
    from_flat_map_size += elt_size;
  }

  r_obj* from_flat_map = KEEP(r_alloc_raw(from_flat_map_size * sizeof(r_ssize)));
  r_ssize* v_from_flat_map = r_raw_begin(from_flat_map);
  r_ssize k = 0;

  for (r_ssize i = 0; i < from_size; ++i) {
    const r_ssize elt_size = v_from_sizes[i];
    for (r_ssize j = 0; j < elt_size; ++j) {
      v_from_flat_map[k] = i;
      ++k;
    }
  }

  FREE(2);
  return from_flat_map;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:701

build_indices_for_to_as_list_of_vectors C signature

[any_sexp, any_sexp, any_sexp, c_int_na, c_int_na] --> any_sexp
untypeable application
error detail
function: [INT] --> *c_int_na
argument: [any_sexp]
timing: 0.601 s
source
r_obj* build_indices_for_to_as_list_of_vectors(
  r_obj* x,
  r_obj* from_flat,
  r_obj* from_flat_map,
  r_ssize x_size,
  r_ssize from_size
) {
  r_obj* indices = KEEP(r_alloc_list(from_size));

  const bool has_from_flat_map = from_flat_map != r_null;
  const r_ssize* v_from_flat_map = has_from_flat_map ? r_raw_cbegin(from_flat_map) : NULL;

  // Want `na_equal = true` for `vec_recode_values(x, from = NA, to = to)`
  const bool na_equal = true;

  // Find `x` values in `from_flat`
  r_obj* loc = KEEP(vec_match_params(
    x,
    from_flat,
    na_equal,
    vec_args.empty,
    vec_args.empty,
    r_lazy_null
  ));
  const int* v_loc = r_int_cbegin(loc);

  r_obj* index_sizes = KEEP(r_alloc_raw(from_size * sizeof(r_ssize)));
  r_ssize* v_index_sizes = r_raw_begin(index_sizes);
  r_memset(v_index_sizes, 0, from_size * sizeof(r_ssize));

  // First pass sums the `index` sizes. Using growables has too much
  // ambiguity when there are a large number of `from` elements.
  for (r_ssize i = 0; i < x_size; ++i) {
    int loc = v_loc[i];

    if (loc != r_globals.na_int) {
      loc = has_from_flat_map ? v_from_flat_map[loc - 1] : loc - 1;
      ++v_index_sizes[loc];
    }
  }

  // Direct pointer to the integer vectors we store in `indices`
  r_obj* v_indices = KEEP(r_alloc_raw(from_size * sizeof(int*)));
  int** v_v_indices = r_raw_begin(v_indices);

  // Allocate each `index`
  for (r_ssize i = 0; i < from_size; ++i) {
    const r_ssize index_size = v_index_sizes[i];
    r_obj* index = r_alloc_integer(index_size);
    r_list_poke(indices, i, index);
    v_v_indices[i] = r_int_begin(index);
  }

  // Set `v_index_sizes` to `0`. We are going to reuse this
  // to now track the location we are inserting at for a particular index.
  r_memset(v_index_sizes, 0, from_size * sizeof(r_ssize));
  r_ssize* v_index_locs = v_index_sizes;
  v_index_sizes = NULL;

  // Second pass inserts the `index` values
  for (r_ssize i = 0; i < x_size; ++i) {
    int loc = v_loc[i];

    if (loc != r_globals.na_int) {
      loc = has_from_flat_map ? v_from_flat_map[loc - 1] : loc - 1;
      int* v_index = v_v_indices[loc];
      const r_ssize index_loc = v_index_locs[loc];
      ++v_index_locs[loc];
      v_index[index_loc] = i + 1;
    }
  }

  FREE(4);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:435

build_xs_and_indices_for_to_as_vector C signature

[any_sexp, any_sexp, any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [INT] --> c_int
argument: [any_sexp]
timing: 0.067 s
source
r_obj* build_xs_and_indices_for_to_as_vector(
  r_obj* x,
  r_obj* from_flat,
  r_obj* to,
  r_ssize x_size
) {
  r_obj* out = KEEP(r_alloc_list(2));

  const bool na_equal = true;

  // Find locations where `to` will be utilized
  // Want `na_equal = true` for `vec_recode_values(x, from = NA, to = to)`
  r_obj* loc = KEEP(vec_match_params(
    x,
    from_flat,
    na_equal,
    vec_args.empty,
    vec_args.empty,
    r_lazy_null
  ));

  // TODO: Might be nice if `vec_match()` optionally reported the number of matches
  // as an `n` attribute like `vec_group_id()`, not sure how that interacts with
  // `na_equal = false` though, do propagated `NA` count as matches?
  const r_ssize size = r_int_count_complete(loc);

  r_obj* xs = r_alloc_list(1);
  r_list_poke(out, 0, xs);

  r_obj* indices = r_alloc_list(1);
  r_list_poke(out, 1, indices);

  // `to_size != 1` otherwise we would have used
  // `build_indices_for_single_to()`, so `to` instead has size of `from_size`
  // and must be resliced and placed in the correct order.
  if (size == x_size) {
    // It's fairly common to match every value in `x` when recoding,
    // so we optimize this case. You don't need to drop the `NA`s
    // out of the index before slicing (there aren't any), and you
    // can use a compact-seq for the assignment index.
    r_obj* index = compact_seq(0, x_size, true);
    r_list_poke(indices, 0, index);
    r_list_poke(xs, 0, vec_slice_unsafe(to, loc));
  } else {
    const int* v_loc = r_int_cbegin(loc);

    r_obj* index = r_alloc_integer(size);
    r_list_poke(indices, 0, index);
    int* v_index = r_int_begin(index);

    for (r_ssize i = 0, j = 0; i < x_size && j < size; ++i) {
      const int elt = v_loc[i];
      v_index[j] = elt;
      j += (elt != r_globals.na_int);
    }

    r_list_poke(xs, 0, vec_slice_unsafe(to, index));

    // Now actually fill `index` for use with `list_combine()`
    for (r_ssize i = 0, j = 0; i < x_size && j < size; ++i) {
      const int elt = v_loc[i];
      v_index[j] = i + 1;
      j += (elt != r_globals.na_int);
    }
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:566

chop C signature

[any_sexp, struct vctrs_proxy_info, *struct vctrs_chop_indices] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.016 s
source
r_obj* chop(r_obj* x,
            struct vctrs_proxy_info info,
            struct vctrs_chop_indices* p_indices) {
  r_obj* proxy = info.inner;
  r_obj* names = KEEP(r_names(proxy));
  const enum vctrs_type type = info.type;

  const r_ssize out_size = indices_out_size(p_indices, proxy);
  r_obj* out = KEEP(r_alloc_list(out_size));

  // Treat `elt` as owned after slicing (we also poke its names directly).
  // `vec_proxy_info()` doesn't recursively proxy.
  const struct vec_restore_opts elt_restore_opts = {
    .ownership = VCTRS_OWNERSHIP_shallow,
    .recursively_proxied = false
  };

  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* index = indices_next(p_indices);

    // Always materialize ALTREP vectors when chopping to avoid inefficiently
    // creating a large amount of small ALTREP objects that are used downstream.
    // This is a heuristic and we should also be on the lookout for cases where
    // we chop to create a small amount of large ALTREP objects that are
    // quickly discarded (#1450).
    r_obj* elt = KEEP(vec_slice_base(
      type,
      proxy,
      index,
      VCTRS_MATERIALIZE_true
    ));

    if (names != r_null) {
      r_obj* elt_names = slice_names(names, index);
      r_attrib_poke_names(elt, elt_names);
    }

    elt = vec_restore_opts(elt, x, &elt_restore_opts);
    r_list_poke(out, i, elt);

    FREE(1);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:252

chop_df C signature

[any_sexp, struct vctrs_proxy_info, *struct vctrs_chop_indices] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.108 s
source
r_obj* chop_df(r_obj* x,
               struct vctrs_proxy_info info,
               struct vctrs_chop_indices* p_indices) {
  r_obj* proxy = info.inner;
  r_obj* const* v_proxy = r_list_cbegin(proxy);

  const r_ssize n_cols = r_length(proxy);

  r_obj* col_names = KEEP(r_names(proxy));
  r_obj* row_names = KEEP(df_rownames(proxy));

  const bool has_row_names = r_typeof(row_names) == R_TYPE_character;

  const r_ssize out_size = indices_out_size(p_indices, proxy);
  r_obj* out = KEEP(r_alloc_list(out_size));
  r_obj* const* v_out = r_list_cbegin(out);

  // Pre-load the `out` container with empty bare data frames
  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* elt = r_alloc_list(n_cols);
    r_list_poke(out, i, elt);

    r_attrib_poke_names(elt, col_names);

    r_obj* index = indices_next(p_indices);
    const r_ssize size = vec_subscript_size(index);

    init_data_frame(elt, size);

    if (has_row_names) {
      r_obj* elt_row_names = slice_rownames(row_names, index);
      r_attrib_poke(elt, r_syms.row_names, elt_row_names);
    }
  }

  r_obj* indices = p_indices->indices;
  r_obj* sizes = p_indices->sizes;

  // Chop each column according to the indices, and then assign the results
  // into the appropriate data frame column in the `out` list
  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* col = v_proxy[i];
    r_obj* col_chopped = KEEP(vec_chop_unsafe(col, indices, sizes));
    r_obj* const* v_col_chopped = r_list_cbegin(col_chopped);

    for (r_ssize j = 0; j < out_size; ++j) {
      r_obj* elt = v_out[j];
      r_list_poke(elt, i, v_col_chopped[j]);
    }

    FREE(1);
  }

  // Each data frame container is owned by us.
  // Columns aren't necessarily owned by us, but that
  // doesn't matter because we don't recursively restore.
  // `vec_proxy_info()` doesn't recursively proxy.
  const struct vec_restore_opts elt_restore_opts = {
    .ownership = VCTRS_OWNERSHIP_shallow,
    .recursively_proxied = false
  };

  // Restore each data frame
  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* elt = v_out[i];
    elt = vec_restore_opts(elt, x, &elt_restore_opts);
    r_list_poke(out, i, elt);
  }

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:300

chop_fallback C signature

[any_sexp, *struct vctrs_chop_indices] --> any_sexp
untypeable application
error detail
function: [env] --> env
argument: [any_sexp]
timing: 0.032 s
source
r_obj* chop_fallback(r_obj* x, struct vctrs_chop_indices* p_indices) {
  // Evaluate in a child of the global environment to allow dispatch
  // to custom functions. We define `[` to point to its base
  // definition to ensure consistent look-up. This is the same logic
  // as in `vctrs_dispatch_n()`, reimplemented here to allow repeated
  // evaluations in a loop.
  r_obj* env = KEEP(r_alloc_empty_environment(r_envs.global));
  r_env_bind(env, syms_x, x);

  // Construct call with symbols, not values, for performance.
  // TODO - Remove once bit64 is updated on CRAN. Special casing integer64
  // objects to ensure correct slicing with `NA_integer_`.
  r_obj* call;
  if (is_integer64(x)) {
    call = KEEP(r_call3(syms.vec_slice_dispatch_integer64, syms_x, syms_i));
    r_env_bind(env, syms.vec_slice_dispatch_integer64, fns.vec_slice_dispatch_integer64);
  } else {
    call = KEEP(r_call3(syms_bracket, syms_x, syms_i));
    r_env_bind(env, syms_bracket, fns_bracket);
  }

  // Sliced `elt` comes from R, so is foreign. Technically not proxied at all,
  // so "restoring" is a bit of a hack, but we only restore if it looks like the
  // `[` result is missing attributes.
  struct vec_restore_opts elt_restore_opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };

  const r_ssize out_size = indices_out_size(p_indices, x);
  r_obj* out = KEEP(r_alloc_list(out_size));

  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* index = indices_next(p_indices);

    index = KEEP(vec_subscript_materialize(index));

    // Update `i` binding with the new index value
    r_env_bind(env, syms_i, index);

    r_obj* elt = KEEP(r_eval(call, env));

    if (!vec_is_restored(elt, x)) {
      // No guarantee that we own `elt` here
      elt = vec_restore_opts(elt, x, &elt_restore_opts);
    }

    r_list_poke(out, i, elt);
    FREE(2);
  }

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:427

chop_shaped C signature

[any_sexp, struct vctrs_proxy_info, *struct vctrs_chop_indices] --> any_sexp
unbound variable
error detail
name: r_dim_names
timing: 0.029 s
source
r_obj* chop_shaped(r_obj* x,
                   struct vctrs_proxy_info info,
                   struct vctrs_chop_indices* p_indices) {
  r_obj* proxy = info.inner;
  const enum vctrs_type type = info.type;

  r_obj* dim_names = KEEP(r_dim_names(proxy));

  r_obj* row_names = r_null;
  if (dim_names != r_null) {
    row_names = r_list_get(dim_names, 0);
  }

  const r_ssize out_size = indices_out_size(p_indices, proxy);
  r_obj* out = KEEP(r_alloc_list(out_size));

  // Treat each `elt` as owned (we also poke its dim names)
  // `vec_proxy_info()` doesn't recursively proxy.
  const struct vec_restore_opts elt_restore_opts = {
    .ownership = VCTRS_OWNERSHIP_shallow,
    .recursively_proxied = false
  };

  for (r_ssize i = 0; i < out_size; ++i) {
    r_obj* index = indices_next(p_indices);

    r_obj* elt = KEEP(vec_slice_shaped(type, proxy, index));

    if (dim_names != r_null) {
      if (row_names != r_null) {
        // Required to slice row names to the right size before poking to avoid
        // erroring on the dimnames length check in `Rf_setAttrib()`
        r_obj* new_dim_names = KEEP(r_clone(dim_names));
        r_obj* new_row_names = slice_names(row_names, index);
        r_list_poke(new_dim_names, 0, new_row_names);
        r_attrib_poke_dim_names(elt, new_dim_names);
        FREE(1);
      } else {
        r_attrib_poke_dim_names(elt, dim_names);
      }
    }

    elt = vec_restore_opts(elt, x, &elt_restore_opts);
    r_list_poke(out, i, elt);

    FREE(1);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:374

chr_as_factor_from_self C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: vec_unique
timing: 0.008 s
source
static SEXP chr_as_factor_from_self(SEXP x, bool ordered) {
  SEXP levels = PROTECT(vec_unique(x));
  levels = PROTECT(remove_na_levels(levels));

  // `NA` values in `x` correctly become `NA` values in the result
  SEXP out = PROTECT(vec_match(x, levels));

  if (ordered) {
    init_ordered(out, levels);
  } else {
    init_factor(out, levels);
  }

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:211

chr_as_factor_impl C signature

[any_sexp, any_sexp, *c_bool, c_int_na] --> any_sexp
untypeable application
error detail
function: ([INT] --> *c_int_na) & ([^INT1] --> *c_int)
argument: [any_sexp]
timing: 0.124 s
source
static SEXP chr_as_factor_impl(SEXP x, SEXP levels, bool* lossy, bool ordered) {
  SEXP out = PROTECT(vec_match(x, levels));
  const int* p_out = INTEGER(out);

  R_len_t size = vec_size(x);
  const SEXP* p_x = STRING_PTR_RO(x);

  // Detect lossy no-matches, but allow `NA` values from `x`
  for (R_len_t i = 0; i < size; ++i) {
    if (p_out[i] == NA_INTEGER && p_x[i] != NA_STRING) {
      *lossy = true;
      UNPROTECT(1);
      return R_NilValue;
    }
  }

  if (ordered) {
    init_ordered(out, levels);
  } else {
    init_factor(out, levels);
  }

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:181

chr_as_location C signature

[any_sexp, any_sexp, *struct location_opts] --> any_sexp
untypeable application
error detail
function: [null | vec, null | vec, c_int] --> INT
argument: [any_sexp & 'I49177, any_sexp & 'I49176, c_int_na]
timing: 0.168 s
source
r_obj* chr_as_location(r_obj* subscript,
                       r_obj* names,
                       const struct location_opts* opts) {
  if (names == R_NilValue) {
    r_abort("Can't use character names to index an unnamed vector.");
  }
  if (r_typeof(names) != R_TYPE_character) {
    r_abort("`names` must be a character vector.");
  }

  bool remove_missing = false;

  r_obj* matched = KEEP(Rf_match(names, subscript, r_globals.na_int));
  r_attrib_poke_names(matched, r_names(subscript));

  r_ssize n = r_length(matched);
  int* p = r_int_begin(matched);
  r_obj* const * ip = r_chr_cbegin(subscript);

  for (r_ssize k = 0; k < n; ++k) {
    const r_obj* elt = ip[k];

    if (elt == r_strs.empty) {
      // `""` never matches, even if `names` contains a `""` name
      stop_subscript_empty(subscript, opts);
    }

    if (elt == r_globals.na_str) {
      // `NA_character_` never matches, even if `names` contains a missing name
      p[k] = r_globals.na_int;

      switch (opts->missing) {
      case SUBSCRIPT_MISSING_PROPAGATE: continue;
      case SUBSCRIPT_MISSING_REMOVE: remove_missing = true; continue;
      case SUBSCRIPT_MISSING_ERROR: stop_subscript_missing(subscript, opts);
      }
    }

    if (p[k] == r_globals.na_int) {
      stop_subscript_oob_name(subscript, names, opts);
    }
  }

  if (remove_missing) {
    if (opts->missing != SUBSCRIPT_MISSING_REMOVE) {
      r_stop_internal("`missing = 'remove'` must be set if `n_missing > 0`.");
    }

    r_obj* not_missing = KEEP(vec_detect_complete(matched));
    matched = KEEP(vec_slice(matched, not_missing));

    FREE(2);
  }
  KEEP(matched);

  FREE(2);
  return matched;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:455

chr_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: SEXP
timing: 0.002 s
source
void chr_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(SEXP, STRING_PTR_RO, chr_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:156

chr_names_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: [CHR, c_int, p(CHR)] --> ()
argument: [any_sexp, c_false | 'I23534, any_sexp]
timing: 0.351 s
source
r_obj* chr_names_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE_BARRIER(R_TYPE_character, r_chr_cbegin, r_chr_poke, r_strs.empty);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:161

chr_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: [CHR, c_int, p(CHR)] --> ()
argument: [any_sexp, c_false | 'I23344, any_sexp]
timing: 0.369 s
source
r_obj* chr_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE_BARRIER(R_TYPE_character, r_chr_cbegin, r_chr_poke, r_globals.na_str);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:157

col_detect_missing C signature

[any_sexp, *c_int_na, c_int_na] --> c_int_na
untypeable application
error detail
function: ([INT, *c_int_na, c_int_na] --> c_int) & ([INT, c_null, c_int_na] --> c_false)
argument: [LGL & 'I57227, *c_int_na & 'I57228, c_int_na & 'I57229]
timing: 0.115 s
source
r_ssize col_detect_missing(r_obj* x,
                           r_ssize* v_loc,
                           r_ssize loc_size) {
  const enum vctrs_type type = vec_proxy_typeof(x);

  switch (type) {
  case VCTRS_TYPE_logical: return lgl_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_integer: return int_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_double: return dbl_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_complex: return cpl_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_raw: return raw_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_character: return chr_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_list: return list_col_detect_missing(x, v_loc, loc_size);
  case VCTRS_TYPE_dataframe: r_stop_internal("Data frame columns should have been flattened by now.");
  case VCTRS_TYPE_null: r_abort("Unexpected `NULL` column found in a data frame.");
  case VCTRS_TYPE_scalar: stop_scalar_type(x, vec_args.empty, r_lazy_null);
  default: stop_unimplemented_vctrs_type("vec_detect_missing", type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:136

COMPARE_COL C signature

tuple3 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.002 s
(definition not located in src/)

cpl_col_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: Rcomplex
timing: 0.002 s
source
void cpl_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(Rcomplex, r_cpl_cbegin, cpl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:323

cpl_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: Rcomplex
timing: 0.003 s
source
void cpl_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(Rcomplex, COMPLEX_RO, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:152

cpl_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: Rcomplex
timing: 0.002 s
source
void cpl_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(Rcomplex, r_cpl_cbegin, cpl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:224

cpl_equal C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na] --> any_sexp
untypeable application
error detail
function: [{ r : c_double ; i : c_double ..}, { r : c_double ; i : c_double ..}] --> c_lgl
argument: [s({ r: c_double, i: c_double }), s({ r: c_double, i: c_double })]
timing: 5.08 s
source
SEXP cpl_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(Rcomplex, COMPLEX_RO, cpl_equal_na_equal, cpl_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:147

cpl_first_missing C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [{ r : c_double ; i : c_double ..}] --> c_bool
argument: [~c_string]
timing: 0.210 s
source
r_ssize cpl_first_missing(r_obj* x) {
  FIRST_MISSING(r_complex, r_cpl_cbegin, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:328

cpl_hash C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [{ r : c_double ; i : c_double ..}] --> c_int_na
argument: [~c_string]
timing: 0.187 s
source
static inline uint32_t cpl_hash(r_obj* x) {
  HASH(r_complex, r_cpl_cbegin, cpl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:86

cpl_hash_fill_na_equal C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: r_complex
timing: 0.002 s
source
static inline void cpl_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(r_complex, r_cpl_cbegin, cpl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:235

cpl_hash_fill_na_propagate C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: r_complex
timing: 0.004 s
source
static inline void cpl_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(r_complex, r_cpl_cbegin, cpl_hash_scalar, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:257

cpl_order_compare_na_equal C signature

[any, any, c_int_na] --> c_int_na
untypeable application
error detail
function: { r : 'I4267 ..} --> 'I4267
argument: any
timing: 0.039 s
source
int cpl_order_compare_na_equal(r_complex x, r_complex y, bool nan_distinct) {
  x = cpl_normalise_missing(x);
  y = cpl_normalise_missing(y);

  const int cmp = dbl_order_compare_na_equal(x.r, y.r, nan_distinct);

  if (cmp == 0) {
    return dbl_order_compare_na_equal(x.i, y.i, nan_distinct);
  } else {
    return cmp;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:65

cpl_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: [CLX] --> *s({ r: c_double, i: c_double })
argument: [any_sexp]
timing: 0.526 s
source
r_obj* cpl_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE(R_TYPE_complex, r_complex, r_cpl_begin, r_cpl_cbegin, r_globals.na_cpl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:83

dbl_adjust C signature

[c_int_na, c_int_na, c_int_na, c_int_na, c_ptr] --> c_void
untypeable application
error detail
function: [c_false, c_false, c_int_na, c_null, *c_int_na] | [c_int_na \ c_false, c_false, c_int_na, c_null, *c_int_na] --> ()
argument: [c_bool, c_bool, c_int_na & 'I74513, *c_double, *c_int_na]
timing: 1.98 s
source
void dbl_adjust(
  const bool decreasing,
  const bool na_last,
  const bool nan_distinct,
  const r_ssize size,
  void* p_x
) {
  double* p_x_dbl = (double*) p_x;
  uint64_t* p_x_u64 = (uint64_t*) p_x;

  if (nan_distinct) {
    dbl_adjust_nan_distinct(decreasing, na_last, size, p_x_dbl, p_x_u64);
  } else {
    dbl_adjust_nan_identical(decreasing, na_last, size, p_x_dbl, p_x_u64);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1762

dbl_col_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: double
timing: 0.002 s
source
void dbl_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(double, r_dbl_cbegin, dbl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:319

dbl_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: double
timing: 0.003 s
source
void dbl_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(double, REAL_RO, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:148

dbl_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: double
timing: 0.002 s
source
void dbl_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(double, r_dbl_cbegin, dbl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:220

dbl_extract_uint64_byte C signature

[c_int_na, c_int_na] --> c_int_na
unbound variable
error detail
name: UINT8_MAX
timing: 0.007 s
source
uint8_t dbl_extract_uint64_byte(uint64_t x, uint8_t shift) {
  return (x >> shift) & UINT8_MAX;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2245

dbl_hash_fill_na_equal C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: double
timing: 0.003 s
source
static inline void dbl_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(double, r_dbl_cbegin, dbl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:232

dbl_hash_fill_na_propagate C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: double
timing: 0.004 s
source
static inline void dbl_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(double, r_dbl_cbegin, dbl_hash_scalar, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:254

dbl_order_radix_recurse C signature

[c_int_na, c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_bool, *struct group_infos] --> c_void
unbound variable
error detail
name: UINT8_MAX_SIZE
timing: 0.482 s
source
void dbl_order_radix_recurse(
  const r_ssize size,
  const uint8_t pass,
  uint64_t* p_x,
  int* p_o,
  uint64_t* p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  r_ssize* p_counts,
  bool* p_skips,
  struct group_infos* p_group_infos
) {
  // Exit as fast as possible if we are below the insertion order boundary
  if (size <= ORDER_INSERTION_BOUNDARY) {
    dbl_order_insertion(size, p_x, p_o, p_group_infos);
    return;
  }

  // Skip passes where our up front check told us that all bytes were the same
  uint8_t next_pass = pass + 1;
  r_ssize* p_counts_next_pass = p_counts + UINT8_MAX_SIZE;

  while (next_pass < DBL_MAX_RADIX_PASS && p_skips[next_pass]) {
    ++next_pass;
    p_counts_next_pass += UINT8_MAX_SIZE;
  }

  const uint8_t radix = PASS_TO_RADIX(pass, DBL_MAX_RADIX_PASS);
  const uint8_t shift = radix * 8;

  uint8_t byte = 0;

  // Histogram
  for (r_ssize i = 0; i < size; ++i) {
    const uint64_t x_elt = p_x[i];

    byte = dbl_extract_uint64_byte(x_elt, shift);

    p_bytes[i] = byte;
    ++p_counts[byte];
  }

  // Fast check to see if all bytes were the same.
  // If so, skip this `pass` since we learned nothing.
  // No need to accumulate counts and iterate over chunks,
  // we know all others are zero.
  if (p_counts[byte] == size) {
    // Reset count for other group chunks
    p_counts[byte] = 0;

    if (next_pass == DBL_MAX_RADIX_PASS) {
      // If we are already at the last pass, we are done
      groups_size_maybe_push(size, p_group_infos);
    } else {
      // Otherwise, recurse on next byte using the same `size` since
      // the group size hasn't changed
      dbl_order_radix_recurse(
        size,
        next_pass,
        p_x,
        p_o,
        p_x_aux,
        p_o_aux,
        p_bytes,
        p_counts_next_pass,
        p_skips,
        p_group_infos
      );
    }

    return;
  }

  r_ssize cumulative = 0;

  // Accumulate counts, skip zeros
  for (uint16_t i = 0; i < UINT8_MAX_SIZE; ++i) {
    r_ssize count = p_counts[i];

    if (count == 0) {
      continue;
    }

    // Replace with `cumulative` first, then bump `cumulative`.
    // `p_counts` now represents starting locations for each radix group.
    p_counts[i] = cumulative;
    cumulative += count;
  }

  // Place into auxiliary arrays in the correct order, then copy back over
  for (r_ssize i = 0; i < size; ++i) {
    const uint8_t byte = p_bytes[i];
    const r_ssize loc = p_counts[byte]++;
    p_o_aux[loc] = p_o[i];
    p_x_aux[loc] = p_x[i];
  }

  // Copy back over
  r_memcpy(p_o, p_o_aux, size * sizeof(*p_o_aux));
  r_memcpy(p_x, p_x_aux, size * sizeof(*p_x_aux));

  r_ssize last_cumulative_count = 0;

  // Recurse on subgroups as required
  for (uint16_t i = 0; last_cumulative_count < size && i < UINT8_MAX_SIZE; ++i) {
    const r_ssize cumulative_count = p_counts[i];

    if (!cumulative_count) {
      continue;
    }

    p_counts[i] = 0;

    // Diff the accumulated counts to get the radix group size
    const r_ssize group_size = cumulative_count - last_cumulative_count;
    last_cumulative_count = cumulative_count;

    if (group_size == 1) {
      groups_size_maybe_push(1, p_group_infos);
      ++p_x;
      ++p_o;
      continue;
    }

    // Can get here in the case of ties, like c(1, 1), which have a
    // `group_size` of 2 in the last radix, but there is nothing left to
    // compare so we are done.
    if (next_pass == DBL_MAX_RADIX_PASS) {
      groups_size_maybe_push(group_size, p_group_infos);
      p_x += group_size;
      p_o += group_size;
      continue;
    }

    // Order next byte of this subgroup
    dbl_order_radix_recurse(
      group_size,
      next_pass,
      p_x,
      p_o,
      p_x_aux,
      p_o_aux,
      p_bytes,
      p_counts_next_pass,
      p_skips,
      p_group_infos
    );

    p_x += group_size;
    p_o += group_size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2018

dbl_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: [DBL] --> *c_double
argument: [any_sexp]
timing: 0.461 s
source
r_obj* dbl_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE(R_TYPE_double, double, r_dbl_begin, r_dbl_cbegin, r_globals.na_dbl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:79

describe_repair C signature

[any_sexp, any_sexp] --> c_void
untypeable application
error detail
function: [any_sexp, env] --> any_sexp
argument: [null, any_sexp]
timing: 0.021 s
source
void describe_repair(r_obj* old_names, r_obj* new_names) {
  r_obj* call = KEEP(r_call3(r_sym("describe_repair"),
                             old_names,
                             new_names));
  r_eval(call, vctrs_ns_env);

  // To reset visibility when called from a `.External2()`
  r_eval(r_null, r_envs.empty);

  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:496

df_cast_match C signature

[*struct cast_opts, any_sexp, any_sexp] --> any_sexp
untypeable application
error detail
function: ([INT] --> *c_int_na) & ([^INT1] --> *c_int)
argument: [any_sexp]
timing: 11.71 s
source
r_obj* df_cast_match(const struct cast_opts* opts,
                     r_obj* x_names,
                     r_obj* to_names) {
  r_obj* x = opts->x;
  r_obj* to = opts->to;

  r_obj* to_dups_pos = KEEP(vec_match(to_names, x_names));
  int* to_dups_pos_data = r_int_begin(to_dups_pos);

  r_ssize to_len = r_length(to_dups_pos);
  r_obj* out = KEEP(r_alloc_list(to_len));
  r_attrib_poke(out, r_syms.names, to_names);

  r_ssize size = df_size(x);
  r_ssize common_len = 0;

  r_ssize i = 0;
  r_ssize x_arg_loc = 0;

  struct vctrs_arg* named_x_arg = new_subscript_arg(opts->p_x_arg, x_names, r_length(x_names), &x_arg_loc);
  KEEP(named_x_arg->shelter);

  struct vctrs_arg* named_to_arg = new_subscript_arg(opts->p_to_arg, to_names, to_len, &i);
  KEEP(named_to_arg->shelter);

  for (; i < to_len; ++i) {
    r_ssize pos = to_dups_pos_data[i];

    if (pos == r_globals.na_int) {
      r_obj* to_col = r_list_get(to, i);

      // FIXME: Need to initialise the vector because we currently use
      // `vec_assign()` in `vec_rbind()` before falling back. Attach
      // an attribute to recognise unspecified vectors in
      // `base_c_invoke()`.
      if (opts->s3_fallback && vec_is_common_class_fallback(to_col)) {
        r_obj* col = KEEP(vec_init(to_col, size));
        r_attrib_poke(col, r_sym("vctrs:::unspecified"), r_true);
        r_list_poke(out, i, col);
        FREE(1);
      } else {
        r_obj* col = vec_init(to_col, size);
        r_list_poke(out, i, col);
      }
    } else {
      --pos; // 1-based index
      ++common_len;
      x_arg_loc = pos;

      struct cast_opts col_opts = {
        .x = r_list_get(x, pos),
        .to = r_list_get(to, i),
        .p_x_arg = named_x_arg,
        .p_to_arg = named_to_arg,
        .call = opts->call,
        .s3_fallback = opts->s3_fallback
      };

      r_obj* col = vec_cast_opts(&col_opts);
      r_list_poke(out, i, col);
    }
  }

  // Restore data frame size before calling `vec_restore()`. `x` and
  // `to` might not have any columns to compute the original size.
  init_data_frame(out, size);
  r_attrib_poke(out, r_syms.row_names, df_rownames(x));

  r_ssize extra_len = r_length(x) - common_len;
  if (extra_len) {
    r_obj* ffi_x_arg = KEEP(vctrs_arg(opts->p_x_arg));
    r_obj* ffi_to_arg = KEEP(vctrs_arg(opts->p_to_arg));
    r_obj* ffi_call = KEEP(r_lazy_eval(opts->call));
    out = vctrs_dispatch6(syms_df_lossy_cast, fns_df_lossy_cast,
                          syms_out, out,
                          syms_x, x,
                          syms_to, to,
                          syms_x_arg, ffi_x_arg,
                          syms_to_arg, ffi_to_arg,
                          syms_call, ffi_call);
    FREE(3);
  }

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:757

df_cast_opts C signature

[*struct cast_opts] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.009 s
source
r_obj* df_cast_opts(const struct cast_opts* opts) {
  r_obj* x_names = KEEP(r_names(opts->x));
  r_obj* to_names = KEEP(r_names(opts->to));

  if (x_names == r_null || to_names == r_null) {
    r_stop_internal("Data frame must have names.");
  }

  r_obj* out = r_null;

  if (obj_equal(x_names, to_names)) {
    out = df_cast_loop(opts, x_names);
  } else {
    out = df_cast_match(opts, x_names, to_names);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:736

df_compare C signature

[any_sexp, any_sexp, c_int_na, c_int_na] --> any_sexp
untypeable application
error detail
function: ([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_ptr] --> ()) & ([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_null] | [c_null, any] --> empty)
argument: [*struct df_short_circuit_info, *c_false]
timing: 1.13 s
source
r_obj* df_compare(r_obj* x, r_obj* y, bool na_equal, r_ssize size) {
  int nprot = 0;

  r_obj* out = KEEP_N(r_alloc_integer(size), &nprot);
  int* v_out = r_int_begin(out);

  // Initialize to "equality" value and only change if we learn that it differs.
  // This also determines the zero column result.
  r_memset(v_out, 0, size * sizeof(int));

  struct df_short_circuit_info info = new_df_short_circuit_info(size, false);
  struct df_short_circuit_info* p_info = &info;
  PROTECT_DF_SHORT_CIRCUIT_INFO(p_info, &nprot);

  df_compare_impl(v_out, p_info, x, y, na_equal);

  FREE(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:82

df_detect_complete_by_col C signature

[any_sexp, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.016 s
source
r_obj* df_detect_complete_by_col(r_obj* x, r_ssize x_size, r_ssize n_cols) {
  r_obj* out = KEEP(r_alloc_list(n_cols));
  r_attrib_poke_names(out, r_names(x));
  r_init_data_frame(out, x_size);

  r_obj* const* v_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* col = v_x[i];
    // Use completeness to match `vec_rank()` and `vec_match()`
    r_obj* complete = vec_detect_complete(col);
    r_list_poke(out, i, complete);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1243

df_equal C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na] --> any_sexp
untypeable application
error detail
function: ([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_ptr] --> ()) & ([*{ row_known : any_sexp ; row_known_pi : c_int_na | c_string ..}, c_null] | [c_null, any] --> empty)
argument: [*struct df_short_circuit_info, *c_false]
timing: 16.34 s
source
SEXP df_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  int nprot = 0;

  SEXP out = PROTECT_N(r_new_logical(size), &nprot);
  int* p_out = LOGICAL(out);

  // Initialize to "equality" value
  // and only change if we learn that it differs
  for (R_len_t i = 0; i < size; ++i) {
    p_out[i] = 1;
  }

  struct df_short_circuit_info info = new_df_short_circuit_info(size, false);
  struct df_short_circuit_info* p_info = &info;
  PROTECT_DF_SHORT_CIRCUIT_INFO(p_info, &nprot);

  R_len_t n_col = Rf_length(x);

  if (n_col != Rf_length(y)) {
    Rf_errorcall(R_NilValue, "`x` and `y` must have the same number of columns");
  }

  void (*vec_equal_col)(SEXP, SEXP, bool, bool, int*, struct df_short_circuit_info*);

  if (na_equal) {
    vec_equal_col = vec_equal_col_na_equal;
  } else {
    vec_equal_col = vec_equal_col_na_propagate;
  }

  const SEXP* p_x = VECTOR_PTR_RO(x);
  const SEXP* p_y = VECTOR_PTR_RO(y);

  for (R_len_t i = 0; i < n_col; ++i) {
    vec_equal_col(p_x[i], p_y[i], x_recycles, y_recycles, p_out, p_info);

    if (p_info->remaining == 0) {
      break;
    }
  }

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:189

df_flat_width C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.127 s
source
r_ssize df_flat_width(r_obj* x) {
  r_ssize n = r_length(x);
  r_ssize out = n;

  r_obj* const * v_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* col = v_x[i];
    if (is_data_frame(col)) {
      out = out + df_flat_width(col) - 1;
    }
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:922

df_flatten_info C signature

[any_sexp] --> struct flatten_info
untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.110 s
source
struct flatten_info df_flatten_info(r_obj* x) {
  bool flatten = false;

  r_ssize n = r_length(x);
  r_ssize width = n;

  r_obj* const * v_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* col = v_x[i];
    if (is_data_frame(col)) {
      flatten = true;
      width = width + df_flat_width(col) - 1;
    }
  }

  return (struct flatten_info){flatten, width};
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:944

df_flatten_loop C signature

[any_sexp, any_sexp, any_sexp, c_int_na] --> c_int_na
unbound variable
error detail
name: r_names
timing: 0.042 s
source
r_ssize df_flatten_loop(r_obj* x,
                        r_obj* out,
                        r_obj* out_names,
                        r_ssize counter) {
  r_ssize n = r_length(x);
  r_obj* x_names = KEEP(r_names(x));

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* col = r_list_get(x, i);

    if (is_data_frame(col)) {
      counter = df_flatten_loop(col, out, out_names, counter);
    } else {
      r_list_poke(out, counter, col);
      r_chr_poke(out_names, counter, r_chr_get(x_names, i));
      ++counter;
    }
  }

  FREE(1);
  return counter;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:999

df_joint_xtfrm_by_col C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na, any_sexp] --> any_sexp
untypeable application
error detail
function: [{ 'I105325 }, c_int] --> 'I105325
argument: [any_sexp, c_false]
timing: 0.739 s
source
r_obj* df_joint_xtfrm_by_col(r_obj* x,
                             r_obj* y,
                             r_ssize x_size,
                             r_ssize y_size,
                             r_ssize n_cols,
                             bool nan_distinct,
                             r_obj* chr_proxy_collate) {
  r_obj* out = KEEP(r_alloc_list(2));

  x = r_clone(x);
  r_list_poke(out, 0, x);

  y = r_clone(y);
  r_list_poke(out, 1, y);

  r_obj* const* v_x = r_list_cbegin(x);
  r_obj* const* v_y = r_list_cbegin(y);

  for (r_ssize col = 0; col < n_cols; ++col) {
    r_obj* x_col = v_x[col];
    r_obj* y_col = v_y[col];
    r_obj* xtfrms = vec_joint_xtfrm(x_col, y_col, x_size, y_size, nan_distinct, chr_proxy_collate);
    r_list_poke(x, col, r_list_get(xtfrms, 0));
    r_list_poke(y, col, r_list_get(xtfrms, 1));
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1210

df_list C signature

[any_sexp, c_int_na, c_int_na, *struct name_repair_opts, struct r_lazy] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.116 s
source
r_obj* df_list(r_obj* x,
               r_ssize size,
               bool unpack,
               const struct name_repair_opts* p_name_repair_opts,
               struct r_lazy error_call) {
  if (r_typeof(x) != R_TYPE_list) {
    r_stop_internal("`x` must be a list.");
  }

  x = KEEP(vec_recycle_common(x, size, vec_args.empty, error_call));

  r_ssize n_cols = r_length(x);

  // Unnamed columns are auto-named with `""`
  if (r_names(x) == r_null) {
    r_obj* names = KEEP(r_new_character(n_cols));
    r_attrib_poke_names(x, names);
    FREE(1);
  }

  x = KEEP(df_list_drop_null(x));

  if (unpack) {
    x = df_list_unpack(x);
  }
  KEEP(x);

  r_obj* names = KEEP(r_names(x));
  names = KEEP(vec_as_names(names, p_name_repair_opts));
  r_attrib_poke_names(x, names);

  FREE(5);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:248

df_locate_matches C signature

[any_sexp, any_sexp, any_sexp, any_sexp, c_int_na, c_int_na, *struct vctrs_incomplete, *struct vctrs_no_match, *struct vctrs_remaining, c(0..5), c(0..5), c_int_na, *c(0..2), *c(0..4), *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [INT] --> *c_int_na
argument: [any_sexp]
timing: 0.449 s
source
r_obj* df_locate_matches(r_obj* needles,
                         r_obj* haystack,
                         r_obj* needles_complete,
                         r_obj* haystack_complete,
                         r_ssize size_needles,
                         r_ssize size_haystack,
                         const struct vctrs_incomplete* incomplete,
                         const struct vctrs_no_match* no_match,
                         const struct vctrs_remaining* remaining,
                         enum vctrs_multiple multiple,
                         enum vctrs_relationship relationship,
                         bool any_filters,
                         const enum vctrs_filter* v_filters,
                         const enum vctrs_ops* v_ops,
                         struct vctrs_arg* needles_arg,
                         struct vctrs_arg* haystack_arg,
                         struct r_lazy error_call) {
  int n_prot = 0;

  r_obj* o_needles = KEEP_N(vec_order(
    needles,
    chrs_asc,
    chrs_smallest,
    true,
    r_null
  ), &n_prot);
  const int* v_o_needles = r_int_cbegin(o_needles);

  r_obj* container_info = KEEP_N(compute_nesting_container_info(
    haystack,
    size_haystack,
    v_ops
  ), &n_prot);

  r_obj* o_haystack = r_list_get(container_info, 0);
  const int* v_o_haystack = r_int_cbegin(o_haystack);

  // Will be `integer()` if no container ids are required.
  // In that case, `n_containers == 1`.
  r_obj* container_ids = r_list_get(container_info, 1);
  const int* v_container_ids = r_int_cbegin(container_ids);

  const int n_containers = r_as_int(r_list_get(container_info, 2));
  const bool any_non_equi = r_as_bool(r_list_get(container_info, 3));

  // In the case of possible multiple matches that fall in separate
  // nesting containers, allocate ~20% extra room
  const r_ssize initial_capacity =
    (n_containers == 1) ?
    size_needles :
    r_double_as_ssize(r_ssize_as_double(size_needles) * 1.2);

  struct r_dyn_array* p_loc_first_match_o_haystack = r_new_dyn_vector(R_TYPE_integer, initial_capacity);
  KEEP_N(p_loc_first_match_o_haystack->shelter, &n_prot);

  {
    // Temporary unstable pointer
    int* v_loc_first_match_o_haystack = (int*) r_dyn_begin(p_loc_first_match_o_haystack);
    for (r_ssize i = 0; i < size_needles; ++i) {
      // Initialize to no match everywhere, no need to initialize extra buffer
      v_loc_first_match_o_haystack[i] = SIGNAL_NO_MATCH;
    }
    p_loc_first_match_o_haystack->count = size_needles;
  }

  // If we can skip, `size_match` will always be `1`
  const bool skip_size_match = (multiple == VCTRS_MULTIPLE_any);

  struct r_dyn_array* p_size_match = NULL;
  if (!skip_size_match) {
    p_size_match = r_new_dyn_vector(R_TYPE_integer, initial_capacity);
    KEEP_N(p_size_match->shelter, &n_prot);

    int* v_size_match = (int*) r_dyn_begin(p_size_match);
    for (r_ssize i = 0; i < size_needles; ++i) {
      // No need to initialize extra buffer
      v_size_match[i] = 1;
    }

    p_size_match->count = size_needles;
  }

  // If we can skip, `loc_needles` will always be an increasing sequence of values
  const bool skip_loc_needles = (multiple == VCTRS_MULTIPLE_any);

  struct r_dyn_array* p_loc_needles = NULL;
  if (!skip_loc_needles) {
    p_loc_needles = r_new_dyn_vector(R_TYPE_integer, initial_capacity);
    KEEP_N(p_loc_needles->shelter, &n_prot);

    int* v_loc_needles = (int*) r_dyn_begin(p_loc_needles);
    for (r_ssize i = 0; i < size_needles; ++i) {
      // No need to initialize extra buffer
      v_loc_needles[i] = i;
    }

    p_loc_needles->count = size_needles;
  }

  // When filtering, we find the filtered match for a particular needle in each
  // nesting container of the haystack. `v_loc_filter_match_o_haystack`
  // keeps track of the overall filtered match loc for a needle across all
  // nesting containers in the haystack.
  const bool has_loc_filter_match_o_haystack =
    any_filters &&
    (multiple == VCTRS_MULTIPLE_all ||
     multiple == VCTRS_MULTIPLE_warning ||
     multiple == VCTRS_MULTIPLE_error ||
     multiple == VCTRS_MULTIPLE_first ||
     multiple == VCTRS_MULTIPLE_last);

  int* v_loc_filter_match_o_haystack = NULL;
  if (has_loc_filter_match_o_haystack) {
    r_obj* loc_filter_match_o_haystack = KEEP_N(r_alloc_integer(size_needles), &n_prot);
    v_loc_filter_match_o_haystack = r_int_begin(loc_filter_match_o_haystack);
  }

  struct poly_vec* p_poly_needles = new_poly_vec(needles, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_needles->shelter, &n_prot);
  const struct poly_df_data* p_needles = (const struct poly_df_data*) p_poly_needles->p_vec;

  struct poly_vec* p_poly_haystack = new_poly_vec(haystack, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_haystack->shelter, &n_prot);
  const struct poly_df_data* p_haystack = (const struct poly_df_data*) p_poly_haystack->p_vec;

  const struct poly_vec* p_poly_needles_complete = new_poly_vec(needles_complete, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_needles_complete->shelter, &n_prot);
  const struct poly_df_data* p_needles_complete = (const struct poly_df_data*) p_poly_needles_complete->p_vec;

  struct poly_vec* p_poly_haystack_complete = new_poly_vec(haystack_complete, VCTRS_TYPE_dataframe);
  KEEP_N(p_poly_haystack_complete->shelter, &n_prot);
  const struct poly_df_data* p_haystack_complete = (const struct poly_df_data*) p_poly_haystack_complete->p_vec;

  if (size_needles > 0) {
    // Recursion requires at least 1 row in needles.
    // In the case of size 0 needles, there is nothing to do, but this avoids
    // a segfault.

    const r_ssize col = 0;
    const r_ssize loc_lower_bound_o_needles = 0;
    const r_ssize loc_upper_bound_o_needles = size_needles - 1;
    const r_ssize loc_lower_bound_o_haystack = 0;
    const r_ssize loc_upper_bound_o_haystack = size_haystack - 1;

    if (n_containers == 1) {
      df_locate_matches_recurse(
        col,
        loc_lower_bound_o_needles,
        loc_upper_bound_o_needles,
        loc_lower_bound_o_haystack,
        loc_upper_bound_o_haystack,
        p_needles,
        p_haystack,
        p_needles_complete,
        p_haystack_complete,
        v_o_needles,
        v_o_haystack,
        incomplete,
        multiple,
        any_filters,
        v_filters,
        v_ops,
        p_loc_first_match_o_haystack,
        p_size_match,
        p_loc_needles,
        v_loc_filter_match_o_haystack
      );
    } else {
      df_locate_matches_with_containers(
        n_containers,
        v_container_ids,
        col,
        loc_lower_bound_o_needles,
        loc_upper_bound_o_needles,
        loc_lower_bound_o_haystack,
        loc_upper_bound_o_haystack,
        p_needles,
        p_haystack,
        p_needles_complete,
        p_haystack_complete,
        v_o_needles,
        v_o_haystack,
        incomplete,
        multiple,
        any_filters,
        v_filters,
        v_ops,
        p_loc_first_match_o_haystack,
        p_size_match,
        p_loc_needles,
        v_loc_filter_match_o_haystack
      );
    }
  }

  r_obj* out = KEEP_N(expand_compact_indices(
    v_o_haystack,
    p_loc_first_match_o_haystack,
    p_size_match,
    p_loc_needles,
    skip_size_match,
    skip_loc_needles,
    incomplete,
    no_match,
    remaining,
    multiple,
    relationship,
    size_needles,
    size_haystack,
    any_non_equi,
    has_loc_filter_match_o_haystack,
    v_filters,
    v_loc_filter_match_o_haystack,
    p_haystack,
    needles_arg,
    haystack_arg,
    error_call
  ), &n_prot);

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:264

df_locate_matches_recurse C signature

[c_int_na, c_int_na, c_int_na, c_int_na, c_int_na, *struct poly_df_data, *struct poly_df_data, *struct poly_df_data, *struct poly_df_data, *c_int_na, *c_int_na, *struct vctrs_incomplete, c(0..5), c_int_na, *c(0..2), *c(0..4), *struct r_dyn_array, *struct r_dyn_array, *struct r_dyn_array, *c_int_na] --> c_void
invalid mlsem AST: Expression contains an orphan ret expression.
timing: 0.011 s
source
void df_locate_matches_recurse(r_ssize col,
                               r_ssize loc_lower_bound_o_needles,
                               r_ssize loc_upper_bound_o_needles,
                               r_ssize loc_lower_bound_o_haystack,
                               r_ssize loc_upper_bound_o_haystack,
                               const struct poly_df_data* p_needles,
                               const struct poly_df_data* p_haystack,
                               const struct poly_df_data* p_needles_complete,
                               const struct poly_df_data* p_haystack_complete,
                               const int* v_o_needles,
                               const int* v_o_haystack,
                               const struct vctrs_incomplete* incomplete,
                               enum vctrs_multiple multiple,
                               bool any_filters,
                               const enum vctrs_filter* v_filters,
                               const enum vctrs_ops* v_ops,
                               struct r_dyn_array* p_loc_first_match_o_haystack,
                               struct r_dyn_array* p_size_match,
                               struct r_dyn_array* p_loc_needles,
                               int* v_loc_filter_match_o_haystack) {
  const enum vctrs_ops op = v_ops[col];
  const enum vctrs_filter filter = v_filters[col];
  const r_ssize n_col = p_needles->n_col;

  const int* v_needles = (const int*) p_needles->v_col_ptr[col];
  const int* v_needles_complete = (const int*) p_needles_complete->v_col_ptr[col];

  const int* v_haystack = (const int*) p_haystack->v_col_ptr[col];
  const int* v_haystack_complete = (const int*) p_haystack_complete->v_col_ptr[col];

  const r_ssize loc_mid_bound_o_needles = midpoint(loc_lower_bound_o_needles, loc_upper_bound_o_needles);
  const r_ssize loc_mid_bound_needles = v_o_needles[loc_mid_bound_o_needles] - 1;

  const int val_needle = v_needles[loc_mid_bound_needles];
  const bool needle_is_complete = v_needles_complete[loc_mid_bound_needles];

  // Find lower and upper duplicate location for this needle
  const r_ssize loc_lower_duplicate_o_needles = int_locate_lower_duplicate(
    val_needle,
    v_needles,
    v_o_needles,
    loc_lower_bound_o_needles,
    loc_mid_bound_o_needles
  );
  const r_ssize loc_upper_duplicate_o_needles = int_locate_upper_duplicate(
    val_needle,
    v_needles,
    v_o_needles,
    loc_mid_bound_o_needles,
    loc_upper_bound_o_needles
  );

  if (!needle_is_complete &&
      (incomplete->action == VCTRS_INCOMPLETE_ACTION_value ||
       incomplete->action == VCTRS_INCOMPLETE_ACTION_drop ||
       incomplete->action == VCTRS_INCOMPLETE_ACTION_error)) {
    // Signal incomplete needle, don't recursive into further columns.
    // Early return at the end of this branch.

    for (r_ssize i = loc_lower_duplicate_o_needles; i <= loc_upper_duplicate_o_needles; ++i) {
      // Will always be the first and only time the output is touched for this
      // needle, so we can poke directly into it
      const int loc_needles = v_o_needles[i] - 1;
      r_dyn_int_poke(p_loc_first_match_o_haystack, loc_needles, SIGNAL_INCOMPLETE);
    }

    // Learned nothing about haystack, so just update lhs/rhs bounds for
    // `o_needles` as needed and continue on
    bool do_lhs = loc_lower_duplicate_o_needles > loc_lower_bound_o_needles;
    bool do_rhs = loc_upper_duplicate_o_needles < loc_upper_bound_o_needles;

    if (do_lhs) {
      const r_ssize lhs_loc_lower_bound_o_needles = loc_lower_bound_o_needles;
      const r_ssize lhs_loc_upper_bound_o_needles = loc_lower_duplicate_o_needles - 1;

      df_locate_matches_recurse(
        col,
        lhs_loc_lower_bound_o_needles,
        lhs_loc_upper_bound_o_needles,
        loc_lower_bound_o_haystack,
        loc_upper_bound_o_haystack,
        p_needles,
        p_haystack,
        p_needles_complete,
        p_haystack_complete,
        v_o_needles,
        v_o_haystack,
        incomplete,
        multiple,
        any_filters,
        v_filters,
        v_ops,
        p_loc_first_match_o_haystack,
        p_size_match,
        p_loc_needles,
        v_loc_filter_match_o_haystack
      );
    }
    if (do_rhs) {
      const r_ssize rhs_loc_lower_bound_o_needles = loc_upper_duplicate_o_needles + 1;
      const r_ssize rhs_loc_upper_bound_o_needles = loc_upper_bound_o_needles;

      df_locate_matches_recurse(
        col,
        rhs_loc_lower_bound_o_needles,
        rhs_loc_upper_bound_o_needles,
        loc_lower_bound_o_haystack,
        loc_upper_bound_o_haystack,
        p_needles,
        p_haystack,
        p_needles_complete,
        p_haystack_complete,
        v_o_needles,
        v_o_haystack,
        incomplete,
        multiple,
        any_filters,
        v_filters,
        v_ops,
        p_loc_first_match_o_haystack,
        p_size_match,
        p_loc_needles,
        v_loc_filter_match_o_haystack
      );
    }

    return;
  }

  const struct vctrs_match_bounds bounds = int_locate_match(
    val_needle,
    v_haystack,
    v_o_haystack,
    loc_lower_bound_o_haystack,
    loc_upper_bound_o_haystack
  );

  r_ssize loc_lower_match_o_haystack = bounds.lower;
  r_ssize loc_upper_match_o_haystack = bounds.upper;

  // Adjust bounds based on non-equi condition.
  // If needle is NA and we are doing an exact match, then we treat it like an
  // equi condition here. Otherwise if needle is NA, then we are careful to
  // never extend the bounds to capture values past it.
  const enum vctrs_ops bounds_op =
    (!needle_is_complete && incomplete->action == VCTRS_INCOMPLETE_ACTION_match) ?
    VCTRS_OPS_eq :
    op;

  switch (bounds_op) {
  case VCTRS_OPS_lt: {
    // Exclude found needle
    loc_lower_match_o_haystack = loc_upper_match_o_haystack + 1;
    if (needle_is_complete) {
      loc_upper_match_o_haystack = loc_upper_bound_o_haystack;
    }
    break;
  }
  case VCTRS_OPS_lte: {
    if (needle_is_complete) {
      loc_upper_match_o_haystack = loc_upper_bound_o_haystack;
    }
    break;
  }
  case VCTRS_OPS_gt: {
    // Exclude found needle
    loc_upper_match_o_haystack = loc_lower_match_o_haystack - 1;
    if (needle_is_complete) {
      loc_lower_match_o_haystack = loc_lower_bound_o_haystack;
    }
    break;
  }
  case VCTRS_OPS_gte: {
    if (needle_is_complete) {
      loc_lower_match_o_haystack = loc_lower_bound_o_haystack;
    }
    break;
  }
  case VCTRS_OPS_eq: {
    break;
  }
  }

  if (needle_is_complete &&
      (op == VCTRS_OPS_gt || op == VCTRS_OPS_gte) &&
      (loc_lower_match_o_haystack <= loc_upper_match_o_haystack)) {
    // In this specific case, a non-NA needle may match an NA in the haystack
    // after applying the non-equi adjustments above because NA values are
    // always ordered as the "smallest" values, and we set
    // `loc_lower_match_o_haystack` to be `loc_lower_bound_o_haystack`, which
    // may capture NAs at the lower bound. If there is an NA on the lower bound,
    // we avoid it by finding the last NA and then going 1 location beyond it.
    const r_ssize loc_lower_match_haystack = v_o_haystack[loc_lower_match_o_haystack] - 1;
    const bool lower_match_haystack_is_complete = v_haystack_complete[loc_lower_match_haystack];

    if (!lower_match_haystack_is_complete) {
      // Find the last incomplete value
      loc_lower_match_o_haystack = int_locate_upper_incomplete(
        v_haystack_complete,
        v_o_haystack,
        loc_lower_match_o_haystack,
        loc_upper_match_o_haystack
      );

      // Exclude it and all before it
      ++loc_lower_match_o_haystack;
    }
  }

  if (loc_lower_match_o_haystack <= loc_upper_match_o_haystack) {
    // Hit!

    switch (filter) {
    case VCTRS_FILTER_max: {
      if (!needle_is_complete || op == VCTRS_OPS_eq) {
        // Lower match value will already equal upper match value
        break;
      }

      // We want the max values of this group. That's the upper match of the
      // haystack and its corresponding lower duplicate.
      const int loc_lower_match_haystack = v_o_haystack[loc_lower_match_o_haystack] - 1;
      const int loc_upper_match_haystack = v_o_haystack[loc_upper_match_o_haystack] - 1;
      const int val_lower_match_haystack = v_haystack[loc_lower_match_haystack];
      const int val_upper_match_haystack = v_haystack[loc_upper_match_haystack];

      if (val_lower_match_haystack != val_upper_match_haystack) {
        loc_lower_match_o_haystack = int_locate_lower_duplicate(
          val_upper_match_haystack,
          v_haystack,
          v_o_haystack,
          loc_lower_match_o_haystack,
          loc_upper_match_o_haystack
        );
      }

      break;
    }
    case VCTRS_FILTER_min: {
      if (!needle_is_complete || op == VCTRS_OPS_eq) {
        // Lower match value will already equal upper match value
        break;
      }

      // We want the min values of this group. That's the lower match of the
      // haystack and its corresponding upper duplicate.
      const int loc_lower_match_haystack = v_o_haystack[loc_lower_match_o_haystack] - 1;
      const int loc_upper_match_haystack = v_o_haystack[loc_upper_match_o_haystack] - 1;
      const int val_lower_match_haystack = v_haystack[loc_lower_match_haystack];
      const int val_upper_match_haystack = v_haystack[loc_upper_match_haystack];

      if (val_lower_match_haystack != val_upper_match_haystack) {
        loc_upper_match_o_haystack = int_locate_upper_duplicate(
          val_lower_match_haystack,
          v_haystack,
          v_o_haystack,
          loc_lower_match_o_haystack,
          loc_upper_match_o_haystack
        );
      }

      break;
    }
    case VCTRS_FILTER_none: {
      break;
    }
    }

    if (col < n_col - 1) {
      // For this column, we've bounded the needles locations to the upper/lower
      // duplicates of the current needle, and the haystack locations to the
      // upper/lower matches of that needle. Now recurse into the next column
      // to further refine the boundaries.
      df_locate_matches_recurse(
        col + 1,
        loc_lower_duplicate_o_needles,
        loc_upper_duplicate_o_needles,
        loc_lower_match_o_haystack,
        loc_upper_match_o_haystack,
        p_needles,
        p_haystack,
        p_needles_complete,
        p_haystack_complete,
        v_o_needles,
        v_o_haystack,
        incomplete,
        multiple,
        any_filters,
        v_filters,
        v_ops,
        p_loc_first_match_o_haystack,
        p_size_match,
        p_loc_needles,
        v_loc_filter_match_o_haystack
      );
    } else {
      // We just finished locating matches for the last column,
      // and we still have at least 1 hit, so record it

      for (r_ssize i = loc_lower_duplicate_o_needles; i <= loc_upper_duplicate_o_needles; ++i) {
        const int loc_needles = v_o_needles[i] - 1;
        const int loc_first_match_o_haystack = r_dyn_int_get(p_loc_first_match_o_haystack, loc_needles);
        const bool first_touch = loc_first_match_o_haystack == r_globals.na_int;

        switch (multiple) {
        case VCTRS_MULTIPLE_any: {
          if (first_touch) {
            // Arbitrarily record the lower match
            r_dyn_int_poke(p_loc_first_match_o_haystack, loc_needles, loc_lower_match_o_haystack);
            break;
          }

          if (any_filters) {
            const int loc_first_match_haystack = v_o_haystack[loc_first_match_o_haystack] - 1;
            const int loc_lower_match_haystack = v_o_haystack[loc_lower_match_o_haystack] - 1;

            const int cmp = p_matches_df_compare_na_equal(
              p_haystack,
              loc_lower_match_haystack,
              p_haystack,
              loc_first_match_haystack,
              v_filters
            );

            // -1 = New haystack value "loses", nothing to update
            //  1 = New haystack value "wins", it becomes new match
            //  0 = Equal values, nothing to update
            if (cmp == 1) {
              r_dyn_int_poke(p_loc_first_match_o_haystack, loc_needles, loc_lower_match_o_haystack);
            }
          }

          break;
        }
        case VCTRS_MULTIPLE_all:
        case VCTRS_MULTIPLE_error:
        case VCTRS_MULTIPLE_warning:
        case VCTRS_MULTIPLE_first:
        case VCTRS_MULTIPLE_last: {
          const int size_match = loc_upper_match_o_haystack - loc_lower_match_o_haystack + 1;

          if (first_touch) {
            r_dyn_int_poke(p_loc_first_match_o_haystack, loc_needles, loc_lower_match_o_haystack);
            r_dyn_int_poke(p_size_match, loc_needles, size_match);

            if (any_filters) {
              v_loc_filter_match_o_haystack[loc_needles] = loc_lower_match_o_haystack;
            }

            break;
          }

          if (any_filters) {
            const int loc_filter_match_o_haystack = v_loc_filter_match_o_haystack[loc_needles];

            const int loc_filter_match_haystack = v_o_haystack[loc_filter_match_o_haystack] - 1;
            const int loc_lower_match_haystack = v_o_haystack[loc_lower_match_o_haystack] - 1;

            const int cmp = p_matches_df_compare_na_equal(
              p_haystack,
              loc_lower_match_haystack,
              p_haystack,
              loc_filter_match_haystack,
              v_filters
            );

            // -1 = New haystack value "loses", nothing to update
            //  1 = New haystack value "wins", it becomes new filter match
            //  0 = Equal values, fall through and append this set of matches
            // Note that in the 1 case, we have no way to invalidate the old
            // match at this point in time. Instead, we record all matches and
            // in `expand_compact_indices()` we skip the ones that aren't
            // equivalent to the filter match.
            if (cmp == -1) {
              break;
            } else if (cmp == 1) {
              v_loc_filter_match_o_haystack[loc_needles] = loc_lower_match_o_haystack;
            }
          }

          r_dyn_push_back(p_loc_first_match_o_haystack, &loc_lower_match_o_haystack);
          r_dyn_push_back(p_size_match, &size_match);
          r_dyn_push_back(p_loc_needles, &loc_needles);
          break;
        }
        }
      }
    }
  } else if (col < n_col - 1 &&
             (incomplete->action == VCTRS_INCOMPLETE_ACTION_value ||
              incomplete->action == VCTRS_INCOMPLETE_ACTION_drop ||
              incomplete->action == VCTRS_INCOMPLETE_ACTION_error)) {
    // This branch occurs if there is no match in `haystack` for this needle,
    // but we aren't on the last column and we are tracking incomplete needles.
    // Before we move on from this needle, we check its future columns for
    // incomplete values. If the current `val_needles` was incomplete, it would
    // have already been caught above, so we only look at future columns.
    for (r_ssize i = loc_lower_duplicate_o_needles; i <= loc_upper_duplicate_o_needles; ++i) {
      const r_ssize loc_needles = v_o_needles[i] - 1;

      for (r_ssize j = col + 1; j < n_col; ++j) {
        const int* v_future_needles_complete = (const int*) p_needles_complete->v_col_ptr[j];
        const bool future_needle_is_complete = v_future_needles_complete[loc_needles];

        if (!future_needle_is_complete) {
          r_dyn_int_poke(p_loc_first_match_o_haystack, loc_needles, SIGNAL_INCOMPLETE);
          break;
        }
      }
    }
  }

  // At this point we have finished recording matches for the current needle in
  // this column, and we need to move on to other needles on the LHS and RHS
  // of the current needle (remember the current needle is the midpoint). For
  // the `==` op case we can also limit the haystack bounds we search in for
  // needles on the LHS/RHS, since those needles won't ever match the current
  // haystack values.
  bool do_lhs = false;
  bool do_rhs = false;

  // Default to current bounds
  r_ssize lhs_loc_lower_bound_o_needles = loc_lower_bound_o_needles;
  r_ssize lhs_loc_upper_bound_o_needles = loc_upper_bound_o_needles;
  r_ssize lhs_loc_lower_bound_o_haystack = loc_lower_bound_o_haystack;
  r_ssize lhs_loc_upper_bound_o_haystack = loc_upper_bound_o_haystack;

  r_ssize rhs_loc_lower_bound_o_needles = loc_lower_bound_o_needles;
  r_ssize rhs_loc_upper_bound_o_needles = loc_upper_bound_o_needles;
  r_ssize rhs_loc_lower_bound_o_haystack = loc_lower_bound_o_haystack;
  r_ssize rhs_loc_upper_bound_o_haystack = loc_upper_bound_o_haystack;

  switch (op) {
  case VCTRS_OPS_eq: {
    do_lhs =
      (loc_lower_duplicate_o_needles > loc_lower_bound_o_needles) &&
      (loc_lower_match_o_haystack > loc_lower_bound_o_haystack);
    do_rhs =
      (loc_upper_duplicate_o_needles < loc_upper_bound_o_needles) &&
      (loc_upper_match_o_haystack < loc_upper_bound_o_haystack);

    // Limit bounds of both needle and haystack using existing info
    if (do_lhs) {
      lhs_loc_upper_bound_o_needles = loc_lower_duplicate_o_needles - 1;
      lhs_loc_upper_bound_o_haystack = loc_lower_match_o_haystack - 1;
    }
    if (do_rhs) {
      rhs_loc_lower_bound_o_needles = loc_upper_duplicate_o_needles + 1;
      rhs_loc_lower_bound_o_haystack = loc_upper_match_o_haystack + 1;
    }

    break;
  }
  case VCTRS_OPS_lt:
  case VCTRS_OPS_lte:
  case VCTRS_OPS_gt:
  case VCTRS_OPS_gte: {
    // Can't update haystack here, as nesting containers make this impossible
    do_lhs = loc_lower_duplicate_o_needles > loc_lower_bound_o_needles;
    do_rhs = loc_upper_duplicate_o_needles < loc_upper_bound_o_needles;

    if (do_lhs) {
      lhs_loc_upper_bound_o_needles = loc_lower_duplicate_o_needles - 1;
    }
    if (do_rhs) {
      rhs_loc_lower_bound_o_needles = loc_upper_duplicate_o_needles + 1;
    }

    break;
  }
  }

  if (do_lhs) {
    df_locate_matches_recurse(
      col,
      lhs_loc_lower_bound_o_needles,
      lhs_loc_upper_bound_o_needles,
      lhs_loc_lower_bound_o_haystack,
      lhs_loc_upper_bound_o_haystack,
      p_needles,
      p_haystack,
      p_needles_complete,
      p_haystack_complete,
      v_o_needles,
      v_o_haystack,
      incomplete,
      multiple,
      any_filters,
      v_filters,
      v_ops,
      p_loc_first_match_o_haystack,
      p_size_match,
      p_loc_needles,
      v_loc_filter_match_o_haystack
    );
  }
  if (do_rhs) {
    df_locate_matches_recurse(
      col,
      rhs_loc_lower_bound_o_needles,
      rhs_loc_upper_bound_o_needles,
      rhs_loc_lower_bound_o_haystack,
      rhs_loc_upper_bound_o_haystack,
      p_needles,
      p_haystack,
      p_needles_complete,
      p_haystack_complete,
      v_o_needles,
      v_o_haystack,
      incomplete,
      multiple,
      any_filters,
      v_filters,
      v_ops,
      p_loc_first_match_o_haystack,
      p_size_match,
      p_loc_needles,
      v_loc_filter_match_o_haystack
    );
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:490

df_locate_matches_with_containers C signature

[c_int_na, *c_int_na, c_int_na, c_int_na, c_int_na, c_int_na, c_int_na, *struct poly_df_data, *struct poly_df_data, *struct poly_df_data, *struct poly_df_data, *c_int_na, *c_int_na, *struct vctrs_incomplete, c(0..5), c_int_na, *c(0..2), *c(0..4), *struct r_dyn_array, *struct r_dyn_array, *struct r_dyn_array, *c_int_na] --> c_void
untypeable assignment
error detail
variable: loc_lower_bound_o_haystack
expected: c_int & 'I106562
given: c_int_na
timing: 2.34 s
source
void df_locate_matches_with_containers(int n_containers,
                                       const int* v_container_ids,
                                       r_ssize col,
                                       r_ssize loc_lower_bound_o_needles,
                                       r_ssize loc_upper_bound_o_needles,
                                       r_ssize loc_lower_bound_o_haystack,
                                       r_ssize loc_upper_bound_o_haystack,
                                       const struct poly_df_data* p_needles,
                                       const struct poly_df_data* p_haystack,
                                       const struct poly_df_data* p_needles_complete,
                                       const struct poly_df_data* p_haystack_complete,
                                       const int* v_o_needles,
                                       const int* v_o_haystack,
                                       const struct vctrs_incomplete* incomplete,
                                       enum vctrs_multiple multiple,
                                       bool any_filters,
                                       const enum vctrs_filter* v_filters,
                                       const enum vctrs_ops* v_ops,
                                       struct r_dyn_array* p_loc_first_match_o_haystack,
                                       struct r_dyn_array* p_size_match,
                                       struct r_dyn_array* p_loc_needles,
                                       int* v_loc_filter_match_o_haystack) {
  const int* v_haystack = v_container_ids;

  for (int i = 0; i < n_containers; ++i) {
    const int val_needle = i;

    const struct vctrs_match_bounds bounds = int_locate_match(
      val_needle,
      v_haystack,
      v_o_haystack,
      loc_lower_bound_o_haystack,
      loc_upper_bound_o_haystack
    );

    const r_ssize loc_lower_match_o_haystack = bounds.lower;
    const r_ssize loc_upper_match_o_haystack = bounds.upper;

    df_locate_matches_recurse(
      col,
      loc_lower_bound_o_needles,
      loc_upper_bound_o_needles,
      loc_lower_match_o_haystack,
      loc_upper_match_o_haystack,
      p_needles,
      p_haystack,
      p_needles_complete,
      p_haystack_complete,
      v_o_needles,
      v_o_haystack,
      incomplete,
      multiple,
      any_filters,
      v_filters,
      v_ops,
      p_loc_first_match_o_haystack,
      p_size_match,
      p_loc_needles,
      v_loc_filter_match_o_haystack
    );

    // Advance lower bound for next container
    loc_lower_bound_o_haystack = loc_upper_match_o_haystack + 1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1015

df_proxy C signature

[any_sexp, c(0..2)] --> any_sexp
unbound variable
error detail
name: vec_proxy_order
timing: 0.080 s
source
r_obj* df_proxy(r_obj* x, enum vctrs_proxy_kind kind) {
  // Always clone to avoid modifying the original object, even if it is one
  // we freshly created in C, because we often work with both the proxy and the
  // original object within the same function (#1837)
  x = KEEP(r_clone(x));

  switch (kind) {
  case VCTRS_PROXY_KIND_equal: DF_PROXY(vec_proxy_equal); break;
  case VCTRS_PROXY_KIND_compare: DF_PROXY(vec_proxy_compare); break;
  case VCTRS_PROXY_KIND_order: DF_PROXY(vec_proxy_order); break;
  }

  x = KEEP(df_flatten(x));
  x = vec_proxy_unwrap(x);

  FREE(2);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:213

DF_PROXY C signature

tuple1 --> any
unbound variable
error detail
name: x
timing: 0.014 s
(definition not located in src/)

df_ptype C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: df_rownames
timing: 0.009 s
source
r_obj* df_ptype(r_obj* x, bool bare) {
  r_obj* row_nms = KEEP(df_rownames(x));

  r_obj* ptype = r_null;
  if (bare) {
    ptype = KEEP(bare_df_map(x, &col_ptype));
  } else {
    ptype = KEEP(df_map(x, &col_ptype));
  }

  if (r_typeof(row_nms) == R_TYPE_character) {
    r_attrib_poke(ptype, r_syms.row_names, r_globals.empty_chr);
  }

  FREE(2);
  return ptype;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:95

df_ptype2 C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.008 s
source
r_obj* df_ptype2(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  r_obj* x_names = KEEP(r_names(x));
  r_obj* y_names = KEEP(r_names(y));

  r_obj* out = r_null;

  if (obj_equal(x_names, y_names)) {
    out = df_ptype2_loop(
      x,
      y,
      x_names,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );
  } else {
    out = df_ptype2_match(
      x,
      y,
      x_names,
      y_names,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:517

df_ptype2_loop C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] --> any_sexp
untypeable application
error detail
function: [{ 'I52293 }, c_int] --> 'I52293
argument: [any_sexp & 'I52175, c_int_na | 'I52258]
timing: 1.01 s
source
r_obj* df_ptype2_loop(
  r_obj* x,
  r_obj* y,
  r_obj* names,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  const r_ssize n_cols = r_length(names);

  r_obj* out = KEEP(r_alloc_list(n_cols));
  r_attrib_poke(out, r_syms.names, names);

  r_ssize i = 0;

  struct vctrs_arg* p_x_col_arg = new_subscript_arg_vec(p_x_arg, out, &i);
  KEEP(p_x_col_arg->shelter);

  struct vctrs_arg* p_y_col_arg = new_subscript_arg_vec(p_y_arg, out, &i);
  KEEP(p_y_col_arg->shelter);

  for (; i < n_cols; ++i) {
    r_obj* x_col = r_list_get(x, i);
    r_obj* y_col = r_list_get(y, i);

    int _;
    r_obj* type = vec_ptype2(
      x_col,
      y_col,
      p_x_col_arg,
      p_y_col_arg,
      call,
      s3_fallback,
      &_
    );

    r_list_poke(out, i, type);
  }

  init_data_frame(out, 0);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:665

df_ptype2_match C signature

[any_sexp, any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] --> any_sexp
unbound variable
error detail
name: vec_match
timing: 0.060 s
source
r_obj* df_ptype2_match(
  r_obj* x,
  r_obj* y,
  r_obj* x_names,
  r_obj* y_names,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  r_obj* x_dups_pos = KEEP(vec_match(x_names, y_names));
  r_obj* y_dups_pos = KEEP(vec_match(y_names, x_names));

  int* x_dups_pos_data = r_int_begin(x_dups_pos);
  int* y_dups_pos_data = r_int_begin(y_dups_pos);

  r_ssize x_len = r_length(x_names);
  r_ssize y_len = r_length(y_names);

  // Count columns that are only in `y`
  r_ssize rest_len = 0;
  for (r_ssize i = 0; i < y_len; ++i) {
    if (y_dups_pos_data[i] == r_globals.na_int) {
      ++rest_len;
    }
  }

  r_ssize out_len = x_len + rest_len;
  r_obj* out = KEEP(r_alloc_list(out_len));
  r_obj* nms = KEEP(r_alloc_character(out_len));
  r_attrib_poke(out, r_syms.names, nms);

  r_ssize i = 0;
  r_ssize y_col_arg_loc = 0;

  struct vctrs_arg* p_x_col_arg = new_subscript_arg(p_x_arg, x_names, x_len, &i);
  KEEP(p_x_col_arg->shelter);

  struct vctrs_arg* p_y_col_arg = new_subscript_arg(p_y_arg, y_names, y_len, &y_col_arg_loc);
  KEEP(p_y_col_arg->shelter);

  // Fill in prototypes of all the columns that are in `x`, in order
  for (; i < x_len; ++i) {
    r_ssize dup = x_dups_pos_data[i];

    r_obj* x_col = r_list_get(x, i);

    r_obj* type;
    if (dup == r_globals.na_int) {
      type = vec_ptype_or_s3_fallback(
        x_col,
        p_x_col_arg,
        vec_typeof(x_col),
        call,
        s3_fallback
      );
    } else {
      // 1-based index
      --dup;
      y_col_arg_loc = dup;
      r_obj* y_col = r_list_get(y, dup);

      int _;
      type = vec_ptype2(
        x_col,
        y_col,
        p_x_col_arg,
        p_y_col_arg,
        call,
        s3_fallback,
        &_
      );
    }

    r_list_poke(out, i, type);
    r_chr_poke(nms, i, r_chr_get(x_names, i));
  }

  // Fill in prototypes of the columns that are only in `y`
  for (r_ssize j = 0; i < out_len; ++j) {
    r_ssize dup = y_dups_pos_data[j];

    if (dup == r_globals.na_int) {
      y_col_arg_loc = j;
      r_obj* y_col = r_list_get(y, j);

      r_obj* type = vec_ptype_or_s3_fallback(
        y_col,
        p_y_col_arg,
        vec_typeof(y_col),
        call,
        s3_fallback
      );

      r_list_poke(out, i, type);
      r_chr_poke(nms, i, r_chr_get(y_names, j));
      ++i;
    }
  }

  init_data_frame(out, 0);

  FREE(6);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:558

df_repair_names C signature

[any_sexp, *struct name_repair_opts] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.005 s
source
r_obj* df_repair_names(r_obj* x, struct name_repair_opts* name_repair) {
  r_obj* nms = KEEP(r_names(x));
  r_obj* repaired = KEEP(vec_as_names(nms, name_repair));

  // Should this go through proxy and restore so that classes can
  // update metadata and check invariants when special columns are
  // renamed?
  if (nms != repaired) {
    x = KEEP(r_clone_referenced(x));
    r_attrib_poke_names(x, repaired);
    FREE(1);
  }

  FREE(2);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:1022

df_rownames_size C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: [any_sexp & 'I8374, [any_sexp, any_sexp & 'I8381, c_ptr] -> c_null | 'I8381 & (<...> | c_null | null | p(CHR) | sym), c_null]
timing: 0.012 s
source
r_ssize df_rownames_size(r_obj* x) {
  r_obj* row_names = r_attrib_map(x, df_rownames_size_cb, NULL);

  if (row_names == NULL) {
    return -1;
  }

  return rownames_size(row_names);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:114

dict_key_size C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: UINT32_MAX
timing: 0.013 s
source
uint32_t dict_key_size(SEXP x) {
  const R_len_t x_size = vec_size(x);

  if (x_size > R_LEN_T_MAX) {
    // Ensure we catch the switch to supporting long vectors in `vec_size()`
    r_stop_internal("Dictionary functions do not support long vectors.");
  }

  const double load_adjusted_size = x_size / 0.50;

  if (load_adjusted_size > UINT32_MAX) {
    r_stop_internal("Can't safely cast load adjusted size to a `uint32_t`.");
  }

  uint32_t size = (uint32_t)load_adjusted_size;
  // Clamp to `INT32_MAX` to avoid overflow in `u32_safe_ceil2()`,
  // at the cost of an increased maximum load factor for long input
  size = size > INT32_MAX ? INT32_MAX : size;
  size = u32_safe_ceil2(size);
  size = (size < 16) ? 16 : size;

  if (x_size > size) {
    // Should never happen with `R_len_t` sizes.
    // This is a defensive check that will be useful when we support long vectors.
    r_stop_internal("Hash table size must be at least as large as input to avoid a load factor of >100%.");
  }

  // Rprintf("size: %u\n", size);
  return size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:121

duplicated_any C signature

[any_sexp] --> c_bool
unbound variable
error detail
name: vec_proxy_equal
timing: 0.019 s
source
bool duplicated_any(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  bool out = duplicated_any_loop(d, n);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:223

EQUAL_COL C signature

tuple3 --> any
unbound variable
error detail
name: x_recycles
timing: 0.004 s
(definition not located in src/)

EQUAL_COL_IMPL C signature

tuple5 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.002 s
(definition not located in src/)

fct_as_factor_impl C signature

[any_sexp, any_sexp, any_sexp, *c_bool, c_int_na] --> any_sexp
untypeable application
error detail
function: ([list, any] --> list) & ([p(CHR), c_true] --> "") & ([prim & 'I53530, c_int] --> v('I53530)) & ([prim & 'I53530, c_true] --> v1('I53530))
argument: [p(INT), c_int_na]
timing: 9.21 s
source
static SEXP fct_as_factor_impl(SEXP x, SEXP x_levels, SEXP to_levels, bool* lossy, bool ordered) {
  // Early exit if levels are identical
  if (x_levels == to_levels) {
    return x;
  }

  R_len_t x_levels_size = vec_size(x_levels);
  R_len_t to_levels_size = vec_size(to_levels);

  // Early exit if `to` has no levels. In this case it is being used as
  // a template
  if (to_levels_size == 0) {
    return x;
  }

  // Always lossy if there are more levels in `x` than in `to`
  if (x_levels_size > to_levels_size) {
    *lossy = true;
    return R_NilValue;
  }

  R_len_t x_size = vec_size(x);

  const SEXP* p_x_levels = STRING_PTR_RO(x_levels);
  const SEXP* p_to_levels = STRING_PTR_RO(to_levels);

  bool is_contiguous_subset = true;

  for (R_len_t i = 0; i < x_levels_size; ++i) {
    if (p_x_levels[i] != p_to_levels[i]) {
      is_contiguous_subset = false;
      break;
    }
  }

  // No recoding required if contiguous subset.
  // Duplicate, strip non-factor attributes, and re-initialize with new levels.
  // Using `r_clone_referenced()` avoids an immediate copy using ALTREP wrappers.
  if (is_contiguous_subset) {
    SEXP out = PROTECT(r_clone_referenced(x));
    r_attrib_zap_all(out);

    if (ordered) {
      init_ordered(out, to_levels);
    } else {
      init_factor(out, to_levels);
    }

    UNPROTECT(1);
    return out;
  }

  const int* p_x = INTEGER_RO(x);

  SEXP out = PROTECT(Rf_allocVector(INTSXP, x_size));
  int* p_out = INTEGER(out);

  if (ordered) {
    init_ordered(out, to_levels);
  } else {
    init_factor(out, to_levels);
  }

  SEXP recode = PROTECT(vec_match(x_levels, to_levels));
  const int* p_recode = INTEGER_RO(recode);

  // Detect if there are any levels in `x` that aren't in `to`
  for (R_len_t i = 0; i < x_levels_size; ++i) {
    if (p_recode[i] == NA_INTEGER) {
      *lossy = true;
      UNPROTECT(2);
      return R_NilValue;
    }
  }

  // Recode `x` int values into `to` level ordering
  for (R_len_t i = 0; i < x_size; ++i) {
    const int elt = p_x[i];

    if (elt == NA_INTEGER) {
      p_out[i] = NA_INTEGER;
      continue;
    }

    p_out[i] = p_recode[elt - 1];
  }

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:306

fct_ptype2 C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] --> any_sexp
unbound variable
error detail
name: levels_union
timing: 0.076 s
source
SEXP fct_ptype2(
  SEXP x,
  SEXP y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  SEXP x_levels = PROTECT(Rf_getAttrib(x, R_LevelsSymbol));
  SEXP y_levels = PROTECT(Rf_getAttrib(y, R_LevelsSymbol));

  if (TYPEOF(x_levels) != STRSXP) {
    stop_corrupt_factor_levels(x, p_x_arg);
  }

  if (TYPEOF(y_levels) != STRSXP) {
    stop_corrupt_factor_levels(y, p_y_arg);
  }

  // Use `x_levels` if they are equal pointers, otherwise compute union
  SEXP levels = (x_levels == y_levels) ?
    x_levels :
    levels_union(x_levels, y_levels);
  PROTECT(levels);

  SEXP out = new_empty_factor(levels);
  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:6

generic_if_else C signature

[any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, c_int_na, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [CHR & v('I89341), c_int] --> 'I89341
argument: [any_sexp, c_false]
timing: 0.218 s
source
r_obj* generic_if_else(
  r_obj* condition,
  r_obj* true_,
  r_obj* false_,
  r_obj* missing,
  r_obj* ptype,
  r_ssize size,
  struct vctrs_arg* p_true_arg,
  struct vctrs_arg* p_false_arg,
  struct vctrs_arg* p_missing_arg,
  struct r_lazy error_call
) {
  r_obj* conditions = KEEP(r_alloc_list(2));
  r_list_poke(conditions, 0, condition);
  // TODO: This is another place where we could use a compact-condition
  // if `list_combine()` could take them as `indices`. Would be 3x less
  // memory, which probably does matter quite a bit for simple cases.
  r_list_poke(conditions, 1, r_lgl_invert(condition));

  r_obj* values = KEEP(r_alloc_list(2));
  r_list_poke(values, 0, true_);
  r_list_poke(values, 1, false_);

  // Must materialize tags to set names on the list, for use in error messages
  r_obj* true_arg = KEEP(vctrs_arg(p_true_arg));
  r_obj* false_arg = KEEP(vctrs_arg(p_false_arg));

  r_obj* names = r_alloc_character(2);
  r_attrib_poke_names(values, names);
  r_chr_poke(names, 0, r_chr_get(true_arg, 0));
  r_chr_poke(names, 1, r_chr_get(false_arg, 0));

  // We want `missing` to be used
  const enum list_combine_unmatched unmatched = LIST_COMBINE_UNMATCHED_default;

  // This won't matter, there are no overlaps, so we choose the default "cheaper" option
  const enum list_combine_multiple multiple = LIST_COMBINE_MULTIPLE_first;

  // All of `true`, `false`, and `missing` are size 1 or size `size`
  const enum assignment_slice_value slice_values = ASSIGNMENT_SLICE_VALUE_yes;

  // We want error messages from outer names, but don't want them on the output
  r_obj* name_spec = name_spec_inner;

  // No name repair
  const struct name_repair_opts* p_name_repair_opts = p_no_repair_opts;

  // Don't use outer names if any errors occur
  struct vctrs_arg* p_values_arg = vec_args.empty;
  struct vctrs_arg* p_conditions_arg = vec_args.empty;

  r_obj* out = list_combine(
    values,
    conditions,
    size,
    missing,
    unmatched,
    multiple,
    slice_values,
    ptype,
    name_spec,
    p_name_repair_opts,
    p_values_arg,
    p_conditions_arg,
    p_missing_arg,
    error_call
  );

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:115

has_dim C signature

[any_sexp] --> c_bool
unbound variable
error detail
name: r_dim
timing: 0.006 s
source
static inline bool has_dim(SEXP x) {
  return r_attrib_has_any(x) && r_dim(x) != R_NilValue;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.h:38

HASH_FILL C signature

tuple3 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

HASH_FILL_NA_PROPAGATE C signature

tuple4 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.002 s
(definition not located in src/)

INIT_ARG2 C signature

tuple2 --> any
untypeable application
error detail
function: [record & 'I82001, any] --> 'I82001
argument: [struct vec_args, *struct vctrs_arg]
timing: 0.011 s
(definition not located in src/)

INIT_LAZY_ARG_2 C signature

tuple2 --> any
untypeable application
error detail
function: [record & 'I82007, any] --> 'I82007
argument: [struct lazy_args, struct r_lazy]
timing: 0.003 s
(definition not located in src/)

int_check_consecutive C signature

[any_sexp, c_int_na, c_int_na, *struct location_opts] --> c_void
unbound variable
error detail
name: qsort
timing: 3.46 s
source
void int_check_consecutive(r_obj* subscript,
                           r_ssize n,
                           r_ssize n_extend,
                           const struct location_opts* opts) {

  r_obj* extended = KEEP(r_alloc_integer(n_extend));
  int* p_extended = r_int_begin(extended);
  int i_extend = 0;
  int new_n = n;

  int* p_subscript = r_int_begin(subscript);

  r_ssize n_subscript = Rf_length(subscript);
  for (r_ssize i = 0; i < n_subscript; ++i) {
    int elt = p_subscript[i];

    // Missing value also covered here
    if (elt <= n) {
      continue;
    }

    // Special case: appending in ascending sequence at the end
    // should not require any sorting
    if (elt - 1 == new_n) {
      ++new_n;
      --n_extend;
    } else {
      p_extended[i_extend++] = elt - 1;
    }
  }

  if (n_extend != i_extend) {
    r_stop_internal("int_check_consecutive",
                    "n_extend (%d) != i_extend (%d).",
                    n_extend,
                    i_extend);
  }

  if (i_extend == 0) {
    FREE(1);
    return;
  }

  // Only the first i_extend entries of the array are populated,
  // the rest is never touched.
  qsort(p_extended, i_extend, sizeof(int), &qsort_int_compare_scalar);

  for (r_ssize i = 0; i < i_extend; ++i) {
    int elt = p_extended[i];

    if (elt != new_n + i) {
      stop_location_oob_non_consecutive(subscript, n, opts);
    }
  }

  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:381

int_col_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
void int_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(int, r_int_cbegin, int_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:315

int_compute_range C signature

[*c_int_na, c_int_na, *c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: UINT32_MAX
timing: 0.028 s
source
void int_compute_range(
  const int* p_x,
  r_ssize size,
  int* p_x_min,
  uint32_t* p_range
) {
  uint32_t range = UINT32_MAX;

  int x_min = NA_INTEGER;
  int x_max = NA_INTEGER;

  r_ssize i = 0;

  // Find first non-NA value
  while (i < size) {
    const int elt = p_x[i];

    if (elt == NA_INTEGER) {
      ++i;
      continue;
    }

    x_min = elt;
    x_max = elt;
    range = 0;

    // Bump to next `i` since we know this one's value
    ++i;

    break;
  }

  // All NAs - Return max range to signal to use radix sort
  if (x_min == NA_INTEGER) {
    *p_x_min = x_min;
    *p_range = range;
    return;
  }

  // Now that we have initial values, iterate through the rest
  // to compute the final min/max.
  for (r_ssize j = i; j < size; ++j) {
    const int elt = p_x[j];

    if (elt == NA_INTEGER) {
      continue;
    }

    if (elt > x_max) {
      x_max = elt;
    } else if (elt < x_min) {
      x_min = elt;
    }
  }

  /*
   * - Max possible range is from
   *   `c(.Machine$integer.max, -.Machine$integer.max)` which is exactly the
   *   max of a `uint32_t`.
   * - We need to go up to `intmax_t` to avoid intermediate overflow.
   * - `+ 1` to get an inclusive range on both ends.
   */
  range = (uint32_t) r__intmax_add(r__intmax_subtract(x_max, x_min), 1);

  *p_x_min = x_min;
  *p_range = range;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:898

int_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.003 s
source
void int_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(int, INTEGER_RO, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:144

int_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
void int_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(int, r_int_cbegin, int_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:216

int_extract_uint32_byte C signature

[c_int_na, c_int_na] --> c_int_na
unbound variable
error detail
name: UINT8_MAX
timing: 0.004 s
source
uint8_t int_extract_uint32_byte(uint32_t x, uint8_t shift) {
  return (x >> shift) & UINT8_MAX;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1440

int_filter C signature

[any_sexp, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.379 s
source
r_obj* int_filter(r_obj* subscript, r_ssize n_filter, int value) {
  const r_ssize size = r_length(subscript);
  const int* v_subscript = r_int_cbegin(subscript);

  r_obj* out = KEEP(r_alloc_integer(size - n_filter));
  int* v_out = r_int_begin(out);

  r_obj* names = r_names(subscript);
  const bool has_names = names != r_null;
  r_obj* const* v_names = NULL;
  r_obj* out_names = r_null;
  if (has_names) {
    v_names = r_chr_cbegin(names);
    out_names = r_alloc_character(size - n_filter);
    r_attrib_poke_names(out, out_names);
  }

  r_ssize j = 0;

  for (r_ssize i = 0; i < size; ++i) {
    const int elt = v_subscript[i];

    if (elt != value) {
      v_out[j] = elt;

      if (has_names) {
        r_chr_poke(out_names, j, v_names[i]);
      }

      ++j;
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:295

int_filter_oob C signature

[any_sexp, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.524 s
source
r_obj* int_filter_oob(r_obj* subscript, r_ssize n, r_ssize n_oob) {
  const r_ssize n_subscript = r_length(subscript);
  const r_ssize n_out = n_subscript - n_oob;

  const int* v_subscript = r_int_cbegin(subscript);

  r_obj* out = KEEP(r_alloc_integer(n_out));
  int* v_out = r_int_begin(out);

  r_obj* names = r_names(subscript);
  const bool has_names = names != r_null;
  r_obj* const* v_names = NULL;
  r_obj* out_names = r_null;
  if (has_names) {
    v_names = r_chr_cbegin(names);
    out_names = r_alloc_character(n_out);
    r_attrib_poke_names(out, out_names);
  }

  r_ssize j = 0;

  for (r_ssize i = 0; i < n_subscript; ++i) {
    const int elt = v_subscript[i];

    if (abs(elt) <= n || elt == r_globals.na_int) {
      v_out[j] = elt;

      if (has_names) {
        r_chr_poke(out_names, j, v_names[i]);
      }

      ++j;
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:341

int_hash_fill_na_equal C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
static inline void int_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(int, r_int_cbegin, int_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:229

int_hash_fill_na_propagate C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
static inline void int_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(int, r_int_cbegin, int_hash_scalar, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:251

int_order_radix_recurse C signature

[c_int_na, c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_int_na, *c_bool, *struct group_infos] --> c_void
unbound variable
error detail
name: UINT8_MAX_SIZE
timing: 0.449 s
source
void int_order_radix_recurse(
  const r_ssize size,
  const uint8_t pass,
  uint32_t* p_x,
  int* p_o,
  uint32_t* p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  r_ssize* p_counts,
  bool* p_skips,
  struct group_infos* p_group_infos
) {
  // Exit as fast as possible if we are below the insertion order boundary
  if (size <= ORDER_INSERTION_BOUNDARY) {
    int_order_insertion(size, p_x, p_o, p_group_infos);
    return;
  }

  // Skip passes where our up front check told us that all bytes were the same
  uint8_t next_pass = pass + 1;
  r_ssize* p_counts_next_pass = p_counts + UINT8_MAX_SIZE;

  while (next_pass < INT_MAX_RADIX_PASS && p_skips[next_pass]) {
    ++next_pass;
    p_counts_next_pass += UINT8_MAX_SIZE;
  }

  const uint8_t radix = PASS_TO_RADIX(pass, INT_MAX_RADIX_PASS);
  const uint8_t shift = radix * 8;

  uint8_t byte = 0;

  // Histogram for this pass
  for (r_ssize i = 0; i < size; ++i) {
    const uint32_t x_elt = p_x[i];

    byte = int_extract_uint32_byte(x_elt, shift);

    p_bytes[i] = byte;
    ++p_counts[byte];
  }

  // Fast check to see if all bytes were the same.
  // If so, skip this `pass` since we learned nothing.
  // No need to accumulate counts and iterate over chunks,
  // we know all others are zero.
  if (p_counts[byte] == size) {
    // Reset count for other group chunks
    p_counts[byte] = 0;

    if (next_pass == INT_MAX_RADIX_PASS) {
      // If we are already at the last pass, we are done
      groups_size_maybe_push(size, p_group_infos);
    } else {
      // Otherwise, recurse on next byte using the same `size` since
      // the group size hasn't changed
      int_order_radix_recurse(
        size,
        next_pass,
        p_x,
        p_o,
        p_x_aux,
        p_o_aux,
        p_bytes,
        p_counts_next_pass,
        p_skips,
        p_group_infos
      );
    }

    return;
  }

  r_ssize cumulative = 0;

  // Accumulate counts, skip zeros
  for (uint16_t i = 0; i < UINT8_MAX_SIZE; ++i) {
    r_ssize count = p_counts[i];

    if (count == 0) {
      continue;
    }

    // Replace with `cumulative` first, then bump `cumulative`.
    // `p_counts` now represents starting locations for each radix group.
    p_counts[i] = cumulative;
    cumulative += count;
  }

  // Place into auxiliary arrays in the correct order, then copy back over
  for (r_ssize i = 0; i < size; ++i) {
    const uint8_t byte = p_bytes[i];
    const r_ssize loc = p_counts[byte]++;
    p_o_aux[loc] = p_o[i];
    p_x_aux[loc] = p_x[i];
  }

  // Copy back over
  r_memcpy(p_o, p_o_aux, size * sizeof(*p_o_aux));
  r_memcpy(p_x, p_x_aux, size * sizeof(*p_x_aux));

  r_ssize last_cumulative_count = 0;

  // Recurse on subgroups as required
  for (uint16_t i = 0; last_cumulative_count < size && i < UINT8_MAX_SIZE; ++i) {
    const r_ssize cumulative_count = p_counts[i];

    if (!cumulative_count) {
      continue;
    }

    // Set to zero to clear for subsequent groups
    p_counts[i] = 0;

    // Diff the accumulated counts to get the radix group size
    const r_ssize group_size = cumulative_count - last_cumulative_count;
    last_cumulative_count = cumulative_count;

    if (group_size == 1) {
      groups_size_maybe_push(1, p_group_infos);
      ++p_x;
      ++p_o;
      continue;
    }

    // Can get here in the case of ties, like c(1L, 1L), which have a
    // `group_size` of 2 in the last radix, but there is nothing left to
    // compare so we are done.
    if (next_pass == INT_MAX_RADIX_PASS) {
      groups_size_maybe_push(group_size, p_group_infos);
      p_x += group_size;
      p_o += group_size;
      continue;
    }

    // Order next byte of this subgroup
    int_order_radix_recurse(
      group_size,
      next_pass,
      p_x,
      p_o,
      p_x_aux,
      p_o_aux,
      p_bytes,
      p_counts_next_pass,
      p_skips,
      p_group_infos
    );

    p_x += group_size;
    p_o += group_size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1222

int_resize C signature

[any_sexp, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: int
timing: 0.312 s
source
SEXP int_resize(SEXP x, r_ssize x_size, r_ssize size) {
  RESIZE(INTEGER_RO, INTEGER, int, INTSXP);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:365

int_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: ([INT] --> *c_int_na) & ([^INT1] --> *c_int)
argument: [any_sexp]
timing: 0.516 s
source
r_obj* int_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE(R_TYPE_integer, int, r_int_begin, r_int_cbegin, r_globals.na_int);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:75

INTERP C signature

tuple3 --> any
unbound variable
error detail
name: va_start
timing: 0.003 s
(definition not located in src/)

is_dotdotint C signature

[c_string] --> c_bool
unbound variable
error detail
name: strtol
timing: 0.205 s
source
bool is_dotdotint(const char* name) {
  int n = strlen(name);

  if (n < 3) {
    return false;
  }
  if (name[0] != '.' || name[1] != '.') {
    return false;
  }

  if (name[2] == '.') {
    name += 3;
  } else {
    name += 2;
  }

  return (bool) strtol(name, NULL, 10);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:357

lgl_col_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
void lgl_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(int, r_lgl_cbegin, lgl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:311

lgl_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
void lgl_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(int, LOGICAL_RO, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:140

lgl_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
void lgl_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(int, r_lgl_cbegin, lgl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:212

lgl_hash_fill_na_equal C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
static inline void lgl_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(int, r_lgl_cbegin, lgl_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:226

lgl_hash_fill_na_propagate C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.002 s
source
static inline void lgl_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(int, r_lgl_cbegin, lgl_hash_scalar, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:248

lgl_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: ([LGL] --> *c_lgl) & ([^LGL1] --> *c_bool)
argument: [any_sexp]
timing: 0.454 s
source
r_obj* lgl_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE(R_TYPE_logical, int, r_lgl_begin, r_lgl_cbegin, r_globals.na_lgl);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:71

list_all_recyclable C signature

[any_sexp, c_int_na, c_bool, *struct vctrs_arg, struct r_lazy] --> c_bool
unbound variable
error detail
name: r_names
timing: 0.047 s
source
bool list_all_recyclable(
  r_obj* xs,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (r_typeof(xs) != R_TYPE_list) {
    r_stop_unexpected_type(r_typeof(xs));
  }

  r_ssize i = 0;

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  struct vctrs_arg* p_x_arg = new_subscript_arg(p_xs_arg, xs_names, xs_size, &i);
  KEEP(p_x_arg->shelter);

  bool out = true;

  for (; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    if (!vec_is_recyclable(x, size, allow_null, p_x_arg, call)) {
      out = false;
      break;
    }
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:258

list_all_size C signature

[any_sexp, c_int_na, c_bool, *struct vctrs_arg, struct r_lazy] --> c_bool
unbound variable
error detail
name: r_names
timing: 0.097 s
source
bool list_all_size(
  r_obj* xs,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (r_typeof(xs) != R_TYPE_list) {
    r_stop_unexpected_type(r_typeof(xs));
  }

  r_ssize i = 0;

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  struct vctrs_arg* p_x_arg = new_subscript_arg(p_xs_arg, xs_names, xs_size, &i);
  KEEP(p_x_arg->shelter);

  bool out = true;

  for (; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    if (!vec_is_size(x, size, allow_null, p_x_arg, call)) {
      out = false;
      break;
    }
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:116

list_all_vectors C signature

[any_sexp, c_bool] --> c_bool
untypeable application
error detail
function: [null, c_bool] | [<> | p(CHR) | sym, c_bool] --> c_bool
argument: [any_sexp, c_bool & 'I82298]
timing: 0.096 s
source
bool list_all_vectors(r_obj* xs, enum vctrs_allow_null allow_null) {
  if (r_typeof(xs) != R_TYPE_list) {
    r_stop_unexpected_type(r_typeof(xs));
  }

  const r_ssize size = r_length(xs);
  r_obj* const* v_xs = r_list_cbegin(xs);

  for (r_ssize i = 0; i < size; ++i) {
    r_obj* x = v_xs[i];
    if (!obj_is_vector(x, allow_null)) {
      return false;
    }
  }

  return true;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:29

list_check_all_condition_indices C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> c_void
unbound variable
error detail
name: r_names
timing: 0.046 s
source
void list_check_all_condition_indices(
  r_obj* xs,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (r_typeof(xs) != R_TYPE_list) {
   r_stop_unexpected_type(r_typeof(xs));
  }

  r_ssize i = 0;

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  struct vctrs_arg* p_x_arg = new_subscript_arg(p_xs_arg, xs_names, xs_size, &i);
  KEEP(p_x_arg->shelter);

  for (; i < xs_size; ++i) {
    check_condition_index(v_xs[i], p_x_arg, call);
  }

  FREE(2);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:957

list_check_all_recyclable C signature

[any_sexp, c_int_na, c_bool, *struct vctrs_arg, struct r_lazy] --> c_void
unbound variable
error detail
name: r_names
timing: 0.075 s
source
void list_check_all_recyclable(
  r_obj* xs,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (r_typeof(xs) != R_TYPE_list) {
    r_stop_unexpected_type(r_typeof(xs));
  }

  r_ssize i = 0;

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  struct vctrs_arg* p_x_arg = new_subscript_arg(p_xs_arg, xs_names, xs_size, &i);
  KEEP(p_x_arg->shelter);

  for (; i < xs_size; ++i) {
    vec_check_recyclable(v_xs[i], size, allow_null, p_x_arg, call);
  }

  FREE(2);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:314

list_check_all_size C signature

[any_sexp, c_int_na, c_bool, *struct vctrs_arg, struct r_lazy] --> c_void
unbound variable
error detail
name: r_names
timing: 0.048 s
source
void list_check_all_size(
  r_obj* xs,
  r_ssize size,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  if (r_typeof(xs) != R_TYPE_list) {
   r_stop_unexpected_type(r_typeof(xs));
  }

  r_ssize i = 0;

  const r_ssize xs_size = r_length(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  r_obj* const* v_xs = r_list_cbegin(xs);

  struct vctrs_arg* p_x_arg = new_subscript_arg(p_xs_arg, xs_names, xs_size, &i);
  KEEP(p_x_arg->shelter);

  for (; i < xs_size; ++i) {
    vec_check_size(v_xs[i], size, allow_null, p_x_arg, call);
  }

  FREE(2);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:172

list_check_all_vectors C signature

[any_sexp, c_bool, *struct vctrs_arg, struct r_lazy] --> c_void
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp, c_bool & 'I69028, *struct vctrs_arg, struct r_lazy & 'I69030]
timing: 0.393 s
source
void list_check_all_vectors(
  r_obj* xs,
  enum vctrs_allow_null allow_null,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  r_ssize i = 0;
  struct vctrs_arg* x_arg = new_subscript_arg_vec(p_xs_arg, xs, &i);
  KEEP(x_arg->shelter);

  const r_ssize xs_size = r_length(xs);
  r_obj* const* v_xs = r_list_cbegin(xs);

  for (; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    obj_check_vector(x, allow_null, x_arg, call);
  }

  FREE(1);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:63

list_combine C signature

[any_sexp, any_sexp, c_int_na, any_sexp, c_bool, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([null] --> c_false) & ([LGL | null] --> c_bool)
argument: [any_sexp]
timing: 0.023 s
source
r_obj* list_combine(
  r_obj* xs,
  r_obj* indices,
  r_ssize size,
  r_obj* default_,
  enum list_combine_unmatched unmatched,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_indices_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call
) {
  const enum s3_fallback s3_fallback = r_is_true(r_peek_option("vctrs:::base_c_in_progress")) ?
      S3_FALLBACK_false :
      S3_FALLBACK_true;

  // `list_combine_impl()` supports `NULL` `indices` for `vec_c()` and
  // `list_unchop()`, which `list_combine()` does not, so we early check here
  // for that. This can technically be hit by users so we want a good error
  // message. `vec_c()` and `list_unchop()` use this to sequentially combine
  // `xs`, but `list_combine()` requires `indices` to be a list.
  obj_check_list(indices, p_indices_arg, error_call);

  const enum vctrs_index_style indices_style = compute_indices_style(indices, size);

  const bool has_indices = true;
  const bool has_default = default_ != r_null;

  return list_combine_impl(
    xs,
    has_indices,
    indices,
    indices_style,
    size,
    has_default,
    default_,
    unmatched,
    multiple,
    slice_xs,
    ptype,
    name_spec,
    p_name_repair_opts,
    p_xs_arg,
    p_indices_arg,
    p_default_arg,
    error_call,
    s3_fallback
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:72

list_combine_common_class_fallback C signature

[any_sexp, c_int_na, any_sexp, c_bool, c_int_na, c_int_na, any_sexp, c_bool, c_bool, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
unbound variable
error detail
name: r_attrib_get
timing: 0.090 s
source
r_obj* list_combine_common_class_fallback(
  r_obj* xs,
  bool has_indices,
  r_obj* indices,
  enum vctrs_index_style indices_style,
  r_ssize size,
  bool has_default,
  r_obj* default_,
  enum list_combine_multiple multiple,
  enum assignment_slice_value slice_xs,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_xs_arg,
  struct vctrs_arg* p_indices_arg,
  struct vctrs_arg* p_default_arg,
  struct r_lazy error_call
) {
  r_obj* cls = KEEP(r_attrib_get(ptype, syms_fallback_class));
  bool implements_c = class_implements_base_c(cls);
  FREE(1);

  if (implements_c) {
    return base_list_combine_fallback(
      xs,
      has_indices,
      indices,
      indices_style,
      size,
      has_default,
      default_,
      multiple,
      slice_xs,
      name_spec,
      p_xs_arg,
      p_default_arg,
      error_call
    );
  } else {
    // Throw out the `vctrs:::common_class_fallback` ptype,
    // it's served its purpose by getting us here
    ptype = r_null;

    const enum s3_fallback s3_fallback = S3_FALLBACK_false;

    // Should cause a common type error, unless another fallback
    // kicks in (for instance, homogeneous class with homogeneous
    // attributes)
    vec_ptype_common(
      xs,
      ptype,
      PTYPE_FINALISE_DEFAULT,
      s3_fallback,
      p_xs_arg,
      error_call
    );

    // We will have already checked `unmatched` before the fallback
    // is invoked, so no need to check it again
    enum list_combine_unmatched unmatched = LIST_COMBINE_UNMATCHED_default;

    // Suboptimal: Call `list_combine_impl()` again to
    // combine vector with homogeneous class fallback
    return list_combine_impl(
      xs,
      has_indices,
      indices,
      indices_style,
      size,
      has_default,
      default_,
      unmatched,
      multiple,
      slice_xs,
      ptype,
      name_spec,
      p_name_repair_opts,
      p_xs_arg,
      p_indices_arg,
      p_default_arg,
      error_call,
      s3_fallback
    );
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:761

list_combine_for_list_unchop C signature

[any_sexp, any_sexp, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([null] --> c_false) & ([LGL | null] --> c_bool)
argument: [any_sexp]
timing: 0.113 s
source
r_obj* list_combine_for_list_unchop(
  r_obj* xs,
  r_obj* indices,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  const enum s3_fallback s3_fallback = r_is_true(r_peek_option("vctrs:::base_c_in_progress")) ?
      S3_FALLBACK_false :
      S3_FALLBACK_true;

  bool has_indices = indices != r_null;
  struct vctrs_arg* p_indices_arg = vec_args.indices;

  // If `!has_indices`, `list_combine()` will compute the size from the sizes of
  // `xs` and will ignore whatever we put here.
  r_ssize size = 0;

  if (has_indices) {
    // Sums the length of each `index` to compute the `size`
    //
    // This was the way that `list_unchop()` would compute the output size when
    // `indices` were provided. In `list_combine()`, the `size` is explicitly
    // required to account for a few edge cases and to work well with `default`.
    //
    // Note that `list_as_locations()` in `list_combine()` isn't allowed to
    // change the `index` size, which is the only reason this works from a
    // theoretical point of view.
    obj_check_list(indices, p_indices_arg, error_call);

    r_obj* const* v_indices = r_list_cbegin(indices);
    r_ssize indices_size = vec_size(indices);

    for (r_ssize i = 0; i < indices_size; ++i) {
      size += r_length(v_indices[i]);
    }
  }

  bool has_default = false;
  r_obj* default_ = r_null;
  struct vctrs_arg* p_default_arg = vec_args.empty;

  enum list_combine_unmatched unmatched = LIST_COMBINE_UNMATCHED_default;
  enum list_combine_multiple multiple = LIST_COMBINE_MULTIPLE_last;
  const enum assignment_slice_value slice_xs = ASSIGNMENT_SLICE_VALUE_no;
  const enum vctrs_index_style indices_style = VCTRS_INDEX_STYLE_location;

  r_obj* out = KEEP(list_combine_impl(
    xs,
    has_indices,
    indices,
    indices_style,
    size,
    has_default,
    default_,
    unmatched,
    multiple,
    slice_xs,
    ptype,
    name_spec,
    p_name_repair_opts,
    p_xs_arg,
    p_indices_arg,
    p_default_arg,
    error_call,
    s3_fallback
  ));

  if (vec_is_unspecified(out) && r_is_object(out)) {
    // The following `list_c()` and `list_unchop()` cases historically return
    // `NULL` because they don't have a `size` argument to maintain an invariant
    // for. `list_combine()` returns `unspecified` for these, because there
    // could be a `size > 0` argument supplied and we need to retain the size
    // invariant. We rectify the difference here.
    //
    // ```
    // vec_c()
    // vec_c(NULL)
    // list_unchop(list())
    // list_unchop(list(), indices = list())
    // list_unchop(list(NULL))
    // list_unchop(list(NULL), indices = list(integer()))
    // ```
    //
    // This is an ambiguous edge case that we've currently defined as also
    // returning `NULL`. `list_combine()` returns `unspecified[2]` here, but
    // that's clearer because `size` has to be explicitly provided.
    //
    // ```
    // list_unchop(list(NULL), indices = list(1:2))
    // ```
    //
    // We still want these cases to return `NA` even though they are technically
    // "unspecified" outputs, so we explicitly check if the output is an S3 object
    // as well, i.e. its an explicit `"vctrs_unspecified"` and not just a logical
    // vector of `NA`s.
    //
    // ```
    // vec_c(NA)
    // list_unchop(list(NA), indices = list(1))
    // ```
    out = r_null;
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:153

list_detect_complete C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: SEXP
timing: 0.002 s
source
void list_detect_complete(SEXP x, R_len_t size, int* p_out) {
  VEC_DETECT_COMPLETE(SEXP, VECTOR_PTR_RO, list_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:164

list_interleave C signature

[any_sexp, c_int_na, any_sexp, any_sexp, *struct name_repair_opts, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([c(..-1), c(..0)] | [c(1..), c(1..)] | [c_false, c(..0)] --> c_int) & ([c_false, c_int_na \ c(1..)] | [c_int_na \ c(0..), c_int_na \ c(1..)] --> c_int_na)
argument: [c_int, c_int_na]
timing: 0.435 s
source
r_obj* list_interleave(
  r_obj* x,
  r_ssize size,
  r_obj* ptype,
  r_obj* name_spec,
  const struct name_repair_opts* p_name_repair_opts,
  struct vctrs_arg* p_x_arg,
  struct r_lazy error_call
) {
  obj_check_list(x, p_x_arg, error_call);

  const r_ssize elt_size = (size == -1) ?
    vec_size_common(x, 0, p_x_arg, error_call) :
    size;

  r_obj* const* v_x = r_list_cbegin(x);
  const r_ssize x_size = r_length(x);

  // `x_size` excluding `NULL`s
  const r_ssize x_size_used = list_interleave_x_size_used(
    v_x,
    x_size
  );

  const r_ssize out_size = r_ssize_mult(x_size_used, elt_size);

  if (out_size > R_LEN_T_MAX) {
    r_abort(
      "Long vectors are not yet supported in `list_interleave()`. "
      "Result from interleaving would have size %td, which is larger "
      "than the maximum supported size of 2^31 - 1.",
      out_size
    );
  }

  r_obj* indices = KEEP(list_interleave_indices(
    v_x,
    x_size,
    x_size_used,
    elt_size
  ));

  r_obj* default_ = r_null;
  struct vctrs_arg* p_indices_arg = vec_args.empty;
  struct vctrs_arg* p_default_arg = vec_args.empty;

  r_obj* out = list_combine(
    x,
    indices,
    out_size,
    default_,
    LIST_COMBINE_UNMATCHED_default,
    LIST_COMBINE_MULTIPLE_last,
    ASSIGNMENT_SLICE_VALUE_no,
    ptype,
    name_spec,
    p_name_repair_opts,
    p_x_arg,
    p_indices_arg,
    p_default_arg,
    error_call
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-interleave.c:45

list_pluck C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [{ 'I28454 }, c_int] --> 'I28454
argument: [<...> | p(CHR) | sym, c_int_na & 'I28412]
timing: 0.133 s
source
r_obj* list_pluck(r_obj* xs, r_ssize i) {
  r_ssize n = r_length(xs);
  r_obj* const * v_xs = r_list_cbegin(xs);

  r_obj* out = KEEP(r_new_list(n));

  for (r_ssize j = 0; j < n; ++j) {
    r_obj* x = v_xs[j];
    if (x != r_null) {
      r_list_poke(out, j, r_list_get(x, i));
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:729

list_sizes C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([c_int] --> INT) & ([c_true] --> INT1)
argument: [c_int_na]
timing: 0.104 s
source
r_obj* list_sizes(
  r_obj* xs,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  obj_check_list(xs, p_xs_arg, call);

  r_ssize size = vec_size(xs);
  r_obj* const * v_xs = r_list_cbegin(xs);

  r_obj* out = KEEP(r_alloc_integer(size));
  int* v_out = r_int_begin(out);

  r_obj* names = vec_names(xs);
  r_attrib_poke_names(out, names);

  r_ssize i = 0;
  struct vctrs_arg* p_x_arg = new_subscript_arg_vec(p_xs_arg, xs, &i);
  KEEP(p_x_arg->shelter);

  for (; i < size; ++i) {
    r_obj* x = v_xs[i];
    v_out[i] = vec_size_params(x, p_x_arg, call);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:73

list_slice C signature

[any_sexp, any_sexp, c_bool] --> any_sexp
untypeable application
error detail
function: [list, c_int, any_sexp] --> ()
argument: [any_sexp, c_false | 'I24735, any_sexp]
timing: 0.348 s
source
r_obj* list_slice(r_obj* x, r_obj* subscript, enum vctrs_materialize materialize) {
  SLICE_BARRIER(R_TYPE_list, r_list_cbegin, r_list_poke, r_null);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:165

LOAD_WITH_HAYSTACK C signature

tuple1 --> any
unbound variable
error detail
name: n_haystack
timing: 0.006 s
(definition not located in src/)

names_iota C signature

[c_int_na] --> any_sexp
untypeable application
error detail
function: ([c_int, c_string, c_int_na, c_string] --> CHR | null) & ([c_true, c_string, c_int_na, c_string] --> CHR1 | null)
argument: [c_int_na & 'I79985, c_string | c_null, c(28), c("...")]
timing: 0.014 s
source
r_obj* names_iota(r_ssize n) {
  char buf[MAX_IOTA_SIZE];
  r_obj* nms = r_chr_iota(n, buf, MAX_IOTA_SIZE, "...");

  if (nms == r_null) {
    r_abort("Too many names to repair.");
  }

  return nms;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:482

needs_df_list_combine_common_class_fallback C signature

[any_sexp] --> c_bool
untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.139 s
source
bool needs_df_list_combine_common_class_fallback(r_obj* x) {
  r_ssize n_cols = r_length(x);
  r_obj* const * v_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* col = v_x[i];

    if (vec_is_common_class_fallback(col)) {
      return true;
    }
    if (is_data_frame(col) && needs_df_list_combine_common_class_fallback(col)) {
      return true;
    }
  }

  return false;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:852

needs_list_combine_common_class_fallback C signature

[any_sexp] --> c_bool
unbound variable
error detail
name: r_attrib_get
timing: 0.013 s
source
bool needs_list_combine_common_class_fallback(r_obj* ptype) {
  if (!vec_is_common_class_fallback(ptype)) {
    return false;
  }

  // Suboptimal: Prevent infinite recursion through `vctrs_vctr` method
  r_obj* cls = r_attrib_get(ptype, syms_fallback_class);
  cls = r_chr_get(cls, r_length(cls) - 1);

  return cls != strings_vctrs_vctr;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:729

needs_list_combine_homogeneous_fallback C signature

[any_sexp, c_int_na, any_sexp, any_sexp] --> c_bool
unbound variable
error detail
name: r_class
timing: 0.479 s
source
bool needs_list_combine_homogeneous_fallback(
  r_obj* xs,
  bool has_default,
  r_obj* default_,
  r_obj* ptype
) {
  r_obj* first = list_first_non_null(xs, NULL);

  if (first == r_null && has_default) {
    // i.e. `list_combine(x = list(), default = foobar(1))`
    first = default_;
  }

  if (!obj_is_vector(first, VCTRS_ALLOW_NULL_no)) {
    return false;
  }

  // Never fall back for `vctrs_vctr` classes to avoid infinite
  // recursion through `c.vctrs_vctr()`
  if (r_inherits(first, "vctrs_vctr")) {
    return false;
  }

  r_obj* ptype_class = KEEP(r_class(ptype));

  if (!obj_has_class(first, ptype_class)) {
    // Cheap test before consulting `vec_ptype2()` and `c()` methods
    FREE(1);
    return false;
  }

  bool out = !vec_implements_ptype2(first) &&
    list_all_have_class(xs, ptype_class) &&
    (has_default ? obj_has_class(default_, ptype_class) : true) &&
    vec_implements_base_c(first);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:987

new_chop_indices C signature

[any_sexp, any_sexp, any_sexp] --> *struct vctrs_chop_indices
untypeable application
error detail
function: ([list, c_int, 'I64738] --> 'I64738) & ([expr, c_int, 'I64738 & (lang | sym)] --> 'I64738 & (lang | sym))
argument: [any_sexp, c_true, any_sexp]
timing: 0.156 s
source
struct vctrs_chop_indices* new_chop_indices(r_obj* x, r_obj* indices, r_obj* sizes) {
  r_obj* shelter = KEEP(r_alloc_list(4));

  r_obj* self = r_alloc_raw(sizeof(struct vctrs_chop_indices));
  r_list_poke(shelter, 0, self);

  struct vctrs_chop_indices* p_indices = r_raw_begin(self);
  p_indices->shelter = shelter;

  p_indices->indices = indices;
  r_list_poke(p_indices->shelter, 1, p_indices->indices);
  p_indices->has_indices = p_indices->indices != r_null;

  p_indices->sizes = sizes;
  r_list_poke(p_indices->shelter, 2, p_indices->sizes);
  p_indices->has_sizes = p_indices->sizes != r_null;

  if (p_indices->has_indices) {
    p_indices->v_indices = r_list_cbegin(p_indices->indices);
    p_indices->v_sizes = NULL;
    p_indices->index = r_null;
    r_list_poke(p_indices->shelter, 3, p_indices->index);
    p_indices->p_index = NULL;
  } else if (p_indices->has_sizes) {
    p_indices->v_indices = NULL;
    p_indices->v_sizes = r_int_cbegin(p_indices->sizes);
    p_indices->index = compact_seq(0, 0, true);
    r_list_poke(p_indices->shelter, 3, p_indices->index);
    p_indices->p_index = r_int_begin(p_indices->index);
  } else {
    p_indices->v_indices = NULL;
    p_indices->v_sizes = NULL;
    p_indices->index = r_int(0);
    r_list_poke(p_indices->shelter, 3, p_indices->index);
    p_indices->p_index = r_int_begin(p_indices->index);
  }

  p_indices->loc = 0;

  FREE(1);
  return p_indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:66

new_counters C signature

[any_sexp, *struct vctrs_arg, *struct vctrs_arg] --> *struct counters
untypeable application
error detail
function: [*struct vctrs_arg, *struct arg_data_counter] --> struct vctrs_arg
argument: [*struct vctrs_arg & 'I28074, c_ptr]
timing: 0.251 s
source
struct counters* new_counters(r_obj* names,
                              struct vctrs_arg* p_curr_arg,
                              struct vctrs_arg* p_parent_arg) {
  // This protects `shelter` and `names`
  r_obj* shelter = KEEP(r_alloc_list(COUNTERS_SHELTER_N));

  r_obj* data_shelter = r_alloc_raw(sizeof(struct counters));
  r_list_poke(shelter, COUNTERS_SHELTER_data, data_shelter);

  // `names` probably don't need to be protected, but we do so to be safe
  // (We used to use splice boxes, and `names` needed to be protected then,
  // but we no longer do as of #1578)
  r_list_poke(shelter, COUNTERS_SHELTER_names, names);

  struct counters* p_counters = r_raw_begin(data_shelter);
  p_counters->shelter = shelter;

  p_counters->curr = 0;
  p_counters->next = 0;

  p_counters->names = names;

  p_counters->curr_counter_arg_data = new_counter_arg_data(p_parent_arg,
                                                           &p_counters->curr,
                                                           &p_counters->names);
  p_counters->next_counter_arg_data = new_counter_arg_data(p_parent_arg,
                                                           &p_counters->next,
                                                           &p_counters->names);

  p_counters->curr_counter = new_counter_arg(p_parent_arg, (void*) &p_counters->curr_counter_arg_data);
  p_counters->next_counter = new_counter_arg(p_parent_arg, (void*) &p_counters->next_counter_arg_data);

  p_counters->curr_arg = p_curr_arg;
  p_counters->next_arg = (struct vctrs_arg*) &p_counters->next_counter;

  FREE(1);
  return p_counters;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg-counter.c:5

new_dictionary_opts C signature

[any_sexp, *struct dictionary_opts] --> *struct dictionary
untypeable application
error detail
function: ([any_sexp, c_true | c(10) | c(255)] --> empty) & ([any_sexp, c(9)] | [any_sexp, c_false] --> *struct poly_vec)
argument: [any_sexp & 'I17202, c_false | c(2..7) | c(10)]
timing: 0.149 s
source
static struct dictionary* new_dictionary_opts(SEXP x, struct dictionary_opts* opts) {
  int nprot = 0;

  SEXP out = PROTECT_N(Rf_allocVector(RAWSXP, sizeof(struct dictionary)), &nprot);
  struct dictionary* d = (struct dictionary*) RAW(out);

  d->protect = out;

  enum vctrs_type type = vec_proxy_typeof(x);

  struct poly_vec* p_poly_vec = new_poly_vec(x, type);
  KEEP_N(p_poly_vec->shelter, &nprot);
  d->p_poly_vec = p_poly_vec;

  d->used = 0;

  if (opts->partial) {
    d->key = NULL;
    d->size = 0;
  } else {
    uint32_t size = dict_key_size(x);

    d->key = (R_len_t*) R_alloc(size, sizeof(R_len_t));

    for (uint32_t i = 0; i < size; ++i) {
      d->key[i] = DICT_EMPTY;
    }

    d->size = size;
  }

  R_len_t n = vec_size(x);
  if (n) {
    d->hash = (uint32_t*) R_alloc(n, sizeof(uint32_t));

    if (!(d->hash)) {
      Rf_errorcall(R_NilValue, "Can't allocate hash lookup table. Please free memory.");
    }

    r_memset(d->hash, 0, n * sizeof(uint32_t));
    vec_hash_fill(x, n, opts->na_equal, d->hash);
  } else {
    d->hash = NULL;
  }

  UNPROTECT(nprot);
  return d;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:62

new_strides_info C signature

[any_sexp, any_sexp] --> struct strides_info
unbound variable
error detail
name: vec_dim
timing: 0.064 s
source
static inline struct strides_info new_strides_info(SEXP x, SEXP index) {
  SEXP dim = PROTECT(vec_dim(x));
  const int* p_dim = INTEGER_RO(dim);

  R_len_t dim_n = Rf_length(dim);
  R_len_t shape_n = dim_n - 1;
  R_len_t index_n = vec_subscript_size(index);

  SEXP strides = PROTECT(vec_strides(p_dim, shape_n));
  const int* p_strides = INTEGER_RO(strides);

  const int* p_index = INTEGER_RO(index);

  // If using a compact rep/seq, the `steps` won't be used, but we still
  // need to put something in the struct
  SEXP steps;
  if (is_compact_rep(index) || is_compact_seq(index)) {
    steps = r_globals.empty_int;
  } else {
    steps = vec_steps(p_index, index_n);
  }
  PROTECT(steps);
  const int* p_steps = INTEGER_RO(steps);

  // Initialize `shape_index` to the first element
  SEXP shape_index = PROTECT(Rf_allocVector(INTSXP, shape_n));
  int* p_shape_index = INTEGER(shape_index);
  for (int i = 0; i < shape_n; ++i) {
    p_shape_index[i] = 0;
  }

  R_len_t shape_elem_n = vec_shape_elem_n(p_dim, dim_n);

  struct strides_info info = {
    .dim = dim,
    .p_dim = p_dim,
    .strides = strides,
    .p_strides = p_strides,
    .index = index,
    .p_index = p_index,
    .steps = steps,
    .p_steps = p_steps,
    .shape_index = shape_index,
    .p_shape_index = p_shape_index,
    .dim_n = dim_n,
    .shape_n = shape_n,
    .index_n = index_n,
    .shape_elem_n = shape_elem_n
  };

  UNPROTECT(4);
  return info;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/strides.h:166

new_subscript_arg C signature

[*struct vctrs_arg, any_sexp, c_int_na, *c_int_na] --> *struct vctrs_arg
untypeable application
error detail
function: [raw] --> *c_int
argument: tuple1
timing: 0.054 s
source
struct vctrs_arg* new_subscript_arg(struct vctrs_arg* parent,
                                    r_obj* names,
                                    r_ssize n,
                                    r_ssize* p_i) {
  r_obj* shelter = KEEP(r_alloc_list(2));
  r_list_poke(shelter, 0, r_alloc_raw(sizeof(struct subscript_arg_data)));
  r_list_poke(shelter, 1, names);

  struct subscript_arg_data* p_data = r_raw_begin(r_list_get(shelter, 0));
  p_data->self = (struct vctrs_arg) {
    .shelter = shelter,
    .parent = parent,
    .fill = &subscript_arg_fill,
    .data = p_data
  };
  p_data->names = names;
  p_data->n = n;
  p_data->p_i = p_i;

  FREE(1);
  return (struct vctrs_arg*) p_data;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg.c:167

obj_attrib_encode_utf8 C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [any_sexp, *c_int_na] --> c_void
argument: [any_sexp & 'I8140, *any]
timing: 0.017 s
source
r_obj* obj_attrib_encode_utf8(r_obj* x, bool owned) {
  // `out` pointer may be updated in place by callback
  r_obj* out = x;

  r_keep_loc shelter;
  KEEP_HERE(out, &shelter);

  struct cb_data data = {
    .p_out = &out,
    .shelter = shelter,
    .p_owned = &owned
  };

  r_attrib_map(x, obj_attrib_encode_utf8_cb, &data);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:160

obj_attrib_encode_utf8_cb C signature

[any_sexp, any_sexp, c_ptr] --> any_sexp
unbound variable
error detail
name: obj_encode_utf8
timing: 0.073 s
source
static r_obj* obj_attrib_encode_utf8_cb(r_obj* tag, r_obj* old, void* data) {
  struct cb_data* p_data = (struct cb_data*) data;

  r_obj* new = obj_encode_utf8(old);
  if (old == new) {
    return NULL;
  }
  KEEP(new);

  if (!(*p_data->p_owned)) {
    // Shallow clones `out` and its attributes
    *p_data->p_out = r_clone(*p_data->p_out);
    KEEP_AT(*p_data->p_out, p_data->shelter);
    *p_data->p_owned = true;
  }

  r_attrib_poke(*p_data->p_out, tag, new);

  FREE(1);
  return NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:137

obj_attrib_equal C signature

[any_sexp, any_sexp] --> c_bool
untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: [any_sexp & 'I2993, [any_sexp, any_sexp, c_ptr] --> any_sexp, *struct attrib_equal_data]
timing: 0.062 s
source
static inline bool obj_attrib_equal(r_obj* x, r_obj* y) {
  const bool x_has_attrib = r_attrib_has_any(x);
  const bool y_has_attrib = r_attrib_has_any(y);

  if (!x_has_attrib && !y_has_attrib) {
    // Neither have attributes
    return true;
  }

  if (x_has_attrib != y_has_attrib) {
    // One or the other has attributes, but not both
    return false;
  }

  // Ok, now we know both have attributes, compare them
  struct attrib_equal_data equal_data = {
    .y = y,
    .x_size = 0
  };
  r_obj* result = r_attrib_map(x, obj_attrib_equal_cb, &equal_data);

  // We got the signal that an attribute was different
  if (result == r_null) {
    return false;
  }

  // All attributes in `x` equal attributes in `y`.
  // Lastly,  ensure `y` doesn't have more attributes than `x`.
  struct attrib_count_data count_data = {
    .y_size = 0
  };
  r_attrib_map(y, obj_attrib_count_cb, &count_data);

  return equal_data.x_size == count_data.y_size;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:535

obj_attrib_equal_cb C signature

[any_sexp, any_sexp, c_ptr] --> any_sexp
unbound variable
error detail
name: r_attrib_get
timing: 0.052 s
source
static r_obj* obj_attrib_equal_cb(r_obj* tag, r_obj* value, void* data) {
  struct attrib_equal_data* p_data = (struct attrib_equal_data*) data;
  p_data->x_size++;

  r_obj* y_value = KEEP(r_attrib_get(p_data->y, tag));

  // Return `r_null` when different to signal that we are done
  SEXP out = obj_equal_utf8(value, y_value) ? NULL : r_null;

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:571

obj_equal C signature

[any_sexp, any_sexp] --> c_bool
unbound variable
error detail
name: obj_encode_utf8
timing: 0.002 s
source
bool obj_equal(r_obj* x, r_obj* y) {
  x = KEEP(obj_encode_utf8(x));
  y = KEEP(obj_encode_utf8(y));

  const bool out = obj_equal_utf8(x, y);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:331

obj_has_class C signature

[any_sexp, any_sexp] --> c_bool
unbound variable
error detail
name: r_class
timing: 0.002 s
source
bool obj_has_class(r_obj* x, r_obj* class) {
  r_obj* x_class = KEEP(r_class(x));
  bool out = obj_equal(x_class, class);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1085

p_chr_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [any_sexp, any_sexp] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.020 s
source
static inline int p_chr_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(SEXP, chr_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:73

p_cpl_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [{ r : c_double ; i : c_double ..}, { r : c_double ; i : c_double ..}] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.021 s
source
static inline int p_cpl_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(Rcomplex, cpl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:70

p_cpl_is_missing C signature

[c_ptr, c_int_na] --> c_bool
untypeable application
error detail
function: [{ r : c_double ; i : c_double ..}] --> c_bool
argument: [~c_string]
timing: 0.009 s
source
bool p_cpl_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(r_complex, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:67

p_dbl_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_double, c_double] --> c(-1..0)
argument: [~c_string, ~c_string]
timing: 0.020 s
source
int p_dbl_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(double, dbl_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:127

p_dbl_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_double, c_double] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.020 s
source
static inline int p_dbl_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(double, dbl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:67

p_dbl_is_missing C signature

[c_ptr, c_int_na] --> c_bool
untypeable application
error detail
function: [c_double] --> c_bool
argument: [~c_string]
timing: 0.009 s
source
bool p_dbl_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(double, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:63

p_dbl_order_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na, c_int_na] --> c_int_na
untypeable application
error detail
function: ([c_double, c_double, c_false] --> c(-1..0)) & ([c_double, c_double, c_int_na \ c_false] --> c(-1..1))
argument: [~c_string, ~c_string, c_int_na & 'I4285]
timing: 0.023 s
source
int p_dbl_order_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j, bool nan_distinct) {
  P_ORDER_COMPARE_NA_EQUAL(double, dbl_order_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:98

p_int_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> c_int
argument: [~c_string, ~c_string]
timing: 0.020 s
source
int p_int_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(int, int_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:123

p_int_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.019 s
source
static inline int p_int_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(int, int_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:64

p_int_is_missing C signature

[c_ptr, c_int_na] --> c_bool
untypeable application
error detail
function: [c_int_na] --> c_bool
argument: [~c_string]
timing: 0.009 s
source
bool p_int_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(int, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:59

p_int_order_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na, c_int_na] --> c_int
argument: [~c_string, ~c_string, c_int_na & 'I4303]
timing: 0.021 s
source
int p_int_order_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j, bool nan_distinct) {
  P_ORDER_COMPARE_NA_EQUAL(int, int_order_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:94

p_lgl_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> c_int
argument: [~c_string, ~c_string]
timing: 0.020 s
source
int p_lgl_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(int, lgl_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:119

p_lgl_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.018 s
source
static inline int p_lgl_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(int, lgl_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:61

p_lgl_is_missing C signature

[c_ptr, c_int_na] --> c_bool
untypeable application
error detail
function: [c_int_na] --> c_bool
argument: [~c_string]
timing: 0.009 s
source
bool p_lgl_is_missing(const void* p_x, r_ssize i) {
  P_IS_MISSING(int, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.h:55

p_lgl_order_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na, c_int_na] --> c_int
argument: [~c_string, ~c_string, c_int_na & 'I4321]
timing: 0.020 s
source
int p_lgl_order_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j, bool nan_distinct) {
  P_ORDER_COMPARE_NA_EQUAL(int, lgl_order_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-compare.h:90

p_list_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [any_sexp, any_sexp] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.019 s
source
static inline int p_list_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(SEXP, list_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:79

p_raw_compare_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> empty
argument: [~c_string, ~c_string]
timing: 0.020 s
source
int p_raw_compare_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_COMPARE_NA_EQUAL(Rbyte, raw_compare_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.h:139

p_raw_equal_na_equal C signature

[c_ptr, c_int_na, c_ptr, c_int_na] --> c_int_na
untypeable application
error detail
function: [c_int_na, c_int_na] --> c_bool
argument: [~c_string, ~c_string]
timing: 0.019 s
source
static inline int p_raw_equal_na_equal(const void* p_x, r_ssize i, const void* p_y, r_ssize j) {
  P_EQUAL_NA_EQUAL(Rbyte, raw_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.h:76

posixlt_as_date C signature

[any_sexp, *c_bool] --> any_sexp
unbound variable
error detail
name: posixlt_as_posixct_impl
timing: 0.008 s
source
SEXP posixlt_as_date(SEXP x, bool* lossy) {
  SEXP lt = x;

  SEXP tzone = PROTECT(tzone_get(lt));
  SEXP ct = PROTECT(posixlt_as_posixct_impl(lt, tzone));

  SEXP out = posixt_as_date(ct, lt, lossy);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:115

proxy_first_missing C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [INT] --> c_int
argument: [LGL & 'I22751]
timing: 0.061 s
source
r_ssize proxy_first_missing(r_obj* proxy) {
  const enum vctrs_type type = vec_proxy_typeof(proxy);

  switch (type) {
  case VCTRS_TYPE_logical: return lgl_first_missing(proxy);
  case VCTRS_TYPE_integer: return int_first_missing(proxy);
  case VCTRS_TYPE_double: return dbl_first_missing(proxy);
  case VCTRS_TYPE_complex: return cpl_first_missing(proxy);
  case VCTRS_TYPE_raw: return raw_first_missing(proxy);
  case VCTRS_TYPE_character: return chr_first_missing(proxy);
  case VCTRS_TYPE_list: return list_first_missing(proxy);
  case VCTRS_TYPE_dataframe: return df_first_missing(proxy);
  case VCTRS_TYPE_null: return 0;
  case VCTRS_TYPE_scalar: stop_scalar_type(proxy, vec_args.empty, r_lazy_null);
  default: stop_unimplemented_vctrs_type("vec_first_missing", type);
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:279

r_abort C signature

any --> c_void
untypeable application
error detail
function: tuple3 --> any
argument: [c_string | c_null, c_string & 'I5907]
timing: 0.005 s
source
void r_abort(const char* fmt, ...) {
  char buf[BUFSIZE];
  INTERP(buf, fmt, ...);
  r_obj* message = KEEP(r_chr(buf));

  // Evaluate in a mask but forward error call to the current frame
  r_obj* frame = KEEP(r_peek_frame());
  r_obj* mask = KEEP(r_alloc_environment(2, frame));
  r_env_bind(mask, r_syms.error_call_flag, frame);

  struct r_pair args[] = {
    { r_syms.message, message }
  };

  r_exec_n(r_null, r_syms.abort, args, R_ARR_SIZEOF(args), mask);

  while (1); // No return
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/cnd.c:38

r_abort_call C signature

any --> empty
untypeable application
error detail
function: tuple3 --> any
argument: [c_string | c_null, c_string & 'I15221]
timing: 0.006 s
source
void r_abort_call(r_obj* call, const char* fmt, ...) {
  char buf[BUFSIZE];
  INTERP(buf, fmt, ...);
  r_obj* message = KEEP(r_chr(buf));

  struct r_pair args[] = {
    { r_syms.message, message },
    { r_syms.call, call }
  };

  r_obj* frame = KEEP(r_peek_frame());
  r_exec_mask_n(r_null, r_syms.abort, args, R_ARR_SIZEOF(args), frame);

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/cnd.c:64

r_alloc_vector C signature

[c(0..10) | c(13..25) | c(30..31) | c(99), c_int_na] --> any_sexp
untypeable application
error detail
function: ([list, any] --> list) & ([prim & 'I22334, c_int] --> v('I22334)) & ([prim & 'I22334, c_true] --> v1('I22334))
argument: [(c(0..10) | c(13..25) | c(30..31) | c(99)) & 'I22329, c_int_na & 'I22330]
timing: 0.016 s
source
r_obj* r_alloc_vector(enum r_type type, r_ssize n) {
#if R_VERSION >= R_Version(4, 6, 0)
  return R_allocResizableVector(type, n);
#else
  return Rf_allocVector(type, n);
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:186

r_arg_as_ssize C signature

[any_sexp, c_string] --> c_int_na
untypeable application
error detail
function: ([INT, c_int_na] --> c_int_na) & ([^INT1, c_int_na] --> c_int)
argument: [DBL & 'I81729, c_false]
timing: 0.304 s
source
r_ssize r_arg_as_ssize(r_obj* n, const char* arg) {
  switch (r_typeof(n)) {

  case R_TYPE_double: {
    if (r_length(n) != 1) {
      goto invalid;
    }

    double out = r_dbl_get(n, 0);

    if (out > R_SSIZE_MAX) {
      r_abort("`%s` is too large a number.", arg);
    }
    if (out != (int_least64_t) out) {
      r_abort("`%s` must be a whole number, not a decimal number.", arg);
    }

    return (r_ssize) floor(out);
  }

  case R_TYPE_integer: {
    if (r_length(n) != 1) {
      goto invalid;
    }
    return (r_ssize) r_int_get(n, 0);
  }

  invalid:
  default:
    r_abort("`%s` must be a scalar integer or double.", arg);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/rlang.c:38

r_as_function C signature

[any_sexp, c_string] --> any_sexp
unbound variable
error detail
name: r_attrib_get
timing: 0.064 s
source
r_obj* r_as_function(r_obj* x, const char* arg) {
  switch (r_typeof(x)) {
  case R_TYPE_closure:
  case R_TYPE_builtin:
  case R_TYPE_special:
    return x;

  case R_TYPE_call:
    if (r_node_car(x) == r_syms.tilde && r_node_cddr(x) == r_null) {
      r_obj* env = r_attrib_get(x, r_syms.dot_environment);
      if (env == r_null) {
        r_abort("Can't transform formula to function because it doesn't have an environment.");
      }

      return r_new_function(rlang_formula_formals, r_node_cadr(x), env);
    }
    // else fallthrough;
  default:
    r_abort("Can't convert `%s` to a function", arg);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.c:6

r_base_ns_get C signature

[c_string] --> any_sexp
untypeable application
error detail
function: [env, sym] --> any_sexp
argument: [any_sexp, sym]
timing: 0.011 s
source
r_obj* r_base_ns_get(const char* name) {
  return r_env_get(r_envs.base, r_sym(name));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.c:15

r_chr_paste_prefix C signature

[any_sexp, c_string, c_string] --> any_sexp
untypeable application
error detail
function: ([c_int] --> raw) & ([c_true] --> raw1)
argument: [c_int_na]
timing: 0.395 s
source
r_obj* r_chr_paste_prefix(r_obj* names, const char* prefix, const char* sep) {
  int n_prot = 0;

  names = KEEP_N(r_clone(names), &n_prot);
  r_ssize n = r_length(names);

  int outer_len = strlen(prefix);
  int names_len = r_chr_max_len(names);

  int sep_len = strlen(sep);
  int total_len = outer_len + names_len + sep_len + 1;

  char* buf = vctrs_paste_buffer;
  if (total_len > VCTRS_PASTE_BUFFER_MAX_SIZE) {
    r_obj* buf_box = KEEP_N(
      r_alloc_raw(total_len * sizeof(char)),
      &n_prot
    );
    buf = (char*) RAW(buf_box);
  }

  buf[total_len - 1] = '\0';
  char* bufp = buf;

  r_memcpy(bufp, prefix, outer_len); bufp += outer_len;

  for (int i = 0; i < sep_len; ++i) {
    *bufp++ = sep[i];
  }

  r_obj* const* p_names = r_chr_cbegin(names);

  for (r_ssize i = 0; i < n; ++i) {
    const char* inner = r_str_c_string(p_names[i]);
    int inner_n = strlen(inner);

    r_memcpy(bufp, inner, inner_n);
    bufp[inner_n] = '\0';

    r_chr_poke(names, i, r_str(buf));
  }

  FREE(n_prot);
  return names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:671

r_chr_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [CHR, c_int, p(CHR)] --> ()
argument: [any_sexp, c_false | c_int_na & 'I22426, p(CHR)]
timing: 0.423 s
source
r_obj* r_chr_resize(r_obj* x, r_ssize new_size) {
  RESIZE_BARRIER(R_TYPE_character, r_chr_cbegin, r_chr_poke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:95

r_cnd_signal C signature

[any_sexp] --> c_void
unbound variable
error detail
name: r_eval_with_x
timing: 0.002 s
source
void r_cnd_signal(r_obj* cnd) {
  r_eval_with_x(cnd_signal_call, cnd, r_envs.base);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/cnd.c:80

r_cpl_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [CLX] --> *s({ r: c_double, i: c_double })
argument: [any_sexp]
timing: 0.340 s
source
r_obj* r_cpl_resize(r_obj* x, r_ssize new_size) {
  RESIZE(R_TYPE_complex, r_complex, r_cpl_cbegin, r_cpl_begin);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:89

r_dbl_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [DBL] --> *c_double
argument: [any_sexp]
timing: 0.331 s
source
r_obj* r_dbl_resize(r_obj* x, r_ssize new_size) {
  RESIZE(R_TYPE_double, double, r_dbl_cbegin, r_dbl_begin);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:86

r_double_as_ssize C signature

[c_double] --> c_int_na
unbound variable
error detail
name: R_SSIZE_MIN
timing: 0.008 s
source
r_ssize r_double_as_ssize(double x) {
  if (x > R_SSIZE_MAX || x < R_SSIZE_MIN) {
    r_stop_internal("Result can't be represented as `r_ssize`.");
  }

  return (r_ssize) x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/c-utils.h:149

r_exec_mask_n_call_poke C signature

[any_sexp, any_sexp, *struct r_pair, c_int_na, any_sexp] --> any_sexp
untypeable application
error detail
function: [env, sym, any_sexp] --> ()
argument: [env & 'I5850, <...> | p(CHR) | sym, any_sexp]
timing: 0.462 s
source
r_obj* r_exec_mask_n_call_poke(r_obj* fn_sym,
                               r_obj* fn,
                               const struct r_pair* args,
                               int n,
                               r_obj* env) {
  if (fn_sym != r_null) {
    r_env_bind(env, fn_sym, fn);
    fn = fn_sym;
  }

  r_obj* list = KEEP(r_new_pairlist(args, n, NULL));

  r_obj* node = list;
  while (node != r_null) {
    r_obj* car = r_node_car(node);
    r_obj* tag = r_node_tag(node);

    if (tag == r_null) {
      // If symbol is not supplied, protect symbolic arguments from
      // evaluation. If supplied this is not needed because of the
      // masking.
      r_node_poke_car(node, r_expr_protect(car));
    } else {
      // If symbol is supplied, assign the value in the environment and
      // use the symbol instead of the value in the list of arguments
      r_env_bind(env, tag, car);
      r_node_poke_car(node, tag);
    }

    node = r_node_cdr(node);
  }

  r_obj* call = r_new_call(fn, list);

  FREE(1);
  return call;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:132

r_init_library_cnd C signature

() --> c_void
untypeable coercion
error detail
expected: any --> empty
given: any
timing: 0.014 s
source
void r_init_library_cnd(void) {
  msg_call = r_parse("message(x)");
  r_preserve(msg_call);

  wng_call = r_parse("warning(x, call. = FALSE)");
  r_preserve(wng_call);

  err_call = r_parse("rlang::abort(x)");
  r_preserve(err_call);

  cnd_signal_call = r_parse("rlang::cnd_signal(x)");
  r_preserve(cnd_signal_call);

  // Silence "'noreturn' attribute does not apply to types warning".
  // It seems like GCC doesn't handle attributes in casts so we need
  // to cast through a typedef.
  // https://stackoverflow.com/questions/9441262/function-pointer-to-attribute-const-function
  typedef r_no_return void (*r_stop_internal_t)(const char*,
                                                int,
                                                r_obj*,
                                                const char* fmt,
                                                ...);
  r_stop_internal = (r_stop_internal_t) R_GetCCallable("rlang", "rlang_stop_internal2");

  r_format_error_arg = (const char* (*)(r_obj*)) r_peek_c_callable("rlang", "rlang_format_error_arg");
  r_obj_type_friendly_full = (const char* (*)(r_obj*, bool, bool)) r_peek_c_callable("rlang", "rlang_obj_type_friendly_full");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/cnd.c:137

r_init_library_env C signature

() --> c_void
untypeable application
error detail
function: [c_string, env] --> any_sexp
argument: [c("missing"), any_sexp]
timing: 0.010 s
source
void r_init_library_env(void) {
#if R_VERSION < R_Version(4, 1, 0)
  new_env_call = r_parse_eval("as.call(list(new.env, TRUE, NULL, NULL))", r_envs.base);
  r_preserve(new_env_call);

  new_env__parent_node = r_node_cddr(new_env_call);
  new_env__size_node = r_node_cdr(new_env__parent_node);
#endif

  missing_prim = r_parse_eval("missing", r_envs.base);

  env2list_call = r_parse("as.list.environment(x, all.names = TRUE)");
  r_preserve(env2list_call);

  list2env_call = r_parse("list2env(x, envir = NULL, parent = y, hash = TRUE)");
  r_preserve(list2env_call);

  exists_call = r_parse("exists(y, envir = x, inherits = z)");
  r_preserve(exists_call);

  remove_call = r_parse("remove(list = y, envir = x, inherits = z)");
  r_preserve(remove_call);

  r_methods_ns_env = r_parse_eval("asNamespace('methods')", r_envs.base);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/env.c:255

r_init_library_fn C signature

() --> c_void
untypeable application
error detail
function: [c_string, env] --> any_sexp
argument: [c("formals(function(..., .x = ..1, .y = ..2, . = ..1) NULL)"), any_sexp]
timing: 0.044 s
source
void r_init_library_fn(void) {
  const char* formals_code = "formals(function(..., .x = ..1, .y = ..2, . = ..1) NULL)";
  rlang_formula_formals = r_parse_eval(formals_code, r_envs.base);
  r_preserve_global(rlang_formula_formals);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/fn.c:28

r_init_library_globals C signature

[any_sexp] --> c_void
untypeable application
error detail
function: [sym] --> p(CHR)
argument: [any_sexp]
timing: 0.090 s
source
void r_init_library_globals(r_obj* ns) {
  r_preserve_global(r_classes.data_frame = r_chr("data.frame"));

  const char* v_tibble_class[] = { "tbl_df", "tbl", "data.frame" };
  r_preserve_global(r_globals.empty_lgl = r_alloc_logical(0));
  r_preserve_global(r_globals.empty_int = r_alloc_integer(0));
  r_preserve_global(r_globals.empty_dbl = r_alloc_double(0));
  r_preserve_global(r_globals.empty_cpl = r_alloc_complex(0));
  r_preserve_global(r_globals.empty_raw = r_alloc_raw(0));
  r_preserve_global(r_globals.empty_chr = r_alloc_character(0));
  r_preserve_global(r_globals.empty_list = r_alloc_list(0));

  r_globals.na_lgl = NA_LOGICAL;
  r_globals.na_int = NA_INTEGER;
  r_globals.na_dbl = NA_REAL;
  r_globals.na_cpl = (r_complex) { .r = NA_REAL, .i = NA_REAL };
  r_globals.na_str = NA_STRING;

  r_preserve_global(r_chrs.empty_string = r_chr(""));
  r_preserve_global(r_chrs.full = r_chr("full"));

  r_classes.tibble = r_chr_n(v_tibble_class, R_ARR_SIZEOF(v_tibble_class));
  r_preserve_global(r_classes.tibble);

  r_strs.dots = r_sym_string(r_syms.dots);
  r_strs.condition = r_sym_string(r_syms.condition);
  r_strs.empty = r_chr_get(r_chrs.empty_string, 0);
  r_strs.error = r_sym_string(r_syms.error);
  r_strs.interrupt = r_sym_string(r_syms.interrupt);
  r_strs.na = r_globals.na_str;
  r_strs.message = r_sym_string(r_syms.message);
  r_strs.warning = r_sym_string(r_syms.warning);

  r_preserve_global(r_false = r_lgl(0));
  r_preserve_global(r_true = r_lgl(1));

  r_envs.empty = R_EmptyEnv;
  r_envs.base = R_BaseEnv;
  r_envs.global = R_GlobalEnv;
  r_envs.ns = ns;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/globals.c:16

r_init_library_globals_syms C signature

() --> c_void
unbound variable
error detail
name: R_TripleColonSymbol
timing: 0.031 s
source
void r_init_library_globals_syms(void) {
  r_syms.abort = r_sym("abort");
  r_syms.arg = r_sym("arg");
  r_syms.brace = R_BraceSymbol;
  r_syms.brackets = R_BracketSymbol;
  r_syms.brackets2 = R_Bracket2Symbol;
  r_syms.call = r_sym("call");
  r_syms.class_ = R_ClassSymbol;
  r_syms.colon2 = R_DoubleColonSymbol;
  r_syms.colon3 = R_TripleColonSymbol;
  r_syms.condition = r_sym("condition");
  r_syms.dots = R_DotsSymbol;
  r_syms.error = r_sym("error");
  r_syms.error_arg = r_sym("error_arg");
  r_syms.error_call = r_sym("error_call");
  r_syms.error_call_flag = r_sym(".__error_call__.");
  r_syms.expr = r_sym("expr");
  r_syms.interrupt = r_sym("interrupt");
  r_syms.missing = R_MissingArg;
  r_syms.message = r_sym("message");
  r_syms.names = R_NamesSymbol;
  r_syms.options = r_sym("options");
  r_syms.dim = R_DimSymbol;
  r_syms.dim_names = R_DimNamesSymbol;
  r_syms.row_names = R_RowNamesSymbol;
  r_syms.stack_overflow_error = r_sym("stackOverflowError");
  r_syms.warning = r_sym("warning");

  r_syms.dot_environment = r_sym(".Environment");
  r_syms.dot_fn = r_sym(".fn");
  r_syms.dot_x = r_sym(".x");
  r_syms.dot_y = r_sym(".y");
  r_syms.function = r_sym("function");
  r_syms.srcfile = r_sym("srcfile");
  r_syms.srcref = r_sym("srcref");
  r_syms.tilde = r_sym("~");
  r_syms.w = r_sym("w");
  r_syms.wholeSrcref = r_sym("wholeSrcref");
  r_syms.x = r_sym("x");
  r_syms.y = r_sym("y");
  r_syms.z = r_sym("z");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/globals.c:58

r_init_library_stack C signature

() --> c_void
untypeable application
error detail
function: [lang | null, any_sexp, env] --> (any -> any)
argument: [null, any_sexp, any_sexp]
timing: 0.013 s
source
void r_init_library_stack(void) {
  // `sys.frame(sys.nframe())` doesn't work because `sys.nframe()`
  // returns the number of the frame in which evaluation occurs. It
  // doesn't return the number of frames on the stack. So we'd need
  // to evaluate it in the last frame on the stack which is what we
  // are looking for to begin with. We use instead this workaround:
  // Call `sys.frame()` from a closure to push a new frame on the
  // stack, and use negative indexing to get the previous frame.
  r_obj* current_frame_body = KEEP(r_parse("sys.frame(-1)"));
  r_obj* current_frame_fn = KEEP(r_new_function(r_null, current_frame_body, r_envs.base));
  peek_frame_call = r_new_call(current_frame_fn, r_null);
  r_preserve(peek_frame_call);
  FREE(2);

  sys_frame_call = generate_sys_call("sys.frame", &sys_frame_n_addr);
  sys_call_call = generate_sys_call("sys.call", &sys_call_n_addr);

  caller_env_call = r_parse("parent.frame()");
  r_preserve_global(caller_env_call);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/stack.c:77

r_int_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: ([INT] --> *c_int_na) & ([^INT1] --> *c_int)
argument: [any_sexp]
timing: 0.400 s
source
r_obj* r_int_resize(r_obj* x, r_ssize new_size) {
  RESIZE(R_TYPE_integer, int, r_int_cbegin, r_int_begin);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:83

r_lazy_eval C signature

[struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([*any \ c_null] --> c_false) & ([c_false] --> c_true) & ([c_int_na \ c_false] --> c_false) & ([c_null] --> c_true) & ([c_string] --> c_false)
argument: ['I7731]
timing: 0.037 s
source
r_obj* r_lazy_eval(struct r_lazy lazy) {
  if (!lazy.env) {
    // Unitialised lazy variable
    return r_null;
  } else if (lazy.env == r_null) {
    // Forced lazy variable
    return lazy.x;
  } else {
    return r_eval(lazy.x, lazy.env);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.h:152

r_len C signature

[c_int_na] --> any_sexp
untypeable application
error detail
function: [c_double] --> DBL1
argument: [c_int_na & 'I54651]
timing: 0.010 s
source
r_obj* r_len(r_ssize x) {
  if (x > INT_MAX) {
    return r_dbl(x);
  } else {
    return r_int(x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:301

r_lgl_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: ([LGL] --> *c_lgl) & ([^LGL1] --> *c_bool)
argument: [any_sexp]
timing: 0.370 s
source
r_obj* r_lgl_resize(r_obj* x, r_ssize new_size) {
  RESIZE(R_TYPE_logical, int, r_lgl_cbegin, r_lgl_begin);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:80

r_lgl_which C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: r_names
timing: 1.48 s
source
r_obj* r_lgl_which(r_obj* x, bool na_propagate) {
  const enum r_type type = r_typeof(x);

  if (type != R_TYPE_logical) {
    r_stop_unexpected_type(type);
  }

  const r_ssize n = r_length(x);
  const int* v_x = r_lgl_cbegin(x);

  const r_ssize out_n = r_lgl_sum(x, na_propagate);

  if (out_n > INT_MAX) {
    r_stop_internal("Can't fit result in an integer vector.");
  }

  r_obj* out = KEEP(r_alloc_integer(out_n));
  int* v_out = r_int_begin(out);

  r_obj* names = r_names(x);
  const bool has_names = (names != r_null);

  if (na_propagate) {
    if (has_names) {
      // Mark `NA` locations with negative location for extracting names later
      for (r_ssize i = 0, j = 0; i < n && j < out_n; ++i) {
        const int x_elt = v_x[i];
        const bool missing = x_elt == r_globals.na_lgl;
        const int elt = missing * (-i - 1) + !missing * x_elt * (i + 1);
        v_out[j] = elt;
        j += (bool) elt;
      }
    } else {
      for (r_ssize i = 0, j = 0; i < n && j < out_n; ++i) {
        const int x_elt = v_x[i];
        const bool missing = x_elt == r_globals.na_lgl;
        const int elt = missing * r_globals.na_int + !missing * x_elt * (i + 1);
        v_out[j] = elt;
        j += (bool) elt;
      }
    }
  } else {
    for (r_ssize i = 0, j = 0; i < n && j < out_n; ++i) {
      const int x_elt = v_x[i];
      v_out[j] = i + 1;
      j += (x_elt == 1);
    }
  }

  if (has_names) {
    r_obj* const* v_names = r_chr_cbegin(names);

    r_obj* out_names = r_alloc_character(out_n);
    r_attrib_poke_names(out, out_names);

    if (na_propagate) {
      // `v_out` contains negative locations which tells you the location of the
      // name to extract while also serving as a signal of where `NA`s should go
      // in the finalized output
      for (r_ssize i = 0; i < out_n; ++i) {
        const int loc = v_out[i];
        const int abs_loc = abs(loc);
        const bool same = (loc == abs_loc);
        v_out[i] = same * loc + !same * r_globals.na_int;
        r_chr_poke(out_names, i, v_names[abs_loc - 1]);
      }
    } else {
      // `v_out` doesn't contain `NA`, so we can use the locations directly
      for (r_ssize i = 0; i < out_n; ++i) {
        const int loc = v_out[i] - 1;
        r_chr_poke(out_names, i, v_names[loc]);
      }
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec-lgl.c:29

r_list_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [list, c_int, any_sexp] --> ()
argument: [any_sexp, c_false | c_int_na & 'I22519, any_sexp]
timing: 0.233 s
source
r_obj* r_list_resize(r_obj* x, r_ssize new_size) {
  RESIZE_BARRIER(R_TYPE_list, r_list_cbegin, r_list_poke);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:98

r_new_dict C signature

[c_int_na] --> *struct r_dict
untypeable application
error detail
function: [list] --> *any_sexp
argument: [any_sexp]
timing: 0.087 s
source
struct r_dict* r_new_dict(r_ssize size) {
  if (size <= 0) {
    r_abort("`size` of dictionary must be positive.");
  }
  size = size_round_power_2(size);

  r_obj* shelter = KEEP(r_alloc_list(2));

  r_obj* dict_raw = r_alloc_raw0(sizeof(struct r_dict));
  r_list_poke(shelter, 0, dict_raw);
  struct r_dict* p_dict = r_raw_begin(dict_raw);

  p_dict->shelter = shelter;

  p_dict->buckets = r_alloc_list(size);
  r_list_poke(shelter, 1, p_dict->buckets);

  p_dict->p_buckets = r_list_cbegin(p_dict->buckets);
  p_dict->n_buckets = size;

  r_attrib_poke(shelter, r_syms.class_, r_chr("rlang_dict"));

  FREE(1);
  return p_dict;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/dict.c:33

r_p_int_fill C signature

[*c_int_na, c_int_na, c_int_na] --> c_void
untypeable application
error detail
function: [any, any, any, any, c_int_na, any] --> ()
argument: ()
timing: 0.004 s
source
void r_p_int_fill(int* p_x, int value, R_len_t n) {
  FILL();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1111

r_p_lgl_fill C signature

[*c_int_na, c_int_na, c_int_na] --> c_void
untypeable application
error detail
function: [any, any, any, any, c_int_na, any] --> ()
argument: ()
timing: 0.004 s
source
void r_p_lgl_fill(int* p_x, int value, R_len_t n) {
  FILL();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1108

r_parse C signature

[c_string] --> any_sexp
untypeable application
error detail
function: [any_sexp, c_int, *c_int_na, any_sexp] --> expr
argument: [^CHR1('I28897), c(-1), *any, null]
timing: 0.039 s
source
r_obj* r_parse(const char* str) {
  r_obj* str_ = KEEP(r_chr(str));

  ParseStatus status;
  r_obj* out = KEEP(R_ParseVector(str_, -1, &status, r_null));
  if (status != PARSE_OK) {
    abort_parse(str_, "Parsing failed");
  }
  if (r_length(out) != 1) {
    abort_parse(str_, "Expected a single expression");
  }

  out = r_list_get(out, 0);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/parse.c:12

r_preserve C signature

tuple1 --> any
untypeable application
error detail
function: [any_sexp] --> c_void
argument: [*any]
timing: 0.004 s
(definition not located in src/)

r_preserve_global C signature

tuple1 --> any
untypeable application
error detail
function: [any_sexp] --> c_void
argument: [*any]
timing: 0.004 s
(definition not located in src/)

r_raw_resize C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [raw] --> *c_int
argument: [any_sexp]
timing: 0.340 s
source
r_obj* r_raw_resize(r_obj* x, r_ssize new_size) {
  RESIZE(R_TYPE_raw, unsigned char, r_raw_cbegin, r_raw_begin);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:92

r_result C signature

[any_sexp, any] --> any_sexp
unbound variable
error detail
name: r_attrib_poke_names
timing: 0.066 s
source
static inline SEXP r_result(SEXP x, ERR err) {
  if (!err) {
    err = R_NilValue;
  }

  SEXP result = PROTECT(Rf_allocVector(VECSXP, 2));
  SET_VECTOR_ELT(result, 0, x);
  SET_VECTOR_ELT(result, 1, err);

  r_attrib_poke_names(result, rlang_result_names);
  r_attrib_poke_class(result, rlang_result_class);

  UNPROTECT(1);
  return result;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:328

r_seq_chr C signature

[c_string, c_int_na] --> any_sexp
untypeable application
error detail
function: ([c_int, c_string, c_int_na, c_string] --> CHR | null) & ([c_true, c_string, c_int_na, c_string] --> CHR1 | null)
argument: [c_int_na & 'I80275, c_string | c_null, c_int, c_string & 'I80274]
timing: 0.031 s
source
r_obj* r_seq_chr(const char* prefix, r_ssize n) {
  int total_len = 24 + strlen(prefix) + 1;

  R_CheckStack2(total_len);
  char buf[total_len];

  return r_chr_iota(n, buf, total_len, prefix);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:723

r_type_as_c_string C signature

[c(0..10) | c(13..25) | c(30..31) | c(99)] --> c_string
untypeable application
error detail
function: ([p(CHR)] --> c_string) & ([p(^CHR('I14983))] --> c_string('I14983)) & ([na_string] --> c("NA"))
argument: [sym]
timing: 0.014 s
source
const char* r_type_as_c_string(enum r_type type) {
  return CHAR(Rf_type2str(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/obj.h:92

r_vec_cbegin C signature

[any_sexp] --> c_ptr
untypeable application
error detail
function: ([c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99), any_sexp] --> any) & ([c(14), DBL] --> *c_double) & ([c(15), CLX] --> *any) & ([c(16), CHR] --> *p(CHR)) & ([c(19), list] --> *any_sexp) & ([c(24), raw] --> c_ptr) & ([c(10), LGL] | [c(13), INT] --> *c_int_na)
argument: [c(0..10) | c(13..25) | c(30..31) | c(99), any_sexp & 'I16094]
timing: 3.03 s
source
const void* r_vec_cbegin(r_obj* x) {
  return r_vec_cbegin0(r_typeof(x), x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.h:98

raw_col_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: Rbyte
timing: 0.002 s
source
void raw_col_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_COL_DETECT_RUN_BOUNDS_BOOL(Rbyte, r_raw_cbegin, raw_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:331

raw_detect_run_bounds_bool C signature

[any_sexp, c_int_na, c_bool, *c_bool] --> c_void
unbound variable
error detail
name: Rbyte
timing: 0.002 s
source
void raw_detect_run_bounds_bool(r_obj* x, r_ssize size, enum vctrs_run_bound which, bool* v_out) {
  VEC_DETECT_RUN_BOUNDS_BOOL(Rbyte, r_raw_cbegin, raw_equal_na_equal);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:232

raw_equal C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: RAW_RO
timing: 1.37 s
source
SEXP raw_equal(SEXP x, SEXP y, R_len_t size, bool x_recycles, bool y_recycles, bool na_equal) {
  EQUAL(Rbyte, RAW_RO, raw_equal_na_equal, raw_equal_na_propagate);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:155

raw_hash C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [c_int_na] --> c_int
argument: [~c_string]
timing: 0.246 s
source
static inline uint32_t raw_hash(r_obj* x) {
  HASH(Rbyte, r_raw_cbegin, raw_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:89

raw_hash_fill_na_equal C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: Rbyte
timing: 0.003 s
source
static inline void raw_hash_fill_na_equal(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL(Rbyte, r_raw_cbegin, raw_hash_scalar);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:241

raw_hash_fill_na_propagate C signature

[any_sexp, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: Rbyte
timing: 0.003 s
source
static inline void raw_hash_fill_na_propagate(r_obj* x, r_ssize size, uint32_t* v_out) {
  HASH_FILL_NA_PROPAGATE(Rbyte, r_raw_cbegin, raw_hash_scalar, raw_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:263

reduce C signature

[any_sexp, *struct vctrs_arg, *struct vctrs_arg, any_sexp, [any_sexp, any_sexp, *struct counters, c_ptr] --> any_sexp, c_ptr] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.057 s
source
r_obj* reduce(
  r_obj* current,
  struct vctrs_arg* p_current_arg,
  struct vctrs_arg* p_parent_arg,
  r_obj* rest,
  r_obj* (*impl)(r_obj* current, r_obj* next, struct counters* counters, void* data),
  void* data
) {
  const r_ssize n = r_length(rest);
  r_obj* names = KEEP(r_names(rest));
  r_obj* const* v_rest = r_list_cbegin(rest);

  struct counters* counters = new_counters(
    names,
    p_current_arg,
    p_parent_arg
  );
  KEEP(counters->shelter);

  r_keep_loc current_pi;
  KEEP_HERE(current, &current_pi);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* next = v_rest[i];
    current = impl(current, next, counters, data);
    KEEP_AT(current, current_pi);
    counters_increment(counters);
  }

  FREE(3);
  return current;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/arg-counter.c:68

rownames_type C signature

[any_sexp] --> c(0..2)
untypeable application
error detail
function: ([arrow] --> c("closure")) & ([env] --> c("environment")) & ([lang] --> c("language")) & ([list] --> c("list")) & ([null] --> c("NULL")) & ([p(CHR)] --> c("character")) & ([p(CLX)] --> c("complex")) & ([p(DBL)] --> c("double")) & ([p(INT)] --> c("integer")) & ([p(LGL)] --> c("logical")) & ([p(raw)] --> c("raw")) & ([sym] --> c("symbol")) & ([expr] --> c("expression"))
argument: [c(0..10) | c(13..25) | c(30..31) | c(99)]
timing: 0.119 s
source
enum rownames_type rownames_type(r_obj* x) {
  switch (r_typeof(x)) {
  case R_TYPE_character:
    return ROWNAMES_TYPE_identifiers;
  case R_TYPE_integer:
    if (r_length(x) == 2 && r_int_begin(x)[0] == r_globals.na_int) {
      return ROWNAMES_TYPE_automatic_compact;
    } else {
      return ROWNAMES_TYPE_automatic;
    }
  default:
    r_stop_internal("Unexpected type `%s`.", Rf_type2char(r_typeof(x)));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:419

stop_incompatible_shape C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg] --> c_void
untypeable application
error detail
function: ([any_sexp, *any_sexp, *any_sexp] --> lang) & ([any_sexp, *any_sexp, c_null] --> empty)
argument: [sym, *(c_null | sym), *(<...> | c_null | null | p(CHR) | sym)]
timing: 2.91 s
source
void stop_incompatible_shape(SEXP x, SEXP y,
                             R_len_t x_size, R_len_t y_size, int axis,
                             struct vctrs_arg* p_x_arg, struct vctrs_arg* p_y_arg) {
  SEXP syms[8] = {
    r_sym("x"),
    r_sym("y"),
    r_sym("x_size"),
    r_sym("y_size"),
    r_sym("axis"),
    r_sym("x_arg"),
    r_sym("y_arg"),
    NULL
  };
  SEXP args[8] = {
    PROTECT(r_protect(x)),
    PROTECT(r_protect(y)),
    PROTECT(r_int(x_size)),
    PROTECT(r_int(y_size)),
    PROTECT(r_int(axis)),
    PROTECT(vctrs_arg(p_x_arg)),
    PROTECT(vctrs_arg(p_y_arg)),
    NULL
  };

  SEXP call = PROTECT(r_call_n(r_sym("stop_incompatible_shape"), syms, args));
  Rf_eval(call, vctrs_ns_env);

  never_reached("stop_incompatible_shape");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/conditions.c:139

stop_name_spec_in_fallback C signature

[any_sexp, struct r_lazy] --> c_void
unbound variable
error detail
name: r_class
timing: 0.014 s
source
void stop_name_spec_in_fallback(r_obj* xs, struct r_lazy error_call) {
  r_obj* common_class = KEEP(r_class(list_first_non_null(xs, NULL)));
  const char* class_str = r_chr_get_c_string(common_class, 0);

  r_abort_lazy_call(
    error_call,
    "Can't use a name specification with non-vctrs types.\n"
    "vctrs methods must be implemented for class `%s`.\n"
    "See <https://vctrs.r-lib.org/articles/s3-vector.html>.",
    class_str
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1296

stop_non_list_type C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> empty
unbound variable
error detail
name: r_eval_with_xyz
timing: 0.003 s
source
void stop_non_list_type(
  r_obj* x,
  struct vctrs_arg* arg,
  struct r_lazy call
) {
  r_eval_with_xyz(KEEP(r_parse("stop_non_list_type(x, y, z)")),
                  x,
                  KEEP(vctrs_arg(arg)),
                  KEEP(r_lazy_eval(call)),
                  vctrs_ns_env);
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:204

uint64_hash C signature

[c_int_na] --> c_int_na
untypeable application
error detail
function: ([c_int_na, c_int] --> c_int) & ([c_int_na, c_int_na] --> c_int_na)
argument: [any, c(33)]
timing: 0.011 s
source
static inline uint32_t uint64_hash(uint64_t x) {
  x ^= x >> 33;
  x *= UINT64_C(0xff51afd7ed558ccd);
  x ^= x >> 33;
  x *= UINT64_C(0xc4ceb9fe1a85ec53);
  x ^= x >> 33;
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.h:41

VCTRS_COUNT_LOOP C signature

tuple1 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

vctrs_dispatch_n C signature

[any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
untypeable application
error detail
function: ([null, any_sexp, *any_sexp, c_null, env] | [null, any_sexp, *sym, *any_sexp, env] | [sym, any_sexp, *any_sexp, c_null, env] | [sym, any_sexp, *sym, *any_sexp, env] --> any_sexp) & ([null, any_sexp, c_null, *any_sexp, env] | [sym, any_sexp, c_null, *any_sexp, env] --> empty)
argument: [any_sexp & 'I6200, any_sexp & 'I6201, *any_sexp & 'I6202, *any_sexp & 'I6203, any]
timing: 0.157 s
source
SEXP vctrs_dispatch_n(SEXP fn_sym, SEXP fn, SEXP* syms, SEXP* args) {
  SEXP mask = PROTECT(r_peek_frame());

  SEXP out = vctrs_eval_mask_n_impl(fn_sym, fn, syms, args, mask);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:154

VCTRS_GROUP_ID_LOOP C signature

tuple1 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

VCTRS_ID_LOOP C signature

tuple1 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

vctrs_init_globals C signature

[any_sexp] --> c_void
untypeable application
error detail
function: [c(0..9) | c(17..18) | c(20..23) | c(30..31) | c(25) | c(99), c_int_na] --> *struct r_dyn_array
argument: [c(19), c_int]
timing: 0.021 s
source
void vctrs_init_globals(r_obj* ns) {
  size_t n_strings = sizeof(struct lazy_calls) / sizeof(struct r_lazy);
  size_t n_lazy_calls = sizeof(struct strings) / sizeof(r_obj*);
  size_t n_globals = n_strings + n_lazy_calls;

  globals_shelter = r_new_dyn_vector(R_TYPE_list, n_globals);
  r_preserve(globals_shelter->shelter);

  // Symbols -----------------------------------------------------------
  syms.arg = r_sym("arg");
  syms.condition_arg = r_sym("condition_arg");
  syms.conditions_arg = r_sym("conditions_arg");
  syms.default_arg = r_sym("default_arg");
  syms.dot_arg = r_sym(".arg");
  syms.dot_call = r_sym(".call");
  syms.dot_error_arg = r_sym(".error_arg");
  syms.dot_error_call = r_sym(".error_call");
  syms.false_arg = r_sym("false_arg");
  syms.from_arg = r_sym("from_arg");
  syms.haystack_arg = r_sym("haystack_arg");
  syms.missing_arg = r_sym("missing_arg");
  syms.indices_arg = r_sym("indices_arg");
  syms.needles_arg = r_sym("needles_arg");
  syms.recurse = r_sym("recurse");
  syms.repair_arg = r_sym("repair_arg");
  syms.times_arg = r_sym("times_arg");
  syms.to_arg = r_sym("to_arg");
  syms.true_arg = r_sym("true_arg");
  syms.value_arg = r_sym("value_arg");
  syms.values_arg = r_sym("values_arg");
  syms.x_arg = r_sym("x_arg");
  syms.y_arg = r_sym("y_arg");

  // Strings and characters --------------------------------------------
  INIT_STRING(AsIs);
  INIT_STRING(repair);
  INIT_STRING(location);
  INIT_STRING(condition);

  // Args --------------------------------------------------------------
  INIT_ARG2(dot_name_repair, ".name_repair");
  INIT_ARG2(dot_ptype, ".ptype");
  INIT_ARG2(dot_size, ".size");
  INIT_ARG2(empty, "");
  INIT_ARG(i);
  INIT_ARG(max_fill);
  INIT_ARG(n);
  INIT_ARG(value);
  INIT_ARG(x);
  INIT_ARG(y);
  INIT_ARG(indices);
  INIT_ARG(sizes);
  INIT_ARG(ptype);
  INIT_ARG(size);

  // Lazy args ---------------------------------------------------------
  INIT_LAZY_ARG_2(dot_name_repair, ".name_repair");

  // Calls -------------------------------------------------------------
  INIT_CALL(vec_assign);
  INIT_CALL(vec_assign_seq);
  INIT_CALL(vec_init);
  INIT_CALL(vec_ptype_finalise);
  INIT_CALL(vec_recycle);
  INIT_CALL(vec_size);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/globals.c:42

vctrs_init_utils C signature

[any_sexp] --> c_void
untypeable application
error detail
function: ([null] --> c_false) & ([LGL | null] --> c_bool)
argument: [any_sexp]
timing: 0.040 s
source
void vctrs_init_utils(SEXP ns) {
  vctrs_ns_env = ns;

  vctrs_debug_verbose = r_is_true(Rf_GetOption1(Rf_install("vctrs:::debug")));

  vctrs_method_table = r_env_get(ns, Rf_install(".__S3MethodsTable__."));
  base_method_table = r_env_get(R_BaseNamespace, Rf_install(".__S3MethodsTable__."));

  s4_c_method_table = r_parse_eval("environment(methods::getGeneric('c'))$.MTable", R_GlobalEnv);
  R_PreserveObject(s4_c_method_table);

  vctrs_shared_empty_str = Rf_mkString("");
  R_PreserveObject(vctrs_shared_empty_str);


  // Holds the CHARSXP objects because unlike symbols they can be
  // garbage collected
  strings2 = r_new_shared_vector(STRSXP, 25);

  strings_dots = Rf_mkChar("...");
  SET_STRING_ELT(strings2, 0, strings_dots);

  strings_empty = Rf_mkChar("");
  SET_STRING_ELT(strings2, 1, strings_empty);

  strings_date = Rf_mkChar("Date");
  SET_STRING_ELT(strings2, 2, strings_date);

  strings_posixct = Rf_mkChar("POSIXct");
  SET_STRING_ELT(strings2, 3, strings_posixct);

  strings_posixlt = Rf_mkChar("POSIXlt");
  SET_STRING_ELT(strings2, 4, strings_posixlt);

  strings_posixt = Rf_mkChar("POSIXt");
  SET_STRING_ELT(strings2, 5, strings_posixt);

  strings_none = Rf_mkChar("none");
  SET_STRING_ELT(strings2, 6, strings_none);

  strings_minimal = Rf_mkChar("minimal");
  SET_STRING_ELT(strings2, 7, strings_minimal);

  strings_unique = Rf_mkChar("unique");
  SET_STRING_ELT(strings2, 8, strings_unique);

  strings_universal = Rf_mkChar("universal");
  SET_STRING_ELT(strings2, 9, strings_universal);

  strings_check_unique = Rf_mkChar("check_unique");
  SET_STRING_ELT(strings2, 10, strings_check_unique);

  strings_unique_quiet = Rf_mkChar("unique_quiet");
  SET_STRING_ELT(strings2, 23, strings_unique_quiet);

  strings_universal_quiet = Rf_mkChar("universal_quiet");
  SET_STRING_ELT(strings2, 24, strings_universal_quiet);

  strings_key = Rf_mkChar("key");
  SET_STRING_ELT(strings2, 11, strings_key);

  strings_loc = Rf_mkChar("loc");
  SET_STRING_ELT(strings2, 12, strings_loc);

  strings_val = Rf_mkChar("val");
  SET_STRING_ELT(strings2, 13, strings_val);

  strings_group = Rf_mkChar("group");
  SET_STRING_ELT(strings2, 14, strings_group);

  strings_length = Rf_mkChar("length");
  SET_STRING_ELT(strings2, 15, strings_length);

  strings_factor = Rf_mkChar("factor");
  SET_STRING_ELT(strings2, 16, strings_factor);

  strings_ordered = Rf_mkChar("ordered");
  SET_STRING_ELT(strings2, 17, strings_ordered);

  strings_list = Rf_mkChar("list");
  SET_STRING_ELT(strings2, 18, strings_list);

  strings_vctrs_vctr = Rf_mkChar("vctrs_vctr");
  SET_STRING_ELT(strings2, 19, strings_vctrs_vctr);

  strings_times = Rf_mkChar("times");
  SET_STRING_ELT(strings2, 20, strings_times);

  strings_needles = Rf_mkChar("needles");
  SET_STRING_ELT(strings2, 21, strings_needles);

  strings_haystack = Rf_mkChar("haystack");
  SET_STRING_ELT(strings2, 22, strings_haystack);


  classes_data_frame = r_new_shared_vector(STRSXP, 1);
  strings_data_frame = Rf_mkChar("data.frame");
  SET_STRING_ELT(classes_data_frame, 0, strings_data_frame);

  classes_factor = r_new_shared_vector(STRSXP, 1);
  SET_STRING_ELT(classes_factor, 0, strings_factor);

  classes_ordered = r_new_shared_vector(STRSXP, 2);
  SET_STRING_ELT(classes_ordered, 0, strings_ordered);
  SET_STRING_ELT(classes_ordered, 1, strings_factor);

  classes_date = r_new_shared_vector(STRSXP, 1);
  SET_STRING_ELT(classes_date, 0, strings_date);

  classes_posixct = r_new_shared_vector(STRSXP, 2);
  SET_STRING_ELT(classes_posixct, 0, strings_posixct);
  SET_STRING_ELT(classes_posixct, 1, strings_posixt);

  chrs_subset = r_new_shared_character("subset");
  chrs_extract = r_new_shared_character("extract");
  chrs_assign = r_new_shared_character("assign");
  chrs_rename = r_new_shared_character("rename");
  chrs_remove = r_new_shared_character("remove");
  chrs_negate = r_new_shared_character("negate");
  chrs_null = r_new_shared_character("NULL");
  chrs_logical = r_new_shared_character("logical");
  chrs_integer = r_new_shared_character("integer");
  chrs_double = r_new_shared_character("double");
  chrs_complex = r_new_shared_character("complex");
  chrs_character = r_new_shared_character("character");
  chrs_raw = r_new_shared_character("raw");
  chrs_list = r_new_shared_character("list");
  chrs_expression = r_new_shared_character("expression");
  chrs_numeric = r_new_shared_character("numeric");
  chrs_function = r_new_shared_character("function");
  chrs_empty = r_new_shared_character("");
  chrs_cast = r_new_shared_character("cast");
  chrs_error = r_new_shared_character("error");
  chrs_combine = r_new_shared_character("combine");
  chrs_convert = r_new_shared_character("convert");
  chrs_asc = r_new_shared_character("asc");
  chrs_desc = r_new_shared_character("desc");
  chrs_largest = r_new_shared_character("largest");
  chrs_smallest = r_new_shared_character("smallest");
  chrs_which = r_new_shared_character("which");

  classes_tibble = r_new_shared_vector(STRSXP, 3);

  strings_tbl_df = Rf_mkChar("tbl_df");
  SET_STRING_ELT(classes_tibble, 0, strings_tbl_df);

  strings_tbl = Rf_mkChar("tbl");
  SET_STRING_ELT(classes_tibble, 1, strings_tbl);
  SET_STRING_ELT(classes_tibble, 2, strings_data_frame);


  classes_vctrs_group_rle = r_new_shared_vector(STRSXP, 3);
  SET_STRING_ELT(classes_vctrs_group_rle, 0, Rf_mkChar("vctrs_group_rle"));
  SET_STRING_ELT(classes_vctrs_group_rle, 1, Rf_mkChar("vctrs_rcrd"));
  SET_STRING_ELT(classes_vctrs_group_rle, 2, Rf_mkChar("vctrs_vctr"));


  vctrs_shared_empty_date = r_new_shared_vector(REALSXP, 0);
  Rf_setAttrib(vctrs_shared_empty_date, R_ClassSymbol, classes_date);

  vctrs_shared_na_cpl.i = NA_REAL;
  vctrs_shared_na_cpl.r = NA_REAL;

  vctrs_shared_missing_lgl = r_new_shared_vector(LGLSXP, 1);
  LOGICAL(vctrs_shared_missing_lgl)[0] = NA_LOGICAL;

  vctrs_shared_missing_int = r_new_shared_vector(INTSXP, 1);
  INTEGER(vctrs_shared_missing_int)[0] = NA_INTEGER;

  vctrs_shared_missing_dbl = r_new_shared_vector(REALSXP, 1);
  REAL(vctrs_shared_missing_dbl)[0] = NA_REAL;

  vctrs_shared_missing_cpl = r_new_shared_vector(CPLXSXP, 1);
  COMPLEX(vctrs_shared_missing_cpl)[0] = vctrs_shared_na_cpl;

  // No actual `NA` value for raw, but we always use `0`
  vctrs_shared_missing_raw = r_new_shared_vector(RAWSXP, 1);
  RAW(vctrs_shared_missing_raw)[0] = 0;

  vctrs_shared_missing_chr = r_new_shared_vector(STRSXP, 1);
  SET_STRING_ELT(vctrs_shared_missing_chr, 0, NA_STRING);

  vctrs_shared_missing_list = r_new_shared_vector(VECSXP, 1);
  SET_VECTOR_ELT(vctrs_shared_missing_list, 0, R_NilValue);

  vctrs_shared_zero_int = r_new_shared_vector(INTSXP, 1);
  INTEGER(vctrs_shared_zero_int)[0] = 0;

  syms_i = Rf_install("i");
  syms_j = Rf_install("j");
  syms_n = Rf_install("n");
  syms_x = Rf_install("x");
  syms_y = Rf_install("y");
  syms_x_size = Rf_install("x_size");
  syms_y_size = Rf_install("y_size");
  syms_to = Rf_install("to");
  syms_dots = Rf_install("...");
  syms_bracket = Rf_install("[");
  syms_x_arg = Rf_install("x_arg");
  syms_y_arg = Rf_install("y_arg");
  syms_to_arg = Rf_install("to_arg");
  syms_times_arg = Rf_install("times_arg");
  syms_subscript_arg = Rf_install("subscript_arg");
  syms_needles_arg = Rf_install("needles_arg");
  syms_haystack_arg = Rf_install("haystack_arg");
  syms_out = Rf_install("out");
  syms_value = Rf_install("value");
  syms_quiet = Rf_install("quiet");
  syms_dot_name_spec = Rf_install(".name_spec");
  syms_outer = Rf_install("outer");
  syms_inner = Rf_install("inner");
  syms_tilde = Rf_install("~");
  syms_dot_environment = Rf_install(".Environment");
  syms_ptype = Rf_install("ptype");
  syms_missing = R_MissingArg;
  syms_size = Rf_install("size");
  syms_subscript_action = Rf_install("subscript_action");
  syms_subscript_type = Rf_install("subscript_type");
  syms_repair = Rf_install("repair");
  syms_tzone = Rf_install("tzone");
  syms_data = Rf_install("data");
  syms_try_catch_impl = Rf_install("try_catch_impl");
  syms_try_catch_hnd = Rf_install("try_catch_hnd");
  syms_vctrs_error_incompatible_type = Rf_install("vctrs_error_incompatible_type");
  syms_vctrs_error_cast_lossy = Rf_install("vctrs_error_cast_lossy");
  syms_cnd_signal = Rf_install("cnd_signal");
  syms_logical = Rf_install("logical");
  syms_numeric = Rf_install("numeric");
  syms_character = Rf_install("character");
  syms_body = Rf_install("body");
  syms_parent = Rf_install("parent");
  syms_s3_methods_table = Rf_install(".__S3MethodsTable__.");
  syms_from_dispatch = Rf_install("vctrs:::from_dispatch");
  syms_s3_fallback = Rf_install("vctrs:::s3_fallback");
  syms_stop_incompatible_type = Rf_install("stop_incompatible_type");
  syms_stop_incompatible_size = Rf_install("stop_incompatible_size");
  syms_stop_assert_size = Rf_install("stop_assert_size");
  syms_stop_matches_overflow = Rf_install("stop_matches_overflow");
  syms_stop_matches_nothing = Rf_install("stop_matches_nothing");
  syms_stop_matches_remaining = Rf_install("stop_matches_remaining");
  syms_stop_matches_incomplete = Rf_install("stop_matches_incomplete");
  syms_stop_matches_multiple = Rf_install("stop_matches_multiple");
  syms_warn_matches_multiple = Rf_install("warn_matches_multiple");
  syms_stop_matches_relationship_one_to_one = Rf_install("stop_matches_relationship_one_to_one");
  syms_stop_matches_relationship_one_to_many = Rf_install("stop_matches_relationship_one_to_many");
  syms_stop_matches_relationship_many_to_one = Rf_install("stop_matches_relationship_many_to_one");
  syms_warn_matches_relationship_many_to_many = Rf_install("warn_matches_relationship_many_to_many");
  syms_stop_combine_unmatched = Rf_install("stop_combine_unmatched");
  syms_action = Rf_install("action");
  syms_vctrs_common_class_fallback = Rf_install(c_strs_vctrs_common_class_fallback);
  syms_fallback_class = Rf_install("fallback_class");
  syms_abort = Rf_install("abort");
  syms_message = Rf_install("message");
  syms_chr_proxy_collate = Rf_install("chr_proxy_collate");
  syms_actual = Rf_install("actual");
  syms_required = Rf_install("required");
  syms_call = Rf_install("call");
  syms_dot_call = Rf_install(".call");
  syms_which = Rf_install("which");
  syms_slice_value = Rf_install("slice_value");
  syms_index_style = Rf_install("index_style");
  syms_loc = Rf_install("loc");

  fns_bracket = r_env_get(R_BaseEnv, syms_bracket);
  fns_quote = r_env_get(R_BaseEnv, Rf_install("quote"));
  fns_names = r_env_get(R_BaseEnv, Rf_install("names"));

  new_env_call = r_parse_eval("as.call(list(new.env, TRUE, NULL, NULL))", R_BaseEnv);
  R_PreserveObject(new_env_call);

  new_env__parent_node = CDDR(new_env_call);
  new_env__size_node = CDR(new_env__parent_node);

  rlang_sym_as_character = (SEXP (*)(SEXP)) R_GetCCallable("rlang", "rlang_sym_as_character");

  syms_as_data_frame2 = Rf_install("as.data.frame2");
  syms_colnames = Rf_install("colnames");

  fns_as_data_frame2 = r_env_get(ns, syms_as_data_frame2);
  fns_colnames = r_env_get(R_BaseEnv, syms_colnames);

  compact_seq_class_string = "vctrs_compact_seq";
  compact_seq_classes = Rf_allocVector(STRSXP, 1);
  R_PreserveObject(compact_seq_classes);
  SET_STRING_ELT(compact_seq_classes, 0, Rf_mkChar(compact_seq_class_string));

  compact_rep_class_string = "vctrs_compact_rep";
  compact_rep_classes = Rf_allocVector(STRSXP, 1);
  R_PreserveObject(compact_rep_classes);
  SET_STRING_ELT(compact_rep_classes, 0, Rf_mkChar(compact_rep_class_string));

  compact_condition_class_string = "vctrs_compact_condition";
  compact_condition_classes = Rf_allocVector(STRSXP, 1);
  R_PreserveObject(compact_condition_classes);
  SET_STRING_ELT(compact_condition_classes, 0, Rf_mkChar(compact_condition_class_string));

  rlang_result_names = Rf_allocVector(STRSXP, 2);
  R_PreserveObject(rlang_result_names);
  SET_STRING_ELT(rlang_result_names, 0, Rf_mkChar("ok"));
  SET_STRING_ELT(rlang_result_names, 1, Rf_mkChar("err"));

  rlang_result_class = Rf_allocVector(STRSXP, 1);
  R_PreserveObject(rlang_result_class);
  SET_STRING_ELT(rlang_result_class, 0, Rf_mkChar("rlang_result"));

  // We assume the following in `union vctrs_dbl_indicator`
  VCTRS_ASSERT(sizeof(double) == sizeof(int64_t));
  VCTRS_ASSERT(sizeof(double) == 2 * sizeof(int));

  // We assume the following in `vec_order()`
  VCTRS_ASSERT(sizeof(int) == sizeof(int32_t));
  VCTRS_ASSERT(sizeof(double) == sizeof(int64_t));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1734

VCTRS_N_DISTINCT_LOOP C signature

tuple1 --> any
unbound variable
error detail
name: n
timing: 0.003 s
(definition not located in src/)

VCTRS_UNIQUE_LOC_LOOP C signature

tuple1 --> any
unbound variable
error detail
name: n
timing: 0.005 s
(definition not located in src/)

vec_as_chop_sizes C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [INT] --> *c_int_na
argument: [any_sexp]
timing: 0.042 s
source
r_obj* vec_as_chop_sizes(r_obj* sizes, r_ssize size) {
  sizes = KEEP(vec_cast(
    sizes,
    r_globals.empty_int,
    vec_args.sizes,
    vec_args.empty,
    r_lazy_null
  ));

  const r_ssize n_sizes = r_length(sizes);
  const int* v_sizes = r_int_cbegin(sizes);

  r_ssize total = 0;

  for (r_ssize i = 0; i < n_sizes; ++i) {
    const int elt = v_sizes[i];

    if (elt == r_globals.na_int) {
      r_abort_lazy_call(r_lazy_null, "`sizes` can't contain missing values.");
    } else if (elt < 0) {
      r_abort_lazy_call(r_lazy_null, "`sizes` can't contain negative sizes.");
    } else if (elt > size) {
      r_abort_lazy_call(r_lazy_null, "`sizes` can't contain sizes larger than %i.", size);
    }

    total += elt;
  }

  if (total != size) {
    r_abort_lazy_call(r_lazy_null, "`sizes` must sum to size %i, not size %i.", size, total);
  }

  FREE(1);
  return sizes;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:552

vec_as_ssize C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> c_int_na
untypeable application
error detail
function: ([INT, c_int_na] --> c_int_na) & ([^INT1, c_int_na] --> c_int)
argument: [(DBL & <>) & 'I63436, c_false]
timing: 1.23 s
source
r_ssize vec_as_ssize(r_obj* n,
                     struct vctrs_arg* p_arg,
                     struct r_lazy call) {
  if (r_is_object(n)) {
    struct cast_opts cast_opts = {
      .x = n,
      .to = r_globals.empty_dbl,
      .p_x_arg = p_arg,
      .call = call
    };
    ERR err = NULL;
    n = vec_cast_e(&cast_opts, &err);

    if (err) {
      goto invalid;
    }
  }
  KEEP(n);

  switch (r_typeof(n)) {

  case R_TYPE_double: {
    if (r_length(n) != 1) {
      goto invalid;
    }
    double out = r_dbl_get(n, 0);

    if (out == r_globals.na_int) {
      goto invalid;
    }
    if (out != floor(out)) {
      r_abort_lazy_call(call,
                        "%s must be a whole number, not a fractional number.",
                        vec_arg_format(p_arg));
    }

    if (out > R_SSIZE_MAX) {
      r_abort_lazy_call(call,
                        "%s is too large a number.",
                        vec_arg_format(p_arg));
    }

    FREE(1);
    return (r_ssize) out;
  }

  case R_TYPE_integer: {
    if (r_length(n) != 1) {
      goto invalid;
    }
    int out = r_int_get(n, 0);

    if (out == r_globals.na_int) {
      goto invalid;
    }

    FREE(1);
    return (r_ssize) out;
  }

  invalid:
  default:
    r_abort_lazy_call(call,
                      "%s must be a single number, not %s.",
                      vec_arg_format(p_arg),
                      r_obj_type_friendly_length(n));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:267

vec_as_subscript_opts C signature

[any_sexp, *struct subscript_opts, *any] --> any_sexp
untypeable application
error detail
function: [any_sexp, *c_int_na] --> c_void
argument: [any_sexp & 'I49469, *any]
timing: 0.179 s
source
r_obj* vec_as_subscript_opts(r_obj* subscript,
                             const struct subscript_opts* opts,
                             ERR* err) {
  if (vec_dim_n(subscript) != 1) {
    *err = new_error_subscript_type(subscript, opts, fns_cnd_body_subscript_dim);
    return r_null;
  }

  r_keep_loc subscript_pi;
  KEEP_HERE(subscript, &subscript_pi);

  r_obj* orig_names = KEEP(r_names(subscript));

  switch (r_typeof(subscript)) {
  case R_TYPE_null:
    if (opts->numeric == SUBSCRIPT_TYPE_ACTION_CAST) {
      subscript = r_globals.empty_int;
    }
    break;
  case R_TYPE_symbol:
    if (opts->character == SUBSCRIPT_TYPE_ACTION_CAST) {
      subscript = rlang_sym_as_character(subscript);
    }
    break;
  default:
    break;
  }
  KEEP_AT(subscript, subscript_pi);

  if (!obj_is_vector(subscript, VCTRS_ALLOW_NULL_no)) {
    *err = new_error_subscript_type(subscript, opts, r_null);
    FREE(2);
    return r_null;
  }

  if (r_is_object(subscript)) {
    subscript = obj_cast_subscript(subscript, opts, err);
  } else if (r_typeof(subscript) == R_TYPE_double) {
    subscript = dbl_cast_subscript(subscript, opts, err);
  }
  KEEP_AT(subscript, subscript_pi);

  if (*err) {
    FREE(2);
    return r_null;
  }

  // Coerce unspecified vectors to integer only if logical indices are
  // not allowed
  if (opts->logical == SUBSCRIPT_TYPE_ACTION_ERROR && vec_is_unspecified(subscript)) {
    struct vctrs_arg* arg = opts->subscript_arg;
    if (opts->numeric == SUBSCRIPT_TYPE_ACTION_CAST) {
      subscript = vec_cast(subscript,
                           r_globals.empty_int,
                           arg,
                           NULL,
                           r_lazy_null);
    } else {
      subscript = vec_cast(subscript,
                           r_globals.empty_chr,
                           arg,
                           NULL,
                           r_lazy_null);
    }
  }
  KEEP_AT(subscript, subscript_pi);

  enum subscript_type_action action = SUBSCRIPT_TYPE_ACTION_ERROR;
  switch (r_typeof(subscript)) {
  case R_TYPE_logical: action = opts->logical; break;
  case R_TYPE_integer: action = opts->numeric; break;
  case R_TYPE_character: action = opts->character; break;
  default: break;
  }

  if (action == SUBSCRIPT_TYPE_ACTION_ERROR) {
    *err = new_error_subscript_type(subscript, opts, r_null);
    FREE(2);
    return r_null;
  }

  if (orig_names != r_null) {
    // FIXME: Handle names in cast methods
    subscript = r_clone_referenced(subscript);
    KEEP_AT(subscript, subscript_pi);
    r_attrib_poke_names(subscript, orig_names);
  }

  FREE(2);
  return subscript;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:5

vec_as_universal_names C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: vctrs_dispatch2
timing: 0.041 s
source
r_obj* vec_as_universal_names(r_obj* names, bool quiet) {
  r_obj* quiet_obj = KEEP(r_lgl(quiet));
  r_obj* out = vctrs_dispatch2(syms_as_universal_names, fns_as_universal_names,
                               syms_names, names,
                               syms_quiet, quiet_obj);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:93

vec_assign_fallback C signature

[any_sexp, any_sexp, any_sexp, c_bool, c_bool] --> any_sexp
unbound variable
error detail
name: vctrs_dispatch5
timing: 0.142 s
source
r_obj* vec_assign_fallback(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  r_obj* ffi_slice_value;
  switch (slice_value) {
  case ASSIGNMENT_SLICE_VALUE_no: ffi_slice_value = r_false; break;
  case ASSIGNMENT_SLICE_VALUE_yes: ffi_slice_value = r_true; break;
  default: r_stop_unreachable();
  }

  r_obj* ffi_index_style;
  switch (index_style) {
  case VCTRS_INDEX_STYLE_location: ffi_index_style = chrs.location; break;
  case VCTRS_INDEX_STYLE_condition: ffi_index_style = chrs.condition; break;
  default: r_stop_unreachable();
  }

  return vctrs_dispatch5(syms_vec_assign_fallback, fns_vec_assign_fallback,
                         syms_x, x,
                         syms_i, index,
                         syms_slice_value, ffi_slice_value,
                         syms_index_style, ffi_index_style,
                         syms_value, value);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:834

vec_bare_dim_n C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: vec_bare_dim
timing: 0.008 s
source
static inline R_len_t vec_bare_dim_n(SEXP x) {
  return Rf_length(vec_bare_dim(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.h:12

vec_cast_default_full C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, c_int_na] --> any_sexp
unbound variable
error detail
name: vctrs_eval_mask7
timing: 0.218 s
source
r_obj* vec_cast_default_full(r_obj* x,
                             r_obj* to,
                             struct vctrs_arg* p_x_arg,
                             struct vctrs_arg* p_to_arg,
                             struct r_lazy call,
                             enum s3_fallback s3_fallback,
                             bool from_dispatch) {
  r_obj* ffi_s3_fallback = KEEP(r_int(s3_fallback));

  r_obj* ffi_x_arg = KEEP(vctrs_arg(p_x_arg));
  r_obj* ffi_to_arg = KEEP(vctrs_arg(p_to_arg));

  r_obj* ffi_call = KEEP(r_lazy_eval(call));
  r_obj* out = vctrs_eval_mask7(syms.vec_default_cast,
                                syms_x, x,
                                syms_to, to,
                                syms_x_arg, ffi_x_arg,
                                syms_to_arg, ffi_to_arg,
                                syms_call, ffi_call,
                                syms_from_dispatch, r_lgl(from_dispatch),
                                syms_s3_fallback, ffi_s3_fallback);
  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:148

vec_cast_dispatch_s3 C signature

[*struct cast_opts] --> any_sexp
untypeable application
error detail
function: [sym] --> c_string
argument: [any_sexp]
timing: 3.08 s
source
r_obj* vec_cast_dispatch_s3(const struct cast_opts* opts) {
  r_obj* x = opts->x;
  r_obj* to = opts->to;
  r_obj* method_sym = r_null;
  r_obj* method = s3_find_method_xy("vec_cast", to, x, vctrs_method_table, &method_sym);

  // Compatibility with legacy double dispatch mechanism
  if (method == r_null) {
    r_obj* to_method_sym = r_null;
    r_obj* to_method = KEEP(s3_find_method2("vec_cast",
                                             to,
                                             vctrs_method_table,
                                             &to_method_sym));

    if (to_method != r_null) {
      // Only `to_method`s contained within a package will
      // have an S3 methods table to look in
      r_obj* to_table = s3_get_table(r_fn_env(to_method));

      if (to_table != r_null) {
        const char* to_method_str = r_sym_c_string(to_method_sym);

        method = s3_find_method2(
          to_method_str,
          x,
          to_table,
          &method_sym
        );
      }
    }

    FREE(1);
  }

  KEEP(method);

  if (method == r_null) {
    r_obj* out = vec_cast_default_full(x,
                                       to,
                                       opts->p_x_arg,
                                       opts->p_to_arg,
                                       opts->call,
                                       opts->s3_fallback,
                                       true);
    FREE(1);
    return out;
  }

  r_obj* r_x_arg = KEEP(vctrs_arg(opts->p_x_arg));
  r_obj* r_to_arg = KEEP(vctrs_arg(opts->p_to_arg));

  r_obj* out = vec_invoke_coerce_method(method_sym, method,
                                        syms_x, x,
                                        syms_to, to,
                                        syms_x_arg, r_x_arg,
                                        syms_to_arg, r_to_arg,
                                        opts->call,
                                        opts->s3_fallback);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/cast.c:183

vec_chop_base C signature

[any_sexp, struct vctrs_proxy_info, *struct vctrs_chop_indices] --> any_sexp
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I65180, c_false, *struct vctrs_arg, struct r_lazy]
timing: 1.06 s
source
r_obj* vec_chop_base(r_obj* x,
                     struct vctrs_proxy_info info,
                     struct vctrs_chop_indices* p_indices) {
  if (vec_requires_fallback(x, info)) {
    // Fallback to `[` if the class doesn't implement a proxy. This is
    // to be maximally compatible with existing classes.
    if (info.type == VCTRS_TYPE_scalar) {
      r_abort_lazy_call(r_lazy_null, "Can't slice a scalar");
    }

    if (has_dim(x)) {
      return chop_fallback_shaped(x, p_indices);
    } else {
      return chop_fallback(x, p_indices);
    }
  }

  switch (info.type) {
  case VCTRS_TYPE_logical:
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_double:
  case VCTRS_TYPE_complex:
  case VCTRS_TYPE_character:
  case VCTRS_TYPE_raw:
  case VCTRS_TYPE_list: {
    if (has_dim(x)) {
      return chop_shaped(x, info, p_indices);
    } else {
      return chop(x, info, p_indices);
    }
  }
  case VCTRS_TYPE_dataframe: {
    return chop_df(x, info, p_indices);
  }
  default:
    obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.empty, r_lazy_null);
    stop_unimplemented_vctrs_type("vec_chop_base", info.type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-chop.c:211

VEC_COL_DETECT_RUN_BOUNDS_BOOL C signature

tuple3 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.002 s
(definition not located in src/)

vec_compare C signature

[any_sexp, any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: obj_encode_utf8
timing: 0.225 s
source
r_obj* vec_compare(r_obj* x, r_obj* y, bool na_equal) {
  r_ssize size = vec_size(x);

  enum vctrs_type type = vec_proxy_typeof(x);
  if (type != vec_proxy_typeof(y) || size != vec_size(y)) {
    stop_not_comparable(x, y, "must have the same types and lengths");
  }

  x = KEEP(obj_encode_utf8(x));
  y = KEEP(obj_encode_utf8(y));

  if (type == VCTRS_TYPE_dataframe) {
    r_obj* out = df_compare(x, y, na_equal, size);
    FREE(2);
    return out;
  }

  if (na_equal) {
    switch (type) {
    case VCTRS_TYPE_logical:   COMPARE(int, r_lgl_cbegin, lgl_compare_na_equal);
    case VCTRS_TYPE_integer:   COMPARE(int, r_int_cbegin, int_compare_na_equal);
    case VCTRS_TYPE_double:    COMPARE(double, r_dbl_cbegin, dbl_compare_na_equal);
    case VCTRS_TYPE_character: COMPARE(r_obj*, r_chr_cbegin, chr_compare_na_equal);
    case VCTRS_TYPE_complex:   r_abort("Can't compare complexes.");
    case VCTRS_TYPE_scalar:    r_abort("Can't compare scalars.");
    case VCTRS_TYPE_list:      r_abort("Can't compare lists.");
    default:                   stop_unimplemented_vctrs_type("vec_compare", type);
    }
  } else {
    switch (type) {
    case VCTRS_TYPE_logical:   COMPARE(int, r_lgl_cbegin, lgl_compare_na_propagate);
    case VCTRS_TYPE_integer:   COMPARE(int, r_int_cbegin, int_compare_na_propagate);
    case VCTRS_TYPE_double:    COMPARE(double, r_dbl_cbegin, dbl_compare_na_propagate);
    case VCTRS_TYPE_character: COMPARE(r_obj*, r_chr_cbegin, chr_compare_na_propagate);
    case VCTRS_TYPE_complex:   r_abort("Can't compare complexes.");
    case VCTRS_TYPE_scalar:    r_abort("Can't compare scalars.");
    case VCTRS_TYPE_list:      r_abort("Can't compare lists.");
    default:                   stop_unimplemented_vctrs_type("vec_compare", type);
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:30

vec_compare_col C signature

[*c_int_na, *struct df_short_circuit_info, any_sexp, any_sexp, c_int_na] --> c_void
unbound variable
error detail
name: int
timing: 0.064 s
source
void vec_compare_col(int* v_out,
                     struct df_short_circuit_info* p_info,
                     r_obj* x,
                     r_obj* y,
                     bool na_equal) {
  enum vctrs_type type = vec_proxy_typeof(x);

  if (type == VCTRS_TYPE_dataframe) {
    df_compare_impl(v_out, p_info, x, y, na_equal);
    return;
  }

  if (na_equal) {
    switch (type) {
    case VCTRS_TYPE_logical:   COMPARE_COL(int, r_lgl_cbegin, lgl_compare_na_equal); break;
    case VCTRS_TYPE_integer:   COMPARE_COL(int, r_int_cbegin, int_compare_na_equal); break;
    case VCTRS_TYPE_double:    COMPARE_COL(double, r_dbl_cbegin, dbl_compare_na_equal); break;
    case VCTRS_TYPE_character: COMPARE_COL(r_obj*, r_chr_cbegin, chr_compare_na_equal); break;
    case VCTRS_TYPE_complex:   r_abort("Can't compare complexes.");
    case VCTRS_TYPE_scalar:    r_abort("Can't compare scalars.");
    case VCTRS_TYPE_list:      r_abort("Can't compare lists.");
    default:                   stop_unimplemented_vctrs_type("vec_compare_col", type);
    }
  } else {
    switch (type) {
    case VCTRS_TYPE_logical:   COMPARE_COL(int, r_lgl_cbegin, lgl_compare_na_propagate); break;
    case VCTRS_TYPE_integer:   COMPARE_COL(int, r_int_cbegin, int_compare_na_propagate); break;
    case VCTRS_TYPE_double:    COMPARE_COL(double, r_dbl_cbegin, dbl_compare_na_propagate); break;
    case VCTRS_TYPE_character: COMPARE_COL(r_obj*, r_chr_cbegin, chr_compare_na_propagate); break;
    case VCTRS_TYPE_complex:   r_abort("Can't compare complexes.");
    case VCTRS_TYPE_scalar:    r_abort("Can't compare scalars.");
    case VCTRS_TYPE_list:      r_abort("Can't compare lists.");
    default:                   stop_unimplemented_vctrs_type("vec_compare_col", type);
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/compare.c:155

vec_condition_subscript_sum C signature

[any_sexp, c_int_na] --> c_int_na
untypeable application
error detail
function: [LGL, c_false] | [LGL, c_int_na \ c_false] --> c_int
argument: [raw & 'I21736, c_int_na & 'I21737]
timing: 0.022 s
source
r_ssize vec_condition_subscript_sum(r_obj* x, bool na_true) {
  if (is_compact_condition(x)) {
    return compact_condition_sum(x);
  } else {
    return r_lgl_sum(x, na_true);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:998

vec_date_restore C signature

[any_sexp, any_sexp, c(0..2)] --> any_sexp
unbound variable
error detail
name: date_validate
timing: 0.014 s
source
SEXP vec_date_restore(SEXP x, SEXP to, const enum vctrs_ownership ownership) {
  SEXP out = PROTECT(vec_restore_default(x, to, ownership));
  out = date_validate(out);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:240

vec_decreasing_expansion C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: vec_proxy_order
timing: 0.079 s
source
int vec_decreasing_expansion(SEXP x) {
  // Bare vectors
  if (!r_is_object(x) && !has_dim(x)) {
    return 1;
  }

  // Compute number of cols in df-cols,
  // and do proxy-compare on the cols as needed
  if (is_data_frame(x)) {
    return df_decreasing_expansion(x);
  }

  int expansion;

  // Otherwise we have an S3 column that could have a data frame
  // ordering proxy containing multiple columns, so we need to check for that
  SEXP proxy = PROTECT(vec_proxy_order(x));

  // If the `proxy` is a data frame, the expansion factor is the
  // number of columns. Otherwise it is 1.
  if (is_data_frame(proxy)) {
    expansion = Rf_length(proxy);
  } else {
    expansion = 1;
  }

  UNPROTECT(1);
  return expansion;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3703

VEC_DETECT_COMPLETE C signature

tuple3 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

vec_detect_run_bounds C signature

[any_sexp, c_bool, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.109 s
source
r_obj* vec_detect_run_bounds(r_obj* x, enum vctrs_run_bound which, struct r_lazy error_call) {
  struct r_vector_bool* p_where = vec_detect_run_bounds_bool(x, which, error_call);
  KEEP(p_where->shelter);
  const bool* v_where = r_vector_bool_cbegin(p_where);

  const r_ssize size = r_vector_bool_length(p_where);

  r_obj* out = KEEP(r_alloc_logical(size));
  int* v_out = r_lgl_begin(out);

  for (r_ssize i = 0; i < size; ++i) {
    v_out[i] = v_where[i];
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:20

vec_detect_run_bounds_bool C signature

[any_sexp, c_bool, struct r_lazy] --> *struct r_vector_bool
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I81105, c_false, *struct vctrs_arg, struct r_lazy & 'I81107]
timing: 0.038 s
source
struct r_vector_bool* vec_detect_run_bounds_bool(r_obj* x,
                                                 enum vctrs_run_bound which,
                                                 struct r_lazy error_call) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.x, error_call);

  r_obj* proxy = KEEP(vec_proxy_equal(x));
  proxy = KEEP(obj_encode_utf8(proxy));

  const r_ssize size = vec_size(proxy);

  struct r_vector_bool* p_out = r_new_vector_bool(size);
  KEEP(p_out->shelter);
  bool* v_out = r_vector_bool_begin(p_out);

  const enum vctrs_type type = vec_proxy_typeof(proxy);

  switch (type) {
  case VCTRS_TYPE_logical: lgl_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_integer: int_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_double: dbl_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_complex: cpl_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_character: chr_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_raw: raw_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_list: list_detect_run_bounds_bool(proxy, size, which, v_out); break;
  case VCTRS_TYPE_dataframe: df_detect_run_bounds_bool(proxy, size, which, v_out); break;
  default: stop_unimplemented_vctrs_type("vec_detect_run_bounds_bool", type);
  }

  FREE(3);
  return p_out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:152

vec_dim_n C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: vec_bare_dim
timing: 0.002 s
source
static inline R_len_t vec_dim_n(SEXP x) {
  SEXP dim = vec_bare_dim(x);

  if (dim == R_NilValue) {
    return 1;
  }

  return Rf_length(dim);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.h:27

vec_equal C signature

[any_sexp, any_sexp, c_int_na, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [CHR & v('I87795), c_int] --> 'I87795
argument: [any_sexp, c_false]
timing: 0.153 s
source
SEXP vec_equal(
  SEXP x,
  SEXP y,
  bool na_equal,
  SEXP ptype,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy error_call
) {
  SEXP args = PROTECT(r_alloc_list(2));
  r_list_poke(args, 0, x);
  r_list_poke(args, 1, y);

  SEXP names = r_alloc_character(2);
  r_attrib_poke_names(args, names);
  SEXP x_name = PROTECT(vctrs_arg(p_x_arg));
  SEXP y_name = PROTECT(vctrs_arg(p_y_arg));
  r_chr_poke(names, 0, r_chr_get(x_name, 0));
  r_chr_poke(names, 1, r_chr_get(y_name, 0));

  args = PROTECT(vec_cast_common(args, ptype, vec_args.empty, error_call));

  const R_len_t size = vec_size_common(args, -1, vec_args.empty, error_call);

  x = r_list_get(args, 0);
  y = r_list_get(args, 1);

  const bool x_recycles = vec_size(x) == 1;
  const bool y_recycles = vec_size(y) == 1;

  SEXP x_proxy = PROTECT(vec_proxy_equal(x));
  SEXP y_proxy = PROTECT(vec_proxy_equal(y));

  x_proxy = PROTECT(obj_encode_utf8(x_proxy));
  y_proxy = PROTECT(obj_encode_utf8(y_proxy));

  enum vctrs_type type = vec_proxy_typeof(x_proxy);

  SEXP out;

  switch (type) {
  case VCTRS_TYPE_logical: out = lgl_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_integer: out = int_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_double: out = dbl_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_complex: out = cpl_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_character: out = chr_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_raw: out = raw_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_list: out = list_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_dataframe: out = df_equal(x_proxy, y_proxy, size, x_recycles, y_recycles, na_equal); break;
  case VCTRS_TYPE_scalar: r_abort_lazy_call(error_call, "Can't compare scalars with `vec_equal()`.");
  default: stop_unimplemented_vctrs_type("vec_equal", type);
  }

  UNPROTECT(8);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:39

vec_equal_col_na_equal C signature

[any_sexp, any_sexp, c_int_na, c_int_na, *c_int_na, *struct df_short_circuit_info] --> c_void
unbound variable
error detail
name: int
timing: 0.083 s
source
void vec_equal_col_na_equal(
  SEXP x,
  SEXP y,
  bool x_recycles,
  bool y_recycles,
  int* p_out,
  struct df_short_circuit_info* p_info
) {
  switch (vec_proxy_typeof(x)) {
  case VCTRS_TYPE_logical: EQUAL_COL(int, LOGICAL_RO, lgl_equal_na_equal); break;
  case VCTRS_TYPE_integer: EQUAL_COL(int, INTEGER_RO, int_equal_na_equal); break;
  case VCTRS_TYPE_double: EQUAL_COL(double, REAL_RO, dbl_equal_na_equal); break;
  case VCTRS_TYPE_complex: EQUAL_COL(Rcomplex, COMPLEX_RO, cpl_equal_na_equal); break;
  case VCTRS_TYPE_character: EQUAL_COL(SEXP, STRING_PTR_RO, chr_equal_na_equal); break;
  case VCTRS_TYPE_raw: EQUAL_COL(Rbyte, RAW_RO, raw_equal_na_equal); break;
  case VCTRS_TYPE_list: EQUAL_COL(SEXP, VECTOR_PTR_RO, list_equal_na_equal); break;
  case VCTRS_TYPE_dataframe: r_stop_internal("Data frame columns should be flattened already.");
  case VCTRS_TYPE_scalar: Rf_errorcall(R_NilValue, "Can't compare scalars with `vec_equal()`.");
  default: stop_unimplemented_vctrs_type("vec_equal", vec_proxy_typeof(x));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:275

vec_equal_col_na_propagate C signature

[any_sexp, any_sexp, c_int_na, c_int_na, *c_int_na, *struct df_short_circuit_info] --> c_void
unbound variable
error detail
name: int
timing: 0.084 s
source
void vec_equal_col_na_propagate(
  SEXP x,
  SEXP y,
  bool x_recycles,
  bool y_recycles,
  int* p_out,
  struct df_short_circuit_info* p_info
) {
  switch (vec_proxy_typeof(x)) {
  case VCTRS_TYPE_logical: EQUAL_COL(int, LOGICAL_RO, lgl_equal_na_propagate); break;
  case VCTRS_TYPE_integer: EQUAL_COL(int, INTEGER_RO, int_equal_na_propagate); break;
  case VCTRS_TYPE_double: EQUAL_COL(double, REAL_RO, dbl_equal_na_propagate); break;
  case VCTRS_TYPE_complex: EQUAL_COL(Rcomplex, COMPLEX_RO, cpl_equal_na_propagate); break;
  case VCTRS_TYPE_character: EQUAL_COL(SEXP, STRING_PTR_RO, chr_equal_na_propagate); break;
  case VCTRS_TYPE_raw: EQUAL_COL(Rbyte, RAW_RO, raw_equal_na_propagate); break;
  case VCTRS_TYPE_list: EQUAL_COL(SEXP, VECTOR_PTR_RO, list_equal_na_propagate); break;
  case VCTRS_TYPE_dataframe: r_stop_internal("Data frame columns should be flattened already.");
  case VCTRS_TYPE_scalar: Rf_errorcall(R_NilValue, "Can't compare scalars with `vec_equal()`.");
  default: stop_unimplemented_vctrs_type("vec_equal", vec_proxy_typeof(x));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/equal.c:298

vec_expand_grid C signature

[any_sexp, c_bool, *struct name_repair_opts, struct r_lazy] --> any_sexp
unbound variable
error detail
name: vec_detect_complete
timing: 0.080 s
source
r_obj* vec_expand_grid(r_obj* xs,
                       enum vctrs_expand_vary vary,
                       const struct name_repair_opts* p_name_repair_opts,
                       struct r_lazy error_call) {
  obj_check_list(xs, vec_args.empty, error_call);

  if (vec_any_missing(xs)) {
    // Drop `NULL`s before any other checks
    r_obj* complete = KEEP(vec_detect_complete(xs));
    xs = vec_slice(xs, complete);
    FREE(1);
  }
  KEEP(xs);

  const r_ssize n = r_length(xs);

  r_obj* out = KEEP(r_alloc_list(n));

  r_obj* names = KEEP(vec_names2(xs));
  if (!r_is_minimal_names(names)) {
    r_abort_lazy_call(error_call, "All inputs must be named.");
  }
  names = vec_as_names(names, p_name_repair_opts);
  r_attrib_poke_names(out, names);

  r_obj* sizes = KEEP(list_sizes(xs, vec_args.empty, error_call));
  const int* v_sizes = r_int_cbegin(sizes);

  r_obj* cumulative = KEEP(r_alloc_raw(n * sizeof(r_ssize)));
  r_ssize* v_cumulative = r_raw_begin(cumulative);

  r_ssize size = 1;

  for (r_ssize i = 0; i < n; ++i) {
    size = r_ssize_mult(size, v_sizes[i]);
    v_cumulative[i] = size;
  }

  // TODO: Support long vectors here
  if (size > R_LEN_T_MAX) {
    r_abort_lazy_call(
      error_call,
      "Long vectors are not yet supported. "
      "Expansion results in an allocation larger than 2^31-1 elements. "
      "Attempted allocation size was %.0lf.",
      (double) size
    );
  }

  r_obj* const* v_xs = r_list_cbegin(xs);

  r_obj* ffi_times_each = KEEP(r_alloc_integer(1));
  int* p_ffi_times_each = r_int_begin(ffi_times_each);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* x = v_xs[i];

    r_ssize times_each = 0;
    r_ssize times = 0;

    if (size != 0) {
      switch (vary) {
      case VCTRS_EXPAND_VARY_slowest: {
        times_each = size / v_cumulative[i];
        times = v_cumulative[i] / v_sizes[i];
        break;
      };
      case VCTRS_EXPAND_VARY_fastest: {
        times_each = v_cumulative[i] / v_sizes[i];
        times = size / v_cumulative[i];
        break;
      }
      }
    }

    *p_ffi_times_each = r_ssize_as_integer(times_each);

    x = KEEP(vec_rep_each(x, ffi_times_each, error_call, vec_args.x, vec_args.empty));
    x = vec_rep(x, r_ssize_as_integer(times), error_call, vec_args.x, vec_args.empty);

    r_list_poke(out, i, x);

    FREE(1);
  }

  init_data_frame(out, size);

  FREE(6);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/expand.c:28

vec_fill_missing C signature

[any_sexp, c_int_na, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: vec_detect_missing
timing: 0.083 s
source
SEXP vec_fill_missing(SEXP x, bool down, bool leading, int max_fill) {
  r_ssize size = vec_size(x);

  SEXP na = PROTECT(vec_detect_missing(x));
  const int* p_na = LOGICAL_RO(na);

  SEXP loc = PROTECT(r_new_integer(size));
  int* p_loc = INTEGER(loc);

  const bool has_max_fill = max_fill != INFINITE_FILL;

  if (down) {
    if (has_max_fill) {
      vec_fill_missing_down_with_max_fill(p_na, size, leading, max_fill, p_loc);
    } else {
      vec_fill_missing_down(p_na, size, leading, p_loc);
    }
  } else {
    if (has_max_fill) {
      vec_fill_missing_up_with_max_fill(p_na, size, leading, max_fill, p_loc);
    } else {
      vec_fill_missing_up(p_na, size, leading, p_loc);
    }
  }

  SEXP out = vec_slice_unsafe(x, loc);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:26

vec_first_missing C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: vec_proxy_equal
timing: 0.002 s
source
r_ssize vec_first_missing(r_obj* x) {
  r_obj* proxy = KEEP(vec_proxy_equal(x));
  r_ssize out = proxy_first_missing(proxy);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:271

VEC_GROUP_LOC_LOOP C signature

tuple1 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

vec_hash_fill C signature

[any_sexp, c_int_na, c_int_na, *c_int_na] --> c_void
unbound variable
error detail
name: r_as_data_frame
timing: 0.051 s
source
void vec_hash_fill(r_obj* x, r_ssize size, bool na_equal, uint32_t* v_out) {
  if (has_dim(x)) {
    // The conversion to data frame is only a stopgap, in the long
    // term, we'll hash arrays natively
    x = KEEP(r_as_data_frame(x));
    vec_hash_fill(x, size, na_equal, v_out);
    FREE(1);
    return;
  }

  if (na_equal) {
    switch (vec_proxy_typeof(x)) {
    case VCTRS_TYPE_logical: lgl_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_integer: int_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_double: dbl_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_complex: cpl_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_character: chr_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_raw: raw_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_list: list_hash_fill_na_equal(x, size, v_out); return;
    case VCTRS_TYPE_dataframe: df_hash_fill(x, size, na_equal, v_out); return;
    default: break;
    }
  } else {
    switch (vec_proxy_typeof(x)) {
    case VCTRS_TYPE_logical: lgl_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_integer: int_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_double: dbl_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_complex: cpl_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_character: chr_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_raw: raw_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_list: list_hash_fill_na_propagate(x, size, v_out); return;
    case VCTRS_TYPE_dataframe: df_hash_fill(x, size, na_equal, v_out); return;
    default: break;
    }
  }

  stop_unimplemented_vctrs_type("vec_hash_fill", vec_proxy_typeof(x));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:165

vec_identify_runs C signature

[any_sexp, struct r_lazy] --> any_sexp
untypeable application
error detail
function: ([c_int] --> INT) & ([c_true] --> INT1)
argument: [c_int_na]
timing: 0.108 s
source
r_obj* vec_identify_runs(r_obj* x, struct r_lazy error_call) {
  struct r_vector_bool* p_starts = vec_detect_run_bounds_bool(x, VCTRS_RUN_BOUND_start, error_call);
  KEEP(p_starts->shelter);
  const bool* v_starts = r_vector_bool_cbegin(p_starts);

  const r_ssize size = r_vector_bool_length(p_starts);

  r_obj* out = KEEP(r_alloc_integer(size));
  int* v_out = r_int_begin(out);

  int n = 0;

  for (r_ssize i = 0; i < size; ++i) {
    n += v_starts[i];
    v_out[i] = n;
  }

  r_obj* ffi_n = r_int(n);
  r_attrib_poke(out, syms_n, ffi_n);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/runs.c:85

vec_if_else C signature

[any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [<...> | p(CHR) | sym, any_sexp, any_sexp, c_false, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] | [<...> | p(CHR) | sym, any_sexp, any_sexp, c_int_na \ c_false, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
argument: [any_sexp & 'I89355, 'I89352 & (<> | null | p(CHR) | sym), 'I89353 & (<> | null | p(CHR) | sym), 'I89354 & (<> | null | p(CHR) | sym), c_bool, c_null & 'I89357, c_null & 'I89358, c_null & 'I89359, struct r_lazy & 'I89360]
timing: 0.800 s
source
r_obj* vec_if_else(
  r_obj* condition,
  r_obj* true_,
  r_obj* false_,
  r_obj* missing,
  r_obj* ptype,
  struct vctrs_arg* p_condition_arg,
  struct vctrs_arg* p_true_arg,
  struct vctrs_arg* p_false_arg,
  struct vctrs_arg* p_missing_arg,
  struct r_lazy error_call
) {
  obj_check_vector(condition, VCTRS_ALLOW_NULL_no, p_condition_arg, error_call);
  check_condition_index(condition, p_condition_arg, error_call);

  const r_ssize size = r_length(condition);

  const bool has_missing = missing != r_null;

  obj_check_vector(true_, VCTRS_ALLOW_NULL_no, p_true_arg, error_call);
  obj_check_vector(false_, VCTRS_ALLOW_NULL_no, p_false_arg, error_call);
  if (has_missing) {
    obj_check_vector(missing, VCTRS_ALLOW_NULL_no, p_missing_arg, error_call);
  }

  ptype = KEEP(ptype_finalize(
    ptype,
    true_,
    false_,
    missing,
    has_missing,
    p_true_arg,
    p_false_arg,
    p_missing_arg,
    error_call
  ));

  r_obj* out;

  if (ptype_is_atomic(ptype)) {
    out = atomic_if_else(
      condition,
      true_,
      false_,
      missing,
      ptype,
      size,
      p_true_arg,
      p_false_arg,
      p_missing_arg,
      error_call,
      has_missing
    );
  } else {
    out = generic_if_else(
      condition,
      true_,
      false_,
      missing,
      ptype,
      size,
      p_true_arg,
      p_false_arg,
      p_missing_arg,
      error_call
    );
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/if-else.c:42

vec_in C signature

[any_sexp, any_sexp, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I68612] --> null & 'I68612
argument: [any_sexp]
timing: 0.176 s
source
SEXP vec_in(
  SEXP needles,
  SEXP haystack,
  bool na_equal,
  struct vctrs_arg* p_needles_arg,
  struct vctrs_arg* p_haystack_arg,
  struct r_lazy call
) {
  int nprot = 0;

  int _;
  SEXP type = vec_ptype2(
    needles,
    haystack,
    p_needles_arg,
    p_haystack_arg,
    call,
    S3_FALLBACK_false,
    &_
  );
  PROTECT_N(type, &nprot);
  type = PROTECT_N(vec_ptype_finalise(type), &nprot);

  needles = vec_cast_params(
    needles,
    type,
    p_needles_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  PROTECT_N(needles, &nprot);

  haystack = vec_cast_params(
    haystack,
    type,
    p_haystack_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  PROTECT_N(haystack, &nprot);

  needles = PROTECT_N(vec_proxy_equal(needles), &nprot);
  needles = PROTECT_N(obj_encode_utf8(needles), &nprot);

  haystack = PROTECT_N(vec_proxy_equal(haystack), &nprot);
  haystack = PROTECT_N(obj_encode_utf8(haystack), &nprot);

  R_len_t n_haystack = vec_size(haystack);
  R_len_t n_needle = vec_size(needles);

  struct dictionary* d = new_dictionary_params(haystack, false, na_equal);
  PROTECT_DICT(d, &nprot);

  // Load dictionary with haystack
  load_with_haystack(d, n_haystack);

  struct dictionary* d_needles = new_dictionary_params(needles, true, na_equal);
  PROTECT_DICT(d_needles, &nprot);

  // Locate needles
  SEXP out = PROTECT_N(Rf_allocVector(LGLSXP, n_needle), &nprot);
  int* p_out = LOGICAL(out);

  if (na_equal) {
    vec_in_loop(p_out, d, d_needles, n_needle);
  } else {
    vec_in_loop_propagate(p_out, d, d_needles, n_needle);
  }

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:566

VEC_IN_LOOP C signature

tuple1 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

VEC_IN_LOOP_PROPAGATE C signature

tuple2 --> any
invalid mlsem AST: Cannot assign to an immutable variable.
timing: 0.001 s
(definition not located in src/)

vec_init C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I29173, c_false, *struct vctrs_arg, struct r_lazy]
timing: 0.024 s
source
r_obj* vec_init(r_obj* x, r_ssize n) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.x, lazy_calls.vec_init);

  if (n < 0) {
    r_abort_lazy_call(lazy_calls.vec_init,
                      "%s must be a positive integer.",
                      r_c_str_format_error_arg("n"));
  }

  r_obj* i = KEEP(compact_rep(r_globals.na_int, n));
  r_obj* out = vec_slice_unsafe(x, i);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:476

vec_interval_group_info C signature

[any_sexp, any_sexp, c_int_na, c_bool, c_int_na] --> any_sexp
untypeable application
error detail
function: [null & 'I88442] --> null & 'I88442
argument: [any_sexp]
timing: 0.586 s
source
r_obj* vec_interval_group_info(r_obj* start,
                               r_obj* end,
                               bool abutting,
                               enum vctrs_interval_missing missing,
                               bool locations) {
  int n_prot = 0;

  int _;
  r_obj* ptype = vec_ptype2(
    start,
    end,
    args_start,
    args_end,
    r_lazy_null,
    S3_FALLBACK_false,
    &_
  );
  KEEP_N(ptype, &n_prot);
  ptype = KEEP_N(vec_ptype_finalise(ptype), &n_prot);

  start = vec_cast_params(
    start,
    ptype,
    args_start,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(start, &n_prot);

  end = vec_cast_params(
    end,
    ptype,
    args_end,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(end, &n_prot);

  r_obj* start_proxy = KEEP_N(vec_proxy_compare(start), &n_prot);
  start_proxy = KEEP_N(obj_encode_utf8(start_proxy), &n_prot);

  r_obj* end_proxy = KEEP_N(vec_proxy_compare(end), &n_prot);
  end_proxy = KEEP_N(obj_encode_utf8(end_proxy), &n_prot);

  const enum vctrs_type type_proxy = vec_proxy_typeof(start_proxy);

  struct poly_vec* p_poly_start = new_poly_vec(start_proxy, type_proxy);
  KEEP_N(p_poly_start->shelter, &n_prot);
  const void* p_start = p_poly_start->p_vec;

  struct poly_vec* p_poly_end = new_poly_vec(end_proxy, type_proxy);
  KEEP_N(p_poly_end->shelter, &n_prot);
  const void* p_end = p_poly_end->p_vec;

  poly_binary_int_fn* const fn_compare = poly_p_compare_na_equal(type_proxy);
  poly_unary_bool_fn* const fn_is_missing = poly_p_is_missing(type_proxy);

  const r_ssize size = vec_size(start_proxy);

  if (size != vec_size(end_proxy)) {
    r_abort("`start` and `end` must have the same size.");
  }

  // Order is computed as ascending order, placing missing intervals up front
  // as the "smallest" values. We document that we assume that if `start` is
  // missing, then `end` is missing too.
  r_obj* order = interval_order(
    start_proxy,
    end_proxy,
    chrs_asc,
    chrs_smallest,
    size
  );
  KEEP_N(order, &n_prot);
  const int* v_order = r_int_cbegin(order);

  // Assume the intervals can be merged into half their original size.
  // Apply a minimum size to avoid a size of zero.
  const r_ssize initial_size = r_ssize_max(size / 2, 1);

  struct r_dyn_array* p_loc_start = r_new_dyn_vector(R_TYPE_integer, initial_size);
  KEEP_N(p_loc_start->shelter, &n_prot);

  struct r_dyn_array* p_loc_end = r_new_dyn_vector(R_TYPE_integer, initial_size);
  KEEP_N(p_loc_end->shelter, &n_prot);

  struct r_dyn_array* p_loc = NULL;
  if (locations) {
    p_loc = r_new_dyn_vector(R_TYPE_list, initial_size);
    KEEP_N(p_loc->shelter, &n_prot);
  }

  r_ssize i = 0;

  r_ssize loc_order_missing_start = 0;
  r_ssize loc_order_missing_end = -1;

  // Move `i` past any missing intervals (they are at the front),
  // recording last missing interval location for later. Only need to check
  // missingness of `start`, because we document that we assume that `end`
  // is missing if `start` is missing.
  for (; i < size; ++i) {
    const r_ssize loc = v_order[i] - 1;

    if (!fn_is_missing(p_start, loc)) {
      break;
    }

    loc_order_missing_end = i;
  }

  r_ssize loc_order_start = 0;
  r_ssize loc_order_end = -1;

  r_ssize loc_group_start = 0;
  r_ssize loc_group_end = -1;

  if (i < size) {
    // Set information about first usable interval
    const r_ssize loc = v_order[i] - 1;
    loc_order_start = i;
    loc_order_end = i;
    loc_group_start = loc;
    loc_group_end = loc;
    ++i;
  }

  const int merge_limit = abutting ? -1 : 0;

  for (; i < size; ++i) {
    const r_ssize loc = v_order[i] - 1;

    // If `abutting`, this says: if group end < new start, finish out the group
    // If `!abutting`, this says: if group end <= new start, finish out the group
    if (fn_compare(p_end, loc_group_end, p_start, loc) <= merge_limit) {
      r_dyn_int_push_back(p_loc_start, loc_group_start + 1);
      r_dyn_int_push_back(p_loc_end, loc_group_end + 1);

      if (locations) {
        const r_ssize loc_size = loc_order_end - loc_order_start + 1;

        r_obj* loc = r_new_integer(loc_size);
        r_dyn_list_push_back(p_loc, loc);
        int* v_loc = r_int_begin(loc);

        const int* v_order_start = v_order + loc_order_start;
        r_memcpy(v_loc, v_order_start, loc_size * sizeof(*v_loc));
      }

      loc_order_start = loc_order_end + 1;
      loc_group_start = loc;
      loc_group_end = loc;
    } else if (fn_compare(p_end, loc_group_end, p_end, loc) == -1) {
      loc_group_end = loc;
    }

    loc_order_end = i;
  }

  if (loc_order_end >= loc_order_start) {
    // Log last interval
    r_dyn_int_push_back(p_loc_start, loc_group_start + 1);
    r_dyn_int_push_back(p_loc_end, loc_group_end + 1);

    if (locations) {
      const r_ssize loc_size = loc_order_end - loc_order_start + 1;

      r_obj* loc = r_new_integer(loc_size);
      r_dyn_list_push_back(p_loc, loc);
      int* v_loc = r_int_begin(loc);

      const int* v_order_start = v_order + loc_order_start;
      r_memcpy(v_loc, v_order_start, loc_size * sizeof(*v_loc));
    }
  }

  if (missing == VCTRS_INTERVAL_MISSING_group &&
      loc_order_missing_end >= loc_order_missing_start) {
    // Log missing interval at the end
    const r_ssize loc_group_missing_start = v_order[loc_order_missing_start] - 1;
    const r_ssize loc_group_missing_end = v_order[loc_order_missing_end] - 1;

    r_dyn_int_push_back(p_loc_start, loc_group_missing_start + 1);
    r_dyn_int_push_back(p_loc_end, loc_group_missing_end + 1);

    if (locations) {
      const r_ssize loc_size = loc_order_missing_end - loc_order_missing_start + 1;

      r_obj* loc = r_new_integer(loc_size);
      r_dyn_list_push_back(p_loc, loc);
      int* v_loc = r_int_begin(loc);

      const int* v_order_start = v_order + loc_order_missing_start;
      r_memcpy(v_loc, v_order_start, loc_size * sizeof(*v_loc));
    }
  }

  r_obj* key = KEEP_N(r_new_list(2), &n_prot);
  r_list_poke(key, 0, r_dyn_unwrap(p_loc_start));
  r_list_poke(key, 1, r_dyn_unwrap(p_loc_end));

  r_obj* key_names = r_new_character(2);
  r_attrib_poke_names(key, key_names);
  r_chr_poke(key_names, 0, r_str("start"));
  r_chr_poke(key_names, 1, r_str("end"));

  r_init_data_frame(key, p_loc_start->count);

  r_obj* out = r_null;
  r_keep_loc out_shelter;
  KEEP_HERE(out, &out_shelter);
  ++n_prot;

  if (locations) {
    out = r_new_list(2);
    KEEP_AT(out, out_shelter);
    r_list_poke(out, 0, key);
    r_list_poke(out, 1, r_dyn_unwrap(p_loc));

    r_obj* out_names = r_new_character(2);
    r_attrib_poke_names(out, out_names);
    r_chr_poke(out_names, 0, r_str("key"));
    r_chr_poke(out_names, 1, r_str("loc"));

    r_init_data_frame(out, p_loc_start->count);
  } else {
    out = key;
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:68

vec_invoke_coerce_method C signature

[any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, any_sexp, struct r_lazy, c_bool] --> any_sexp
unbound variable
error detail
name: vctrs_dispatch6
timing: 0.105 s
source
r_obj* vec_invoke_coerce_method(r_obj* method_sym, r_obj* method,
                                r_obj* x_sym, r_obj* x,
                                r_obj* y_sym, r_obj* y,
                                r_obj* x_arg_sym, r_obj* x_arg,
                                r_obj* y_arg_sym, r_obj* y_arg,
                                struct r_lazy lazy_call,
                                enum s3_fallback s3_fallback) {
  r_obj* call = KEEP(r_lazy_eval(lazy_call));

  if (s3_fallback != S3_FALLBACK_false) {
    r_obj* ffi_s3_fallback = KEEP(r_int(s3_fallback));

    r_obj* out = vctrs_dispatch6(method_sym, method,
                                 x_sym, x,
                                 y_sym, y,
                                 x_arg_sym, x_arg,
                                 y_arg_sym, y_arg,
                                 syms_call, call,
                                 syms_s3_fallback, ffi_s3_fallback);
    FREE(2);
    return out;
  } else {
    r_obj* out = vctrs_dispatch5(method_sym, method,
                                 x_sym, x,
                                 y_sym, y,
                                 x_arg_sym, x_arg,
                                 y_arg_sym, y_arg,
                                 syms_call, call);
    FREE(1);
    return out;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:191

vec_is_coercible C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] --> c_bool
untypeable application
error detail
function: ([*any \ c_null] --> c_false) & ([c_false] --> c_true) & ([c_int_na \ c_false] --> c_false) & ([c_null] --> c_true) & ([c_string] --> c_false)
argument: tuple1
timing: 0.034 s
source
bool vec_is_coercible(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  ERR err = NULL;
  vec_is_coercible_e(
    x,
    y,
    p_x_arg,
    p_y_arg,
    call,
    s3_fallback,
    &err
  );
  return !err;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2.c:317

vec_is_restored C signature

[any_sexp, any_sexp] --> c_bool
untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: [any_sexp & 'I23583, [any_sexp, any_sexp, c_ptr] -> c_null | null, c_null]
timing: 0.034 s
source
bool vec_is_restored(r_obj* x, r_obj* to) {
  // Don't restore if there is an actual `[` method that ignored
  // attributes. Some methods like [.ts intentionally strip the class
  // and attributes. FIXME: This branch is now probably sufficient.
  if (s3_find_method("[", to, base_method_table) != r_null) {
    return true;
  }

  if (!r_attrib_has_any(x)) {
    return false;
  }

  // Class is restored if it contains any other attributes than names.
  // We might want to add support for data frames later on.
  return r_attrib_map(x, vec_is_restored_cb, NULL) != NULL;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:417

vec_joint_xtfrm C signature

[any_sexp, any_sexp, c_int_na, c_int_na, c_int_na, any_sexp] --> any_sexp
unbound variable
error detail
name: vec_joint_proxy_order
timing: 1.18 s
source
r_obj* vec_joint_xtfrm(r_obj* x,
                       r_obj* y,
                       r_ssize x_size,
                       r_ssize y_size,
                       bool nan_distinct,
                       r_obj* chr_proxy_collate) {
  int n_prot = 0;

  r_obj* out = KEEP_N(r_alloc_list(2), &n_prot);

  // These aren't true ranks, but that name makes the most sense
  r_obj* x_ranks = r_alloc_integer(x_size);
  r_list_poke(out, 0, x_ranks);
  int* v_x_ranks = r_int_begin(x_ranks);

  r_obj* y_ranks = r_alloc_integer(y_size);
  r_list_poke(out, 1, y_ranks);
  int* v_y_ranks = r_int_begin(y_ranks);

  // Retain the results of applying the proxy, normalizing the encoding, and
  // doing the collation transform, since we will make comparisons directly
  // on these objects.
  // This also uses a special variant of `vec_proxy_order()` to support list
  // columns, which have proxies that can't be computed independently.
  r_obj* proxies = KEEP_N(vec_joint_proxy_order(x, y), &n_prot);

  r_obj* x_proxy = r_list_get(proxies, 0);
  x_proxy = KEEP_N(obj_encode_utf8(x_proxy), &n_prot);
  x_proxy = KEEP_N(proxy_apply_chr_proxy_collate(x_proxy, chr_proxy_collate), &n_prot);

  r_obj* y_proxy = r_list_get(proxies, 1);
  y_proxy = KEEP_N(obj_encode_utf8(y_proxy), &n_prot);
  y_proxy = KEEP_N(proxy_apply_chr_proxy_collate(y_proxy, chr_proxy_collate), &n_prot);

  // Called with `direction = "asc", na_value = "smallest"` to match the
  // comparison helpers in `match-compare.h`
  r_obj* x_info = KEEP_N(vec_order_info(
    x_proxy,
    chrs_asc,
    chrs_smallest,
    nan_distinct,
    r_null
  ), &n_prot);

  r_obj* y_info = KEEP_N(vec_order_info(
    y_proxy,
    chrs_asc,
    chrs_smallest,
    nan_distinct,
    r_null
  ), &n_prot);

  const int* v_x_o = r_int_cbegin(r_list_get(x_info, 0));
  const int* v_x_group_sizes = r_int_cbegin(r_list_get(x_info, 1));
  r_ssize x_n_groups = r_length(r_list_get(x_info, 1));

  const int* v_y_o = r_int_cbegin(r_list_get(y_info, 0));
  const int* v_y_group_sizes = r_int_cbegin(r_list_get(y_info, 1));
  r_ssize y_n_groups = r_length(r_list_get(y_info, 1));

  const enum vctrs_type type = vec_proxy_typeof(x_proxy);

  const struct poly_vec* p_x_poly = new_poly_vec(x_proxy, type);
  KEEP_N(p_x_poly->shelter, &n_prot);
  const void* p_x_vec = p_x_poly->p_vec;

  const struct poly_vec* p_y_poly = new_poly_vec(y_proxy, type);
  KEEP_N(p_y_poly->shelter, &n_prot);
  const void* p_y_vec = p_y_poly->p_vec;

  r_ssize i = 0;
  r_ssize j = 0;
  r_ssize x_o_loc = 0;
  r_ssize y_o_loc = 0;

  // Start rank as small as possible (while still different from NA),
  // to maximally utilize `int` storage
  int rank = INT_MIN + 1;

  // Now that we have the ordering of both vectors,
  // it is just a matter of merging two sorted arrays
  switch (type) {
  case VCTRS_TYPE_logical: VEC_JOINT_XTFRM_LOOP(p_lgl_order_compare_na_equal); break;
  case VCTRS_TYPE_integer: VEC_JOINT_XTFRM_LOOP(p_int_order_compare_na_equal); break;
  case VCTRS_TYPE_double: VEC_JOINT_XTFRM_LOOP(p_dbl_order_compare_na_equal); break;
  case VCTRS_TYPE_complex: VEC_JOINT_XTFRM_LOOP(p_cpl_order_compare_na_equal); break;
  case VCTRS_TYPE_character: VEC_JOINT_XTFRM_LOOP(p_chr_order_compare_na_equal); break;
  case VCTRS_TYPE_dataframe: VEC_JOINT_XTFRM_LOOP(p_df_order_compare_na_equal); break;
  default: stop_unimplemented_vctrs_type("vec_joint_xtfrm", type);
  }

  while (i < x_n_groups) {
    // Finish up remaining x groups
    const int x_group_size = v_x_group_sizes[i];

    for (int k = 0; k < x_group_size; ++k) {
      v_x_ranks[v_x_o[x_o_loc] - 1] = rank;
      ++x_o_loc;
    }

    ++i;
    ++rank;
  }

  while (j < y_n_groups) {
    // Finish up remaining y groups
    const int y_group_size = v_y_group_sizes[j];

    for (int k = 0; k < y_group_size; ++k) {
      v_y_ranks[v_y_o[y_o_loc] - 1] = rank;
      ++y_o_loc;
    }

    ++j;
    ++rank;
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:76

vec_locate_matches C signature

[any_sexp, any_sexp, any_sexp, any_sexp, *struct vctrs_incomplete, *struct vctrs_no_match, *struct vctrs_remaining, c(0..5), c(0..5), c_int_na, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I110165] --> null & 'I110165
argument: [any_sexp]
timing: 0.130 s
source
r_obj* vec_locate_matches(r_obj* needles,
                          r_obj* haystack,
                          r_obj* condition,
                          r_obj* filter,
                          const struct vctrs_incomplete* incomplete,
                          const struct vctrs_no_match* no_match,
                          const struct vctrs_remaining* remaining,
                          enum vctrs_multiple multiple,
                          enum vctrs_relationship relationship,
                          bool nan_distinct,
                          r_obj* chr_proxy_collate,
                          struct vctrs_arg* needles_arg,
                          struct vctrs_arg* haystack_arg,
                          struct r_lazy error_call) {
  int n_prot = 0;

  int _;
  r_obj* ptype = KEEP_N(vec_ptype2(
    needles,
    haystack,
    needles_arg,
    haystack_arg,
    error_call,
    S3_FALLBACK_false,
    &_
  ), &n_prot);
  ptype = KEEP_N(vec_ptype_finalise(ptype), &n_prot);

  needles = KEEP_N(vec_cast_params(
    needles,
    ptype,
    needles_arg,
    vec_args.empty,
    error_call,
    S3_FALLBACK_false
  ), &n_prot);

  haystack = KEEP_N(vec_cast_params(
    haystack,
    ptype,
    haystack_arg,
    vec_args.empty,
    error_call,
    S3_FALLBACK_false
  ), &n_prot);

  r_ssize size_needles = vec_size(needles);
  r_ssize size_haystack = vec_size(haystack);

  // Support non-data frame types by wrapping them in a 1-col data frame
  if (!is_data_frame(needles)) {
    needles = KEEP_N(r_list(needles), &n_prot);
    haystack = KEEP_N(r_list(haystack), &n_prot);

    r_obj* names = KEEP_N(r_chr("x"), &n_prot);
    r_attrib_poke_names(needles, names);
    r_attrib_poke_names(haystack, names);

    r_init_data_frame(needles, size_needles);
    r_init_data_frame(haystack, size_haystack);
  }

  r_ssize n_cols = r_length(needles);

  enum vctrs_ops* v_ops = (enum vctrs_ops*) R_alloc(n_cols, sizeof(enum vctrs_ops));
  parse_condition(condition, n_cols, v_ops);

  enum vctrs_filter* v_filters = (enum vctrs_filter*) R_alloc(n_cols, sizeof(enum vctrs_filter));
  parse_filter(filter, n_cols, v_filters);

  bool any_filters = false;
  for (r_ssize i = 0; i < n_cols; ++i) {
    if (v_filters[i] != VCTRS_FILTER_none) {
      any_filters = true;
      break;
    }
  }

  if (n_cols == 0) {
    // If there are no columns, this operation isn't well defined.
    r_abort_lazy_call(error_call, "Must have at least 1 column to match on.");
  }

  // Compute the locations of incomplete values per column since computing
  // joint ranks per column is going to replace the incomplete values with
  // integer ranks
  r_obj* needles_complete = df_detect_complete_by_col(needles, size_needles, n_cols);
  KEEP_N(needles_complete, &n_prot);

  r_obj* haystack_complete = df_detect_complete_by_col(haystack, size_haystack, n_cols);
  KEEP_N(haystack_complete, &n_prot);

  // Compute joint xtfrm to simplify each column down to an integer vector
  r_obj* args = KEEP_N(df_joint_xtfrm_by_col(
    needles,
    haystack,
    size_needles,
    size_haystack,
    n_cols,
    nan_distinct,
    chr_proxy_collate
  ), &n_prot);
  needles = r_list_get(args, 0);
  haystack = r_list_get(args, 1);

  r_obj* out = df_locate_matches(
    needles,
    haystack,
    needles_complete,
    haystack_complete,
    size_needles,
    size_haystack,
    incomplete,
    no_match,
    remaining,
    multiple,
    relationship,
    any_filters,
    v_filters,
    v_ops,
    needles_arg,
    haystack_arg,
    error_call
  );

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:132

vec_locate_sorted_groups C signature

[any_sexp, any_sexp, any_sexp, c_int_na, any_sexp] --> any_sexp
untypeable application
error detail
function: [{ 'I81539 }, c_int] --> 'I81539
argument: [any_sexp, c_false]
timing: 0.068 s
source
SEXP vec_locate_sorted_groups(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  bool nan_distinct,
  SEXP chr_proxy_collate
) {
  SEXP info = KEEP(vec_order_info(
    x,
    direction,
    na_value,
    nan_distinct,
    chr_proxy_collate
  ));

  SEXP o = r_list_get(info, 0);
  const int* p_o = r_int_cbegin(o);

  SEXP sizes = r_list_get(info, 1);
  const int* p_sizes = r_int_cbegin(sizes);

  r_ssize n_groups = r_length(sizes);

  SEXP loc = KEEP(r_alloc_list(n_groups));

  SEXP key_loc = KEEP(r_alloc_integer(n_groups));
  int* p_key_loc = r_int_begin(key_loc);

  int start = 0;

  for (r_ssize i = 0; i < n_groups; ++i) {
    p_key_loc[i] = p_o[start];

    const int size = p_sizes[i];

    SEXP elt = r_alloc_integer(size);
    r_list_poke(loc, i, elt);
    int* p_elt = r_int_begin(elt);

    R_len_t k = 0;

    for (int j = 0; j < size; ++j) {
      p_elt[k] = p_o[start];
      ++start;
      ++k;
    }
  }

  SEXP key = KEEP(vec_slice(x, key_loc));

  // Construct output data frame
  SEXP out = KEEP(r_alloc_list(2));
  r_list_poke(out, 0, key);
  r_list_poke(out, 1, loc);

  SEXP names = KEEP(r_alloc_character(2));
  r_chr_poke(names, 0, strings_key);
  r_chr_poke(names, 1, strings_loc);

  r_attrib_poke(out, r_syms.names, names);

  out = new_data_frame(out, n_groups);

  FREE(6);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:205

vec_match_params C signature

[any_sexp, any_sexp, c_int_na, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I52535] --> null & 'I52535
argument: [any_sexp]
timing: 0.174 s
source
SEXP vec_match_params(SEXP needles,
                      SEXP haystack,
                      bool na_equal,
                      struct vctrs_arg* needles_arg,
                      struct vctrs_arg* haystack_arg,
                      struct r_lazy call) {
  int nprot = 0;

  int _;
  SEXP type = vec_ptype2(
    needles,
    haystack,
    needles_arg,
    haystack_arg,
    call,
    S3_FALLBACK_false,
    &_
  );
  PROTECT_N(type, &nprot);
  type = PROTECT_N(vec_ptype_finalise(type), &nprot);

  needles = vec_cast_params(
    needles,
    type,
    needles_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  PROTECT_N(needles, &nprot);

  haystack = vec_cast_params(
    haystack,
    type,
    haystack_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  PROTECT_N(haystack, &nprot);

  needles = PROTECT_N(vec_proxy_equal(needles), &nprot);
  needles = PROTECT_N(obj_encode_utf8(needles), &nprot);

  haystack = PROTECT_N(vec_proxy_equal(haystack), &nprot);
  haystack = PROTECT_N(obj_encode_utf8(haystack), &nprot);

  R_len_t n_haystack = vec_size(haystack);
  R_len_t n_needle = vec_size(needles);

  struct dictionary* d = new_dictionary_params(haystack, false, na_equal);
  PROTECT_DICT(d, &nprot);

  // Load dictionary with haystack
  load_with_haystack(d, n_haystack);

  struct dictionary* d_needles = new_dictionary_params(needles, true, na_equal);
  PROTECT_DICT(d_needles, &nprot);

  // Locate needles
  SEXP out = PROTECT_N(Rf_allocVector(INTSXP, n_needle), &nprot);
  int* p_out = INTEGER(out);

  if (na_equal) {
    vec_match_loop(p_out, d, d_needles, n_needle);
  } else {
    vec_match_loop_propagate(p_out, d, d_needles, n_needle);
  }

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:392

vec_names_impl C signature

[any_sexp, c_int_na] --> any_sexp
unbound variable
error detail
name: df_rownames
timing: 0.279 s
source
r_obj* vec_names_impl(r_obj* x, bool proxy) {
  bool has_class = r_is_object(x);

  if (has_class && r_inherits(x, "data.frame")) {
    // Only return row names if they are character. Data frames with
    // automatic row names are treated as unnamed.
    r_obj* rn = df_rownames(x);
    if (rownames_type(rn) == ROWNAMES_TYPE_identifiers) {
      return rn;
    } else {
      return r_null;
    }
  }

  if (vec_bare_dim(x) == r_null) {
    if (!proxy && has_class) {
      return vctrs_dispatch1(syms_names, fns_names, syms_x, x);
    } else {
      return r_names(x);
    }
  }

  r_obj* dimnames = KEEP(r_attrib_get(x, r_syms.dim_names));
  if (dimnames == r_null || r_length(dimnames) < 1) {
    FREE(1);
    return r_null;
  }

  r_obj* out = r_list_get(dimnames, 0);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:137

vec_order C signature

[any_sexp, any_sexp, any_sexp, c_int_na, any_sexp] --> any_sexp
untypeable application
error detail
function: [{ 'I81481 }, c_int] --> 'I81481
argument: [any_sexp, c_false]
timing: 0.030 s
source
SEXP vec_order(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  bool nan_distinct,
  SEXP chr_proxy_collate
) {
  const bool group_sizes = false;
  SEXP info = vec_order_info_impl(x, direction, na_value, nan_distinct, chr_proxy_collate, group_sizes);
  return r_list_get(info, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:171

vec_order_info_impl C signature

[any_sexp, any_sexp, any_sexp, c_int_na, any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [CHR, *c_bool, *c_bool] --> ()
argument: [any_sexp & 'I78429]
timing: 0.172 s
source
SEXP vec_order_info_impl(
  SEXP x,
  SEXP direction,
  SEXP na_value,
  bool nan_distinct,
  SEXP chr_proxy_collate,
  bool group_sizes
) {
  // TODO call
  struct r_lazy call = r_lazy_null;

  int n_prot = 0;

  SEXP decreasing = PROTECT_N(parse_direction(direction), &n_prot);
  SEXP na_largest = PROTECT_N(parse_na_value(na_value), &n_prot);

  // Call on `x` before potentially flattening cols with `vec_proxy_order()`
  SEXP args = PROTECT_N(vec_order_expand_args(x, decreasing, na_largest), &n_prot);

  R_len_t arg_size = vec_size_common(args, 0, vec_args.empty, call);
  args = PROTECT_N(vec_recycle_common(args, arg_size, vec_args.empty, call), &n_prot);

  decreasing = VECTOR_ELT(args, 0);
  na_largest = VECTOR_ELT(args, 1);

  SEXP na_last = PROTECT_N(vec_order_compute_na_last(na_largest, decreasing), &n_prot);

  SEXP proxy = PROTECT_N(vec_proxy_order(x), &n_prot);
  proxy = PROTECT_N(obj_encode_utf8(proxy), &n_prot);
  proxy = PROTECT_N(proxy_apply_chr_proxy_collate(proxy, chr_proxy_collate), &n_prot);

  r_ssize size = vec_size(proxy);
  const enum vctrs_type type = vec_proxy_typeof(proxy);

  // Compute the maximum size required for auxiliary working memory
  const size_t n_bytes_lazy_raw = vec_compute_n_bytes_lazy_raw(proxy, type);

  // Auxiliary vectors to hold intermediate results while ordering.
  // If `x` is a data frame we allocate enough room for the largest column type.
  struct lazy_raw* p_lazy_x_chunk = new_lazy_raw(size, n_bytes_lazy_raw);
  PROTECT_LAZY_VEC(p_lazy_x_chunk, &n_prot);

  struct lazy_raw* p_lazy_x_aux = new_lazy_raw(size, n_bytes_lazy_raw);
  PROTECT_LAZY_VEC(p_lazy_x_aux, &n_prot);

  struct lazy_raw* p_lazy_o_aux = new_lazy_raw(size, sizeof(int));
  PROTECT_LAZY_VEC(p_lazy_o_aux, &n_prot);

  struct lazy_raw* p_lazy_bytes = new_lazy_raw(size, sizeof(uint8_t));
  PROTECT_LAZY_VEC(p_lazy_bytes, &n_prot);

  // Compute the maximum size of the `counts` vector needed during radix
  // ordering. 4 * 256 for integers, 8 * 256 for doubles, not used for characters
  // since the number of iterations depends on string length.
  size_t n_bytes_lazy_counts = vec_compute_n_bytes_lazy_counts(proxy, type);
  r_ssize size_lazy_counts = UINT8_MAX_SIZE * n_bytes_lazy_counts;

  struct lazy_raw* p_lazy_counts = new_lazy_raw(size_lazy_counts, sizeof(r_ssize));
  PROTECT_LAZY_VEC(p_lazy_counts, &n_prot);

  // Determine if group tracking can be turned off.
  // We turn if off if ordering non-data frame input as long as
  // locations haven't been requested by the user.
  // It is more efficient to ignore it when possible.
  bool force_groups = group_sizes;
  bool ignore_groups = force_groups ? false : (is_data_frame(proxy) ? false : true);

  // Construct the two sets of group info needed for tracking groups.
  // We switch between them after each data frame column is processed.
  struct group_info* p_group_info0 = new_group_info();
  PROTECT_GROUP_INFO(p_group_info0, &n_prot);

  struct group_info* p_group_info1 = new_group_info();
  PROTECT_GROUP_INFO(p_group_info1, &n_prot);

  struct group_infos* p_group_infos = new_group_infos(
    p_group_info0,
    p_group_info1,
    size,
    force_groups,
    ignore_groups
  );
  PROTECT_GROUP_INFOS(p_group_infos, &n_prot);

  struct order* p_order = new_order(size);
  PROTECT_ORDER(p_order, &n_prot);

  vec_order_switch(
    proxy,
    decreasing,
    na_last,
    nan_distinct,
    size,
    type,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );

  SEXP out = PROTECT_N(r_alloc_list(3), &n_prot);
  r_list_poke(out, 0, p_order->data);

  if (group_sizes) {
    struct group_info* p_group_info = groups_current(p_group_infos);
    SEXP sizes = p_group_info->data;
    sizes = r_int_resize(sizes, p_group_info->n_groups);
    r_list_poke(out, 1, sizes);
    r_list_poke(out, 2, r_int((int) p_group_info->max_group_size));
  }

  UNPROTECT(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:306

vec_parallel C signature

[any_sexp, c(0..2), c_int_na, *struct vctrs_arg, struct r_lazy, c_bool] --> any_sexp
untypeable application
error detail
function: ([LGL] --> *c_lgl) & ([^LGL1] --> *c_bool)
argument: [any_sexp]
timing: 1.53 s
source
r_obj* vec_parallel(
  r_obj* xs,
  enum vec_parallel_missing missing,
  r_ssize size,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call,
  enum vec_parallel_variant parallel
) {
  // Input must be a list
  obj_check_list(xs, p_xs_arg, error_call);

  // Every element of that list must be a bare logical vector
  list_check_all_condition_indices(xs, p_xs_arg, error_call);

  // Every element of that list must be the same size
  size = compute_size(size, xs);
  list_check_all_size(xs, size, VCTRS_ALLOW_NULL_no, p_xs_arg, error_call);

  r_obj* out = KEEP(r_alloc_logical(size));
  int* v_out = r_lgl_begin(out);

  const r_ssize xs_size = r_length(xs);
  r_obj* const* v_xs = r_list_cbegin(xs);

  if (xs_size == 0) {
    // Zero input case is special, fill with values that match `any()` and `all()`
    switch (parallel) {
      case VEC_PARALLEL_VARIANT_all: r_p_lgl_fill(v_out, 1, size); break;
      case VEC_PARALLEL_VARIANT_any: r_p_lgl_fill(v_out, 0, size); break;
      default: r_stop_unreachable();
    }
  } else {
    // Initialize output with first input
    r_obj* x = v_xs[0];
    const int* v_x = r_lgl_begin(x);
    vec_parallel_init(v_x, missing, size, v_out);

    // Combine with remaining inputs
    for (r_ssize i = 1; i < xs_size; ++i) {
      r_obj* x = v_xs[i];
      const int* v_x = r_lgl_begin(x);

      switch (parallel) {
        case VEC_PARALLEL_VARIANT_all: vec_pall_fill(v_x, missing, size, v_out); break;
        case VEC_PARALLEL_VARIANT_any: vec_pany_fill(v_x, missing, size, v_out); break;
        default: r_stop_unreachable();
      }
    }
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/parallel.c:57

vec_proxy_assign_names C signature

[any_sexp, any_sexp, any_sexp, c(0..2), c_bool, c_bool] --> any_sexp
untypeable application
error detail
function: ([c_int] --> CHR) & ([c_true] --> CHR1)
argument: [c_int_na]
timing: 0.088 s
source
r_obj* vec_proxy_assign_names(
  r_obj* proxy,
  r_obj* index,
  r_obj* value_proxy,
  enum vctrs_ownership ownership,
  enum assignment_slice_value slice_value,
  enum vctrs_index_style index_style
) {
  // Both of these inputs are assumed to be proxied already
  r_obj* proxy_nms = KEEP(vec_proxy_names(proxy));
  r_obj* value_nms = KEEP(vec_proxy_names(value_proxy));

  if (proxy_nms == r_null && value_nms == r_null) {
    // No names at all to worry about
    FREE(2);
    return proxy;
  }

  if (value_nms == r_null) {
    // If there are `proxy_nms` but no `value_nms`, we need clear any names at
    // this `index`. This also clears when we freshly create `proxy_nms` which
    // is a no-op, but that's okay, it keeps the logic simple.
    value_nms = r_chrs.empty_string;
  }

  if (proxy_nms == r_null) {
    proxy_nms = KEEP(r_alloc_character(vec_size(proxy)));
  } else {
    proxy_nms = KEEP(vec_clone_referenced(proxy_nms, ownership));
  }
  proxy_nms = KEEP(chr_assign(
    proxy_nms,
    index,
    value_nms,
    ownership,
    slice_value,
    index_style
  ));

  proxy = KEEP(vec_clone_referenced(proxy, ownership));
  proxy = vec_proxy_set_names(proxy, proxy_nms, ownership);

  FREE(5);
  return proxy;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:864

vec_ptype C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> any_sexp
unbound variable
error detail
name: vec_ptype_slice
timing: 0.078 s
source
r_obj* vec_ptype(r_obj* x, struct vctrs_arg* x_arg, struct r_lazy call) {
  switch (vec_typeof(x)) {
  case VCTRS_TYPE_null:        return r_null;
  case VCTRS_TYPE_unspecified: return vctrs_shared_empty_uns;
  case VCTRS_TYPE_logical:     return vec_ptype_slice(x, r_globals.empty_lgl);
  case VCTRS_TYPE_integer:     return vec_ptype_slice(x, r_globals.empty_int);
  case VCTRS_TYPE_double:      return vec_ptype_slice(x, r_globals.empty_dbl);
  case VCTRS_TYPE_complex:     return vec_ptype_slice(x, r_globals.empty_cpl);
  case VCTRS_TYPE_character:   return vec_ptype_slice(x, r_globals.empty_chr);
  case VCTRS_TYPE_raw:         return vec_ptype_slice(x, r_globals.empty_raw);
  case VCTRS_TYPE_list:        return vec_ptype_slice(x, r_globals.empty_list);
  case VCTRS_TYPE_dataframe:   return df_ptype(x, true);
  case VCTRS_TYPE_s3:          return s3_ptype(x, x_arg, call);
  case VCTRS_TYPE_scalar:      stop_scalar_type(x, x_arg, call);
  }
  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:13

vec_ptype_final C signature

[any_sexp, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I51947] --> null & 'I51947
argument: [any_sexp]
timing: 0.019 s
source
r_obj* vec_ptype_final(r_obj* x, struct vctrs_arg* x_arg, struct r_lazy call) {
  r_obj* out = KEEP(vec_ptype(x, x_arg, call));
  out = vec_ptype_finalise(out);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:113

vec_ptype2_default_full C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, c_int_na] --> any_sexp
unbound variable
error detail
name: vctrs_eval_mask7
timing: 0.189 s
source
r_obj* vec_ptype2_default_full(r_obj* x,
                               r_obj* y,
                               struct vctrs_arg* x_arg,
                               struct vctrs_arg* y_arg,
                               struct r_lazy call,
                               enum s3_fallback s3_fallback,
                               bool from_dispatch) {
  r_obj* ffi_s3_fallback = KEEP(r_int(s3_fallback));
  r_obj* ffi_x_arg = KEEP(vctrs_arg(x_arg));
  r_obj* ffi_y_arg = KEEP(vctrs_arg(y_arg));
  r_obj* ffi_call = KEEP(r_lazy_eval(call));

  r_obj* out = vctrs_eval_mask7(syms_vec_ptype2_default,
                                syms_x, x,
                                syms_y, y,
                                syms_x_arg, ffi_x_arg,
                                syms_y_arg, ffi_y_arg,
                                syms_call, ffi_call,
                                syms_from_dispatch, r_lgl(from_dispatch),
                                syms_s3_fallback, ffi_s3_fallback);

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:75

vec_ptype2_dispatch_native C signature

[any_sexp, any_sexp, c(0..10) | c(255), c(0..10) | c(255), *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool, *c_int_na] --> any_sexp
unbound variable
error detail
name: date_datetime_ptype2
timing: 0.239 s
source
r_obj* vec_ptype2_dispatch_native(
  r_obj* x,
  r_obj* y,
  enum vctrs_type x_type,
  enum vctrs_type y_type,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback,
  int* left
) {
  enum vctrs_type2_s3 type2_s3 = vec_typeof2_s3_impl(x, y, x_type, y_type, left);

  switch (type2_s3) {
  case VCTRS_TYPE2_S3_character_bare_factor:
  case VCTRS_TYPE2_S3_character_bare_ordered:
    return r_globals.empty_chr;

  case VCTRS_TYPE2_S3_bare_factor_bare_factor:
    return fct_ptype2(
      x,
      y,
      p_x_arg,
      p_y_arg
    );

  case VCTRS_TYPE2_S3_bare_ordered_bare_ordered:
    return ord_ptype2(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );

  case VCTRS_TYPE2_S3_bare_date_bare_date:
    return vctrs_shared_empty_date;

  case VCTRS_TYPE2_S3_bare_date_bare_posixct:
  case VCTRS_TYPE2_S3_bare_date_bare_posixlt:
    return date_datetime_ptype2(x, y);

  case VCTRS_TYPE2_S3_bare_posixct_bare_posixct:
  case VCTRS_TYPE2_S3_bare_posixct_bare_posixlt:
  case VCTRS_TYPE2_S3_bare_posixlt_bare_posixlt:
    return datetime_datetime_ptype2(x, y);

  case VCTRS_TYPE2_S3_dataframe_bare_tibble:
  case VCTRS_TYPE2_S3_bare_tibble_bare_tibble:
    return tib_ptype2(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback
    );

  default:
    return r_null;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:6

vec_ptype2_dispatch_s3 C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy, c_bool] --> any_sexp
untypeable application
error detail
function: [sym] --> c_string
argument: [any_sexp]
timing: 0.095 s
source
r_obj* vec_ptype2_dispatch_s3(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg,
  struct r_lazy call,
  enum s3_fallback s3_fallback
) {
  x = KEEP(vec_ptype(x, p_x_arg, call));
  y = KEEP(vec_ptype(y, p_y_arg, call));

  r_obj* method_sym = r_null;
  r_obj* method = s3_find_method_xy("vec_ptype2", x, y, vctrs_method_table, &method_sym);

  // Compatibility with legacy double dispatch mechanism
  if (method == r_null) {
    r_obj* x_method_sym = r_null;
    r_obj* x_method = KEEP(s3_find_method2(
      "vec_ptype2",
      x,
      vctrs_method_table,
      &x_method_sym
    ));

    if (x_method != r_null) {
      // Only `x_method`s contained within a package will
      // have an S3 methods table to look in
      r_obj* x_table = s3_get_table(r_fn_env(x_method));

      if (x_table != r_null) {
        const char* x_method_str = r_sym_c_string(x_method_sym);

        method = s3_find_method2(
          x_method_str,
          y,
          x_table,
          &method_sym
        );
      }
    }

    FREE(1);
  }

  KEEP(method);

  if (method == r_null) {
    r_obj* out = vec_ptype2_default_full(
      x,
      y,
      p_x_arg,
      p_y_arg,
      call,
      s3_fallback,
      true
    );
    FREE(3);
    return out;
  }

  r_obj* ffi_x_arg = KEEP(vctrs_arg(p_x_arg));
  r_obj* ffi_y_arg = KEEP(vctrs_arg(p_y_arg));

  r_obj* out = vec_invoke_coerce_method(
    method_sym,
    method,
    syms_x,
    x,
    syms_y,
    y,
    syms_x_arg,
    ffi_x_arg,
    syms_y_arg,
    ffi_y_arg,
    call,
    s3_fallback
  );

  FREE(5);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype2-dispatch.c:109

vec_rank C signature

[any_sexp, c(0..3), c_bool, any_sexp, any_sexp, c_int_na, any_sexp] --> any_sexp
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I98676, c_false, *struct vctrs_arg, struct r_lazy]
timing: 0.091 s
source
r_obj* vec_rank(r_obj* x,
                enum ties ties_type,
                enum incomplete incomplete_type,
                r_obj* direction,
                r_obj* na_value,
                bool nan_distinct,
                r_obj* chr_proxy_collate) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, vec_args.x, r_lazy_null);

  r_ssize size = vec_size(x);

  r_keep_loc pi_x;
  KEEP_HERE(x, &pi_x);

  r_obj* complete = r_null;
  r_keep_loc pi_complete;
  KEEP_HERE(complete, &pi_complete);
  int* v_complete = NULL;

  r_ssize rank_size = size;
  bool rank_incomplete_with_na = (incomplete_type == INCOMPLETE_na);

  if (rank_incomplete_with_na) {
    // Slice out complete values of `x` to rank.
    // Retain the logical vector for constructing `out`.
    complete = vec_detect_complete(x);
    KEEP_AT(complete, pi_complete);
    v_complete = r_lgl_begin(complete);

    bool all_complete = r_lgl_all(complete);

    if (all_complete) {
      // No incomplete values to rank
      rank_incomplete_with_na = false;
    } else {
      x = vec_slice(x, complete);
      KEEP_AT(x, pi_x);

      rank_size = vec_size(x);
    }
  }

  r_obj* rank = KEEP(r_alloc_integer(rank_size));
  int* v_rank = r_int_begin(rank);

  r_obj* info = KEEP(vec_order_info(x, direction, na_value, nan_distinct, chr_proxy_collate));

  r_obj* order = r_list_get(info, 0);
  const int* v_order = r_int_cbegin(order);

  r_obj* group_sizes = r_list_get(info, 1);
  const int* v_group_sizes = r_int_cbegin(group_sizes);
  r_ssize n_groups = r_length(group_sizes);

  switch (ties_type) {
  case TIES_min: vec_rank_min(v_order, v_group_sizes, n_groups, v_rank); break;
  case TIES_max: vec_rank_max(v_order, v_group_sizes, n_groups, v_rank); break;
  case TIES_sequential: vec_rank_sequential(v_order, v_group_sizes, n_groups, v_rank); break;
  case TIES_dense: vec_rank_dense(v_order, v_group_sizes, n_groups, v_rank); break;
  }

  r_obj* out = r_null;

  if (rank_incomplete_with_na) {
    out = KEEP(r_alloc_integer(size));
    int* v_out = r_int_begin(out);
    r_ssize j = 0;

    for (r_ssize i = 0; i < size; ++i) {
      v_out[i] = v_complete[i] ? v_rank[j++] : r_globals.na_int;
    }

    FREE(1);
  } else {
    out = rank;
  }

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rank.c:41

vec_raw_size C signature

[any_sexp] --> c_int_na
unbound variable
error detail
name: r_dim
timing: 0.017 s
source
r_ssize vec_raw_size(r_obj* x) {
  r_obj* dimensions = r_dim(x);

  if (dimensions == r_null || r_length(dimensions) == 0) {
    return r_length(x);
  }

  if (r_typeof(dimensions) != R_TYPE_integer) {
    r_stop_internal("Corrupt vector, `dim` attribute is not an integer vector.");
  }

  return r_int_get(dimensions, 0);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:53

vec_recode_values C signature

[any_sexp, any_sexp, any_sexp, any_sexp, c_bool, c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, any_sexp, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null, c_int_na, c_bool, c_null, struct r_lazy] | [<> | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp, c_int_na, c_false, c_null & 'I69248, struct r_lazy & 'I69251]
timing: 16.58 s
source
r_obj* vec_recode_values(
  r_obj* x,
  r_obj* from,
  r_obj* to,
  r_obj* default_,
  enum list_combine_unmatched unmatched,
  bool from_as_list_of_vectors,
  bool to_as_list_of_vectors,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_from_arg,
  struct vctrs_arg* p_to_arg,
  struct vctrs_arg* p_default_arg,
  r_obj* ptype,
  struct r_lazy error_call
) {
  int n_prot = 0;

  const bool has_default = default_ != r_null;

  // Vector checks ----

  obj_check_vector(x, VCTRS_ALLOW_NULL_no, p_x_arg, error_call);

  if (from_as_list_of_vectors) {
    obj_check_list(from, p_from_arg, error_call);
    list_check_all_vectors(from, VCTRS_ALLOW_NULL_no, p_from_arg, error_call);
  } else {
    obj_check_vector(from, VCTRS_ALLOW_NULL_no, p_from_arg, error_call);
  }

  if (to_as_list_of_vectors) {
    obj_check_list(to, p_to_arg, error_call);
    list_check_all_vectors(to, VCTRS_ALLOW_NULL_no, p_to_arg, error_call);
  } else {
    obj_check_vector(to, VCTRS_ALLOW_NULL_no, p_to_arg, error_call);
  }

  if (has_default) {
    obj_check_vector(default_, VCTRS_ALLOW_NULL_no, p_default_arg, error_call);
  }

  // Type checks ----

  // Finalize `ptype` up front
  // Remember that `default` gets a chance to participate in `ptype` determination
  ptype = KEEP_N(
    ptype_finalize(
      ptype,
      to,
      default_,
      to_as_list_of_vectors,
      p_to_arg,
      p_default_arg,
      error_call
    ),
    &n_prot
  );

  // Cast `to` to the determined common type
  // Errors can happen here if user supplied `ptype`, short circuiting common type checks
  if (to_as_list_of_vectors) {
    to = KEEP_N(vec_cast_common(to, ptype, p_to_arg, error_call), &n_prot);
  } else {
    to = KEEP_N(vec_cast(to, ptype, p_to_arg, vec_args.empty, error_call), &n_prot);
  }

  // Cast `default` to determined common type
  if (has_default) {
    default_ = KEEP_N(
      vec_cast(
        default_,
        ptype,
        p_default_arg,
        vec_args.empty,
        error_call
      ),
      &n_prot
    );
  }

  // Cast `from` to the type of `x`
  if (from_as_list_of_vectors) {
    // TODO: `vec_cast_common()` should take `to_arg` so we can use `p_x_arg` here
    from = KEEP_N(vec_cast_common(from, x, p_from_arg, error_call), &n_prot);
  } else {
    from = KEEP_N(vec_cast(from, x, p_from_arg, p_x_arg, error_call), &n_prot);
  }

  // Size checks ----

  const r_ssize x_size = vec_size(x);
  r_ssize from_size = vec_size(from);
  const r_ssize to_size = vec_size(to);

  // Check size of `to` as recyclable against the size of `from`,
  // regardless of `from_as_list_of_vectors` and `to_as_list_of_vectors`
  vec_check_recyclable(to, from_size, VCTRS_ALLOW_NULL_no, p_to_arg, error_call);

  if (to_as_list_of_vectors) {
    // Each element of `to` should be recyclable against `x`.
    list_check_all_recyclable(to, x_size, VCTRS_ALLOW_NULL_no, p_to_arg, error_call);
  }

  if (has_default) {
    // `default` should be recycled against `x`.
    vec_check_recyclable(default_, x_size, VCTRS_ALLOW_NULL_no, p_default_arg, error_call);
  }

  // Implementation ----

  // At this point we don't expect any errors, all vector, type, and size
  // checks have been done. So `p_*_arg` and `error_call` are not used.

  // Try `to_as_list_of_vectors` optimization
  //
  // All size 1 `to` values is a common `dplyr::recode_values()` case
  if (to_as_list_of_vectors) {
    if (list_all_size(to, 1, VCTRS_ALLOW_NULL_no, p_to_arg, error_call)) {
      // Optimize `to` to a flat vector and drop any outer names on the list, we've
      // already done casting checks and we don't want them on the flat form. We
      // don't expect any errors here.
      to_as_list_of_vectors = false;

      to = KEEP_N(
        vec_c(
          to,
          ptype,
          name_spec_inner,
          p_no_repair_opts,
          vec_args.empty,
          r_lazy_null
        ),
        &n_prot
      );
    }
  }

  // Flatten `from` to a vector if it is a list
  r_obj* from_flat;

  if (from_as_list_of_vectors) {
    from_flat = KEEP_N(
      vec_c(
        from,
        x,
        name_spec_inner,
        p_no_repair_opts,
        vec_args.empty,
        r_lazy_null
      ),
      &n_prot
    );
  } else {
    from_flat = from;
  }

  // Compute `xs` and `indices` for `list_combine()`
  r_obj* xs;
  r_obj* indices;

  if (to_as_list_of_vectors) {
    if (to_size == 1) {
      xs = to;
      indices = KEEP_N(build_indices_for_single_to(x, from_flat), &n_prot);
    } else {
      xs = to;

      r_obj* from_flat_map = r_null;
      if (from_as_list_of_vectors && from_size != vec_size(from_flat)) {
        // `from` was flattened and that changed its size, we need a "map" back
        // into the unflattened form to place indices correctly
        from_flat_map = KEEP_N(build_from_flat_map(from, from_size), &n_prot);
      }

      indices = KEEP_N(
        build_indices_for_to_as_list_of_vectors(
          x,
          from_flat,
          from_flat_map,
          x_size,
          from_size
        ),
        &n_prot
      );
    }
  } else {
    if (to_size == 1) {
      xs = KEEP_N(r_list(to), &n_prot);
      indices = KEEP_N(build_indices_for_single_to(x, from_flat), &n_prot);
    } else {
      if (from_as_list_of_vectors && from_size != vec_size(from_flat)) {
        // `from` was flattened and that changed its size, we need to
        // repeat `to` elements to match the new flattened size
        to = KEEP_N(build_repeated_to(to, from), &n_prot);
      }

      r_obj* result = KEEP_N(
        build_xs_and_indices_for_to_as_vector(
          x,
          from_flat,
          to,
          x_size
        ),
        &n_prot
      );

      xs = r_list_get(result, 0);
      indices = r_list_get(result, 1);
    }
  }

  // The `indices` are actually built in such a way that `"first"` is
  // the effective behavior here, so it doesn't actually matter what
  // we provide. Regardless, we want `case_when()` like behavior.
  const enum list_combine_multiple multiple = LIST_COMBINE_MULTIPLE_last;

  // - With `to_as_list_of_vectors`, each `to` element was size 1 or `x_size`
  //   so can use `ASSIGNMENT_SLICE_VALUE_yes`.
  // - With `!to_as_list_of_vectors`, `to` was size 1 or `from_size` but has
  //   already been resliced to the `indices` size.
  enum assignment_slice_value slice_xs = to_as_list_of_vectors ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  r_obj* out = list_combine(
    xs,
    indices,
    x_size,
    default_,
    unmatched,
    multiple,
    slice_xs,
    ptype,
    name_spec_inner,
    p_no_repair_opts,
    vec_args.empty,
    vec_args.empty,
    vec_args.empty,
    error_call
  );

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:7

vec_recycle_xs_fallback C signature

[any_sexp, any_sexp, *struct vctrs_arg, struct r_lazy] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.028 s
source
r_obj* vec_recycle_xs_fallback(
  r_obj* xs,
  r_obj* indices,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  r_ssize xs_size = vec_size(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  xs = KEEP(r_clone_referenced(xs));

  r_ssize i = 0;

  struct vctrs_arg* p_x_arg = new_subscript_arg(
    p_xs_arg,
    xs_names,
    xs_size,
    &i
  );
  KEEP(p_x_arg->shelter);

  r_obj* const* v_xs = r_list_cbegin(xs);
  r_obj* const* v_indices = r_list_cbegin(indices);

  for (; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    r_ssize index_size = r_length(v_indices[i]);
    r_list_poke(xs, i, vec_recycle_fallback(x, index_size, p_x_arg, error_call));
  }

  FREE(3);
  return xs;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1413

vec_rep_each C signature

[any_sexp, any_sexp, struct r_lazy, *struct vctrs_arg, *struct vctrs_arg] --> any_sexp
untypeable application
error detail
function: ([INT, c_int_na] --> c_int_na) & ([^INT1, c_int_na] --> c_int)
argument: [any_sexp, c_false]
timing: 0.050 s
source
r_obj* vec_rep_each(r_obj* x,
                    r_obj* times,
                    struct r_lazy error_call,
                    struct vctrs_arg* p_x_arg,
                    struct vctrs_arg* p_times_arg) {
  times = KEEP(vec_cast(times,
                        r_globals.empty_int,
                        p_times_arg,
                        vec_args.empty,
                        error_call));

  const r_ssize times_size = vec_size(times);

  r_obj* out;

  if (times_size == 1) {
    const int times_ = r_int_get(times, 0);

    if (times_ == 1) {
      out = x;
    } else if (times_ == 0) {
      out = vec_slice_unsafe(x, r_globals.empty_int);
    } else {
      out = vec_rep_each_uniform(x, times_, error_call, p_times_arg);
    }
  } else {
    out = vec_rep_each_impl(x, times, times_size, error_call, p_times_arg);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:76

vec_rep_each_impl C signature

[any_sexp, any_sexp, c_int_na, struct r_lazy, *struct vctrs_arg] --> any_sexp
untypeable application
error detail
function: ([c_int] --> INT) & ([c_true] --> INT1)
argument: [c_int_na]
timing: 0.517 s
source
static r_obj* vec_rep_each_impl(r_obj* x,
                                r_obj* times,
                                const r_ssize times_size,
                                struct r_lazy error_call,
                                struct vctrs_arg* p_times_arg) {
  const r_ssize x_size = vec_size(x);

  if (x_size != times_size) {
    stop_recycle_incompatible_size(times_size,
                                   x_size,
                                   p_times_arg,
                                   error_call);
  }

  const int* v_times = r_int_cbegin(times);

  r_ssize size = 0;
  for (r_ssize i = 0; i < times_size; ++i) {
    const int elt_times = v_times[i];

    check_rep_each_times(elt_times, i + 1, error_call, p_times_arg);

    const r_ssize elt_times_ = (r_ssize) elt_times;

    if (plus_would_overflow(size, elt_times_)) {
      stop_rep_size_oob(error_call);
    }

    size += elt_times_;
  }

  r_obj* subscript = KEEP(r_alloc_integer(size));
  int* v_subscript = r_int_begin(subscript);

  r_ssize k = 0;

  for (r_ssize i = 1; i <= x_size; ++i) {
    const r_ssize elt_times = (r_ssize) v_times[i - 1];

    for (r_ssize j = 0; j < elt_times; ++j, ++k) {
      v_subscript[k] = i;
    }
  }

  r_obj* out = vec_slice_unsafe(x, subscript);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:157

vec_replace_values C signature

[any_sexp, any_sexp, any_sexp, c_int_na, c_int_na, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c(1..2)] --> any_sexp
argument: [any_sexp, any_sexp, c(2)]
timing: 1.19 s
source
r_obj* vec_replace_values(
  r_obj* x,
  r_obj* from,
  r_obj* to,
  bool from_as_list_of_vectors,
  bool to_as_list_of_vectors,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_from_arg,
  struct vctrs_arg* p_to_arg,
  struct r_lazy error_call
) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, p_x_arg, error_call);

  r_obj* default_ = x;
  struct vctrs_arg* p_default_arg = p_x_arg;

  const enum list_combine_unmatched unmatched = LIST_COMBINE_UNMATCHED_default;
  r_obj* ptype = KEEP(vec_ptype_final(x, p_x_arg, error_call));

  r_obj* out = KEEP(vec_recode_values(
    x,
    from,
    to,
    default_,
    unmatched,
    from_as_list_of_vectors,
    to_as_list_of_vectors,
    p_x_arg,
    p_from_arg,
    p_to_arg,
    p_default_arg,
    ptype,
    error_call
  ));

  // `vec_recode_values()` creates a new vector and names come from any of `to`
  // or `default`, but `vec_replace_values()` updates an existing vector and
  // should act like `[<-` and `base::replace()`, retaining existing names.
  // `out` is totally fresh, so we can claim deep ownership over it (though we
  // only require shallow ownership to set names).
  r_obj* names = KEEP(vec_names(x));
  out = vec_set_names(out, names, VCTRS_OWNERSHIP_deep);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/recode.c:252

vec_replace_when C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c(1..2)] --> any_sexp
argument: [any_sexp, any_sexp, c(2)]
timing: 0.107 s
source
r_obj* vec_replace_when(
  r_obj* x,
  r_obj* conditions,
  r_obj* values,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_conditions_arg,
  struct vctrs_arg* p_values_arg,
  struct r_lazy error_call
) {
  obj_check_vector(x, VCTRS_ALLOW_NULL_no, p_x_arg, error_call);

  r_obj* default_ = x;
  struct vctrs_arg* p_default_arg = p_x_arg;

  const enum list_combine_unmatched unmatched = LIST_COMBINE_UNMATCHED_default;

  const r_ssize size = vec_size(x);
  r_obj* ptype = KEEP(vec_ptype_final(x, p_x_arg, error_call));

  r_obj* out = KEEP(vec_case_when(
    conditions,
    values,
    default_,
    unmatched,
    ptype,
    size,
    p_conditions_arg,
    p_values_arg,
    p_default_arg,
    error_call
  ));

  // `vec_case_when()` creates a new vector and names come from any of `values`
  // or `default`, but `vec_replace_when()` modifies an existing vector and
  // should act like `[<-` and `base::replace()`, retaining existing names.
  // `out` is totally fresh, so we can claim deep ownership over it (though we
  // only require shallow ownership to set names).
  r_obj* names = KEEP(vec_names(x));
  out = vec_set_names(out, names, VCTRS_OWNERSHIP_deep);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/case-when.c:51

vec_restore_default C signature

[any_sexp, any_sexp, c(0..2)] --> any_sexp
untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: ['I20089, [any_sexp, any_sexp, c_ptr] -> c_null, *struct vec_restore_collect_data]
timing: 0.181 s
source
r_obj* vec_restore_default(r_obj* x, r_obj* to, enum vctrs_ownership ownership) {
  if (x == to) {
    // Rare but useful pointer comparison
    return x;
  }

  if (!r_attrib_has_any(x) && !r_attrib_has_any(to)) {
    // No one has attributes (nothing to clear, nothing to add).
    // Don't need to worry about OBJECT/S4 bit, you'd always have at least one attribute.
    return x;
  }

  // Note: Could this be `R_tryWrap()` one day? For backwards compatibility with
  // R < 4.6, maybe we would have our own ALTREP wrapper class implementation?
  // https://github.com/wch/r-source/commit/84293ec070c219b9ad2df44ae84d3f0f58d5ce7c
  x = KEEP(vec_clone_referenced(x, ownership));

  // In one pass, collect attributes we want to retain from `x`
  struct vec_restore_collect_data data = {
    .names = r_null,
    .dim = r_null,
    .dim_names = r_null,
    .row_names = r_null
  };
  r_attrib_map(x, vec_restore_collect_cb, &data);
  r_obj* names = KEEP(data.names);
  r_obj* dim = KEEP(data.dim);
  r_obj* dim_names = KEEP(data.dim_names);
  r_obj* row_names = KEEP(data.row_names);

  if (dim == r_null) {
    // This is a vector, clear any `dim` or `dim_names`
    dim_names = r_null;
  } else {
    // This is an array, clear any `names` or `row_names`
    names = r_null;
    row_names = r_null;
  }

  // We don't actually retain row names if `to` isn't a data frame
  if (row_names != r_null && !is_data_frame(to)) {
    row_names = r_null;
  }

  // Copy over all attributes from `to`
  //
  // Uses `SHALLOW_DUPLICATE_ATTRIB()`. Notably:
  // - Shallow clones attribute pairlist from `to`
  // - `SET_ATTRIB()` for efficiency and avoids
  //   `Rf_getAttrib()`/`Rf_setAttrib()` funny business
  // - `SET_OBJECT()`
  // - `SET_S4_OBJECT()` / `UNSET_S4_OBJECT()`
  r_attrib_clone_from(x, to);

  // Retain specific attributes from `x`
  //
  // We must set all 4! If `to` had `names` but `x` does not, then `names` will
  // be `r_null` and will clear the `names` brought over by
  // `r_attrib_clone_from()`.
  r_attrib_poke(x, r_syms.names, names);
  r_attrib_poke(x, r_syms.dim, dim);
  r_attrib_poke(x, r_syms.dim_names, dim_names);
  r_attrib_poke(x, r_syms.row_names, row_names);

  FREE(5);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:109

vec_set_difference C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I101313] --> null & 'I101313
argument: [any_sexp]
timing: 0.145 s
source
r_obj* vec_set_difference(r_obj* x,
                          r_obj* y,
                          r_obj* ptype,
                          struct vctrs_arg* x_arg,
                          struct vctrs_arg* y_arg,
                          struct r_lazy call) {
  int n_prot = 0;

  if (ptype == r_null) {
    int _;

    ptype = vec_ptype2(
      x,
      y,
      x_arg,
      y_arg,
      call,
      S3_FALLBACK_false,
      &_
    );
    KEEP_N(ptype, &n_prot);

    ptype = vec_ptype_finalise(ptype);
    KEEP_N(ptype, &n_prot);
  }

  x = vec_cast_params(
    x,
    ptype,
    x_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(x, &n_prot);

  y = vec_cast_params(
    y,
    ptype,
    y_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(y, &n_prot);

  r_obj* x_proxy = KEEP_N(vec_proxy_equal(x), &n_prot);
  x_proxy = KEEP_N(obj_encode_utf8(x_proxy), &n_prot);

  r_obj* y_proxy = KEEP_N(vec_proxy_equal(y), &n_prot);
  y_proxy = KEEP_N(obj_encode_utf8(y_proxy), &n_prot);

  const r_ssize x_size = vec_size(x_proxy);
  const r_ssize y_size = vec_size(y_proxy);

  struct dictionary* x_dict = new_dictionary(x_proxy);
  PROTECT_DICT(x_dict, &n_prot);

  struct dictionary* y_dict = new_dictionary_partial(y_proxy);
  PROTECT_DICT(y_dict, &n_prot);

  r_obj* marked_shelter = KEEP_N(r_alloc_raw(x_size * sizeof(bool)), &n_prot);
  bool* v_marked = (bool*) r_raw_begin(marked_shelter);

  vec_set_difference_loop(x_dict, y_dict, x_size, y_size, v_marked);

  r_ssize n_marked = 0;
  for (r_ssize i = 0; i < x_size; ++i) {
    n_marked += v_marked[i];
  }

  r_obj* loc = KEEP_N(r_alloc_integer(n_marked), &n_prot);
  int* v_loc = r_int_begin(loc);
  r_ssize j = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    if (v_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  r_obj* out = vec_slice_unsafe(x, loc);

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:181

vec_set_intersect C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I100182] --> null & 'I100182
argument: [any_sexp]
timing: 0.145 s
source
r_obj* vec_set_intersect(r_obj* x,
                         r_obj* y,
                         r_obj* ptype,
                         struct vctrs_arg* x_arg,
                         struct vctrs_arg* y_arg,
                         struct r_lazy call) {
  int n_prot = 0;

  if (ptype == r_null) {
    int _;

    ptype = vec_ptype2(
      x,
      y,
      x_arg,
      y_arg,
      call,
      S3_FALLBACK_false,
      &_
    );
    KEEP_N(ptype, &n_prot);

    ptype = vec_ptype_finalise(ptype);
    KEEP_N(ptype, &n_prot);
  }

  x = vec_cast_params(
    x,
    ptype,
    x_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(x, &n_prot);

  y = vec_cast_params(
    y,
    ptype,
    y_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(y, &n_prot);

  r_obj* x_proxy = KEEP_N(vec_proxy_equal(x), &n_prot);
  x_proxy = KEEP_N(obj_encode_utf8(x_proxy), &n_prot);

  r_obj* y_proxy = KEEP_N(vec_proxy_equal(y), &n_prot);
  y_proxy = KEEP_N(obj_encode_utf8(y_proxy), &n_prot);

  const r_ssize x_size = vec_size(x_proxy);
  const r_ssize y_size = vec_size(y_proxy);

  struct dictionary* x_dict = new_dictionary(x_proxy);
  PROTECT_DICT(x_dict, &n_prot);

  struct dictionary* y_dict = new_dictionary_partial(y_proxy);
  PROTECT_DICT(y_dict, &n_prot);

  r_obj* marked_shelter = KEEP_N(r_alloc_raw(x_size * sizeof(bool)), &n_prot);
  bool* v_marked = (bool*) r_raw_begin(marked_shelter);
  r_memset(v_marked, 0, x_size * sizeof(bool));

  vec_set_intersect_loop(x_dict, y_dict, x_size, y_size, v_marked);

  r_ssize n_marked = 0;
  for (r_ssize i = 0; i < x_size; ++i) {
    n_marked += v_marked[i];
  }

  r_obj* loc = KEEP_N(r_alloc_integer(n_marked), &n_prot);
  int* v_loc = r_int_begin(loc);
  r_ssize j = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    if (v_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  r_obj* out = vec_slice_unsafe(x, loc);

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:27

vec_set_rownames C signature

[any_sexp, any_sexp, c_int_na, c(0..2)] --> any_sexp
unbound variable
error detail
name: r_attrib_get
timing: 0.198 s
source
r_obj* vec_set_rownames(r_obj* x, r_obj* names, bool proxy, const enum vctrs_ownership ownership) {
  if (!proxy && r_is_object(x)) {
    return set_rownames_dispatch(x, names);
  }

  r_obj* dim_names = r_attrib_get(x, r_syms.dim_names);

  // Early exit when no new row names and no existing row names
  if (names == r_null) {
    if (dim_names == r_null || r_list_get(dim_names, 0) == r_null) {
      return x;
    }
  }

  // Okay, now protect `dim_names`
  KEEP(dim_names);

  x = KEEP(vec_clone_referenced(x, ownership));

  if (dim_names == r_null) {
    dim_names = KEEP(r_alloc_list(vec_dim_n(x)));
  } else {
    // Also clone attribute
    dim_names = KEEP(r_clone(dim_names));
  }

  r_list_poke(dim_names, 0, names);
  r_attrib_poke(x, r_syms.dim_names, dim_names);

  FREE(3);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:772

vec_set_symmetric_difference C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I104577] --> null & 'I104577
argument: [any_sexp]
timing: 0.154 s
source
r_obj* vec_set_symmetric_difference(r_obj* x,
                                    r_obj* y,
                                    r_obj* ptype,
                                    struct vctrs_arg* x_arg,
                                    struct vctrs_arg* y_arg,
                                    struct r_lazy call) {
  int n_prot = 0;

  if (ptype == r_null) {
    int _;

    ptype = vec_ptype2(
      x,
      y,
      x_arg,
      y_arg,
      call,
      S3_FALLBACK_false,
      &_
    );
    KEEP_N(ptype, &n_prot);

    ptype = vec_ptype_finalise(ptype);
    KEEP_N(ptype, &n_prot);
  }

  x = vec_cast_params(
    x,
    ptype,
    x_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(x, &n_prot);

  y = vec_cast_params(
    y,
    ptype,
    y_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(y, &n_prot);

  r_obj* x_proxy = KEEP_N(vec_proxy_equal(x), &n_prot);
  x_proxy = KEEP_N(obj_encode_utf8(x_proxy), &n_prot);

  r_obj* y_proxy = KEEP_N(vec_proxy_equal(y), &n_prot);
  y_proxy = KEEP_N(obj_encode_utf8(y_proxy), &n_prot);

  const r_ssize x_size = vec_size(x_proxy);
  const r_ssize y_size = vec_size(y_proxy);

  struct dictionary* x_dict = new_dictionary(x_proxy);
  PROTECT_DICT(x_dict, &n_prot);

  struct dictionary* y_dict = new_dictionary(y_proxy);
  PROTECT_DICT(y_dict, &n_prot);

  r_obj* x_marked_shelter = KEEP_N(r_alloc_raw(x_size * sizeof(bool)), &n_prot);
  bool* v_x_marked = (bool*) r_raw_begin(x_marked_shelter);

  r_obj* y_marked_shelter = KEEP_N(r_alloc_raw(y_size * sizeof(bool)), &n_prot);
  bool* v_y_marked = (bool*) r_raw_begin(y_marked_shelter);

  const struct r_ssize_pair n_marked = vec_set_symmetric_difference_loop(
    x_dict,
    y_dict,
    x_size,
    y_size,
    v_x_marked,
    v_y_marked
  );

  const r_ssize n_x_marked = n_marked.x;
  const r_ssize n_y_marked = n_marked.y;

  r_obj* loc = KEEP_N(r_alloc_integer(n_x_marked), &n_prot);
  int* v_loc = r_int_begin(loc);
  r_ssize j = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    if (v_x_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  // Slice out `x`, then reuse `loc` for slicing `y`
  x = KEEP_N(vec_slice_unsafe(x, loc), &n_prot);

  loc = KEEP_N(r_int_resize(loc, n_y_marked), &n_prot);
  v_loc = r_int_begin(loc);
  j = 0;

  for (r_ssize i = 0; i < y_size; ++i) {
    if (v_y_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  y = KEEP_N(vec_slice_unsafe(y, loc), &n_prot);

  const struct name_repair_opts name_repair_opts = {
    .type = NAME_REPAIR_none,
    .fn = r_null
  };

  r_obj* args = KEEP_N(r_alloc_list(2), &n_prot);
  r_list_poke(args, 0, x);
  r_list_poke(args, 1, y);

  r_obj* out = vec_c(
    args,
    ptype,
    r_null,
    &name_repair_opts,
    vec_args.empty,
    r_lazy_null
  );

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:588

vec_set_union C signature

[any_sexp, any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
untypeable application
error detail
function: [null & 'I103437] --> null & 'I103437
argument: [any_sexp]
timing: 0.149 s
source
r_obj* vec_set_union(r_obj* x,
                     r_obj* y,
                     r_obj* ptype,
                     struct vctrs_arg* x_arg,
                     struct vctrs_arg* y_arg,
                     struct r_lazy call) {
  int n_prot = 0;

  if (ptype == r_null) {
    int _;

    ptype = vec_ptype2(
      x,
      y,
      x_arg,
      y_arg,
      call,
      S3_FALLBACK_false,
      &_
    );
    KEEP_N(ptype, &n_prot);

    ptype = vec_ptype_finalise(ptype);
    KEEP_N(ptype, &n_prot);
  }

  x = vec_cast_params(
    x,
    ptype,
    x_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(x, &n_prot);

  y = vec_cast_params(
    y,
    ptype,
    y_arg,
    vec_args.empty,
    call,
    S3_FALLBACK_false
  );
  KEEP_N(y, &n_prot);

  r_obj* x_proxy = KEEP_N(vec_proxy_equal(x), &n_prot);
  x_proxy = KEEP_N(obj_encode_utf8(x_proxy), &n_prot);

  r_obj* y_proxy = KEEP_N(vec_proxy_equal(y), &n_prot);
  y_proxy = KEEP_N(obj_encode_utf8(y_proxy), &n_prot);

  const r_ssize x_size = vec_size(x_proxy);
  const r_ssize y_size = vec_size(y_proxy);

  struct dictionary* x_dict = new_dictionary(x_proxy);
  PROTECT_DICT(x_dict, &n_prot);

  struct dictionary* y_dict = new_dictionary(y_proxy);
  PROTECT_DICT(y_dict, &n_prot);

  r_obj* marked_shelter = KEEP_N(r_alloc_raw(x_size * sizeof(bool)), &n_prot);
  bool* v_marked = (bool*) r_raw_begin(marked_shelter);

  const r_ssize n_x_marked = vec_set_union_x_loop(
    x_dict,
    x_size,
    v_marked
  );

  r_obj* loc = KEEP_N(r_alloc_integer(n_x_marked), &n_prot);
  int* v_loc = r_int_begin(loc);
  r_ssize j = 0;

  for (r_ssize i = 0; i < x_size; ++i) {
    if (v_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  // Go ahead and slice out `x`
  x = KEEP_N(vec_slice_unsafe(x, loc), &n_prot);

  // Resize `v_marked` for use with `y`
  marked_shelter = KEEP_N(r_raw_resize(marked_shelter, y_size * sizeof(bool)), &n_prot);
  v_marked = (bool*) r_raw_begin(marked_shelter);

  const r_ssize n_y_marked = vec_set_union_y_loop(
    x_dict,
    y_dict,
    x_size,
    y_size,
    v_marked
  );

  loc = KEEP_N(r_int_resize(loc, n_y_marked), &n_prot);
  v_loc = r_int_begin(loc);
  j = 0;

  for (r_ssize i = 0; i < y_size; ++i) {
    if (v_marked[i]) {
      v_loc[j] = i + 1;
      ++j;
    }
  }

  y = KEEP_N(vec_slice_unsafe(y, loc), &n_prot);

  const struct name_repair_opts name_repair_opts = {
    .type = NAME_REPAIR_none,
    .fn = r_null
  };

  r_obj* args = KEEP_N(r_alloc_list(2), &n_prot);
  r_list_poke(args, 0, x);
  r_list_poke(args, 1, y);

  r_obj* out = vec_c(
    args,
    ptype,
    r_null,
    &name_repair_opts,
    vec_args.empty,
    r_lazy_null
  );

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/set.c:338

vec_shape_broadcast C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg, struct r_lazy] --> any_sexp
unbound variable
error detail
name: vctrs_eval_mask5
timing: 0.040 s
source
r_obj* vec_shape_broadcast(
  r_obj* x,
  r_obj* to,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_to_arg,
  struct r_lazy call
) {
  r_obj* ffi_x_arg = KEEP(vctrs_arg(p_x_arg));
  r_obj* ffi_to_arg = KEEP(vctrs_arg(p_to_arg));
  r_obj* ffi_call = KEEP(r_lazy_eval(call));

  r_obj* out = vctrs_eval_mask5(
    r_sym("shape_broadcast"),
    r_syms.x,
    x,
    r_sym("to"),
    to,
    syms.x_arg,
    ffi_x_arg,
    syms.to_arg,
    ffi_to_arg,
    r_syms.call,
    ffi_call
  );

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:210

vec_shape2 C signature

[any_sexp, any_sexp, *struct vctrs_arg, *struct vctrs_arg] --> any_sexp
unbound variable
error detail
name: r_dim
timing: 0.010 s
source
r_obj* vec_shape2(
  r_obj* x,
  r_obj* y,
  struct vctrs_arg* p_x_arg,
  struct vctrs_arg* p_y_arg
) {
  r_obj* x_dimensions = r_dim(x);

  if (x_dimensions == r_null) {
    r_obj* y_dimensions = r_dim(y);

    if (y_dimensions == r_null) {
      return r_null;
    } else {
      KEEP(y_dimensions);
      r_obj* out = dims_shape(y_dimensions);
      FREE(1);
      return out;
    }
  } else {
    KEEP(x_dimensions);
    r_obj* y_dimensions = r_dim(y);

    if (y_dimensions == r_null) {
      r_obj* out = dims_shape(x_dimensions);
      FREE(1);
      return out;
    } else {
      KEEP(y_dimensions);
      r_obj* out = dims_shape2(x_dimensions, y_dimensions, x, y, p_x_arg, p_y_arg);
      FREE(2);
      return out;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/shape.c:62

vec_shrink C signature

[any_sexp, c_int_na, c_int_na] --> any_sexp
unbound variable
error detail
name: R_isResizable
timing: 0.004 s
source
r_obj* vec_shrink(r_obj* x, r_ssize new_size, r_ssize old_size) {
#if R_VERSION >= R_Version(4, 6, 0)
  if (R_isResizable(x)) {
    R_resizeVector(x, new_size);
    return x;
  } else {
    return Rf_xlengthgets(x, new_size);
  }
#else
  SETLENGTH(x, new_size);
  SET_TRUELENGTH(x, old_size);
  SET_GROWABLE_BIT(x);
  return x;
#endif
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/vec.c:62

vec_size C signature

[any_sexp] --> c_int_na
untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp & 'I8498, *struct vctrs_arg, struct r_lazy]
timing: 0.016 s
source
r_ssize vec_size(r_obj* x) {
  return vec_size_params(x, vec_args.x, lazy_calls.vec_size);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:11

vec_size_common C signature

[any_sexp, c_int_na, *struct vctrs_arg, struct r_lazy] --> c_int_na
untypeable application
error detail
function: [any_sexp, *struct vctrs_arg, *struct vctrs_arg, any_sexp, [any_sexp, any_sexp, *struct counters, c_ptr] --> any_sexp, c_ptr] --> any_sexp
argument: [null, *struct vctrs_arg, *struct vctrs_arg & 'I61950, any_sexp & 'I61948, *(([any_sexp, any_sexp, *struct counters, c_null] | [any_sexp, any_sexp, c_null, (*(~(c_string | struct size_common_reduce_opts)) | c_string) \ c_null] | [any_sexp, any_sexp, c_null, *struct size_common_reduce_opts \ c_null] -> empty) & ([any_sexp, any_sexp, *struct counters, c_ptr] & ~[any_sexp, any_sexp, *struct counters, c_null] & ~[any_sexp, any_sexp, c_null, (*(~(c_string | struct size_common_reduce_opts)) | c_string) \ c_null] & ~[any_sexp, any_sexp, c_null, *struct size_common_reduce_opts \ c_null] -> any_sexp)), *struct size_common_reduce_opts]
timing: 0.045 s
source
r_ssize vec_size_common(
  r_obj* xs,
  r_ssize absent,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy call
) {
  struct size_common_reduce_opts reduce_opts = {
    .current_size = -1,
    .call = call
  };

  // Interested in `reduce_opts.current_size`,
  // not in the returned `r_obj*` from `reduce()`
  reduce(
    r_null,
    vec_args.empty,
    p_xs_arg,
    xs,
    &size2_common,
    &reduce_opts
  );

  r_ssize out = reduce_opts.current_size;

  if (out == -1) {
    out = absent;
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size-common.c:56

vec_slice_shaped C signature

[c(0..10) | c(255), any_sexp, any_sexp] --> any_sexp
untypeable application
error detail
function: ([*{ dim : any ; strides : any ; index : any ; steps : any ; shape_index : any ..}, c_null] --> empty) & ([*{ dim : any ; strides : any ; index : any ; steps : any ; shape_index : any ..}, c_ptr] --> ())
argument: [*struct strides_info, *c_false]
timing: 0.020 s
source
SEXP vec_slice_shaped(enum vctrs_type type, SEXP x, SEXP index) {
  int n_protect = 0;

  struct strides_info info = new_strides_info(x, index);
  PROTECT_STRIDES_INFO(&info, &n_protect);

  SEXP out = vec_slice_shaped_base(type, x, index, &info);

  UNPROTECT(n_protect);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-array.c:290

vec_slice_xs_fallback C signature

[any_sexp, any_sexp, c_int_na, *struct vctrs_arg, struct r_lazy] --> any_sexp
unbound variable
error detail
name: r_names
timing: 0.036 s
source
r_obj* vec_slice_xs_fallback(
  r_obj* xs,
  r_obj* indices,
  r_ssize size,
  struct vctrs_arg* p_xs_arg,
  struct r_lazy error_call
) {
  r_ssize xs_size = vec_size(xs);
  r_obj* xs_names = KEEP(r_names(xs));
  xs = KEEP(r_clone_referenced(xs));

  r_ssize i = 0;

  struct vctrs_arg* p_x_arg = new_subscript_arg(
    p_xs_arg,
    xs_names,
    xs_size,
    &i
  );
  KEEP(p_x_arg->shelter);

  r_obj* const* v_xs = r_list_cbegin(xs);
  r_obj* const* v_indices = r_list_cbegin(indices);

  for (; i < xs_size; ++i) {
    r_obj* x = v_xs[i];
    r_obj* index = v_indices[i];

    const r_ssize x_size = vec_size(x);
    const r_ssize index_size = r_length(index);

    if (x_size == 1) {
      // Recycle "up" to the size of the index
      x = vec_recycle_fallback(x, index_size, p_x_arg, error_call);
    } else if (x_size == size) {
      // Slice "down" to the size of the index
      x = vec_slice_fallback(x, index);
    } else {
      // `x` is the wrong size, error
      vec_check_recyclable(x, size, VCTRS_ALLOW_NULL_no, p_x_arg, error_call);
    }

    r_list_poke(xs, i, x);
  }

  FREE(3);
  return xs;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1453

vec_unique_names C signature

[any_sexp, c_int_na] --> any_sexp
untypeable application
error detail
function: [CHR, c_int_na, c_false] | [CHR, c_int_na, c_int_na \ c_false] | [null, c_int_na, c_false] | [null, c_int_na, c_int_na \ c_false] --> any_sexp
argument: [any_sexp, c_int_na, c_bool]
timing: 0.042 s
source
r_obj* vec_unique_names(r_obj* x, bool quiet) {
  r_obj* names = KEEP(vec_names(x));
  r_obj* out = vec_unique_names_impl(names, vec_size(x), quiet);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:452

vec_unrep C signature

[any_sexp, struct r_lazy] --> any_sexp
unbound variable
error detail
name: vec_slice_unsafe
timing: 0.243 s
source
r_obj* vec_unrep(r_obj* x, struct r_lazy error_call) {
  r_obj* times = KEEP(vec_run_sizes(x, error_call));
  const int* v_times = r_int_cbegin(times);

  const r_ssize size = r_length(times);

  r_obj* loc = KEEP(r_alloc_integer(size));
  int* v_loc = r_int_begin(loc);

  r_ssize current = 1;

  for (r_ssize i = 0; i < size; ++i) {
    v_loc[i] = current;
    current += v_times[i];
  }

  r_obj* out = KEEP(r_new_list(2));

  r_list_poke(out, 0, vec_slice_unsafe(x, loc));
  r_list_poke(out, 1, times);

  r_obj* names = r_new_character(2);
  r_attrib_poke_names(out, names);
  r_chr_poke(names, 0, strings_key);
  r_chr_poke(names, 1, strings_times);

  init_data_frame(out, size);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:346

chr_encode_utf8 untypeable

unbound variable
error detail
name: vmaxset
timing: 0.312 s
source
r_obj* chr_encode_utf8(r_obj* x) {
  r_ssize size = r_length(x);
  r_ssize start = chr_find_encoding_start(x, size);

  if (size == start) {
    return x;
  }

  x = KEEP(r_clone(x));
  r_obj* const* p_x = r_chr_cbegin(x);

  const void* vmax = vmaxget();

  for (r_ssize i = start; i < size; ++i) {
    r_obj* const elt = p_x[i];

    if (!str_is_ascii_or_utf8(elt)) {
      r_chr_poke(x, i, str_as_utf8(elt));
    }
  }

  vmaxset(vmax);
  FREE(1);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:52

colnames untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.001 s
source
SEXP colnames(SEXP x) {
  return vctrs_dispatch1(syms_colnames, fns_colnames,
                         syms_x, x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1010

colnames2 untypeable

unbound variable
error detail
name: colnames
timing: 0.002 s
source
r_obj* colnames2(r_obj* x) {
  r_obj* names = colnames(x);
  if (names == r_null) {
    return r_alloc_character(Rf_ncols(x));
  } else {
    return names;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1015

cpl_detect_missing untypeable

untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.027 s
source
r_obj* cpl_detect_missing(r_obj* x) {
  DETECT_MISSING(r_complex, r_cpl_cbegin, cpl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:70

date_as_date untypeable

unbound variable
error detail
name: date_validate
timing: 0.001 s
source
SEXP date_as_date(SEXP x) {
  return date_validate(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:65

date_as_posixct untypeable

unbound variable
error detail
name: r_date_as_character
timing: 0.010 s
source
SEXP date_as_posixct(SEXP x, SEXP to) {
  SEXP tzone = PROTECT(tzone_get(to));

  // Date -> character -> POSIXct
  // This is the only way to retain the same clock time
  SEXP out = PROTECT(r_date_as_character(x));
  out = PROTECT(r_chr_date_as_posixct(out, tzone));

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:71

date_as_posixlt untypeable

unbound variable
error detail
name: r_date_as_character
timing: 0.010 s
source
SEXP date_as_posixlt(SEXP x, SEXP to) {
  SEXP tzone = PROTECT(tzone_get(to));

  // Date -> character -> POSIXlt
  // This is the only way to retain the same clock time
  SEXP out = PROTECT(r_date_as_character(x));
  out = PROTECT(r_chr_date_as_posixlt(out, tzone));

  UNPROTECT(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:85

date_datetime_ptype2 untypeable

untypeable application
error detail
function: [(~CHR)<...> | sym] --> empty
argument: [any_sexp]
timing: 0.031 s
source
SEXP date_datetime_ptype2(SEXP x, SEXP y) {
  SEXP x_class = PROTECT(Rf_getAttrib(x, R_ClassSymbol));
  SEXP x_first_class = STRING_ELT(x_class, 0);

  SEXP tzone = (x_first_class == strings_date) ? tzone_get(y) : tzone_get(x);
  PROTECT(tzone);

  SEXP out = new_empty_datetime(tzone);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:33

datetime_datetime_ptype2 untypeable

untypeable application
error detail
function: [CHR & 'I20847, any_sexp & 'I20848] --> CHR & 'I20847 | any_sexp & 'I20848
argument: [any_sexp, any_sexp]
timing: 0.024 s
source
SEXP datetime_datetime_ptype2(SEXP x, SEXP y) {
  SEXP x_tzone = PROTECT(tzone_get(x));
  SEXP y_tzone = PROTECT(tzone_get(y));

  // Never allocates
  SEXP tzone = tzone_union(x_tzone, y_tzone);

  SEXP out = new_empty_datetime(tzone);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:48

datetime_rezone untypeable

untypeable application
error detail
function: [CHR, CHR] --> c_bool
argument: [any_sexp, any_sexp & 'I46894]
timing: 0.019 s
source
static SEXP datetime_rezone(SEXP x, SEXP tzone) {
  SEXP x_tzone = PROTECT(tzone_get(x));

  if (tzone_equal(x_tzone, tzone)) {
    UNPROTECT(1);
    return x;
  }

  SEXP out = PROTECT(r_clone_referenced(x));

  Rf_setAttrib(out, syms_tzone, tzone);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:395

dbl_detect_missing untypeable

untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.025 s
source
r_obj* dbl_detect_missing(r_obj* x) {
  DETECT_MISSING(double, r_dbl_cbegin, dbl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:66

df_detect_missing untypeable

untypeable application
error detail
function: ([c_int] --> raw) & ([c_true] --> raw1)
argument: [c_int_na]
timing: 0.143 s
source
r_obj* df_detect_missing(r_obj* x) {
  int n_prot = 0;

  const r_ssize n_col = r_length(x);
  const r_ssize size = vec_size(x);
  r_obj* const* v_x = r_list_cbegin(x);

  // A location vector to track rows where we still need to check for missing
  // values. After we iterate through all columns, `v_loc` points to the missing
  // rows.
  r_ssize loc_size = size;
  r_obj* loc_shelter = KEEP_N(r_alloc_raw(loc_size * sizeof(r_ssize)), &n_prot);
  r_ssize* v_loc = (r_ssize*) r_raw_begin(loc_shelter);

  for (r_ssize i = 0; i < loc_size; ++i) {
    v_loc[i] = i;
  }

  for (r_ssize i = 0; i < n_col; ++i) {
    r_obj* col = v_x[i];

    loc_size = col_detect_missing(col, v_loc, loc_size);

    // If all rows have at least one non-missing value, break
    if (loc_size == 0) {
      break;
    }
  }

  r_obj* out = KEEP_N(r_new_logical(size), &n_prot);
  int* v_out = r_lgl_begin(out);
  r_p_lgl_fill(v_out, 0, size);

  for (r_ssize i = 0; i < loc_size; ++i) {
    const r_ssize loc = v_loc[i];
    v_out[loc] = 1;
  }

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:91

df_flatten untypeable

untypeable application
error detail
function: ([c_int] --> CHR) & ([c_true] --> CHR1)
argument: [c_int_na]
timing: 0.036 s
source
r_obj* df_flatten(r_obj* x) {
  struct flatten_info info = df_flatten_info(x);

  if (!info.flatten) {
    return x;
  }

  r_obj* out = KEEP(r_alloc_list(info.width));
  r_obj* out_names = KEEP(r_alloc_character(info.width));
  r_attrib_poke_names(out, out_names);

  df_flatten_loop(x, out, out_names, 0);
  init_data_frame(out, df_size(x));

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:980

df_joint_proxy_order untypeable

unbound variable
error detail
name: vec_joint_proxy_order
timing: 0.344 s
source
r_obj* df_joint_proxy_order(r_obj* x, r_obj* y) {
  x = KEEP(r_clone_referenced(x));
  y = KEEP(r_clone_referenced(y));

  const r_ssize n_cols = r_length(x);
  if (n_cols != r_length(y)) {
    r_stop_internal("`x` and `y` must have the same number of columns.");
  }

  r_obj* const* v_x = r_list_cbegin(x);
  r_obj* const* v_y = r_list_cbegin(y);

  for (r_ssize i = 0; i < n_cols; ++i) {
    r_obj* proxies = vec_joint_proxy_order(v_x[i], v_y[i]);
    r_list_poke(x, i, r_list_get(proxies, 0));
    r_list_poke(y, i, r_list_get(proxies, 1));
  }

  x = KEEP(df_flatten(x));
  x = KEEP(vec_proxy_unwrap(x));

  y = KEEP(df_flatten(y));
  y = KEEP(vec_proxy_unwrap(y));

  r_obj* out = KEEP(r_alloc_list(2));
  r_list_poke(out, 0, x);
  r_list_poke(out, 1, y);

  FREE(7);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:355

df_list_unpack untypeable

unbound variable
error detail
name: r_names
timing: 0.047 s
source
r_obj* df_list_unpack(r_obj* x) {
  r_obj* names = KEEP(r_names(x));
  r_obj* const * p_names = r_chr_cbegin(names);

  bool any_needs_unpack = false;
  r_ssize n_cols = r_length(x);
  r_ssize i = 0;

  for (; i < n_cols; ++i) {
    // Only unpack unnamed data frames
    if (p_names[i] != strings_empty) {
      continue;
    }

    r_obj* col = r_list_get(x, i);

    if (is_data_frame(col)) {
      any_needs_unpack = true;
      break;
    }
  }

  if (!any_needs_unpack) {
    FREE(1);
    return x;
  }

  r_obj* unpack = KEEP(r_new_logical(n_cols));
  int* p_unpack = LOGICAL(unpack);

  for (r_ssize j = 0; j < n_cols; ++j) {
    p_unpack[j] = 0;
  }

  r_ssize width = i;

  for (; i < n_cols; ++i) {
    // Only unpack unnamed data frames
    if (p_names[i] != strings_empty) {
      ++width;
      continue;
    }

    r_obj* col = r_list_get(x, i);

    if (is_data_frame(col)) {
      width += r_length(col);
      p_unpack[i] = 1;
    } else {
      ++width;
    }
  }

  r_obj* out = KEEP(r_new_list(width));
  r_obj* out_names = KEEP(r_new_character(width));

  r_ssize loc = 0;

  // Unpack loop
  for (r_ssize i = 0; i < n_cols; ++i) {
    if (!p_unpack[i]) {
      r_list_poke(out, loc, r_list_get(x, i));
      r_chr_poke(out_names, loc, p_names[i]);
      ++loc;
      continue;
    }

    r_obj* col = r_list_get(x, i);
    r_obj* col_names = KEEP(r_names(col));

    if (r_typeof(col_names) != R_TYPE_character) {
      r_stop_internal(
        "Encountered corrupt data frame. "
        "Data frames must have character column names."
      );
    }

    r_obj* const * p_col_names = r_chr_cbegin(col_names);
    r_ssize col_i = 0;

    r_ssize stop = loc + r_length(col);

    for (; loc < stop; ++loc, ++col_i) {
      r_list_poke(out, loc, r_list_get(col, col_i));
      r_chr_poke(out_names, loc, p_col_names[col_i]);
    }

    loc = stop;
    FREE(1);
  }

  r_attrib_poke_names(out, out_names);

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:321

df_proxy_recurse untypeable

unbound variable
error detail
name: vec_proxy_recurse
timing: 0.153 s
source
r_obj* df_proxy_recurse(r_obj* x) {
  r_obj* out = KEEP(r_clone(x));

  r_ssize n = r_length(out);
  r_obj* const * v_out = r_list_cbegin(out);

  for (r_ssize i = 0; i < n; ++i) {
    r_list_poke(out, i, vec_proxy_recurse(v_out[i]));
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:38

df_rownames untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.001 s
source
r_obj* df_rownames(r_obj* x) {
  return r_attrib_get(x, R_RowNamesSymbol);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.h:16

df_slice untypeable

unbound variable
error detail
name: r_names
timing: 0.069 s
source
r_obj* df_slice(r_obj* x, r_obj* subscript) {
  r_ssize n = r_length(x);
  r_ssize size = df_size(x);

  r_obj* out = KEEP(r_alloc_list(n));

  // FIXME: Should that be restored?
  r_obj* nms = r_names(x);
  r_attrib_poke(out, r_syms.names, nms);

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* elt = r_list_get(x, i);

    if (vec_size(elt) != size) {
      r_stop_internal("Column `%s` (size %" R_PRI_SSIZE ") must match the data frame (size %" R_PRI_SSIZE ").",
                      r_chr_get_c_string(nms, i),
                      vec_size(elt),
                      size);
    }

    r_obj* sliced = vec_slice_unsafe(elt, subscript);
    r_list_poke(out, i, sliced);
  }

  init_data_frame(out, vec_subscript_size(subscript));

  r_obj* row_nms = KEEP(df_rownames(x));
  if (r_typeof(row_nms) == R_TYPE_character) {
    row_nms = slice_rownames(row_nms, subscript);
    r_attrib_poke(out, r_syms.row_names, row_nms);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:171

ffi_apply_name_spec untypeable entry .Call

untypeable application
error detail
function: ([CHR | null, null, any_sexp & 'I80425, c_int_na] --> null | any_sexp & 'I80425) & ([CHR | null, p(CHR), null & 'I80425, c_true] | [CHR | null, <...> | p(CHR) | sym, null & 'I80425, c_false] --> any_sexp)
argument: [any_sexp & 'I80414, 'I80419, any_sexp & 'I80416, c_int_na]
timing: 0.109 s
source
r_obj* ffi_apply_name_spec(r_obj* name_spec, r_obj* outer, r_obj* inner, r_obj* n) {
  return apply_name_spec(name_spec, r_chr_get(outer, 0), inner, r_int_get(n, 0));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:547

ffi_as_location untypeable entry .Call

untypeable application
error detail
function: ([INT, c_int_na] --> c_int_na) & ([^INT1, c_int_na] --> c_int)
argument: [any_sexp, c_false]
timing: 1.16 s
source
r_obj* ffi_as_location(r_obj* subscript,
                       r_obj* ffi_n,
                       r_obj* names,
                       r_obj* loc_negative,
                       r_obj* loc_oob,
                       r_obj* loc_zero,
                       r_obj* missing,
                       r_obj* frame) {
  r_ssize n = 0;

  if (ffi_n == r_null && r_typeof(subscript) == R_TYPE_character) {
    n = r_length(subscript);
  } else {
    if (r_is_object(ffi_n) || r_typeof(ffi_n) != R_TYPE_integer) {
      ffi_n = vec_cast(ffi_n,
                       r_globals.empty_int,
                       vec_args.n,
                       vec_args.empty,
                       (struct r_lazy) { .x = frame, .env = r_null });
    }
    KEEP(ffi_n);

    if (r_length(ffi_n) != 1) {
      r_stop_internal("`n` must be a scalar number.");
    }

    n = r_int_get(ffi_n, 0);
    FREE(1);
  }

  struct r_lazy arg_ = { .x = syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_);

  struct r_lazy call = (struct r_lazy) { .x = syms_call, .env = frame };

  struct location_opts opts = {
    .subscript_opts = {
      .subscript_arg = &arg,
      .call          = call
    },
    .missing        = parse_subscript_arg_missing(missing, call),
    .loc_negative   = parse_loc_negative(loc_negative, call),
    .loc_oob        = parse_loc_oob(loc_oob, call),
    .loc_zero       = parse_loc_zero(loc_zero, call)
  };

  return vec_as_location_opts(subscript, n, names, &opts);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:515

ffi_as_not_s4 untypeable entry .Call

unbound variable
error detail
name: r_as_not_s4
timing: 0.001 s
source
r_obj* ffi_as_not_s4(r_obj* x) {
  return r_as_not_s4(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:250

ffi_as_short_length untypeable entry .Call

untypeable application
error detail
function: [any_sexp, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp & 'I64151, *struct vctrs_arg, struct r_lazy]
timing: 0.046 s
source
r_obj* ffi_as_short_length(r_obj* n, r_obj* frame) {
  struct r_lazy call = { .x = frame, .env = r_null };

  struct r_lazy arg_lazy = { .x = syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_lazy);

  return r_len(vec_as_short_length(n, &arg, call));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:236

ffi_as_subscript untypeable entry .Call

untypeable application
error detail
function: [any_sexp & 'I83142, <...> | c_false | c_null | null | p(CHR) | sym] --> any_sexp & 'I83142
argument: [any_sexp, any]
timing: 0.074 s
source
r_obj* ffi_as_subscript(r_obj* subscript,
                        r_obj* logical,
                        r_obj* numeric,
                        r_obj* character,
                        r_obj* frame) {
  struct r_lazy arg_ = { .x = syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_);

  struct r_lazy call = { .x = r_syms.call, .env = frame };

  struct subscript_opts opts = {
    .logical = parse_subscript_arg_type(logical, "logical"),
    .numeric = parse_subscript_arg_type(numeric, "numeric"),
    .character = parse_subscript_arg_type(character, "character"),
    .subscript_arg = &arg,
    .call = call
  };

  ERR err = NULL;
  r_obj* out = vec_as_subscript_opts(subscript, &opts, &err);
  KEEP2(out, err);

  out = r_result_get(out, err);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript.c:222

ffi_assign_compact_condition untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, INT, c_int_na, c_false, c_false, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_false, c_true, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_true, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp, any_sexp & 'I92873, c_int_na, c_bool, c_bool, *struct vctrs_arg, struct r_lazy]
timing: 0.303 s
source
r_obj* ffi_assign_compact_condition(
  r_obj* x,
  r_obj* index,
  r_obj* value,
  r_obj* ffi_slice_value
) {
  struct r_lazy call = r_lazy_null;

  const enum assignment_slice_value slice_value =
    r_arg_as_bool(ffi_slice_value, "slice_value") ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  if (!is_compact_condition(index)) {
    r_stop_internal("`index` must be a `compact_condition`.");
  }

  const enum vctrs_index_style index_style = VCTRS_INDEX_STYLE_condition;

  // Comes from the R side, so not owned, and not proxying recursively
  const struct vec_proxy_assign_opts assign_opts = {
    .x_arg = vec_args.x,
    .value_arg = vec_args.value,
    .call = call,
    .slice_value = slice_value,
    .index_style = index_style,
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };
  struct vec_restore_opts restore_opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };

  const r_ssize x_size = vec_size(x);

  // Cast `value` and check that it can recycle
  value = KEEP(vec_cast(value, x, vec_args.value, vec_args.x, call));

  check_recyclable_against_index(
    value,
    index,
    x_size,
    assign_opts.slice_value,
    assign_opts.index_style,
    assign_opts.value_arg,
    assign_opts.call
  );

  r_obj* proxy = KEEP(vec_proxy(x));
  proxy = KEEP(vec_proxy_assign_opts(proxy, index, value, &assign_opts));
  r_obj* out = vec_restore_opts(proxy, x, &restore_opts);

  FREE(3);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:1128

ffi_assign_seq untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, INT, c_int_na, c_false, c_false, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_false, c_true, c_null, struct r_lazy] | [<> | null | p(CHR) | sym, any_sexp, c_int_na, c_true, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp, INT, c_int_na, c_bool, c_bool, *struct vctrs_arg, struct r_lazy]
timing: 1.35 s
source
r_obj* ffi_assign_seq(
  r_obj* x,
  r_obj* value,
  r_obj* ffi_start,
  r_obj* ffi_size,
  r_obj* ffi_increasing,
  r_obj* ffi_slice_value
) {
  r_ssize start = r_int_get(ffi_start, 0);
  r_ssize size = r_int_get(ffi_size, 0);
  bool increasing = r_lgl_get(ffi_increasing, 0);

  struct r_lazy call = lazy_calls.vec_assign_seq;

  const enum assignment_slice_value slice_value =
    r_arg_as_bool(ffi_slice_value, "slice_value") ?
    ASSIGNMENT_SLICE_VALUE_yes :
    ASSIGNMENT_SLICE_VALUE_no;

  r_obj* index = KEEP(compact_seq(start, size, increasing));
  const enum vctrs_index_style index_style = VCTRS_INDEX_STYLE_location;

  // Comes from the R side, so not owned, and not proxying recursively
  const struct vec_proxy_assign_opts assign_opts = {
    .x_arg = vec_args.x,
    .value_arg = vec_args.value,
    .call = call,
    .slice_value = slice_value,
    .index_style = index_style,
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };
  struct vec_restore_opts restore_opts = {
    .ownership = VCTRS_OWNERSHIP_foreign,
    .recursively_proxied = false
  };

  const r_ssize x_size = vec_size(x);

  // Cast `value` and check that it can recycle
  value = KEEP(vec_cast(value, x, vec_args.value, vec_args.x, call));

  check_recyclable_against_index(
    value,
    index,
    x_size,
    assign_opts.slice_value,
    assign_opts.index_style,
    assign_opts.value_arg,
    assign_opts.call
  );

  r_obj* proxy = KEEP(vec_proxy(x));
  proxy = KEEP(vec_proxy_assign_opts(proxy, index, value, &assign_opts));
  r_obj* out = vec_restore_opts(proxy, x, &restore_opts);

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:1066

ffi_compute_nesting_container_info untypeable entry .Call

untypeable application
error detail
function: [any_sexp, c_int_na, *c_false] --> list
argument: [any_sexp & 'I110206, c_int_na, *c(0..4)]
timing: 0.206 s
source
r_obj* ffi_compute_nesting_container_info(r_obj* haystack, r_obj* condition) {
  r_ssize n_cols = r_length(haystack);
  enum vctrs_ops* v_ops = (enum vctrs_ops*) R_alloc(n_cols, sizeof(enum vctrs_ops));
  parse_condition(condition, n_cols, v_ops);
  const r_ssize size_haystack = vec_size(haystack);
  return compute_nesting_container_info(haystack, size_haystack, v_ops);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:2217

ffi_init untypeable entry .Call

untypeable application
error detail
function: [any_sexp, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp & 'I89594, *struct vctrs_arg, struct r_lazy]
timing: 0.014 s
source
r_obj* ffi_init(r_obj* x, r_obj* ffi_n, r_obj* ffi_frame) {
  struct r_lazy call = { .x = ffi_frame, .env = r_null };
  r_ssize n = vec_as_short_length(ffi_n, vec_args.n, call);

  r_obj* out = vec_init(x, n);

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:493

ffi_interval_complement untypeable entry .Call

unbound variable
error detail
name: vec_interval_complement
timing: 0.002 s
source
r_obj* ffi_interval_complement(r_obj* start,
                               r_obj* end,
                               r_obj* lower,
                               r_obj* upper) {
  return vec_interval_complement(start, end, lower, upper);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:305

ffi_interval_groups untypeable entry .Call

untypeable application
error detail
function: [any_sexp, any_sexp, c_int_na, c_bool, c_int_na] --> any_sexp
argument: [any_sexp & 'I88443, any_sexp & 'I88444, c_lgl, c_bool | c_void, c_false]
timing: 0.029 s
source
r_obj* ffi_interval_groups(r_obj* start,
                           r_obj* end,
                           r_obj* ffi_abutting,
                           r_obj* ffi_missing) {
  const bool abutting = r_arg_as_bool(ffi_abutting, "abutting");
  const enum vctrs_interval_missing missing = parse_missing(ffi_missing);
  const bool locations = false;

  r_obj* out = KEEP(vec_interval_group_info(start, end, abutting, missing, locations));

  r_obj* loc_start = r_list_get(out, 0);
  r_obj* loc_end = r_list_get(out, 1);

  r_list_poke(out, 0, vec_slice_unsafe(start, loc_start));
  r_list_poke(out, 1, vec_slice_unsafe(end, loc_end));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:12

ffi_interval_locate_containers untypeable entry .Call

unbound variable
error detail
name: vec_interval_locate_containers
timing: 0.001 s
source
r_obj* ffi_interval_locate_containers(r_obj* start, r_obj* end) {
  return vec_interval_locate_containers(start, end);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:722

ffi_interval_locate_groups untypeable entry .Call

untypeable application
error detail
function: [any_sexp, any_sexp, c_int_na, c_bool, c_int_na] --> any_sexp
argument: [any_sexp & 'I88456, any_sexp & 'I88457, c_lgl, c_bool | c_void, c_true]
timing: 0.034 s
source
r_obj* ffi_interval_locate_groups(r_obj* start,
                                  r_obj* end,
                                  r_obj* ffi_abutting,
                                  r_obj* ffi_missing) {
  const bool abutting = r_arg_as_bool(ffi_abutting, "abutting");
  const enum vctrs_interval_missing missing = parse_missing(ffi_missing);
  const bool locations = true;

  r_obj* out = KEEP(vec_interval_group_info(start, end, abutting, missing, locations));

  r_obj* key = r_list_get(out, 0);
  r_obj* loc_start = r_list_get(key, 0);
  r_obj* loc_end = r_list_get(key, 1);

  r_list_poke(key, 0, vec_slice_unsafe(start, loc_start));
  r_list_poke(key, 1, vec_slice_unsafe(end, loc_end));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:32

ffi_locate_matches untypeable entry .Call

untypeable application
error detail
function: ([CHR] --> c_bool) & ([null] --> empty)
argument: [any_sexp & 'I110170, struct r_lazy]
timing: 0.032 s
source
r_obj* ffi_locate_matches(r_obj* needles,
                          r_obj* haystack,
                          r_obj* condition,
                          r_obj* filter,
                          r_obj* incomplete,
                          r_obj* no_match,
                          r_obj* remaining,
                          r_obj* multiple,
                          r_obj* relationship,
                          r_obj* nan_distinct,
                          r_obj* chr_proxy_collate,
                          r_obj* needles_arg,
                          r_obj* haystack_arg,
                          r_obj* frame) {
  struct r_lazy error_call = { .x = r_syms.error_call, .env = frame };
  struct r_lazy internal_call = { .x = frame, .env = r_null };

  const struct vctrs_incomplete c_incomplete = parse_incomplete(incomplete, internal_call);
  const struct vctrs_no_match c_no_match = parse_no_match(no_match, internal_call);
  const struct vctrs_remaining c_remaining = parse_remaining(remaining, internal_call);
  const enum vctrs_multiple c_multiple = parse_multiple(multiple, internal_call);
  const enum vctrs_relationship c_relationship = parse_relationship(relationship, internal_call);
  const bool c_nan_distinct = r_arg_as_bool(nan_distinct, "nan_distinct");

  struct vctrs_arg c_needles_arg = vec_as_arg(needles_arg);
  struct vctrs_arg c_haystack_arg = vec_as_arg(haystack_arg);

  return vec_locate_matches(
    needles,
    haystack,
    condition,
    filter,
    &c_incomplete,
    &c_no_match,
    &c_remaining,
    c_multiple,
    c_relationship,
    c_nan_distinct,
    chr_proxy_collate,
    &c_needles_arg,
    &c_haystack_arg,
    error_call
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:86

ffi_minimal_names untypeable entry .Call

untypeable application
error detail
function: ([c_int] --> CHR) & ([c_true] --> CHR1)
argument: [c_int_na]
timing: 0.020 s
source
r_obj* ffi_minimal_names(r_obj* x) {
  r_obj* names = KEEP(vec_names(x));

  if (names == r_null) {
    names = r_alloc_character(vec_size(x));
  } else {
    names = ffi_as_minimal_names(names);
  }

  FREE(1);
  return names;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:217

ffi_new_data_frame untypeable entry .External

untypeable application
error detail
function: [lang] --> any_sexp
argument: [lang | null]
timing: 0.023 s
source
r_obj* ffi_new_data_frame(r_obj* args) {
  args = r_node_cdr(args);

  r_obj* x = r_node_car(args); args = r_node_cdr(args);
  r_obj* n = r_node_car(args); args = r_node_cdr(args);
  r_obj* cls = r_node_car(args); args = r_node_cdr(args);
  r_obj* attrib = args;

  if (r_typeof(x) != R_TYPE_list) {
    r_abort_call(r_null, "`x` must be a list");
  }

  // Input comes from the R side, so we must always clone it. This is also
  // important because we pull attributes from `x` later on, but clear the ones
  // on `out` right now because we build it from scratch.
  r_obj* out = KEEP(r_clone(x));
  r_attrib_zap_all(out);

  r_obj* names = NULL;
  r_obj* row_names = NULL;

  for (r_obj* node = attrib; node != r_null; node = r_node_cdr(node)) {
    r_obj* tag = r_node_tag(node);
    r_obj* value = r_node_car(node);

    // We might add dynamic dots later on
    if (tag == r_syms.class_) {
      r_stop_internal("Can't supply `class` in `...`.");
    }

    if (tag == r_syms.names) {
      names = value;
      continue;
    }

    if (tag == r_syms.row_names) {
      // We used to validate a user supplied `n` against a user supplied
      // `row.names`, but that requires extracting out the `rownames_size()`,
      // which can materialize ALTREP row name objects and is prohibitively
      // expensive (tidyverse/dplyr#6596). So instead we say that user supplied
      // `row.names` overrides both the implied size of `x` and a user supplied
      // `n`, even if they are incompatible.
      row_names = value;
      continue;
    }

    r_attrib_poke(out, tag, value);
  }

  // `names` handling:
  // - If `...` had `names`, use them.
  // - If `x` is empty, use `character()` names (supports empty `list()` case).
  // - Use `r_names(x)`.
  //
  // Note that this means `new_data_frame(list(1))` purposefully constructs a
  // corrupt data frame with no names, which is questionable, but we have a test
  // for this and I think we use it for testing other edge cases.
  if (names == NULL) {
    if (r_length(x) == 0) {
      names = r_globals.empty_chr;
    } else {
      names = r_names(x);
    }
  }
  r_attrib_poke_names(out, names);

  // `row.names` handling:
  // - If `...` had `row.names`, use them.
  // - If `n` was provided, use it (overridden by `row.names` in `...`).
  // - Use `df_raw_size_from_list(x)`.
  //
  // Note that this means `new_data_frame(new_data_frame(n = 10L))` will return
  // a zero row data frame. `new_data_frame()` always treats `x` as a bare list,
  // even if it might contain some extra info about the `row.names` in the zero
  // column data frame case.
  if (row_names == NULL) {
    const r_ssize size = n != r_null ? df_size_from_n(n) : df_raw_size_from_list(x);
    row_names = new_compact_rownames(size);
  }
  KEEP(row_names);
  attrib_append_row_names(out, row_names);
  FREE(1);

  if (cls == r_null) {
    cls = classes_data_frame;
  } else {
    cls = c_data_frame_class(cls);
  }
  r_attrib_poke_class(out, cls);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-data-frame.c:36

ffi_obj_check_vector untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I82247, c_false, *struct vctrs_arg, struct r_lazy]
timing: 0.040 s
source
r_obj* ffi_obj_check_vector(r_obj* x, r_obj* frame) {
  struct r_lazy call = { .x = r_syms.call, .env = frame };

  struct r_lazy arg_lazy = { .x = r_syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_lazy);

  // Not exposed at the R level for single vector checks
  const enum vctrs_allow_null allow_null = VCTRS_ALLOW_NULL_no;

  obj_check_vector(x, allow_null, &arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:9

ffi_obj_encode_utf8 untypeable entry .Call

unbound variable
error detail
name: obj_encode_utf8
timing: 0.002 s
source
SEXP ffi_obj_encode_utf8(SEXP x) {
  return obj_encode_utf8(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:182

ffi_proxy_info untypeable entry .Call

untypeable application
error detail
function: ([list, *c_string] --> list) & ([prim & 'I98116, *c_string] --> v('I98116))
argument: [c(19), *(c_string | c_null)]
timing: 0.019 s
source
r_obj* ffi_proxy_info(r_obj* x) {
  struct vctrs_proxy_info info = vec_proxy_info(x);
  KEEP(info.inner);

  r_obj* out = KEEP(Rf_mkNamed(R_TYPE_list, (const char*[]) { "type", "had_proxy_method", "proxy", "" }));
  r_list_poke(out, 0, r_chr(vec_type_as_str(info.type)));
  r_list_poke(out, 1, r_lgl(info.had_proxy_method));
  r_list_poke(out, 2, info.inner);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:44

ffi_size untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp & 'I61357, *struct vctrs_arg, struct r_lazy]
timing: 0.025 s
source
r_obj* ffi_size(r_obj* x, r_obj* frame) {
  struct r_lazy call = { .x = frame, .env = r_null };
  return r_len(vec_size_params(x, vec_args.x, call));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/size.c:6

ffi_slice_rep untypeable entry .Call

unbound variable
error detail
name: vec_slice_unsafe
timing: 0.056 s
source
r_obj* ffi_slice_rep(r_obj* x, r_obj* ffi_i, r_obj* ffi_n) {
  r_ssize i = r_int_get(ffi_i, 0);
  r_ssize n = r_int_get(ffi_n, 0);

  r_obj* subscript = KEEP(compact_rep(i, n));
  r_obj* out = vec_slice_unsafe(x, subscript);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:521

ffi_slice_seq untypeable entry .Call

unbound variable
error detail
name: vec_slice_unsafe
timing: 0.117 s
source
r_obj* ffi_slice_seq(r_obj* x,
                     r_obj* ffi_start,
                     r_obj* ffi_size,
                     r_obj* ffi_increasing) {
  r_ssize start = r_int_get(ffi_start, 0);
  r_ssize size = r_int_get(ffi_size, 0);
  bool increasing = r_lgl_get(ffi_increasing, 0);

  r_obj* subscript = KEEP(compact_seq(start, size, increasing));
  r_obj* out = vec_slice_unsafe(x, subscript);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:504

ffi_type_info untypeable entry .Call

untypeable application
error detail
function: ([list, *c_string] --> list) & ([prim & 'I98098, *c_string] --> v('I98098))
argument: [c(19), *(c_string | c_null)]
timing: 0.007 s
source
r_obj* ffi_type_info(r_obj* x) {
  r_obj* out = KEEP(Rf_mkNamed(R_TYPE_list, (const char*[]) { "type", "had_proxy_method", "" }));

  const enum vctrs_type type = vec_typeof(x);
  r_list_poke(out, 0, r_chr(vec_type_as_str(type)));
  r_list_poke(out, 1, r_lgl(vec_proxy_method(x) != r_null));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:33

ffi_vec_check_recyclable untypeable entry .Call

untypeable application
error detail
function: [null, c_int_na, c_bool, c_null, struct r_lazy] | [<> | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] --> c_int_na
argument: [any_sexp & 'I82692, c_int_na, c_false, *struct vctrs_arg, struct r_lazy]
timing: 0.048 s
source
r_obj* ffi_vec_check_recyclable(r_obj* x, r_obj* ffi_size, r_obj* frame) {
  struct r_lazy call = { .x = r_syms.call, .env = frame };
  struct r_lazy arg_lazy = { .x = r_syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_lazy);

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");

  // Not exposed at the R level for single vector checks
  const enum vctrs_allow_null allow_null = VCTRS_ALLOW_NULL_no;

  vec_check_recyclable(x, size, allow_null, &arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:226

ffi_vec_check_size untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, c_int_na, c_bool, c_null, struct r_lazy] --> ()
argument: [any_sexp & 'I82451, c_int_na, c_false, *struct vctrs_arg, struct r_lazy]
timing: 0.046 s
source
r_obj* ffi_vec_check_size(r_obj* x, r_obj* ffi_size, r_obj* frame) {
  struct r_lazy call = { .x = r_syms.call, .env = frame };
  struct r_lazy arg_lazy = { .x = r_syms.arg, .env = frame };
  struct vctrs_arg arg = new_lazy_arg(&arg_lazy);

  const r_ssize size = r_arg_as_ssize(ffi_size, "size");

  // Not exposed at the R level for single vector checks
  const enum vctrs_allow_null allow_null = VCTRS_ALLOW_NULL_no;

  vec_check_size(x, size, allow_null, &arg, call);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/assert.c:84

ffi_vec_detect_missing untypeable entry .Call

unbound variable
error detail
name: vec_detect_missing
timing: 0.001 s
source
r_obj* ffi_vec_detect_missing(r_obj* x) {
  return vec_detect_missing(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:6

ffi_vec_hash untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.006 s
source
r_obj* ffi_vec_hash(r_obj* x) {
  x = KEEP(vec_proxy_equal(x));

  const r_ssize size = vec_size(x);
  r_obj* out = KEEP(r_alloc_raw(size * sizeof(uint32_t)));
  uint32_t* v_out = (uint32_t*) r_raw_begin(out);

  r_memset(v_out, 0, size * sizeof(uint32_t));
  vec_hash_fill(x, size, true, v_out);

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/hash.c:149

ffi_vec_rep untypeable entry .Call

untypeable application
error detail
function: [struct r_lazy, c_null] --> empty
argument: [struct r_lazy, *struct vctrs_arg]
timing: 0.067 s
source
r_obj* ffi_vec_rep(r_obj* x, r_obj* ffi_times, r_obj* frame) {
  struct r_lazy error_call = { .x = r_syms.error_call, .env = frame };

  struct r_lazy x_arg_lazy = { .x = syms.x_arg, .env = frame };
  struct vctrs_arg x_arg = new_lazy_arg(&x_arg_lazy);

  struct r_lazy times_arg_lazy = { .x = syms.times_arg, .env = frame };
  struct vctrs_arg times_arg = new_lazy_arg(&times_arg_lazy);

  ffi_times = KEEP(vec_cast(ffi_times,
                            r_globals.empty_int,
                            &times_arg,
                            vec_args.empty,
                            error_call));

  if (vec_size(ffi_times) != 1) {
    stop_rep_times_size(error_call, &times_arg);
  }

  const int times = r_int_get(ffi_times, 0);
  r_obj* out = vec_rep(x, times, error_call, &x_arg, &times_arg);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rep.c:47

ffi_vec_set_names untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym, <...> | p(CHR) | sym, c(1..2)] --> any_sexp
argument: [any_sexp & 'I80427, any_sexp & 'I80428, c_false]
timing: 0.006 s
source
r_obj* ffi_vec_set_names(r_obj* x, r_obj* names) {
  // Comes from the R side, so `VCTRS_OWNERSHIP_foreign`
  return vec_set_names(x, names, VCTRS_OWNERSHIP_foreign);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:881

glue_as_name_spec untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.024 s
source
r_obj* glue_as_name_spec(r_obj* spec) {
  if (!r_is_string(spec)) {
    r_abort("Glue specification in `.name_spec` must be a single string.");
  }
  return vctrs_dispatch1(syms_glue_as_name_spec, fns_glue_as_name_spec,
                         syms_internal_spec, spec);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:650

int_detect_missing untypeable

untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.028 s
source
r_obj* int_detect_missing(r_obj* x) {
  DETECT_MISSING(int, r_int_cbegin, int_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:62

levels_union untypeable

unbound variable
error detail
name: vec_unique
timing: 0.055 s
source
static SEXP levels_union(SEXP x, SEXP y) {
  SEXP args = PROTECT(Rf_allocVector(VECSXP, 2));
  SET_VECTOR_ELT(args, 0, x);
  SET_VECTOR_ELT(args, 1, y);

  const struct name_repair_opts name_repair_opts = {
    .type = NAME_REPAIR_none,
    .fn = R_NilValue
  };

  // Combine with known ptype
  // No name repair because this is just combining factor levels
  SEXP xy = PROTECT(vec_c(
    args,
    r_globals.empty_chr,
    R_NilValue,
    &name_repair_opts,
    vec_args.empty,
    r_lazy_null
  ));

  SEXP out = vec_unique(xy);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:83

lgl_detect_missing untypeable

untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.028 s
source
r_obj* lgl_detect_missing(r_obj* x) {
  DETECT_MISSING(int, r_lgl_cbegin, lgl_is_missing);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:58

list_drop_empty untypeable

untypeable application
error detail
function: ([c_int] --> LGL) & ([c_true] --> LGL1)
argument: [c_int_na]
timing: 0.213 s
source
r_obj* list_drop_empty(r_obj* x) {
  if (!obj_is_list(x)) {
    r_abort("`x` must be a list.");
  }

  r_ssize i = 0;
  const r_ssize size = vec_size(x);

  r_obj* const* v_x = r_list_cbegin(x);

  // Locate first element to drop
  for (; i < size; ++i) {
    if (vec_size(v_x[i]) == 0) {
      break;
    }
  }

  if (i == size) {
    // Nothing to drop
    return x;
  }

  r_obj* keep = KEEP(r_alloc_logical(size));
  int* v_keep = r_lgl_begin(keep);

  for (r_ssize j = 0; j < i; ++j) {
    // Keep everything before first element to drop
    v_keep[j] = true;
  }

  // `i` should be dropped so handle that here
  v_keep[i] = false;
  ++i;

  for (; i < size; ++i) {
    v_keep[i] = vec_size(v_x[i]) != 0;
  }

  r_obj* out = vec_slice(x, keep);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/empty.c:10

list_encode_utf8 untypeable

untypeable application
error detail
function: [any_sexp, *c_int_na] --> c_void
argument: [any_sexp & 'I8106, *any]
timing: 0.025 s
source
r_obj* list_encode_utf8(r_obj* x) {
  bool owned = false;

  r_keep_loc pi;
  KEEP_HERE(x, &pi);

  r_ssize size = r_length(x);
  r_obj* const* p_x = r_list_cbegin(x);

  for (r_ssize i = 0; i < size; ++i) {
    r_obj* const elt_old = p_x[i];

    r_obj* const elt_new = obj_encode_utf8(elt_old);
    if (elt_old == elt_new) {
      continue;
    }
    KEEP(elt_new);

    if (!owned) {
      x = r_clone(x);
      KEEP_AT(x, pi);
      p_x = r_list_cbegin(x);
      owned = true;
    }

    r_list_poke(x, i, elt_new);
    FREE(1);
  }

  FREE(1);
  return x;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:96

list_location_to_location_indices untypeable

unbound variable
error detail
name: vec_subscript_materialize
timing: 1.76 s
source
r_obj* list_location_to_location_indices(r_obj* indices) {
  // Only clone if at least one index is compact, which is rare
  bool has_compact = false;

  const r_ssize indices_size = r_length(indices);
  r_obj* const* v_indices = r_list_cbegin(indices);

  for (r_ssize i = 0; i < indices_size; ++i) {
    r_obj* index = v_indices[i];

    if (is_compact_seq(index)) {
      has_compact = true;
      break;
    }
  }

  if (!has_compact) {
    // Nothing to do, we are already in expanded location form
    return indices;
  }

  // We probably don't own these, the user provides them.
  indices = KEEP(r_clone_referenced(indices));
  v_indices = r_list_cbegin(indices);

  for (r_ssize i = 0; i < indices_size; ++i) {
    r_obj* index = v_indices[i];

    if (is_compact_seq(index)) {
      r_list_poke(indices, i, vec_subscript_materialize(index));
    }
  }

  FREE(1);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1505

obj_encode_utf8 untypeable

unbound variable
error detail
name: chr_encode_utf8
timing: 0.014 s
source
r_obj* obj_encode_utf8(r_obj* x) {
  r_obj* out;

  switch (r_typeof(x)) {
  case R_TYPE_character: out = chr_encode_utf8(x); break;
  case R_TYPE_list: out = list_encode_utf8(x); break;
  default: out = x; break;
  }

  if (r_attrib_has_any(out)) {
    // Only `KEEP()` if there are attributes
    KEEP(out);
    // Pass down ownership to avoid a reclone if attributes change
    bool owned = x != out;
    out = obj_attrib_encode_utf8(out, owned);
    FREE(1);
  }

  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/encoding.c:28

posixct_as_posixlt untypeable

unbound variable
error detail
name: posixct_as_posixlt_impl
timing: 0.007 s
source
SEXP posixct_as_posixlt(SEXP x, SEXP to) {
  SEXP tzone = PROTECT(tzone_get(to));
  SEXP out = posixct_as_posixlt_impl(x, tzone);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:202

posixct_as_posixlt_impl untypeable

unbound variable
error detail
name: r_as_posixlt
timing: 0.001 s
source
static SEXP posixct_as_posixlt_impl(SEXP x, SEXP tzone) {
  return r_as_posixlt(x, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:209

posixlt_as_posixct untypeable

unbound variable
error detail
name: posixlt_as_posixct_impl
timing: 0.007 s
source
SEXP posixlt_as_posixct(SEXP x, SEXP to) {
  SEXP tzone = PROTECT(tzone_get(to));
  SEXP out = posixlt_as_posixct_impl(x, tzone);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:183

posixlt_as_posixct_impl untypeable

unbound variable
error detail
name: r_as_posixct
timing: 0.007 s
source
static SEXP posixlt_as_posixct_impl(SEXP x, SEXP tzone) {
  SEXP x_tzone = PROTECT(tzone_get(x));
  x = PROTECT(r_as_posixct(x, x_tzone));

  SEXP out = posixct_as_posixct_impl(x, tzone);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:190

posixlt_as_posixlt untypeable

untypeable application
error detail
function: [CHR, CHR] --> c_bool
argument: [any_sexp, any_sexp]
timing: 0.021 s
source
SEXP posixlt_as_posixlt(SEXP x, SEXP to) {
  SEXP x_tzone = PROTECT(tzone_get(x));
  SEXP to_tzone = PROTECT(tzone_get(to));

  if (tzone_equal(x_tzone, to_tzone)) {
    UNPROTECT(2);
    return x;
  }

  SEXP out = x;

  // `as.POSIXlt.default()` doesn't respect `tz` so we have to do:
  // POSIXlt<x-tzone> -> POSIXct<x-tzone> -> POSIXct<to-tzone> -> POSIXlt<to-tzone>
  out = PROTECT(posixlt_as_posixct_impl(out, x_tzone));
  out = PROTECT(posixct_as_posixct_impl(out, to_tzone));
  out = PROTECT(posixct_as_posixlt_impl(out, to_tzone));

  UNPROTECT(5);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:215

proxy_detect_missing untypeable

unbound variable
error detail
name: lgl_detect_missing
timing: 0.028 s
source
r_obj* proxy_detect_missing(r_obj* proxy) {
  const enum vctrs_type type = vec_proxy_typeof(proxy);

  switch (type) {
  case VCTRS_TYPE_logical: return lgl_detect_missing(proxy);
  case VCTRS_TYPE_integer: return int_detect_missing(proxy);
  case VCTRS_TYPE_double: return dbl_detect_missing(proxy);
  case VCTRS_TYPE_complex: return cpl_detect_missing(proxy);
  case VCTRS_TYPE_raw: return raw_detect_missing(proxy);
  case VCTRS_TYPE_character: return chr_detect_missing(proxy);
  case VCTRS_TYPE_list: return list_detect_missing(proxy);
  case VCTRS_TYPE_dataframe: return df_detect_missing(proxy);
  case VCTRS_TYPE_null: return r_globals.empty_lgl;
  case VCTRS_TYPE_scalar: stop_scalar_type(proxy, vec_args.empty, r_lazy_null);
  default: stop_unimplemented_vctrs_type("vec_detect_missing", type);
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:19

push_default untypeable

unbound variable
error detail
name: r_names
timing: 0.007 s
source
r_obj* push_default(
  r_obj* xs,
  r_obj* default_
) {
  const r_ssize xs_size = vec_size(xs);

  r_obj* xs_names = KEEP(r_names(xs));
  xs = KEEP(r_list_resize(xs, xs_size + 1));
  r_list_poke(xs, xs_size, default_);

  if (xs_names != r_null) {
    xs_names = r_chr_resize(xs_names, xs_size + 1);
    r_attrib_poke_names(xs, xs_names);
    r_chr_poke(xs_names, xs_size, r_strs.empty);
  }

  FREE(2);
  return xs;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1310

push_default_index untypeable

unbound variable
error detail
name: r_names
timing: 0.007 s
source
r_obj* push_default_index(
  r_obj* indices,
  r_obj* default_index
) {
  const r_ssize indices_size = vec_size(indices);

  r_obj* indices_names = KEEP(r_names(indices));
  indices = KEEP(r_list_resize(indices, indices_size + 1));
  r_list_poke(indices, indices_size, default_index);

  if (indices_names != r_null) {
    indices_names = r_chr_resize(indices_names, indices_size + 1);
    r_attrib_poke_names(indices, indices_names);
    r_chr_poke(indices_names, indices_size, r_strs.empty);
  }

  FREE(2);
  return indices;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/list-combine.c:1331

r_as_data_frame untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.011 s
source
SEXP r_as_data_frame(SEXP x) {
  if (is_bare_data_frame(x)) {
    return x;
  } else {
    return vctrs_dispatch1(syms_as_data_frame2, fns_as_data_frame2, syms_x, x);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:1422

r_as_date untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.001 s
source
static SEXP r_as_date(SEXP x) {
  return vctrs_dispatch1(syms_as_date, fns_as_date, syms_x, x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:483

r_as_not_s4 untypeable

untypeable application
error detail
function: [any_sexp] --> any_sexp
argument: [any_sexp & 'I5652, c_false, c_false]
timing: 0.004 s
source
static inline SEXP r_as_not_s4(SEXP x) {
  // - Return value must be used, unlike `UNSET_S4_OBJECT()`
  // - `Rf_asS4()` calls `shallow_duplicate(x)` if `MAYBE_SHARED(x)`
  // - `flag = 0` goes through `UNSET_S4_OBJECT()`
  // - `complete` is for S4 objects that wrap a "complete" S3 object by placing
  //   it in the `.Data` slot. If you set `complete = 1`, it will unwrap and
  //   return that, which we don't want. If `complete = 0`, no additional
  //   behavior will happen beyond the `UNSET_S4_OBJECT()` call.
  const Rboolean flag = 0;
  const int complete = 0;
  return Rf_asS4(x, flag, complete);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:278

r_as_posixct untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.002 s
source
static SEXP r_as_posixct(SEXP x, SEXP tzone) {
  return vctrs_dispatch2(syms_as_posixct, fns_as_posixct, syms_x, x, syms_tz, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:490

r_as_posixlt untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.002 s
source
static SEXP r_as_posixlt(SEXP x, SEXP tzone) {
  return vctrs_dispatch2(syms_as_posixlt, fns_as_posixlt, syms_x, x, syms_tz, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:497

r_attrib_get untypeable

untypeable application
error detail
function: [any_sexp, *([any_sexp, any_sexp, c_ptr] --> any_sexp), *any] --> any_sexp
argument: [any_sexp & 'I2811, *([any_sexp, any_sexp & 'I2824, c_ptr] -> c_null | 'I2824 & (<...> | c_null | null | p(CHR) | sym)), *('I2812 \ c_string)]
timing: 0.039 s
source
r_obj* r_attrib_get(r_obj* x, r_obj* tag) {
  r_obj* out = r_attrib_map(x, &r_attrib_get_cb, &tag);
  return out ? out : r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.c:10

r_chr_date_as_posixct untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.003 s
source
static SEXP r_chr_date_as_posixct(SEXP x, SEXP tzone) {
  return vctrs_dispatch2(syms_chr_date_as_posixct, fns_chr_date_as_posixct, syms_x, x, syms_tzone, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:511

r_chr_date_as_posixlt untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.003 s
source
static SEXP r_chr_date_as_posixlt(SEXP x, SEXP tzone) {
  return vctrs_dispatch2(syms_chr_date_as_posixlt, fns_chr_date_as_posixlt, syms_x, x, syms_tzone, tzone);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:518

r_class untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.003 s
source
r_obj* r_class(r_obj* x) {
  return r_attrib_get(x, r_syms.class_);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:47

r_date_as_character untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.001 s
source
static SEXP r_date_as_character(SEXP x) {
  return vctrs_dispatch1(syms_date_as_character, fns_date_as_character, syms_x, x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:504

r_dim untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.002 s
source
r_obj* r_dim(r_obj* x) {
  return r_attrib_get(x, r_syms.dim);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:54

r_dim_names untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.003 s
source
r_obj* r_dim_names(r_obj* x) {
  return r_attrib_get(x, r_syms.dim_names);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:59

r_eval_with_x untypeable

untypeable application
error detail
function: [env, sym, any_sexp] --> ()
argument: [env, any_sexp, any_sexp & 'I5579]
timing: 0.024 s
source
r_obj* r_eval_with_x(r_obj* call, r_obj* x, r_obj* parent) {
  r_obj* env = KEEP(r_alloc_environment(1, parent));
  r_env_bind(env, r_syms.x, x);

  r_obj* out = r_eval(call, env);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:4

r_eval_with_xyz untypeable

untypeable application
error detail
function: [env, sym, any_sexp] --> ()
argument: [env, any_sexp, any_sexp & 'I28846]
timing: 0.029 s
source
r_obj* r_eval_with_xyz(r_obj* call, r_obj* x, r_obj* y, r_obj* z, r_obj* parent) {
  r_obj* env = KEEP(r_alloc_environment(3, parent));
  r_env_bind(env, r_syms.x, x);
  r_env_bind(env, r_syms.y, y);
  r_env_bind(env, r_syms.z, z);

  r_obj* out = r_eval(call, env);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.c:23

r_init_library untypeable

untypeable application
error detail
function: [c_string, env] --> any_sexp
argument: [c("new.env(hash = FALSE, parent = baseenv(), size = 1L)"), any_sexp]
timing: 0.025 s
source
r_obj* r_init_library(r_obj* ns) {
  if (!R_IsNamespaceEnv(ns)) {
    Rf_errorcall(r_null,
                 "Can't initialise rlang library.\n"
                 "x `ns` must be a namespace environment.");
  }

  // Local precious lists are disabled by default because rchk
  // requires the base precious list and we don't want to
  // double-preserve. Still enable it on CI to get that part of the
  // code tested.
  _r_use_local_precious_list =
    getenv("RLIB_USE_LOCAL_PRECIOUS_LIST") ||
    getenv("CI");

  // Need to be first
  r_init_library_vendor(); // Needed for xxh used in `r_preserve()`
  r_init_library_globals_syms();
  r_init_library_obj(ns);
  r_init_library_globals(ns);

  shared_x_env = r_parse_eval("new.env(hash = FALSE, parent = baseenv(), size = 1L)", r_envs.base);
  r_preserve(shared_x_env);

  shared_xy_env = r_parse_eval("new.env(hash = FALSE, parent = baseenv(), size = 1L)", r_envs.base);
  r_preserve(shared_xy_env);

  shared_xyz_env = r_parse_eval("new.env(hash = FALSE, parent = baseenv(), size = 1L)", r_envs.base);
  r_preserve(shared_xyz_env);

  r_init_library_sym();
  r_init_library_eval();
  r_init_library_env();
  r_init_rlang_ns_env();
  r_init_library_arg();
  r_init_library_call();
  r_init_library_cnd();
  r_init_library_dyn_array();
  r_init_library_fn();
  r_init_library_quo();
  r_init_library_session();
  r_init_library_stack();

  // Return a SEXP so the init function can be called from R
  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/rlang.c:78

r_names untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.003 s
source
r_obj* r_names(r_obj* x) {
  return r_attrib_get(x, r_syms.names);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/attrib.h:64

remove_na_levels untypeable

unbound variable
error detail
name: vec_slice
timing: 0.124 s
source
static SEXP remove_na_levels(SEXP levels) {
  R_len_t size = vec_size(levels);
  const SEXP* p_levels = STRING_PTR_RO(levels);

  // There might only ever be 1 `NA` level.
  // Remove it if it exists.
  for (R_len_t i = 0; i < size; ++i) {
    if (p_levels[i] == NA_STRING) {
      int na_loc = (i + 1) * -1;

      SEXP na_loc_obj = PROTECT(r_int(na_loc));
      SEXP out = vec_slice(levels, na_loc_obj);

      UNPROTECT(1);
      return out;
    }
  }

  return levels;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:228

set_names_dispatch untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.002 s
source
r_obj* set_names_dispatch(r_obj* x, r_obj* names) {
  return vctrs_dispatch2(syms_set_names_dispatch, fns_set_names_dispatch,
                         syms_x, x,
                         syms_names, names);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:741

set_rownames_dispatch untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.002 s
source
r_obj* set_rownames_dispatch(r_obj* x, r_obj* names) {
  return vctrs_dispatch2(syms_set_rownames_dispatch, fns_set_rownames_dispatch,
                         syms_x, x,
                         syms_names, names);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:734

shaped_as_df_col untypeable

unbound variable
error detail
name: r_as_data_frame
timing: 0.004 s
source
r_obj* shaped_as_df_col(r_obj* x, r_obj* outer) {
  // If packed, store array as a column
  if (outer != strings_empty) {
    return x;
  }

  // If unpacked, transform to data frame first. We repair names
  // after unpacking and concatenation.
  r_obj* out = KEEP(r_as_data_frame(x));

  // Remove names if they were repaired by `as.data.frame()`
  if (colnames(x) == r_null) {
    r_attrib_poke_names(out, r_null);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/bind.c:721

vctrs_count untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.038 s
source
SEXP vctrs_count(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  SEXP count = PROTECT_N(Rf_allocVector(INTSXP, d->size), &nprot);
  int* p_count = INTEGER(count);

  // Load dictionary and accumulate `p_count`
  vctrs_count_loop(d, n, p_count);

  // Create output
  SEXP out_loc = PROTECT_N(Rf_allocVector(INTSXP, d->used), &nprot);
  int* p_out_loc = INTEGER(out_loc);

  // Reuse `count` storage, which will be narrowed
  SEXP out_count = count;
  int* p_out_count = p_count;

  int i = 0;
  for (uint32_t hash = 0; hash < d->size; ++hash) {
    if (d->key[hash] == DICT_EMPTY) {
      continue;
    }

    p_out_loc[i] = d->key[hash] + 1;
    p_out_count[i] = p_count[hash];
    i++;
  }

  out_count = PROTECT_N(r_int_resize(out_count, d->used), &nprot);

  SEXP out = PROTECT_N(Rf_allocVector(VECSXP, 2), &nprot);
  SET_VECTOR_ELT(out, 0, out_loc);
  SET_VECTOR_ELT(out, 1, out_count);
  SEXP names = PROTECT_N(Rf_allocVector(STRSXP, 2), &nprot);
  SET_STRING_ELT(names, 0, Rf_mkChar("loc"));
  SET_STRING_ELT(names, 1, Rf_mkChar("count"));
  Rf_setAttrib(out, R_NamesSymbol, names);
  init_data_frame(out, d->used);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:739

vctrs_date_validate untypeable entry .Call

unbound variable
error detail
name: date_validate
timing: 0.001 s
source
SEXP vctrs_date_validate(SEXP x) {
  return date_validate(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:329

vctrs_detect_complete untypeable entry .Call

unbound variable
error detail
name: vec_detect_complete
timing: 0.001 s
source
SEXP vctrs_detect_complete(SEXP x) {
  return vec_detect_complete(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:43

vctrs_dim untypeable entry .Call

unbound variable
error detail
name: vec_dim
timing: 0.001 s
source
SEXP vctrs_dim(SEXP x) {
  return vec_dim(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.c:4

vctrs_dispatch1 untypeable

untypeable application
error detail
function: [any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
argument: [any_sexp & 'I7264, any_sexp & 'I7265, *(c_null | 'I7266 \ c_string), *(c_null | 'I7267 \ c_string)]
timing: 0.043 s
source
SEXP vctrs_dispatch1(SEXP fn_sym, SEXP fn,
                     SEXP x_sym, SEXP x) {
  SEXP syms[2] = { x_sym, NULL };
  SEXP args[2] = { x, NULL };
  return vctrs_dispatch_n(fn_sym, fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:162

vctrs_dispatch2 untypeable

untypeable application
error detail
function: [any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
argument: [any_sexp & 'I19484, any_sexp & 'I19485, *(c_null | 'I19486 \ c_string), *(c_null | 'I19487 \ c_string)]
timing: 0.083 s
source
SEXP vctrs_dispatch2(SEXP fn_sym, SEXP fn,
                     SEXP x_sym, SEXP x,
                     SEXP y_sym, SEXP y) {
  SEXP syms[3] = { x_sym, y_sym, NULL };
  SEXP args[3] = { x, y, NULL };
  return vctrs_dispatch_n(fn_sym, fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:168

vctrs_dispatch3 untypeable

untypeable application
error detail
function: [any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
argument: [any_sexp & 'I14984, any_sexp & 'I14985, *(c_null | 'I14986 \ c_string), *(c_null | 'I14987 \ c_string)]
timing: 0.127 s
source
SEXP vctrs_dispatch3(SEXP fn_sym, SEXP fn,
                     SEXP x_sym, SEXP x,
                     SEXP y_sym, SEXP y,
                     SEXP z_sym, SEXP z) {
  SEXP syms[4] = { x_sym, y_sym, z_sym, NULL };
  SEXP args[4] = { x, y, z, NULL };
  return vctrs_dispatch_n(fn_sym, fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:175

vctrs_dispatch5 untypeable

untypeable application
error detail
function: [any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
argument: [any_sexp & 'I6211, any_sexp & 'I6212, *(c_null | 'I6213 \ c_string), *(c_null | 'I6214 \ c_string)]
timing: 0.214 s
source
r_obj* vctrs_dispatch5(r_obj* fn_sym, r_obj* fn,
                     r_obj* x1_sym, r_obj* x1,
                     r_obj* x2_sym, r_obj* x2,
                     r_obj* x3_sym, r_obj* x3,
                     r_obj* x4_sym, r_obj* x4,
                     r_obj* x5_sym, r_obj* x5) {
  r_obj* syms[6] = { x1_sym, x2_sym, x3_sym, x4_sym, x5_sym, NULL };
  r_obj* args[6] = { x1, x2, x3, x4, x5, NULL };
  return vctrs_dispatch_n(fn_sym, fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:76

vctrs_dispatch6 untypeable

untypeable application
error detail
function: [any_sexp, any_sexp, *any_sexp, *any_sexp] --> any_sexp
argument: [any_sexp & 'I44444, any_sexp & 'I44445, *(c_null | 'I44446 \ c_string), *(c_null | 'I44447 \ c_string)]
timing: 0.328 s
source
SEXP vctrs_dispatch6(SEXP fn_sym, SEXP fn,
                     SEXP x1_sym, SEXP x1,
                     SEXP x2_sym, SEXP x2,
                     SEXP x3_sym, SEXP x3,
                     SEXP x4_sym, SEXP x4,
                     SEXP x5_sym, SEXP x5,
                     SEXP x6_sym, SEXP x6) {
  SEXP syms[7] = { x1_sym, x2_sym, x3_sym, x4_sym, x5_sym, x6_sym, NULL };
  SEXP args[7] = { x1, x2, x3, x4, x5, x6, NULL };
  return vctrs_dispatch_n(fn_sym, fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:192

vctrs_duplicated untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.039 s
source
SEXP vctrs_duplicated(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  SEXP out = PROTECT_N(Rf_allocVector(LGLSXP, n), &nprot);
  int* p_out = LOGICAL(out);
  r_memset(p_out, 0, n * sizeof(int));

  uint32_t* p_hashes = (uint32_t*) R_alloc(n, sizeof(uint32_t));

  vctrs_duplicated_loop(d, n, p_hashes, p_out);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:823

vctrs_eval_mask1 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I14712, *(c_null | 'I14713 \ c_string), *(c_null | 'I14714 \ c_string)]
timing: 0.059 s
source
SEXP vctrs_eval_mask1(SEXP fn,
                      SEXP x_sym, SEXP x) {
  SEXP syms[2] = { x_sym, NULL };
  SEXP args[2] = { x, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:65

vctrs_eval_mask2 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I8536, *(c_null | 'I8537 \ c_string), *(c_null | 'I8538 \ c_string)]
timing: 0.072 s
source
SEXP vctrs_eval_mask2(SEXP fn,
                      SEXP x_sym, SEXP x,
                      SEXP y_sym, SEXP y) {
  SEXP syms[3] = { x_sym, y_sym, NULL };
  SEXP args[3] = { x, y, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:71

vctrs_eval_mask4 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I11052, *(c_null | 'I11053 \ c_string), *(c_null | 'I11054 \ c_string)]
timing: 0.190 s
source
SEXP vctrs_eval_mask4(SEXP fn,
                      SEXP x1_sym, SEXP x1,
                      SEXP x2_sym, SEXP x2,
                      SEXP x3_sym, SEXP x3,
                      SEXP x4_sym, SEXP x4) {
  SEXP syms[5] = { x1_sym, x2_sym, x3_sym, x4_sym, NULL };
  SEXP args[5] = { x1, x2, x3, x4, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:86

vctrs_eval_mask5 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I9911, *(c_null | 'I9912 \ c_string), *(c_null | 'I9913 \ c_string)]
timing: 0.253 s
source
SEXP vctrs_eval_mask5(SEXP fn,
                      SEXP x1_sym, SEXP x1,
                      SEXP x2_sym, SEXP x2,
                      SEXP x3_sym, SEXP x3,
                      SEXP x4_sym, SEXP x4,
                      SEXP x5_sym, SEXP x5) {
  SEXP syms[6] = { x1_sym, x2_sym, x3_sym, x4_sym, x5_sym, NULL };
  SEXP args[6] = { x1, x2, x3, x4, x5, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:95

vctrs_eval_mask6 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I8629, *(c_null | 'I8630 \ c_string), *(c_null | 'I8631 \ c_string)]
timing: 0.307 s
source
SEXP vctrs_eval_mask6(SEXP fn,
                      SEXP x1_sym, SEXP x1,
                      SEXP x2_sym, SEXP x2,
                      SEXP x3_sym, SEXP x3,
                      SEXP x4_sym, SEXP x4,
                      SEXP x5_sym, SEXP x5,
                      SEXP x6_sym, SEXP x6) {
  SEXP syms[7] = { x1_sym, x2_sym, x3_sym, x4_sym, x5_sym, x6_sym, NULL };
  SEXP args[7] = { x1, x2, x3, x4, x5, x6, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:105

vctrs_eval_mask7 untypeable

untypeable application
error detail
function: [any_sexp, *any_sexp, *any_sexp] --> any
argument: [any_sexp & 'I39556, *(c_null | 'I39557 \ c_string), *(c_null | 'I39558 \ c_string)]
timing: 0.390 s
source
SEXP vctrs_eval_mask7(SEXP fn,
                      SEXP x1_sym, SEXP x1,
                      SEXP x2_sym, SEXP x2,
                      SEXP x3_sym, SEXP x3,
                      SEXP x4_sym, SEXP x4,
                      SEXP x5_sym, SEXP x5,
                      SEXP x6_sym, SEXP x6,
                      SEXP x7_sym, SEXP x7) {
  SEXP syms[8] = { x1_sym, x2_sym, x3_sym, x4_sym, x5_sym, x6_sym, x7_sym, NULL };
  SEXP args[8] = { x1, x2, x3, x4, x5, x6, x7, NULL };
  return vctrs_eval_mask_n(fn, syms, args);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:116

vctrs_group_id untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.033 s
source
SEXP vctrs_group_id(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  SEXP out = PROTECT_N(Rf_allocVector(INTSXP, n), &nprot);
  int* p_out = INTEGER(out);

  vctrs_group_id_loop(d, n, p_out);

  SEXP n_groups = PROTECT_N(Rf_ScalarInteger(d->used), &nprot);
  Rf_setAttrib(out, syms_n, n_groups);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:7

vctrs_group_rle untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.039 s
source
SEXP vctrs_group_rle(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  SEXP g = PROTECT_N(Rf_allocVector(INTSXP, n), &nprot);
  int* p_g = INTEGER(g);

  SEXP l = PROTECT_N(Rf_allocVector(INTSXP, n), &nprot);
  int* p_l = INTEGER(l);

  if (n == 0) {
    SEXP out = PROTECT_N(new_group_rle(g, l, 0), &nprot);
    UNPROTECT(nprot);
    return out;
  }

  const R_len_t size = vctrs_group_rle_loop(d, n, p_g, p_l);

  g = PROTECT_N(Rf_lengthgets(g, size), &nprot);
  l = PROTECT_N(Rf_lengthgets(l, size), &nprot);

  SEXP out = new_group_rle(g, l, d->used);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:70

vctrs_id untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.019 s
source
SEXP vctrs_id(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  SEXP out = PROTECT_N(Rf_allocVector(INTSXP, n), &nprot);
  int* p_out = INTEGER(out);

  vctrs_id_loop(d, n, p_out);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:321

vctrs_init_library untypeable entry .Call

unbound variable
error detail
name: r_init_library
timing: 0.001 s
source
r_obj* vctrs_init_library(r_obj* ns) {
  r_init_library(ns);

  vctrs_init_bind(ns);
  vctrs_init_cast(ns);
  vctrs_init_data(ns);
  vctrs_init_dictionary(ns);
  vctrs_init_interval(ns);
  vctrs_init_match(ns);
  vctrs_init_names(ns);
  vctrs_init_proxy_restore(ns);
  vctrs_init_slice(ns);
  vctrs_init_slice_assign(ns);
  vctrs_init_subscript(ns);
  vctrs_init_subscript_loc(ns);
  vctrs_init_ptype(ns);
  vctrs_init_ptype2(ns);
  vctrs_init_ptype2_dispatch(ns);
  vctrs_init_rep(ns);
  vctrs_init_type_data_frame(ns);
  vctrs_init_type_date_time(ns);
  vctrs_init_type_info(ns);
  vctrs_init_unspecified(ns);
  vctrs_init_utils(ns);
  vctrs_init_globals(ns);

  return r_null;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/init.c:470

vctrs_integer64_proxy untypeable entry .Call

unbound variable
error detail
name: r_attrib_get
timing: 0.021 s
source
r_obj* vctrs_integer64_proxy(r_obj* x) {
  if (r_typeof(x) != R_TYPE_double) {
    r_stop_internal("`x` must be a double.");
  }
  if (r_attrib_get(x, R_DimSymbol) != r_null) {
    r_stop_internal("`x` should not have a `dim` attribute.");
  }

  r_ssize size = r_length(x);
  // Casting `const double*` to `const long long*` is UB, but we are mimicking
  // what bit64 is doing, so if this ever breaks it means that bit64 is broken.
  const long long* v_x = (const long long*) r_dbl_cbegin(x);

  r_obj* nms = KEEP(r_chr_n(
    v_integer64_proxy_df_names_c_strings,
    INTEGER64_PROXY_DF_SIZE
  ));

  r_obj* out = KEEP(r_alloc_df_list(
    size,
    nms,
    v_integer64_proxy_df_types,
    INTEGER64_PROXY_DF_SIZE
  ));

  r_init_data_frame(out, size);

  r_obj* left = r_list_get(out, INTEGER64_PROXY_DF_LOCS_left);
  r_obj* right = r_list_get(out, INTEGER64_PROXY_DF_LOCS_right);

  double* v_left = r_dbl_begin(left);
  double* v_right = r_dbl_begin(right);

  for (r_ssize i = 0; i < size; ++i) {
    const long long elt = v_x[i];

    if (elt == r_na_llong) {
      v_left[i] = r_globals.na_dbl;
      v_right[i] = r_globals.na_dbl;
      continue;
    }

    const int64_t elt_i64 = (int64_t) elt;

    int64_unpack(elt_i64, i, v_left, v_right);
  }

  FREE(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-integer64.c:25

vctrs_list_drop_empty untypeable entry .Call

unbound variable
error detail
name: list_drop_empty
timing: 0.001 s
source
r_obj* vctrs_list_drop_empty(r_obj* x) {
  return list_drop_empty(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/empty.c:5

vctrs_locate_complete untypeable entry .Call

unbound variable
error detail
name: vec_locate_complete
timing: 0.001 s
source
SEXP vctrs_locate_complete(SEXP x) {
  return vec_locate_complete(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:28

vctrs_n_distinct untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.012 s
source
SEXP vctrs_n_distinct(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  vctrs_n_distinct_loop(d, n);

  UNPROTECT(nprot);
  return Rf_ScalarInteger(d->used);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:274

vctrs_slice_complete untypeable entry .Call

unbound variable
error detail
name: vec_slice_complete
timing: 0.001 s
source
SEXP vctrs_slice_complete(SEXP x) {
  return vec_slice_complete(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:8

vctrs_unique_loc untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.024 s
source
SEXP vctrs_unique_loc(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  x = PROTECT_N(vec_proxy_equal(x), &nprot);
  x = PROTECT_N(obj_encode_utf8(x), &nprot);

  struct dictionary* d = new_dictionary(x);
  PROTECT_DICT(d, &nprot);

  struct growable g = new_growable(INTSXP, 256);
  PROTECT_GROWABLE(&g, &nprot);

  vctrs_unique_loc_loop(d, &g, n);

  SEXP out = growable_values(&g);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:156

vec_bare_dim untypeable

unbound variable
error detail
name: r_dim
timing: 0.001 s
source
static inline SEXP vec_bare_dim(SEXP x) {
  return r_dim(x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.h:9

vec_detect_complete untypeable

unbound variable
error detail
name: vec_proxy_equal
timing: 0.013 s
source
SEXP vec_detect_complete(SEXP x) {
  SEXP proxy = PROTECT(vec_proxy_equal(x));

  R_len_t size = vec_size(proxy);

  SEXP out = PROTECT(r_new_logical(size));
  int* p_out = LOGICAL(out);

  // Initialize assuming fully complete
  for (R_len_t i = 0; i < size; ++i) {
    p_out[i] = 1;
  }

  vec_detect_complete_switch(proxy, size, p_out);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:50

vec_detect_missing untypeable

unbound variable
error detail
name: vec_proxy_equal
timing: 0.002 s
source
r_obj* vec_detect_missing(r_obj* x) {
  r_obj* proxy = KEEP(vec_proxy_equal(x));
  r_obj* out = proxy_detect_missing(proxy);
  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/missing.c:11

vec_dim untypeable

unbound variable
error detail
name: vec_bare_dim
timing: 0.002 s
source
static inline SEXP vec_dim(SEXP x) {
  SEXP dim = vec_bare_dim(x);

  if (dim == R_NilValue) {
    dim = r_int(Rf_length(x));
  }

  return dim;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dim.h:17

vec_group_loc untypeable entry .Call

unbound variable
error detail
name: vec_proxy_equal
timing: 0.070 s
source
SEXP vec_group_loc(SEXP x) {
  int nprot = 0;

  R_len_t n = vec_size(x);

  SEXP proxy = PROTECT_N(vec_proxy_equal(x), &nprot);
  proxy = PROTECT_N(obj_encode_utf8(proxy), &nprot);

  struct dictionary* d = new_dictionary(proxy);
  PROTECT_DICT(d, &nprot);

  SEXP groups = PROTECT_N(Rf_allocVector(INTSXP, n), &nprot);
  int* p_groups = INTEGER(groups);

  // Identify groups
  vec_group_loc_loop(d, n, p_groups);

  const int n_groups = d->used;

  // Location of first occurence of each group in `x`
  SEXP key_loc = PROTECT_N(Rf_allocVector(INTSXP, n_groups), &nprot);
  int* p_key_loc = INTEGER(key_loc);
  int key_loc_current = 0;

  // Count of the number of elements in each group
  SEXP counts = PROTECT_N(Rf_allocVector(INTSXP, n_groups), &nprot);
  int* p_counts = INTEGER(counts);
  r_memset(p_counts, 0, n_groups * sizeof(int));

  for (int i = 0; i < n; ++i) {
    const int group = p_groups[i];

    if (group == key_loc_current) {
      p_key_loc[key_loc_current] = i + 1;
      ++key_loc_current;
    }

    ++p_counts[group];
  }

  SEXP out_loc = PROTECT_N(Rf_allocVector(VECSXP, n_groups), &nprot);

  // Direct pointer to the location vectors we store in `out_loc`
  int** p_elt_loc = (int**) R_alloc(n_groups, sizeof(int*));

  // Initialize `out_loc` to a list of integers with sizes corresponding
  // to the number of elements in that group
  for (int i = 0; i < n_groups; ++i) {
    SEXP elt_loc = Rf_allocVector(INTSXP, p_counts[i]);
    p_elt_loc[i] = INTEGER(elt_loc);
    SET_VECTOR_ELT(out_loc, i, elt_loc);
  }

  // The current location we are updating, each group has its own counter
  SEXP locations = PROTECT_N(Rf_allocVector(INTSXP, n_groups), &nprot);
  int* p_locations = INTEGER(locations);
  r_memset(p_locations, 0, n_groups * sizeof(int));

  // Fill in the location values for each group
  for (int i = 0; i < n; ++i) {
    const int group = p_groups[i];
    const int location = p_locations[group];
    p_elt_loc[group][location] = i + 1;
    ++p_locations[group];
  }

  SEXP out_key = PROTECT_N(vec_slice(x, key_loc), &nprot);

  // Construct output data frame
  SEXP out = PROTECT_N(Rf_allocVector(VECSXP, 2), &nprot);
  SET_VECTOR_ELT(out, 0, out_key);
  SET_VECTOR_ELT(out, 1, out_loc);

  SEXP names = PROTECT_N(Rf_allocVector(STRSXP, 2), &nprot);
  SET_STRING_ELT(names, 0, strings_key);
  SET_STRING_ELT(names, 1, strings_loc);

  Rf_setAttrib(out, R_NamesSymbol, names);

  out = new_data_frame(out, n_groups);

  UNPROTECT(nprot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/group.c:191

vec_interval_complement untypeable

untypeable application
error detail
function: [null & 'I88822] --> null & 'I88822
argument: [any_sexp]
timing: 0.292 s
source
r_obj* vec_interval_complement(r_obj* start,
                               r_obj* end,
                               r_obj* lower,
                               r_obj* upper) {
  int n_prot = 0;

  int _;
  r_obj* ptype = vec_ptype2(
    start,
    end,
    args_start,
    args_end,
    r_lazy_null,
    S3_FALLBACK_false,
    &_
  );
  KEEP_N(ptype, &n_prot);
  ptype = KEEP_N(vec_ptype_finalise(ptype), &n_prot);

  start = vec_cast_params(
    start,
    ptype,
    args_start,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(start, &n_prot);

  end = vec_cast_params(
    end,
    ptype,
    args_end,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(end, &n_prot);

  r_obj* start_proxy = KEEP_N(vec_proxy_compare(start), &n_prot);
  start_proxy = KEEP_N(obj_encode_utf8(start_proxy), &n_prot);

  r_obj* end_proxy = KEEP_N(vec_proxy_compare(end), &n_prot);
  end_proxy = KEEP_N(obj_encode_utf8(end_proxy), &n_prot);

  const enum vctrs_type type_proxy = vec_proxy_typeof(start_proxy);

  struct poly_vec* p_poly_start = new_poly_vec(start_proxy, type_proxy);
  KEEP_N(p_poly_start->shelter, &n_prot);
  const void* p_start = p_poly_start->p_vec;

  struct poly_vec* p_poly_end = new_poly_vec(end_proxy, type_proxy);
  KEEP_N(p_poly_end->shelter, &n_prot);
  const void* p_end = p_poly_end->p_vec;

  poly_binary_int_fn* const fn_compare = poly_p_compare_na_equal(type_proxy);

  bool use_lower = (lower != r_null);
  bool use_upper = (upper != r_null);

  bool append_lower = false;
  bool append_upper = false;

  const void* p_lower = NULL;
  if (use_lower) {
    if (vec_size(lower) != 1) {
      r_abort("`lower` must be size 1.");
    }

    lower = vec_cast_params(
      lower,
      ptype,
      args_lower,
      vec_args.empty,
      r_lazy_null,
      S3_FALLBACK_false
    );
    KEEP_N(lower, &n_prot);

    r_obj* lower_proxy = KEEP_N(vec_proxy_compare(lower), &n_prot);
    lower_proxy = KEEP_N(obj_encode_utf8(lower_proxy), &n_prot);

    r_obj* lower_complete = KEEP_N(vec_detect_complete(lower_proxy), &n_prot);
    if (!r_lgl_get(lower_complete, 0)) {
      r_abort("`lower` can't contain missing values.");
    }

    struct poly_vec* p_poly_lower = new_poly_vec(lower_proxy, type_proxy);
    KEEP_N(p_poly_lower->shelter, &n_prot);
    p_lower = p_poly_lower->p_vec;
  }

  const void* p_upper = NULL;
  if (use_upper) {
    if (vec_size(upper) != 1) {
      r_abort("`upper` must be size 1.");
    }

    upper = vec_cast_params(
      upper,
      ptype,
      args_upper,
      vec_args.empty,
      r_lazy_null,
      S3_FALLBACK_false
    );
    KEEP_N(upper, &n_prot);

    r_obj* upper_proxy = KEEP_N(vec_proxy_compare(upper), &n_prot);
    upper_proxy = KEEP_N(obj_encode_utf8(upper_proxy), &n_prot);

    r_obj* upper_complete = KEEP_N(vec_detect_complete(upper_proxy), &n_prot);
    if (!r_lgl_get(upper_complete, 0)) {
      r_abort("`upper` can't contain missing values.");
    }

    struct poly_vec* p_poly_upper = new_poly_vec(upper_proxy, type_proxy);
    KEEP_N(p_poly_upper->shelter, &n_prot);
    p_upper = p_poly_upper->p_vec;
  }

  if (use_lower && use_upper && fn_compare(p_lower, 0, p_upper, 0) >= 0) {
    // Handle the special case of `lower >= upper` up front.
    // This could also be an error, but we try to be a little flexible.
    // These can't follow the standard code path because it assumes
    // `lower < upper`, like the rest of the intervals.
    // - `lower > upper` is an invalid interval.
    // - `lower = upper` will always result in an empty complement.
    r_obj* out = KEEP_N(r_new_list(2), &n_prot);
    r_list_poke(out, 0, vec_slice_unsafe(start, r_globals.empty_int));
    r_list_poke(out, 1, vec_slice_unsafe(end, r_globals.empty_int));

    r_obj* out_names = r_new_character(2);
    r_attrib_poke_names(out, out_names);
    r_chr_poke(out_names, 0, r_str("start"));
    r_chr_poke(out_names, 1, r_str("end"));

    r_init_data_frame(out, 0);

    FREE(n_prot);
    return out;
  }

  // Merge to sort, remove all missings, and merge all abutting intervals
  const bool abutting = true;
  const bool locations = false;
  r_obj* minimal = KEEP_N(vec_interval_group_info(
    start,
    end,
    abutting,
    VCTRS_INTERVAL_MISSING_drop,
    locations
  ), &n_prot);
  const int* v_loc_minimal_start = r_int_cbegin(r_list_get(minimal, 0));
  const int* v_loc_minimal_end = r_int_cbegin(r_list_get(minimal, 1));

  r_ssize size = vec_size(minimal);

  // Because we have the minimal interval information (i.e. no intervals overlap
  // or abut!), we know that the complement takes exactly `size - 1` space if
  // `lower` and `upper` aren't used.
  //
  // If `lower` is used, it can at most add one more interval, and
  // requires one more `loc_end` location. No `loc_start` location is needed
  // because we just append `lower` to the front if needed.
  //
  // If `upper` is used, it can at most add one more interval, and
  // requires one more `loc_start` location. No `loc_end` location is needed
  // because we just append `upper` to the end if needed.
  const r_ssize max_size_start = r_ssize_max(size - 1 + use_upper, 0);
  const r_ssize max_size_end = r_ssize_max(size - 1 + use_lower, 0);

  r_obj* loc_start = KEEP_N(r_alloc_integer(max_size_start), &n_prot);
  int* v_loc_start = r_int_begin(loc_start);
  r_ssize i_start = 0;

  r_obj* loc_end = KEEP_N(r_alloc_integer(max_size_end), &n_prot);
  int* v_loc_end = r_int_begin(loc_end);
  r_ssize i_end = 0;

  r_ssize i = 0;

  r_ssize loc_lower_is_after_start_of = -1;
  r_ssize loc_lower_is_before_end_of = 0;

  if (use_lower) {
    // Shift `i` forward to the first interval completely past `lower`.
    // Track information about where `lower` is in relation to the intervals.
    for (; i < size; ++i) {
      const r_ssize loc_start = v_loc_minimal_start[i] - 1;
      const r_ssize loc_end = v_loc_minimal_end[i] - 1;

      if (fn_compare(p_lower, 0, p_end, loc_end) == 1) {
        ++loc_lower_is_before_end_of;
        ++loc_lower_is_after_start_of;
      } else if (fn_compare(p_lower, 0, p_start, loc_start) >= 0) {
        ++loc_lower_is_after_start_of;
      } else {
        break;
      }
    }
  }

  r_ssize loc_upper_is_after_start_of = size - 1;
  r_ssize loc_upper_is_before_end_of = size;

  if (use_upper) {
    // Shift `size` backwards to the first interval that is completely before `upper`.
    // Track information about where `upper` is in relation to the intervals.
    for (; size - 1 >= 0; --size) {
      const r_ssize loc_start = v_loc_minimal_start[size - 1] - 1;
      const r_ssize loc_end = v_loc_minimal_end[size - 1] - 1;

      if (fn_compare(p_upper, 0, p_start, loc_start) == -1) {
        --loc_upper_is_before_end_of;
        --loc_upper_is_after_start_of;
      } else if (fn_compare(p_upper, 0, p_end, loc_end) <= 0) {
        --loc_upper_is_before_end_of;
      } else {
        break;
      }
    }
  }

  const bool has_intervals_between = i < size;

  if (use_lower && has_intervals_between) {
    r_ssize loc_gap_start = -1;
    if (loc_lower_is_before_end_of == loc_lower_is_after_start_of) {
      // `lower` is in the middle of an interval, use the end of that interval
      loc_gap_start = v_loc_minimal_end[loc_lower_is_before_end_of] - 1;
    } else {
      // `lower` is not within an interval, use `lower`
      append_lower = true;
    }

    // The next start location is the end of the interval that `loc_gap_start`
    // lines up with. We know this start location exists because of
    // `has_intervals_between`.
    const r_ssize loc_gap_end = v_loc_minimal_start[loc_lower_is_after_start_of + 1] - 1;

    if (!append_lower) {
      v_loc_start[i_start] = loc_gap_start + 1;
      ++i_start;
    }
    v_loc_end[i_end] = loc_gap_end + 1;
    ++i_end;
  }

  r_ssize loc_previous_end = -1;

  if (i < size) {
    // Set information about first usable interval
    loc_previous_end = v_loc_minimal_end[i] - 1;
    ++i;
  }

  for (; i < size; ++i) {
    const r_ssize loc_elt_start = v_loc_minimal_start[i] - 1;
    const r_ssize loc_elt_end = v_loc_minimal_end[i] - 1;

    const r_ssize loc_gap_start = loc_previous_end;
    const r_ssize loc_gap_end = loc_elt_start;

    v_loc_start[i_start] = loc_gap_start + 1;
    ++i_start;

    v_loc_end[i_end] = loc_gap_end + 1;
    ++i_end;

    loc_previous_end = loc_elt_end;
  }

  if (use_upper && has_intervals_between) {
    // The previous end location is the start of the interval that `loc_gap_end`
    // lines up with. We know this end location exists because of
    // `has_intervals_between`.
    const r_ssize loc_gap_start = v_loc_minimal_end[loc_upper_is_before_end_of - 1] - 1;

    r_ssize loc_gap_end = -1;
    if (loc_upper_is_before_end_of == loc_upper_is_after_start_of) {
      // `upper` is in the middle of an interval, use the start of that interval
      loc_gap_end = v_loc_minimal_start[loc_upper_is_before_end_of] - 1;
    } else {
      // `upper` is not within an interval, use `upper`
      append_upper = true;
    }

    v_loc_start[i_start] = loc_gap_start + 1;
    ++i_start;
    if (!append_upper) {
      v_loc_end[i_end] = loc_gap_end + 1;
      ++i_end;
    }
  }

  if (use_lower && use_upper && !has_intervals_between) {
    /*
     * This branch handles the case when `lower` and `upper` have no full
     * intervals between them. They can be in any of these states. In
     * particular, if they are in the same interval together, then there is
     * no complement.
     *
     * | [ ) <lower> <upper> [ ) | append_lower = append_upper = true. complement: <lower> -> <upper>
     * | [ <lower> ) <upper> [ ) | append_upper = true. complement: ) -> <upper>
     * | [ ) <lower> [ <upper> ) | append_lower = true. complement: <lower> -> [
     * | [ <lower> ) [ <upper> ) | both in separate intervals. complement: ) -> [
     * | [ <lower> <upper> ) [ ) | both in same interval! complement: none
     * | [ ) [ <lower> <upper> ) | both in same interval! complement: none
     */
    bool lower_in_interval = false;
    bool upper_in_interval = false;

    r_ssize loc_gap_start = -1;
    if (loc_lower_is_before_end_of == loc_lower_is_after_start_of) {
      lower_in_interval = true;
      loc_gap_start = v_loc_minimal_end[loc_lower_is_before_end_of] - 1;
    } else {
      append_lower = true;
    }

    r_ssize loc_gap_end = -1;
    if (loc_upper_is_before_end_of == loc_upper_is_after_start_of) {
      upper_in_interval = true;
      loc_gap_end = v_loc_minimal_start[loc_upper_is_before_end_of] - 1;
    } else {
      append_upper = true;
    }

    const bool lower_and_upper_in_same_interval =
      lower_in_interval &&
      upper_in_interval &&
      (loc_lower_is_before_end_of == loc_upper_is_before_end_of);

    if (!append_lower && !lower_and_upper_in_same_interval) {
      v_loc_start[i_start] = loc_gap_start + 1;
      ++i_start;
    }
    if (!append_upper && !lower_and_upper_in_same_interval) {
      v_loc_end[i_end] = loc_gap_end + 1;
      ++i_end;
    }
  }

  // This should essentially be free.
  // It will only ever shrink `loc_start` and `loc_end`.
  loc_start = KEEP_N(r_int_resize(loc_start, i_start), &n_prot);
  loc_end = KEEP_N(r_int_resize(loc_end, i_end), &n_prot);

  // Slice `end` to get new starts and `start` to get new ends!
  r_obj* out_start = KEEP_N(vec_slice_unsafe(end, loc_start), &n_prot);
  r_obj* out_end = KEEP_N(vec_slice_unsafe(start, loc_end), &n_prot);

  if (append_lower || append_upper) {
    r_obj* args = KEEP_N(r_new_list(2), &n_prot);

    const struct name_repair_opts name_repair_opts = {
      .type = NAME_REPAIR_none,
      .fn = R_NilValue
    };

    if (append_lower) {
      // Push `lower` to the start of the new starts
      r_list_poke(args, 0, lower);
      r_list_poke(args, 1, out_start);

      out_start = KEEP_N(vec_c(
        args,
        ptype,
        R_NilValue,
        &name_repair_opts,
        vec_args.empty,
        r_lazy_null
      ), &n_prot);
    }

    if (append_upper) {
      // Push `upper` to the end of the new ends
      r_list_poke(args, 0, out_end);
      r_list_poke(args, 1, upper);

      out_end = KEEP_N(vec_c(
        args,
        ptype,
        R_NilValue,
        &name_repair_opts,
        vec_args.empty,
        r_lazy_null
      ), &n_prot);
    }
  }

  r_obj* out = KEEP_N(r_new_list(2), &n_prot);
  r_list_poke(out, 0, out_start);
  r_list_poke(out, 1, out_end);

  r_obj* out_names = r_new_character(2);
  r_attrib_poke_names(out, out_names);
  r_chr_poke(out_names, 0, r_str("start"));
  r_chr_poke(out_names, 1, r_str("end"));

  r_init_data_frame(out, vec_size(out_start));

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:313

vec_interval_locate_containers untypeable

untypeable application
error detail
function: [null & 'I89036] --> null & 'I89036
argument: [any_sexp]
timing: 0.185 s
source
r_obj* vec_interval_locate_containers(r_obj* start, r_obj* end) {
  int n_prot = 0;

  int _;
  r_obj* ptype = vec_ptype2(
    start,
    end,
    args_start,
    args_end,
    r_lazy_null,
    S3_FALLBACK_false,
    &_
  );
  KEEP_N(ptype, &n_prot);
  ptype = KEEP_N(vec_ptype_finalise(ptype), &n_prot);

  start = vec_cast_params(
    start,
    ptype,
    args_start,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(start, &n_prot);

  end = vec_cast_params(
    end,
    ptype,
    args_end,
    vec_args.empty,
    r_lazy_null,
    S3_FALLBACK_false
  );
  KEEP_N(end, &n_prot);

  r_obj* start_proxy = KEEP_N(vec_proxy_compare(start), &n_prot);
  start_proxy = KEEP_N(obj_encode_utf8(start_proxy), &n_prot);

  r_obj* end_proxy = KEEP_N(vec_proxy_compare(end), &n_prot);
  end_proxy = KEEP_N(obj_encode_utf8(end_proxy), &n_prot);

  const enum vctrs_type type_proxy = vec_proxy_typeof(start_proxy);

  struct poly_vec* p_poly_start = new_poly_vec(start_proxy, type_proxy);
  KEEP_N(p_poly_start->shelter, &n_prot);
  const void* p_start = p_poly_start->p_vec;

  struct poly_vec* p_poly_end = new_poly_vec(end_proxy, type_proxy);
  KEEP_N(p_poly_end->shelter, &n_prot);
  const void* p_end = p_poly_end->p_vec;

  poly_binary_int_fn* const fn_compare = poly_p_compare_na_equal(type_proxy);
  poly_unary_bool_fn* const fn_is_missing = poly_p_is_missing(type_proxy);

  const r_ssize size = vec_size(start_proxy);

  if (size != vec_size(end_proxy)) {
    r_abort("`start` and `end` must have the same size.");
  }

  // Order is computed with the first column in ascending order, and the
  // second column in descending order. This makes it easy to find the
  // containers, as any time we detect something that isn't contained in the
  // current container, it must be a new container. Missing intervals are up
  // front for easy detection. We document that we assume that if `start` is
  // missing, then `end` is missing too.
  r_obj* direction = KEEP_N(r_new_character(2), &n_prot);
  r_chr_poke(direction, 0, r_str("asc"));
  r_chr_poke(direction, 1, r_str("desc"));

  r_obj* na_value = KEEP_N(r_new_character(2), &n_prot);
  r_chr_poke(na_value, 0, r_str("smallest"));
  r_chr_poke(na_value, 1, r_str("largest"));

  r_obj* order = interval_order(
    start_proxy,
    end_proxy,
    direction,
    na_value,
    size
  );
  KEEP_N(order, &n_prot);
  const int* v_order = r_int_cbegin(order);

  // Assume that half the intervals are containers.
  // This is probably a little high.
  // Apply a minimum size to avoid a size of zero.
  const r_ssize initial_size = r_ssize_max(size / 2, 1);

  struct r_dyn_array* p_loc = r_new_dyn_vector(R_TYPE_integer, initial_size);
  KEEP_N(p_loc->shelter, &n_prot);

  r_ssize i = 0;
  bool any_missing = false;

  // Move `i` past any missing intervals (they are at the front),
  // recording if there are any missing intervals for later. Only need to check
  // missingness of `start`, because we document that we assume that `end`
  // is missing if `start` is missing.
  for (; i < size; ++i) {
    const r_ssize loc = v_order[i] - 1;

    if (!fn_is_missing(p_start, loc)) {
      break;
    }

    any_missing = true;
  }

  r_ssize loc_container = -1;

  if (i < size) {
    // Set information about first usable container
    const r_ssize loc = v_order[i] - 1;
    loc_container = loc;
    r_dyn_int_push_back(p_loc, loc_container + 1);
    ++i;
  }

  for (; i < size; ++i) {
    const r_ssize loc = v_order[i] - 1;

    if ((fn_compare(p_start, loc_container, p_start, loc) != 1) &&
        (fn_compare(p_end, loc_container, p_end, loc) != -1)) {
      // Still in current container
      continue;
    }

    // New container
    loc_container = loc;
    r_dyn_int_push_back(p_loc, loc_container + 1);
  }

  if (any_missing) {
    // Push missing container as the last container.
    // We know missings are at the front, so just use the first order value
    // as the location. This matches ascending ordering with missing values
    // at the end, and breaking ties with the first missing location we saw.
    r_dyn_int_push_back(p_loc, v_order[0]);
  }

  r_obj* out = r_dyn_unwrap(p_loc);

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/interval.c:727

vec_joint_proxy_order untypeable

unbound variable
error detail
name: vec_joint_proxy_order_independent
timing: 0.029 s
source
r_obj* vec_joint_proxy_order(r_obj* x, r_obj* y) {
  if (r_typeof(x) != r_typeof(y)) {
    r_stop_internal("`x` and `y` should have the same type.");
  }

  switch (vec_typeof(x)) {
  case VCTRS_TYPE_unspecified:
  case VCTRS_TYPE_logical:
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_double:
  case VCTRS_TYPE_complex:
  case VCTRS_TYPE_character:
  case VCTRS_TYPE_raw: {
    return vec_joint_proxy_order_independent(x, y);
  }
  case VCTRS_TYPE_list: {
    return vec_joint_proxy_order_dependent(x, y);
  }
  case VCTRS_TYPE_dataframe: {
    return df_joint_proxy_order(x, y);
  }
  case VCTRS_TYPE_s3: {
    return vec_joint_proxy_order_s3(x, y);
  }
  case VCTRS_TYPE_null:
  case VCTRS_TYPE_scalar: {
    stop_unimplemented_vctrs_type("vec_joint_proxy_order", vec_typeof(x));
  }
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:235

vec_joint_proxy_order_dependent untypeable

unbound variable
error detail
name: vec_proxy_order
timing: 0.047 s
source
r_obj* vec_joint_proxy_order_dependent(r_obj* x, r_obj* y) {
  r_ssize x_size = vec_size(x);
  r_ssize y_size = vec_size(y);

  r_obj* x_slicer = KEEP(compact_seq(0, x_size, true));
  r_obj* y_slicer = KEEP(compact_seq(x_size, y_size, true));

  r_obj* ptype = KEEP(vec_ptype(x, vec_args.empty, r_lazy_null));

  r_obj* out = KEEP(r_alloc_list(2));
  r_list_poke(out, 0, x);
  r_list_poke(out, 1, y);

  // Combine
  // NOTE: Without long vector support, this limits the maximum allowed
  // size of `vec_locate_matches()` input to
  // `vec_size(x) + vec_size(y) <= INT_MAX`
  // when foreign columns are used.
  r_obj* combined = KEEP(vec_c(
    out,
    ptype,
    r_null,
    p_no_repair_opts,
    vec_args.empty,
    r_lazy_null
  ));

  // Compute joint order-proxy
  r_obj* proxy = KEEP(vec_proxy_order(combined));

  // Separate and store back in `out`
  r_list_poke(out, 0, vec_slice_unsafe(proxy, x_slicer));
  r_list_poke(out, 1, vec_slice_unsafe(proxy, y_slicer));

  FREE(6);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:280

vec_joint_proxy_order_independent untypeable

unbound variable
error detail
name: vec_proxy_order
timing: 0.007 s
source
r_obj* vec_joint_proxy_order_independent(r_obj* x, r_obj* y) {
  r_obj* out = KEEP(r_alloc_list(2));

  r_list_poke(out, 0, vec_proxy_order(x));
  r_list_poke(out, 1, vec_proxy_order(y));

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match-joint.c:269

vec_locate_complete untypeable

unbound variable
error detail
name: vec_detect_complete
timing: 0.001 s
source
SEXP vec_locate_complete(SEXP x) {
  SEXP where = PROTECT(vec_detect_complete(x));
  SEXP out = r_lgl_which(where, false);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:33

vec_names2 untypeable

untypeable application
error detail
function: ([c_int] --> CHR) & ([c_true] --> CHR1)
argument: [c_int_na]
timing: 0.028 s
source
r_obj* vec_names2(r_obj* x) {
  r_obj* names = vec_names(x);
  if (names == r_null) {
    return r_alloc_character(vec_size(x));
  } else {
    return names;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/names.c:178

vec_proxy_compare untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.019 s
source
r_obj* vec_proxy_compare(r_obj* x) {
  r_obj* out = KEEP(vec_proxy_compare_impl(x));

  if (is_data_frame(out)) {
    // Automatically proxy df-proxies recursively.
    // Also flattens and unwraps them (#1537, #1664).
    out = df_proxy(out, VCTRS_PROXY_KIND_compare);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:67

vec_proxy_equal untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.021 s
source
r_obj* vec_proxy_equal(r_obj* x) {
  r_obj* out = KEEP(vec_proxy_equal_impl(x));

  if (is_data_frame(out)) {
    // Automatically proxy df-proxies recursively.
    // Also flattens and unwraps them (#1537, #1664).
    out = df_proxy(out, VCTRS_PROXY_KIND_equal);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:53

vec_proxy_order untypeable entry .Call

untypeable application
error detail
function: [<> | null | p(CHR) | sym] --> c_false
argument: [any_sexp]
timing: 0.020 s
source
r_obj* vec_proxy_order(r_obj* x) {
  r_obj* out = KEEP(vec_proxy_order_impl(x));

  if (is_data_frame(out)) {
    // Automatically proxy df-proxies recursively.
    // Also flattens and unwraps them (#1537, #1664).
    out = df_proxy(out, VCTRS_PROXY_KIND_order);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy.c:81

vec_ptype_finalise_dispatch untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.002 s
source
r_obj* vec_ptype_finalise_dispatch(r_obj* x) {
  return vctrs_dispatch1(
    syms_vec_ptype_finalise_dispatch, fns_vec_ptype_finalise_dispatch,
    syms_x, x
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/unspecified.c:138

vec_ptype_invoke untypeable

unbound variable
error detail
name: vctrs_dispatch1
timing: 0.003 s
source
r_obj* vec_ptype_invoke(r_obj* x, r_obj* method) {
  return vctrs_dispatch1(syms_vec_ptype, method, syms_x, x);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/ptype.c:91

vec_restore_dispatch untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.004 s
source
r_obj* vec_restore_dispatch(r_obj* x, r_obj* to) {
  return vctrs_dispatch2(syms_vec_restore_dispatch, fns_vec_restore_dispatch,
                         syms_x, x,
                         syms_to, to);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/proxy-restore.c:61

vec_reverse untypeable

unbound variable
error detail
name: vec_slice_unsafe
timing: 0.024 s
source
r_obj* vec_reverse(r_obj* x) {
  const r_ssize size = vec_size(x);
  const r_ssize start = (size == 0) ? 0 : size - 1;
  const bool increasing = false;
  r_obj* index = KEEP(compact_seq(start, size, increasing));

  r_obj* out = vec_slice_unsafe(x, index);

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:464

vec_slice_altrep untypeable

unbound variable
error detail
name: vec_subscript_materialize
timing: 0.002 s
source
r_obj* vec_slice_altrep(r_obj* x, r_obj* subscript) {
  subscript = KEEP(vec_subscript_materialize(subscript));

  r_obj* out = vctrs_dispatch2(
    syms.vec_slice_altrep,
    fns.vec_slice_altrep,
    syms_x,
    x,
    syms_i,
    subscript
  );

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:236

vec_slice_complete untypeable

unbound variable
error detail
name: vec_locate_complete
timing: 0.001 s
source
SEXP vec_slice_complete(SEXP x) {
  SEXP loc = PROTECT(vec_locate_complete(x));

  // Skip `vec_as_location()` in `vec_slice()`
  SEXP out = vec_slice_unsafe(x, loc);

  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/complete.c:15

vec_slice_dispatch untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.053 s
source
r_obj* vec_slice_dispatch(r_obj* x, r_obj* subscript) {
  // TODO - Remove once bit64 is updated on CRAN. Special casing integer64
  // objects to ensure correct slicing with `NA_integer_`.
  if (is_integer64(x)) {
    return vctrs_dispatch2(syms.vec_slice_dispatch_integer64, fns.vec_slice_dispatch_integer64,
                           syms_x, x,
                           syms_i, subscript);
  }

  return vctrs_dispatch2(syms_bracket, fns_bracket,
                         syms_x, x,
                         syms_i, subscript);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:222

vec_slice_fallback untypeable

unbound variable
error detail
name: vctrs_dispatch2
timing: 0.070 s
source
r_obj* vec_slice_fallback(r_obj* x, r_obj* subscript) {
  // TODO - Remove once bit64 is updated on CRAN. Special casing integer64
  // objects to ensure correct slicing with `NA_integer_`.
  if (is_integer64(x)) {
    return vctrs_dispatch2(syms.vec_slice_fallback_integer64, fns.vec_slice_fallback_integer64,
                           syms_x, x,
                           syms_i, subscript);
  }

  return vctrs_dispatch2(syms.vec_slice_fallback, fns.vec_slice_fallback,
                         syms_x, x,
                         syms_i, subscript);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:207

vec_slice_unsafe untypeable

unbound variable
error detail
name: r_attrib_get
timing: 0.191 s
source
r_obj* vec_slice_unsafe(r_obj* x, r_obj* subscript) {
  int nprot = 0;

  struct vctrs_proxy_info info = vec_proxy_info(x);
  KEEP_N(info.inner, &nprot);

  // Fallback to `[` if the class doesn't implement a proxy. This is
  // to be maximally compatible with existing classes.
  if (vec_requires_fallback(x, info)) {
    if (info.type == VCTRS_TYPE_scalar) {
      obj_check_vector(x, VCTRS_ALLOW_NULL_no, NULL, r_lazy_null);
    }

    subscript = KEEP_N(vec_subscript_materialize(subscript), &nprot);

    r_obj* out;

    if (has_dim(x)) {
      out = KEEP_N(vec_slice_fallback(x, subscript), &nprot);
    } else {
      out = KEEP_N(vec_slice_dispatch(x, subscript), &nprot);
    }

    // Take over attribute restoration only if there is no `[` method
    if (!vec_is_restored(out, x)) {
      // Sliced `out` comes from R, so is foreign. Technically not proxied at all,
      // so "restoring" is a bit of a hack, but we only restore if it looks like the
      // `[` result is missing attributes.
      struct vec_restore_opts restore_opts = {
        .ownership = VCTRS_OWNERSHIP_foreign,
        .recursively_proxied = false
      };

      out = vec_restore_opts(out, x, &restore_opts);
    }

    FREE(nprot);
    return out;
  }

  switch (info.type) {
  case VCTRS_TYPE_null:
    r_stop_internal("Unexpected `NULL`.");

  case VCTRS_TYPE_logical:
  case VCTRS_TYPE_integer:
  case VCTRS_TYPE_double:
  case VCTRS_TYPE_complex:
  case VCTRS_TYPE_character:
  case VCTRS_TYPE_raw:
  case VCTRS_TYPE_list: {
    r_obj* out;

    if (has_dim(x)) {
      out = KEEP_N(vec_slice_shaped(info.type, info.inner, subscript), &nprot);

      r_obj* names = KEEP_N(r_attrib_get(x, r_syms.dim_names), &nprot);
      if (names != r_null) {
        names = KEEP_N(r_clone(names), &nprot);
        r_obj* row_names = r_list_get(names, 0);
        row_names = KEEP_N(slice_names(row_names, subscript), &nprot);
        r_list_poke(names, 0, row_names);
        r_attrib_poke(out, r_syms.dim_names, names);
      }
    } else {
      out = KEEP_N(vec_slice_base(info.type, info.inner, subscript, VCTRS_MATERIALIZE_false), &nprot);

      r_obj* names = KEEP_N(r_names(x), &nprot);
      names = KEEP_N(slice_names(names, subscript), &nprot);
      r_attrib_poke_names(out, names);
    }

    // Sliced `out` is a fresh object from `vec_slice_base()` or
    // `vec_slice_shaped()` that we control (and we even modify names directly
    // above). For atomics, shallow and deep ownership are the same. We mark as
    // shallow just for consistency with the data frame path.
    struct vec_restore_opts restore_opts = {
      .ownership = VCTRS_OWNERSHIP_shallow,
      .recursively_proxied = false
    };

    out = vec_restore_opts(out, x, &restore_opts);

    FREE(nprot);
    return out;
  }

  case VCTRS_TYPE_dataframe: {
    r_obj* out = KEEP_N(df_slice(info.inner, subscript), &nprot);

    // Sliced `out` is a fresh list container from `df_slice()`, but we don't
    // necessarily own the sliced columns (an individual column could have gone
    // through the fallback path) so we set shallow ownership. This is fine, we
    // don't restore recursively here, so only the list container will need to
    // be modified during restoration.
    struct vec_restore_opts restore_opts = {
      .ownership = VCTRS_OWNERSHIP_shallow,
      .recursively_proxied = false
    };

    out = vec_restore_opts(out, x, &restore_opts);

    FREE(nprot);
    return out;
  }

  default:
    stop_unimplemented_vctrs_type("vec_slice_impl", info.type);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice.c:296

vec_split untypeable entry .Call

unbound variable
error detail
name: vec_group_loc
timing: 0.011 s
source
SEXP vec_split(SEXP x, SEXP by) {
  if (vec_size(x) != vec_size(by)) {
    Rf_errorcall(R_NilValue, "`x` and `by` must have the same size.");
  }

  SEXP out = PROTECT(vec_group_loc(by));

  SEXP indices = VECTOR_ELT(out, 1);

  SEXP val = vec_chop_unsafe(x, indices, r_null);
  SET_VECTOR_ELT(out, 1, val);

  SEXP names = PROTECT(Rf_getAttrib(out, R_NamesSymbol));
  SET_STRING_ELT(names, 1, strings_val);
  Rf_setAttrib(out, R_NamesSymbol, names);

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/split.c:4

vec_subscript_materialize untypeable

untypeable application
error detail
function: [raw] --> LGL
argument: [^INT1 & 'I22202]
timing: 0.052 s
source
SEXP vec_subscript_materialize(SEXP x) {
  if (is_compact_rep(x)) {
    return compact_rep_materialize(x);
  } else if (is_compact_seq(x)) {
    return compact_seq_materialize(x);
  } else if (is_compact_condition(x)) {
    return compact_condition_materialize(x);
  } else {
    return x;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.c:974

vec_unique untypeable

unbound variable
error detail
name: vctrs_unique_loc
timing: 0.002 s
source
SEXP vec_unique(SEXP x) {
  SEXP index = PROTECT(vctrs_unique_loc(x));
  SEXP out = vec_slice_unsafe(x, index);
  UNPROTECT(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/dictionary.c:210

chr_order timeout

timing: 20.00 s
source
void chr_order(
  SEXP x,
  bool decreasing,
  bool na_last,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct group_infos* p_group_infos
) {
  const SEXP* p_x = STRING_PTR_RO(x);

  const enum vctrs_sortedness sortedness = chr_sortedness(
    p_x,
    size,
    decreasing,
    na_last,
    p_group_infos
  );

  // Handle sorted cases and set ordering to initialized
  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    int* p_o = p_order->p_data;
    ord_resolve_sortedness(sortedness, size, p_o);
    p_order->initialized = true;
    return;
  }

  int* p_o = init_order(p_order);

  const char** p_x_chunk = (const char**) init_lazy_raw(p_lazy_x_chunk);

  // Extract out `CHAR()` string pointers and `Rf_length()` string sizes,
  // skipping missings along the way, but returning the count of them and
  // the max string size
  const struct r_ssize_int_pair pair = chr_extract_without_missings(
    size,
    p_x,
    p_x_chunk
  );
  const r_ssize n_missing = pair.x;
  const int max_string_size = pair.y;

  if (n_missing != 0) {
    // If there are missings, handle them by pushing their ordering to the front
    // (or back, depending on `na_last`) of `p_o`
    int* p_o_aux = init_lazy_raw(p_lazy_o_aux);

    chr_handle_missings(
      size,
      n_missing,
      na_last,
      p_x,
      p_o,
      p_o_aux
    );

    size -= n_missing;
    p_o = na_last ? p_o : (p_o + n_missing);
  }

  if (!na_last && n_missing != 0) {
    // Push `na_last` group before sorting
    groups_size_maybe_push(n_missing, p_group_infos);
  }

  if (size <= ORDER_INSERTION_BOUNDARY) {
    chr_order_insertion(
      size,
      decreasing,
      p_x_chunk,
      p_o,
      p_group_infos
    );
  } else {
    const char** p_x_aux = (const char**) init_lazy_raw(p_lazy_x_aux);

    int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);
    uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

    chr_order_radix(
      size,
      decreasing,
      max_string_size,
      p_x_chunk,
      p_o,
      p_x_aux,
      p_o_aux,
      p_bytes,
      p_group_infos
    );
  }

  if (na_last && n_missing != 0) {
    // Push `na_last` group after sorting
    groups_size_maybe_push(n_missing, p_group_infos);
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2497

chr_order_insertion timeout

timing: 20.00 s
source
void chr_order_insertion(
  const r_ssize size,
  const bool decreasing,
  const char** p_x,
  int* p_o,
  struct group_infos* p_group_infos
) {
  // Don't think this can occur, but safer this way
  if (size == 0) {
    return;
  }

  const int direction = decreasing ? -1 : 1;

  for (r_ssize i = 1; i < size; ++i) {
    const char* elt = p_x[i];
    const int elt_o = p_o[i];

    r_ssize j = i - 1;

    while (j >= 0) {
      const char* cmp_elt = p_x[j];

      if (str_ge(elt, cmp_elt, direction)) {
        break;
      }

      // It seems to help performance to avoid loading this
      // before the if statement, since it often isn't needed
      const int cmp_elt_o = p_o[j];

      // Swap
      p_x[j + 1] = cmp_elt;
      p_o[j + 1] = cmp_elt_o;

      // Next
      --j;
    }

    // Place original elements in new location
    // closer to start of the vector
    p_x[j + 1] = elt;
    p_o[j + 1] = elt_o;
  }

  // We've ordered a small chunk, we need to push at least one group size.
  // Depends on the post-ordered results so we have to do this
  // in a separate loop.
  r_ssize group_size = 1;
  const char* previous = p_x[0];

  for (r_ssize i = 1; i < size; ++i) {
    const char* current = p_x[i];

    // Continue the current group run
    if (current == previous) {
      ++group_size;
      continue;
    }

    // Push current run size and reset size tracker
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;

    previous = current;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2976

chr_order_radix_recurse timeout

timing: 20.00 s
source
void chr_order_radix_recurse(
  const r_ssize size,
  const bool decreasing,
  const int pass,
  const int max_string_size,
  const char** p_x,
  int* p_o,
  const char** p_x_aux,
  int* p_o_aux,
  uint8_t* p_bytes,
  struct group_infos* p_group_infos
) {
  // Exit as fast as possible if we are below the insertion order boundary
  if (size <= ORDER_INSERTION_BOUNDARY) {
    chr_order_insertion(
      size,
      decreasing,
      p_x,
      p_o,
      p_group_infos
    );
    return;
  }

  const int next_pass = pass + 1;

  // Fast check to see if all bytes within this group are the same. If so, skip
  // this `pass` since we learned nothing. Unlike with other methods, it is useful
  // to do this check before the histogram because with strings there is often a
  // long common prefix, and it is faster to skip past that as quickly as possible,
  // avoiding the jumpiness of histogramming.
  if (chr_all_same_byte(p_x, size)) {
    if (next_pass == max_string_size) {
      // If we are already at the last pass, we are done
      groups_size_maybe_push(size, p_group_infos);
    } else {
      // Otherwise, advance `p_x` to the next byte and immediately recurse using
      // the same `size` since the group size hasn't changed
      for (r_ssize i = 0; i < size; ++i) {
        ++p_x[i];
      }

      chr_order_radix_recurse(
        size,
        decreasing,
        next_pass,
        max_string_size,
        p_x,
        p_o,
        p_x_aux,
        p_o_aux,
        p_bytes,
        p_group_infos
      );
    }

    return;
  }

  // We don't carry along `p_counts` from an up front allocation since
  // the strings have variable length
  r_ssize p_counts[UINT8_MAX_SIZE] = { 0 };

  // Histogram
  //
  // Histogramming strings is very special!
  //
  // Note that R strings never contain a nul terminator of `\0`, which is byte
  // `0`, in the string itself. However, all R strings end with a nul terminator
  // since they are C style strings.
  //
  // We utilize this fact when histogramming. If we hit a string of "ab" on
  // `pass = 2` then it will extract the nul terminator `\0` as byte `0` and
  // will therefore bucket all `"ab"` strings together. Then the check for
  // `nul_terminator_i` will detect this, keeping us from over recursing on
  // `"ab"` and indexing past the nul terminator!
  //
  // This trick avoids needing to track the string size alongside the string
  // pointer. We just need the `max_string_size` of the total number of times to
  // recurse, and the algorithm automatically stops early on shorter strings.
  //
  // We also advance the `char*` returned by `p_x[i]` to the next byte right
  // after we access it, for use by the next `pass`. This actually makes
  // `chr_order_insertion()` and `chr_all_same_byte()` a little simpler, because
  // we've already taken care of advancing past all the bytes that we know are
  // all the same. For strings like `"ab"` in the example above, this can advance
  // us past the `\0` nul terminator, but we will never access that location.
  for (r_ssize i = 0; i < size; ++i) {
    const uint8_t byte = (uint8_t) *p_x[i];
    ++p_x[i];
    p_bytes[i] = byte;
    ++p_counts[byte];
  }

  r_ssize cumulative = 0;

  // Handle decreasing/increasing by altering the order in which
  // counts are accumulated
  const int direction = decreasing ? -1 : 1;
  r_ssize j = decreasing ? UINT8_MAX_SIZE - 1 : 0;

  // Accumulate counts, skip zeros
  for (uint16_t i = 0; i < UINT8_MAX_SIZE; ++i) {
    r_ssize count = p_counts[j];

    if (count == 0) {
      j += direction;
      continue;
    }

    // Insert current cumulative value, then increment
    p_counts[j] = cumulative;
    cumulative += count;

    j += direction;
  }

  // Place into auxiliary arrays in the correct order
  for (r_ssize i = 0; i < size; ++i) {
    const uint8_t byte = p_bytes[i];
    const r_ssize loc = p_counts[byte]++;
    p_o_aux[loc] = p_o[i];
    p_x_aux[loc] = p_x[i];
  }

  // Copy back into `p_o` because our output is `p_o`, but recognize that we can
  // just swap the auxiliary data related to `x` to achieve the same idea there
  r_memcpy(p_o, p_o_aux, size * sizeof(*p_o_aux));
  SWAP(const char**, p_x, p_x_aux);

  // Cumulative counts will be in reverse order if we were decreasing. We
  // reverse them to put them in the correct order for cumulative count diffing.
  // This works nicely because `UINT8_MAX_SIZE` is even.
  if (decreasing) {
    for (uint16_t i = 0; i < UINT8_MAX_SIZE_HALVED; ++i) {
      const r_ssize front = p_counts[i];
      const r_ssize back = p_counts[UINT8_MAX_SIZE - 1 - i];
      p_counts[i] = back;
      p_counts[UINT8_MAX_SIZE - 1 - i] = front;
    }
  }

  const uint16_t nul_terminator_i = decreasing ? UINT8_MAX_SIZE - 1 : 0;

  r_ssize last_cumulative_count = 0;

  // Recurse on subgroups as required
  for (uint16_t i = 0; last_cumulative_count < size && i < UINT8_MAX_SIZE; ++i) {
    const r_ssize cumulative_count = p_counts[i];

    if (!cumulative_count) {
      continue;
    }

    // Set to zero to clear for subsequent groups
    p_counts[i] = 0;

    // Diff the accumulated counts to get the radix group size
    const r_ssize group_size = cumulative_count - last_cumulative_count;
    last_cumulative_count = cumulative_count;

    if (group_size == 1) {
      groups_size_maybe_push(1, p_group_infos);
      ++p_x;
      ++p_o;
      continue;
    }

    // If `i` is pointing to the `\0` byte bucket, we are done with this group.
    // `\0` is the end of string marker, so all strings in this bucket are the
    // same and we can't recurse further into them, otherwise we'd index OOB
    // (see the test that mentions `\0`). Happens with `c("abc", "abd", "a",
    // "a")` where after the first pass we haven't learned anything, and after
    // the second pass two of the strings are on `\0`. We avoid indexing OOB on
    // a third pass by exiting early when we see the `\0` group.
    // `chr_all_same()` would also catch this, but this check is faster and
    // clearer.
    if (i == nul_terminator_i) {
      groups_size_maybe_push(group_size, p_group_infos);
      p_x += group_size;
      p_o += group_size;
      continue;
    }

    // If we've made it to the end of the string, finalize the group.
    // We can get here with `c("xyz", "xyz", "xyx")` where we need the
    // last byte to break the tie, but we end up with a group size of 2.
    if (next_pass == max_string_size) {
      groups_size_maybe_push(group_size, p_group_infos);
      p_x += group_size;
      p_o += group_size;
      continue;
    }

    // If the upcoming subgroup is all the same string, we are done. This is a
    // very useful performance optimization for cases like `c("abcd", "def",
    // "abcd")` where after the first pass we have two groups, but every string
    // within each group is already the same so we don't need to continue
    // recursing.
    if (chr_all_same(p_x, group_size)) {
      groups_size_maybe_push(group_size, p_group_infos);
      p_x += group_size;
      p_o += group_size;
      continue;
    }

    // Order next byte of this subgroup
    chr_order_radix_recurse(
      group_size,
      decreasing,
      next_pass,
      max_string_size,
      p_x,
      p_o,
      p_x_aux,
      p_o_aux,
      p_bytes,
      p_group_infos
    );

    p_x += group_size;
    p_o += group_size;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:2744

date_validate timeout

timing: 20.00 s
source
static SEXP date_validate(SEXP x) {
  switch (TYPEOF(x)) {
  case REALSXP:
    return x;
  case INTSXP:
    // Keeps attributes
    return Rf_coerceVector(x, REALSXP);
  default:
    r_stop_internal("Corrupt `Date` with unknown type %s.",
                    Rf_type2char(TYPEOF(x)));
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:334

datetime_validate_type timeout

timing: 20.00 s
source
static SEXP datetime_validate_type(SEXP x) {
  switch (TYPEOF(x)) {
  case REALSXP:
    return x;
  case INTSXP:
    // Keeps attributes
    return Rf_coerceVector(x, REALSXP);
  default:
    r_stop_internal("Corrupt `POSIXct` with unknown type %s.",
                    Rf_type2char(TYPEOF(x)));
  }

  never_reached("datetime_validate_type");
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-date-time.c:377

dbl_order_impl timeout

timing: 20.00 s
source
void dbl_order_impl(
  const double* p_x,
  bool decreasing,
  bool na_last,
  bool nan_distinct,
  r_ssize size,
  bool copy,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  const enum vctrs_sortedness sortedness = dbl_sortedness(
    p_x,
    size,
    decreasing,
    na_last,
    nan_distinct,
    p_group_infos
  );

  // Handle sorted cases and set ordering to initialized
  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    int* p_o = p_order->p_data;
    ord_resolve_sortedness(sortedness, size, p_o);
    p_order->initialized = true;
    return;
  }

  int* p_o = init_order(p_order);

  void* p_x_chunk;
  if (copy) {
    p_x_chunk = init_lazy_raw(p_lazy_x_chunk);
    r_memcpy(p_x_chunk, p_x, size * sizeof(*p_x));
  } else {
    p_x_chunk = p_lazy_x_chunk->p_data;
  }

  dbl_adjust(decreasing, na_last, nan_distinct, size, p_x_chunk);

  if (size <= ORDER_INSERTION_BOUNDARY) {
    dbl_order_insertion(size, p_x_chunk, p_o, p_group_infos);
    return;
  }

  uint64_t* p_x_aux = (uint64_t*) init_lazy_raw(p_lazy_x_aux);

  int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);

  uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

  r_ssize* p_counts = (r_ssize*) init_lazy_raw(p_lazy_counts);
  r_memset(p_counts, 0, p_lazy_counts->size);

  dbl_order_radix(
    size,
    p_x_chunk,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1664

dbl_order_insertion timeout typed → timeout

timing: 20.00 s
source
void dbl_order_insertion(
  const r_ssize size,
  uint64_t* p_x,
  int* p_o,
  struct group_infos* p_group_infos
) {
  // Don't think this can occur, but safer this way
  if (size == 0) {
    return;
  }

  for (r_ssize i = 1; i < size; ++i) {
    const uint64_t x_elt = p_x[i];
    const int o_elt = p_o[i];

    r_ssize j = i - 1;

    while (j >= 0) {
      const uint64_t x_cmp_elt = p_x[j];

      if (x_elt >= x_cmp_elt) {
        break;
      }

      int o_cmp_elt = p_o[j];

      // Swap
      p_x[j + 1] = x_cmp_elt;
      p_o[j + 1] = o_cmp_elt;

      // Next
      --j;
    }

    // Place original elements in new location
    // closer to start of the vector
    p_x[j + 1] = x_elt;
    p_o[j + 1] = o_elt;
  }

  // We've ordered a small chunk, we need to push at least one group size.
  // Depends on the post-ordered results so we have to do this
  // in a separate loop.
  r_ssize group_size = 1;
  uint64_t previous = p_x[0];

  for (r_ssize i = 1; i < size; ++i) {
    const uint64_t current = p_x[i];

    // Continue the current group run
    if (current == previous) {
      ++group_size;
      continue;
    }

    // Push current run size and reset size tracker
    groups_size_maybe_push(group_size, p_group_infos);
    group_size = 1;

    previous = current;
  }

  // Push final group run
  groups_size_maybe_push(group_size, p_group_infos);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:1896

df_assign timeout

timing: 20.00 s
source
r_obj* df_assign(r_obj* x,
                 r_obj* index,
                 r_obj* value,
                 const struct vec_proxy_assign_opts* p_opts) {
  r_obj* out = KEEP(vec_clone_referenced(x, p_opts->ownership));

  r_ssize n = r_length(out);

  if (r_length(value) != n) {
    r_stop_internal("Can't assign %d columns to df of length %d.",
                    r_length(value),
                    n);
  }

  // During assignment, if we have deep ownership over `x` we can
  // propagate that ownership to the columns, otherwise we have no
  // known ownership over the columns
  enum vctrs_ownership col_ownership;
  switch (p_opts->ownership) {
  case VCTRS_OWNERSHIP_foreign: col_ownership = VCTRS_OWNERSHIP_foreign; break;
  case VCTRS_OWNERSHIP_shallow: col_ownership = VCTRS_OWNERSHIP_foreign; break;
  case VCTRS_OWNERSHIP_deep: col_ownership = VCTRS_OWNERSHIP_deep; break;
  default: r_stop_unreachable();
  }

  const struct vec_proxy_assign_opts col_proxy_assign_opts = {
    .assign_names = p_opts->assign_names,
    .ignore_outer_names = p_opts->ignore_outer_names,
    .slice_value = p_opts->slice_value,
    .call = p_opts->call,
    .x_arg = p_opts->x_arg,
    .value_arg = p_opts->value_arg,
    .index_style = p_opts->index_style,
    .ownership = col_ownership,
    .recursively_proxied = p_opts->recursively_proxied
  };

  for (r_ssize i = 0; i < n; ++i) {
    r_obj* out_elt = r_list_get(out, i);
    r_obj* value_elt = r_list_get(value, i);

    // No need to cast or recycle because those operations are
    // recursive and have already been performed. However, proxy and
    // restore are not necessarily recursive and we might need to
    // proxy each element we recurse into.
    //
    // NOTE: `vec_proxy_assign_opts()` proxies `value_elt`.
    r_obj* proxy_elt = KEEP(p_opts->recursively_proxied ? out_elt : vec_proxy(out_elt));

    r_obj* assigned_elt = KEEP(vec_proxy_assign_opts(proxy_elt, index, value_elt, &col_proxy_assign_opts));

    if (!p_opts->recursively_proxied) {
      const struct vec_restore_opts col_restore_opts = {
        .ownership = col_ownership,
        .recursively_proxied = false
      };
      assigned_elt = vec_restore_opts(assigned_elt, out_elt, &col_restore_opts);
    }

    r_list_poke(out, i, assigned_elt);
    FREE(2);
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:766

df_order timeout

timing: 20.00 s
source
void df_order(
  SEXP x,
  SEXP decreasing,
  SEXP na_last,
  bool nan_distinct,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  r_ssize n_cols = r_length(x);

  bool recycle_decreasing;
  r_ssize n_decreasing = r_length(decreasing);
  int* p_decreasing = LOGICAL(decreasing);

  if (n_decreasing == 1) {
    recycle_decreasing = true;
  } else if (n_decreasing == n_cols) {
    recycle_decreasing = false;
  } else {
    Rf_errorcall(
      R_NilValue,
      "Internal error: `vec_order_expand_args()` should expand "
      "`decreasing` to have length 1 or length equal "
      "to the number of columns of `x` after calling `vec_proxy_order()`."
    );
  }

  bool recycle_na_last;
  r_ssize n_na_last = r_length(na_last);
  int* p_na_last = LOGICAL(na_last);

  if (n_na_last == 1) {
    recycle_na_last = true;
  } else if (n_na_last == n_cols) {
    recycle_na_last = false;
  } else {
    Rf_errorcall(
      R_NilValue,
      "Internal error: `vec_order_expand_args()` should expand "
      "`na_last` to have length 1 or length equal "
      "to the number of columns of `x` after calling `vec_proxy_order()`."
    );
  }

  // Special case no columns
  if (n_cols == 0) {
    init_order(p_order);
    if (size != 0) {
      groups_size_maybe_push(size, p_group_infos);
    }
    return;
  }

  SEXP col = VECTOR_ELT(x, 0);
  bool col_decreasing = p_decreasing[0];
  bool col_na_last = p_na_last[0];
  enum vctrs_type type = vec_proxy_typeof(col);

  // Apply on one column to fill `p_group_infos`.
  // First column is immutable and we must copy into `x_chunk`.
  vec_order_base_switch(
    col,
    col_decreasing,
    col_na_last,
    nan_distinct,
    size,
    type,
    p_order,
    p_lazy_x_chunk,
    p_lazy_x_aux,
    p_lazy_o_aux,
    p_lazy_bytes,
    p_lazy_counts,
    p_group_infos
  );

  // For complex, we have to rerun the column a second time on the
  // imaginary part. This is done by decrementing `i` after processing
  // the real part so the column is rerun.
  bool complex_first_pass = true;

  // Iterate over remaining columns by group chunk
  for (r_ssize i = 1; i < n_cols; ++i) {
    // Get the number of group chunks from previous column group info
    struct group_info* p_group_info_pre = groups_current(p_group_infos);
    r_ssize n_groups = p_group_info_pre->n_groups;

    // If there were no ties, we are completely done
    if (n_groups == size) {
      break;
    }

    if (!recycle_decreasing) {
      col_decreasing = p_decreasing[i];
    }
    if (!recycle_na_last) {
      col_na_last = p_na_last[i];
    }

    // Reset pointer between columns since we increment it as
    // we iterate through the groups, but need it to start from the beginning
    // on the next column. `p_o` is initialized now that we have already
    // processed at least one column.
    int* p_o_col = p_order->p_data;

    col = VECTOR_ELT(x, i);
    type = vec_proxy_typeof(col);

    // Turn off group tracking if:
    // - We are on the last column
    // - The user didn't request group information
    // - That column isn't the first pass of a complex column
    if (i == n_cols - 1 && !p_group_infos->force_groups && !complex_first_pass) {
      p_group_infos->ignore_groups = true;
    }

    // Swap to other group info to prepare for this column
    groups_swap(p_group_infos);

    // Iterate over this column's group chunks
    for (r_ssize group = 0; group < n_groups; ++group) {
      r_ssize group_size = p_group_info_pre->p_data[group];

      // Fast handling of simplest case
      if (group_size == 1) {
        ++p_o_col;
        groups_size_maybe_push(1, p_group_infos);
        continue;
      }

      // Extract current chunk and place into `x_chunk` in sequential order
      switch (type) {
      case VCTRS_TYPE_integer: DF_ORDER_EXTRACT_CHUNK(INTEGER_RO, int); break;
      case VCTRS_TYPE_logical: DF_ORDER_EXTRACT_CHUNK(LOGICAL_RO, int); break;
      case VCTRS_TYPE_double: DF_ORDER_EXTRACT_CHUNK(REAL_RO, double); break;
      case VCTRS_TYPE_character: DF_ORDER_EXTRACT_CHUNK(STRING_PTR_RO, SEXP); break;
      case VCTRS_TYPE_complex: DF_ORDER_EXTRACT_CHUNK_CPL(); break;
      default: Rf_errorcall(R_NilValue, "Unknown data frame column type in `vec_order()`.");
      }

      vec_order_chunk_switch(
        col_decreasing,
        col_na_last,
        nan_distinct,
        group_size,
        type,
        p_o_col,
        p_lazy_x_chunk,
        p_lazy_x_aux,
        p_lazy_o_aux,
        p_lazy_bytes,
        p_lazy_counts,
        p_group_infos
      );

      p_o_col += group_size;
    }

    if (type == VCTRS_TYPE_complex) {
      if (complex_first_pass) {
        // Transition from first pass to second pass
        complex_first_pass = false;
        // Decrement `i` so we reuse this column
        --i;
      } else {
        // Reset flag for future complex columns
        complex_first_pass = true;
      }
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:3132

expand_compact_indices timeout

timing: 20.00 s
source
r_obj* expand_compact_indices(const int* v_o_haystack,
                              struct r_dyn_array* p_loc_first_match_o_haystack,
                              struct r_dyn_array* p_size_match,
                              struct r_dyn_array* p_loc_needles,
                              bool skip_size_match,
                              bool skip_loc_needles,
                              const struct vctrs_incomplete* incomplete,
                              const struct vctrs_no_match* no_match,
                              const struct vctrs_remaining* remaining,
                              enum vctrs_multiple multiple,
                              enum vctrs_relationship relationship,
                              r_ssize size_needles,
                              r_ssize size_haystack,
                              bool any_non_equi,
                              bool has_loc_filter_match_o_haystack,
                              const enum vctrs_filter* v_filters,
                              const int* v_loc_filter_match_o_haystack,
                              const struct poly_df_data* p_haystack,
                              struct vctrs_arg* needles_arg,
                              struct vctrs_arg* haystack_arg,
                              struct r_lazy error_call) {
  int n_prot = 0;

  const r_ssize n_used = p_loc_first_match_o_haystack->count;

  const int* v_loc_first_match_o_haystack = (const int*) r_dyn_cbegin(p_loc_first_match_o_haystack);
  const int* v_size_match = skip_size_match ? NULL : (const int*) r_dyn_cbegin(p_size_match);
  const int* v_loc_needles = skip_loc_needles ? NULL : (const int*) r_dyn_cbegin(p_loc_needles);

  const bool one_match_per_needle =
    multiple == VCTRS_MULTIPLE_any ||
    multiple == VCTRS_MULTIPLE_first ||
    multiple == VCTRS_MULTIPLE_last;

  r_ssize size_out = 0;
  if (one_match_per_needle) {
    size_out = size_needles;
  } else {
    double dbl_size_out = 0;

    for (r_ssize i = 0; i < n_used; ++i) {
      // This could get extremely large with improperly specified non-equi joins.
      // May over-allocate in the case of `filters` with `multiple = "all"`,
      // or when `no_match = "drop"` or `incomplete = "drop"`.
      dbl_size_out += (double) v_size_match[i];
    }

    if (dbl_size_out > R_LEN_T_MAX) {
      // TODO: Update this after a switch to long vector support
      stop_matches_overflow(dbl_size_out, error_call);
    }

    size_out = r_double_as_ssize(dbl_size_out);
  }

  r_keep_loc out_needles_pi;
  r_obj* out_needles = r_alloc_integer(size_out);
  KEEP_HERE(out_needles, &out_needles_pi);
  ++n_prot;

  r_keep_loc out_haystack_pi;
  r_obj* out_haystack = r_alloc_integer(size_out);
  KEEP_HERE(out_haystack, &out_haystack_pi);
  ++n_prot;

  int* v_out_needles = r_int_begin(out_needles);
  int* v_out_haystack = r_int_begin(out_haystack);

  const int* v_o_loc_needles = NULL;
  if (!skip_loc_needles) {
    // `loc_needles` is used to record the location of the needle that the
    // matches correspond to. The first `size_needles` elements will be in
    // sequential order, but locations after that correspond to the "extra"
    // matches gathered from different nesting containers. We need the order of
    // this `loc_needles` vector so we can process all the matches for needle 1,
    // then 2, then 3, etc, in that order, across all nesting containers.
    r_obj* loc_needles = KEEP_N(r_dyn_unwrap(p_loc_needles), &n_prot);
    r_obj* o_loc_needles = KEEP_N(vec_order(loc_needles, chrs_asc, chrs_smallest, true, r_null), &n_prot);
    v_o_loc_needles = r_int_cbegin(o_loc_needles);
  }

  bool any_multiple_needles = false;
  bool any_multiple_haystack = false;

  r_ssize loc_first_multiple_needles = -1;
  r_ssize loc_first_multiple_haystack = -1;

  // Check is always needed for `multiple = "all"`.
  // This also handles `relationship` options too, since if `multiple` is
  // `"any"`, `"first"`, or `"last"`, we can't invalidate a `relationship`.
  bool check_multiple_needles =
    multiple == VCTRS_MULTIPLE_all ||
    // TODO: Remove deprecated support for `multiple = "error"/"warning"`
    multiple == VCTRS_MULTIPLE_error ||
    multiple == VCTRS_MULTIPLE_warning;

  // Used to enforce `check_multiple_needles`
  r_ssize loc_needles_previous = r_globals.na_int;

  bool check_multiple_haystack = false;
  switch (relationship) {
  // Expecting `haystack` can match any number of `needles`
  case VCTRS_RELATIONSHIP_none:
  case VCTRS_RELATIONSHIP_many_to_one:
  case VCTRS_RELATIONSHIP_many_to_many: {
    check_multiple_haystack = false;
    break;
  }
  // Expecting `haystack` to match at most 1 `needles`
  case VCTRS_RELATIONSHIP_one_to_one:
  case VCTRS_RELATIONSHIP_one_to_many: {
    check_multiple_haystack = true;
    break;
  }
  // Only check for multiple matches in `haystack` if we are also checking
  // for them in `needles`. Otherwise we can't possibly have a many-to-many
  // issue so there is no need to check for one.
  case VCTRS_RELATIONSHIP_warn_many_to_many: {
    check_multiple_haystack = check_multiple_needles;
    break;
  }
  }

  const bool retain_remaining_haystack =
    remaining->action == VCTRS_REMAINING_ACTION_value ||
    remaining->action == VCTRS_REMAINING_ACTION_error;

  bool track_matches_haystack = check_multiple_haystack || retain_remaining_haystack;
  bool* v_detect_matches_haystack = NULL;
  if (track_matches_haystack) {
    r_obj* detect_matches_haystack = KEEP_N(r_alloc_raw(size_haystack * sizeof(bool)), &n_prot);
    v_detect_matches_haystack = r_raw_begin(detect_matches_haystack);
    r_memset(v_detect_matches_haystack, 0, size_haystack * sizeof(bool));
  }

  // For `multiple = "first" / "last"`
  r_ssize loc_haystack_overall = r_globals.na_int;

  r_ssize loc_out = 0;

  for (r_ssize i = 0; i < n_used; ++i) {
    const int loc = skip_loc_needles ? i : v_o_loc_needles[i] - 1;

    const int loc_first_match_o_haystack = v_loc_first_match_o_haystack[loc];
    const int size_match = skip_size_match ? 1 : v_size_match[loc];
    const int loc_needles = skip_loc_needles ? loc : v_loc_needles[loc];

    if (loc_first_match_o_haystack == SIGNAL_INCOMPLETE) {
      if (size_match != 1) {
        r_stop_internal(
          "`size_match` should always be 1 in the case of incomplete values."
        );
      }

      switch (incomplete->action) {
      case VCTRS_INCOMPLETE_ACTION_value: {
        v_out_needles[loc_out] = loc_needles + 1;
        v_out_haystack[loc_out] = incomplete->value;
        ++loc_out;
        continue;
      }
      case VCTRS_INCOMPLETE_ACTION_drop: {
        // Do not increment `loc_out`, do not store locations
        continue;
      }
      case VCTRS_INCOMPLETE_ACTION_error: {
        stop_matches_incomplete(loc_needles, needles_arg, error_call);
      }
      case VCTRS_INCOMPLETE_ACTION_compare:
      case VCTRS_INCOMPLETE_ACTION_match: {
        r_stop_internal(
          "Needles should never be marked as `SIGNAL_INCOMPLETE`",
          "when `incomplete = 'compare'` or `incomplete = 'match'`."
        );
      }
      default: {
        r_stop_internal("Unknown `incomplete->action`.");
      }
      }
    }

    if (loc_first_match_o_haystack == SIGNAL_NO_MATCH) {
      if (size_match != 1) {
        r_stop_internal(
          "`size_match` should always be 1 in the case of no matches."
        );
      }

      switch (no_match->action) {
      case VCTRS_NO_MATCH_ACTION_value: {
        v_out_needles[loc_out] = loc_needles + 1;
        v_out_haystack[loc_out] = no_match->value;
        ++loc_out;
        continue;
      }
      case VCTRS_NO_MATCH_ACTION_drop: {
        continue;
      }
      case VCTRS_NO_MATCH_ACTION_error: {
        stop_matches_nothing(loc_needles, needles_arg, haystack_arg, error_call);
      }
      default: {
        r_stop_internal("Unknown `no_match->action`.");
      }
      }
    }

    if (has_loc_filter_match_o_haystack) {
      // When recording matches, if we updated the filter match value for a
      // particular needle, then we weren't able to remove the old match from
      // `p_loc_first_match_o_haystack`. So we need to check that the current
      // match value in the haystack is the same as the recorded filter match
      // value for this needle. If it is the same, we continue, otherwise we
      // move on to the next value.
      const int loc_filter_match_o_haystack = v_loc_filter_match_o_haystack[loc_needles];

      bool equal = false;

      if (loc_filter_match_o_haystack == loc_first_match_o_haystack) {
        equal = true;
      } else {
        const int loc_filter_match_haystack = v_o_haystack[loc_filter_match_o_haystack] - 1;
        const int loc_first_match_haystack = v_o_haystack[loc_first_match_o_haystack] - 1;

        equal = p_matches_df_equal_na_equal(
          p_haystack,
          loc_first_match_haystack,
          p_haystack,
          loc_filter_match_haystack,
          v_filters
        );
      }

      if (!equal) {
        continue;
      }
    }

    if (check_multiple_needles) {
      if (size_match > 1) {
        // Easy, obvious, case.
        // This containment group had >1 matches for this `needle` so we
        // immediately handle multiple `needles` matches.
        any_multiple_needles = true;
      } else if (loc_needles == loc_needles_previous) {
        // We've recorded a match for this `needle` before. Remember that
        // `needles` are processed in increasing order across all containment
        // groups due to `v_o_loc_needles` so this simple tracking of the
        // previous `needle` works.
        any_multiple_needles = true;
      } else {
        // There was exactly 1 match for the `needle` in this containment group,
        // and we've never recorded a match for this `needle` before.
        // In that case we record that we've seen it for the next iteration.
        loc_needles_previous = loc_needles;
      }

      if (any_multiple_needles) {
        loc_first_multiple_needles = loc_needles;

        // TODO: Remove deprecated support for `multiple = "error"/"warning"`
        switch (multiple) {
        case VCTRS_MULTIPLE_all:
          break;
        case VCTRS_MULTIPLE_error:
          stop_matches_multiple(
            loc_first_multiple_needles,
            needles_arg,
            haystack_arg,
            error_call
          );
        case VCTRS_MULTIPLE_warning: {
          warn_matches_multiple(
            loc_first_multiple_needles,
            needles_arg,
            haystack_arg,
            error_call
          );
          break;
        }
        default:
          r_stop_internal("`check_multiple_needles` should have been false.");
        }

        switch (relationship) {
        case VCTRS_RELATIONSHIP_one_to_one:
          stop_matches_relationship_one_to_one(
            loc_first_multiple_needles,
            "needles",
            needles_arg,
            haystack_arg,
            error_call
          );
        case VCTRS_RELATIONSHIP_many_to_one:
          stop_matches_relationship_many_to_one(
            loc_first_multiple_needles,
            needles_arg,
            haystack_arg,
            error_call
          );
        case VCTRS_RELATIONSHIP_warn_many_to_many: {
          if (any_multiple_haystack) {
            warn_matches_relationship_many_to_many(
              loc_first_multiple_needles,
              loc_first_multiple_haystack,
              needles_arg,
              haystack_arg,
              error_call
            );
          }
          break;
        }
        default: {
          switch (multiple) {
          case VCTRS_MULTIPLE_all:
            // We are tracking if there are multiple matches, but don't throw
            // any errors or warnings on them
            break;
          // TODO: Remove deprecated support for `multiple = "error"/"warning"`
          case VCTRS_MULTIPLE_error:
            r_stop_internal("`multiple = 'error'` should have thrown by now.");
          case VCTRS_MULTIPLE_warning:
            break;
          default:
            r_stop_internal("`check_multiple_needles` should have been false.");
          }
        }
        }

        // We know there are multiple and don't need to continue checking
        check_multiple_needles = false;
      }
    }

    int loc_o_haystack = loc_first_match_o_haystack;

    switch (multiple) {
    case VCTRS_MULTIPLE_first:
    case VCTRS_MULTIPLE_last: {
      if (skip_loc_needles) {
        // We use `v_loc_needles` unconditionally below because it should always
        // be available when finding the first/last match
        r_stop_internal(
          "`skip_loc_needles` should never be `true` with `multiple = 'first'/'last'`."
        );
      }

      if (loc_haystack_overall == r_globals.na_int) {
        // Start of a new needle
        loc_haystack_overall = v_o_haystack[loc_o_haystack] - 1;
      }

      // Branching here seems to help a good bit when there are many matches
      if (multiple == VCTRS_MULTIPLE_first) {
        for (r_ssize j = 0; j < size_match; ++j) {
          const int loc_haystack = v_o_haystack[loc_o_haystack] - 1;

          if (loc_haystack_overall > loc_haystack) {
            loc_haystack_overall = loc_haystack;
          }

          ++loc_o_haystack;
        }
      } else if (multiple == VCTRS_MULTIPLE_last) {
        for (r_ssize j = 0; j < size_match; ++j) {
          const int loc_haystack = v_o_haystack[loc_o_haystack] - 1;

          if (loc_haystack_overall < loc_haystack) {
            loc_haystack_overall = loc_haystack;
          }

          ++loc_o_haystack;
        }
      } else {
        r_stop_internal(
          "`multiple` should only be 'first' or 'last' here."
        );
      }

      const bool at_end_of_all_matches = (i == n_used - 1);

      // Check if we are at the end of the vector or if the next needle location
      // is different from this one, at which point we can record the match
      // corresponding to the first/last result
      bool at_end_of_needle_matches = true;

      if (!at_end_of_all_matches) {
        const int loc_next = v_o_loc_needles[i + 1] - 1;
        const int loc_needles_next = v_loc_needles[loc_next];
        at_end_of_needle_matches = (loc_needles != loc_needles_next);
      }

      if (at_end_of_needle_matches) {
        v_out_needles[loc_out] = loc_needles + 1;
        v_out_haystack[loc_out] = loc_haystack_overall + 1;

        if (track_matches_haystack) {
          if (check_multiple_haystack) {
            // `true` if a match already existed
            any_multiple_haystack = v_detect_matches_haystack[loc_haystack_overall];

            if (any_multiple_haystack) {
              loc_first_multiple_haystack = loc_haystack_overall;

              switch (relationship) {
              case VCTRS_RELATIONSHIP_one_to_one:
                stop_matches_relationship_one_to_one(
                  loc_first_multiple_haystack,
                  "haystack",
                  needles_arg,
                  haystack_arg,
                  error_call
                );
              case VCTRS_RELATIONSHIP_one_to_many:
                stop_matches_relationship_one_to_many(
                  loc_first_multiple_haystack,
                  needles_arg,
                  haystack_arg,
                  error_call
                );
              case VCTRS_RELATIONSHIP_warn_many_to_many:
                r_stop_internal(
                  "`relationship = 'warn-many-to-many'` with "
                  "`multiple = 'first'/'last' should have resulted in "
                  "`check_multiple_haystack = false`."
                );
              default:
                r_stop_internal("`check_multiple_haystack` should have been false.");
              }
            }
          }

          // This haystack value was a match, so it isn't "remaining".
          v_detect_matches_haystack[loc_haystack_overall] = true;
        }

        ++loc_out;
        loc_haystack_overall = r_globals.na_int;
      }

      break;
    }
    case VCTRS_MULTIPLE_all:
    case VCTRS_MULTIPLE_error:
    case VCTRS_MULTIPLE_warning:
    case VCTRS_MULTIPLE_any: {
      for (r_ssize j = 0; j < size_match; ++j) {
        const int loc_haystack = v_o_haystack[loc_o_haystack] - 1;

        v_out_needles[loc_out] = loc_needles + 1;
        v_out_haystack[loc_out] = loc_haystack + 1;

        if (track_matches_haystack) {
          if (check_multiple_haystack) {
            // `true` if a match already existed
            any_multiple_haystack = v_detect_matches_haystack[loc_haystack];

            if (any_multiple_haystack) {
              loc_first_multiple_haystack = loc_haystack;

              switch (relationship) {
              case VCTRS_RELATIONSHIP_one_to_one:
                stop_matches_relationship_one_to_one(
                  loc_first_multiple_haystack,
                  "haystack",
                  needles_arg,
                  haystack_arg,
                  error_call
                );
              case VCTRS_RELATIONSHIP_one_to_many:
                stop_matches_relationship_one_to_many(
                  loc_first_multiple_haystack,
                  needles_arg,
                  haystack_arg,
                  error_call
                );
              case VCTRS_RELATIONSHIP_warn_many_to_many: {
                if (any_multiple_needles) {
                  warn_matches_relationship_many_to_many(
                    loc_first_multiple_needles,
                    loc_first_multiple_haystack,
                    needles_arg,
                    haystack_arg,
                    error_call
                  );
                }

                // We know there are multiple and don't need to continue checking
                check_multiple_haystack = false;

                // Only continue tracking if needed for `remaining`
                track_matches_haystack = retain_remaining_haystack;

                break;
              }
              default:
                r_stop_internal("`check_multiple_haystack` should have been false.");
              }
            }
          }

          // This haystack value was a match, so it isn't "remaining".
          v_detect_matches_haystack[loc_haystack] = true;
        }

        ++loc_out;
        ++loc_o_haystack;
      }

      break;
    }
    }
  }

  if (loc_out < size_out) {
    // Can happen with a `filter` and `multiple = "all"`, where it is possible
    // for potential matches coming from a different nesting container
    // to be skipped over in the `has_loc_filter_match_o_haystack` section.
    // Can also happen with `no_match = "drop"` or `incomplete = "drop"`.
    // This resize should be essentially free by setting truelength/growable.
    size_out = loc_out;

    out_needles = r_int_resize(out_needles, size_out);
    KEEP_AT(out_needles, out_needles_pi);
    v_out_needles = r_int_begin(out_needles);

    out_haystack = r_int_resize(out_haystack, size_out);
    KEEP_AT(out_haystack, out_haystack_pi);
    v_out_haystack = r_int_begin(out_haystack);
  }

  if (any_multiple_needles && any_non_equi) {
    // If we had multiple matches and we were doing a non-equi join, then
    // the needles column will be correct, but any group of multiple matches in
    // the haystack column will be ordered incorrectly within the needle group.
    // They will be ordered using the order of the original haystack values,
    // rather than by first appearance. Reordering the entire output data frame
    // orders them correctly, as within each needle group it will put the
    // haystack locations in ascending order (i.e. by first appearance).
    // This is expensive! `out` could have a huge number of matches.
    r_obj* both = KEEP(new_matches_result(out_needles, out_haystack));

    r_obj* o_haystack_appearance = KEEP(vec_order(both, chrs_asc, chrs_smallest, true, r_null));
    int* v_o_haystack_appearance = r_int_begin(o_haystack_appearance);

    // Avoid a second allocation by reusing the appearance order vector,
    // which has the same size and type as the output and we won't overwrite it
    r_obj* out_haystack_reordered = o_haystack_appearance;
    int* v_out_haystack_reordered = v_o_haystack_appearance;

    for (r_ssize i = 0; i < size_out; ++i) {
      v_out_haystack_reordered[i] = v_out_haystack[v_o_haystack_appearance[i] - 1];
    }

    out_haystack = out_haystack_reordered;
    v_out_haystack = v_out_haystack_reordered;

    FREE(2);
    KEEP_AT(out_haystack, out_haystack_pi);
  }

  if (retain_remaining_haystack) {
    r_ssize n_remaining_haystack = 0;

    switch (remaining->action) {
    case VCTRS_REMAINING_ACTION_error: {
      for (r_ssize i = 0; i < size_haystack; ++i) {
        if (!v_detect_matches_haystack[i]) {
          stop_matches_remaining(i, needles_arg, haystack_arg, error_call);
        }
      }
      break;
    }
    case VCTRS_REMAINING_ACTION_value: {
      for (r_ssize i = 0; i < size_haystack; ++i) {
        n_remaining_haystack += !v_detect_matches_haystack[i];
      }
      break;
    }
    case VCTRS_REMAINING_ACTION_drop: {
      r_stop_internal("`remaining` should never be 'drop' here.");
    }
    }

    if (n_remaining_haystack > 0) {
      // Resize to have enough room for "remaining" haystack values at the end
      r_ssize new_size_out = r_ssize_add(size_out, n_remaining_haystack);

      out_needles = r_int_resize(out_needles, new_size_out);
      KEEP_AT(out_needles, out_needles_pi);
      v_out_needles = r_int_begin(out_needles);

      out_haystack = r_int_resize(out_haystack, new_size_out);
      KEEP_AT(out_haystack, out_haystack_pi);
      v_out_haystack = r_int_begin(out_haystack);

      // Add in "remaining" values at the end of the output
      for (r_ssize i = size_out; i < new_size_out; ++i) {
        v_out_needles[i] = remaining->value;
      }

      r_ssize j = size_out;

      for (r_ssize i = 0; i < size_haystack; ++i) {
        if (!v_detect_matches_haystack[i]) {
          v_out_haystack[j] = i + 1;
          ++j;
        }
      }

      size_out = new_size_out;
    }
  }

  r_obj* out = new_matches_result(out_needles, out_haystack);

  FREE(n_prot);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/match.c:1593

init_df_poly_vec timeout

timing: 20.00 s
source
void init_df_poly_vec(struct poly_vec* p_poly_vec) {
  r_obj* df = p_poly_vec->vec;
  r_ssize n_col = r_length(df);

  r_obj* shelter = KEEP(r_alloc_list(4));

  r_list_poke(shelter, 0, p_poly_vec->shelter);
  p_poly_vec->shelter = shelter;

  r_obj* data_handle = KEEP(r_alloc_raw(sizeof(struct poly_df_data)));
  struct poly_df_data* data = (struct poly_df_data*) r_raw_begin(data_handle);
  r_list_poke(shelter, 1, data_handle);

  r_obj* col_type_handle = KEEP(r_alloc_raw(n_col * sizeof(enum vctrs_type)));
  enum vctrs_type* v_col_type = (enum vctrs_type*) r_raw_begin(col_type_handle);
  r_list_poke(shelter, 2, col_type_handle);

  r_obj* col_ptr_handle = KEEP(r_alloc_raw(n_col * sizeof(void*)));
  const void** v_col_ptr = (const void**) r_raw_begin(col_ptr_handle);
  r_list_poke(shelter, 3, col_ptr_handle);

  for (r_ssize i = 0; i < n_col; ++i) {
    r_obj* col = r_list_get(df, i);
    v_col_type[i] = vec_proxy_typeof(col);
    v_col_ptr[i] = r_vec_cbegin(col);
  }

  data->v_col_type = v_col_type;
  data->v_col_ptr = v_col_ptr;
  data->n_col = n_col;

  p_poly_vec->p_vec = (void*) data;

  FREE(4);
}
/__w/r-typing/r-typing/work/sources/vctrs/src/poly-op.c:103

init_order timeout

timing: 20.00 s
source
int* init_order(struct order* p_order) {
  if (p_order->initialized) {
    return p_order->p_data;
  }

  // Initialize `x` with sequential 1-based ordering
  for (r_ssize i = 0; i < p_order->size; ++i) {
    p_order->p_data[i] = i + 1;
  }

  p_order->initialized = true;

  return p_order->p_data;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.h:76

int_as_location timeout

timing: 20.00 s
source
r_obj* int_as_location(r_obj* subscript,
                       r_ssize n,
                       const struct location_opts* opts) {
  const int* data = r_int_cbegin(subscript);
  r_ssize loc_n = r_length(subscript);

  // Zeros need to be filtered out from the subscript vector.
  // `int_invert_location()` filters them out for negative indices, but
  // positive indices need to go through and `int_filter_zero()`.
  r_ssize n_zero = 0;

  r_ssize n_oob = 0;
  r_ssize n_missing = 0;

  for (r_ssize i = 0; i < loc_n; ++i, ++data) {
    int elt = *data;

    if (elt == r_globals.na_int) {
      switch (opts->missing) {
      case SUBSCRIPT_MISSING_PROPAGATE: break;
      case SUBSCRIPT_MISSING_REMOVE: ++n_missing; break;
      case SUBSCRIPT_MISSING_ERROR: stop_subscript_missing(subscript, opts);
      }
    } else if (elt == 0) {
      switch (opts->loc_zero) {
      case LOC_ZERO_REMOVE: ++n_zero; break;
      case LOC_ZERO_ERROR: stop_location_zero(subscript, opts);
      case LOC_ZERO_IGNORE: break;
      }
    } else if (elt < 0) {
      switch (opts->loc_negative) {
      case LOC_NEGATIVE_INVERT: return int_invert_location(subscript, n, opts);
      case LOC_NEGATIVE_ERROR: stop_location_negative(subscript, opts);
      case LOC_NEGATIVE_IGNORE: {
        if (abs(elt) > n) {
          switch (opts->loc_oob) {
          case LOC_OOB_ERROR: stop_subscript_oob_location(subscript, n, opts);
          case LOC_OOB_EXTEND: stop_subscript_negative_oob_location(subscript, n, opts);
          case LOC_OOB_REMOVE: ++n_oob; break;
          }
        }
        break;
      }
      }
    } else if (elt > n) {
      switch (opts->loc_oob) {
      case LOC_OOB_ERROR: stop_subscript_oob_location(subscript, n, opts);
      case LOC_OOB_EXTEND: ++n_oob; break;
      case LOC_OOB_REMOVE: ++n_oob; break;
      }
    }
  }

  r_keep_loc subscript_shelter;
  KEEP_HERE(subscript, &subscript_shelter);

  if (n_missing > 0) {
    subscript = int_filter_missing(subscript, n_missing);
    KEEP_AT(subscript, subscript_shelter);
  }

  if (n_zero > 0) {
    subscript = int_filter_zero(subscript, n_zero);
    KEEP_AT(subscript, subscript_shelter);
  }

  if (n_oob > 0) {
    switch (opts->loc_oob) {
    case LOC_OOB_ERROR: {
      r_stop_internal("An error should have been thrown on the first OOB value.");
    }
    case LOC_OOB_EXTEND: {
      int_check_consecutive(subscript, n, n_oob, opts);
      break;
    }
    case LOC_OOB_REMOVE: {
      subscript = int_filter_oob(subscript, n, n_oob);
      KEEP_AT(subscript, subscript_shelter);
      break;
    }
    }
  }

  FREE(1);
  return subscript;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/subscript-loc.c:146

int_order timeout

timing: 20.00 s
source
void int_order(
  SEXP x,
  bool decreasing,
  bool na_last,
  r_ssize size,
  struct order* p_order,
  struct lazy_raw* p_lazy_x_chunk,
  struct lazy_raw* p_lazy_x_aux,
  struct lazy_raw* p_lazy_o_aux,
  struct lazy_raw* p_lazy_bytes,
  struct lazy_raw* p_lazy_counts,
  struct group_infos* p_group_infos
) {
  const int* p_x = INTEGER_RO(x);

  const enum vctrs_sortedness sortedness = int_sortedness(
    p_x,
    size,
    decreasing,
    na_last,
    p_group_infos
  );

  // Handle sorted cases and set ordering to initialized
  if (sortedness != VCTRS_SORTEDNESS_unsorted) {
    int* p_o = p_order->p_data;
    ord_resolve_sortedness(sortedness, size, p_o);
    p_order->initialized = true;
    return;
  }

  if (size <= ORDER_INSERTION_BOUNDARY) {
    int* p_o = init_order(p_order);

    void* p_x_chunk = init_lazy_raw(p_lazy_x_chunk);
    r_memcpy(p_x_chunk, p_x, size * sizeof(*p_x));

    int_adjust(decreasing, na_last, size, p_x_chunk);

    int_order_insertion(size, p_x_chunk, p_o, p_group_infos);

    return;
  }

  uint32_t range;
  int x_min;

  int_compute_range(p_x, size, &x_min, &range);

  /*
   * If in counting order range and on the first column / single vector,
   * `p_o_aux` won't be used, so no need to initialize it.
   *
   * Also, `p_o` will be filled directly, so for performance we don't
   * initialize its order.
   */
  if (range < INT_ORDER_COUNTING_RANGE_BOUNDARY) {
    const bool initialized = false;

    int* p_o = p_order->p_data;
    int* p_o_aux = NULL;

    int_order_counting(
      p_x,
      size,
      x_min,
      range,
      initialized,
      decreasing,
      na_last,
      p_o,
      p_o_aux,
      p_group_infos
    );

    p_order->initialized = true;
    return;
  }

  int* p_o = init_order(p_order);

  int* p_o_aux = (int*) init_lazy_raw(p_lazy_o_aux);

  uint32_t* p_x_aux = (uint32_t*) init_lazy_raw(p_lazy_x_aux);

  uint8_t* p_bytes = (uint8_t*) init_lazy_raw(p_lazy_bytes);

  r_ssize* p_counts = (r_ssize*) init_lazy_raw(p_lazy_counts);
  r_memset(p_counts, 0, p_lazy_counts->size);

  // Copy `x` so we can modify in place
  void* p_x_chunk = init_lazy_raw(p_lazy_x_chunk);
  r_memcpy(p_x_chunk, p_x, size * sizeof(*p_x));

  int_adjust(decreasing, na_last, size, p_x_chunk);

  int_order_radix(
    size,
    p_x_chunk,
    p_o,
    p_x_aux,
    p_o_aux,
    p_bytes,
    p_counts,
    p_group_infos
  );
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:715

int_order_counting timeout

timing: 20.00 s
source
void int_order_counting(
  const int* p_x,
  r_ssize size,
  int x_min,
  uint32_t range,
  bool initialized,
  bool decreasing,
  bool na_last,
  int* p_o,
  int* p_o_aux,
  struct group_infos* p_group_infos
) {
  // - Only allocate this once (counts are reset to 0 at end)
  // - Allocating as static allows us to allocate an array this large
  // - `+ 1` to ensure there is room for the extra `NA` bucket
  static r_ssize p_counts[INT_ORDER_COUNTING_RANGE_BOUNDARY + 1] = { 0 };

  // `NA` values get counted in the last used bucket
  uint32_t na_bucket = range;
  r_ssize na_count = 0;

  // Sanity check
  if (range > INT_ORDER_COUNTING_RANGE_BOUNDARY) {
    Rf_errorcall(R_NilValue, "Internal error: `range > INT_ORDER_COUNTING_RANGE_BOUNDARY`.");
  }

  // Histogram pass
  for (r_ssize i = 0; i < size; ++i) {
    const int elt = p_x[i];

    if (elt == NA_INTEGER) {
      ++na_count;
    } else {
      const uint32_t bucket = elt - x_min;
      ++p_counts[bucket];
    }
  }

  // Add `NA` counts once at the end
  p_counts[na_bucket] = na_count;

  r_ssize cumulative = 0;

  // Handle decreasing/increasing by altering the order in which
  // counts are accumulated
  const int direction = decreasing ? -1 : 1;
  r_ssize j = decreasing ? range - 1 : 0;

  // `na_last = false` pushes NA counts to the front
  if (!na_last && na_count != 0) {
    p_counts[na_bucket] = cumulative;
    cumulative += na_count;
    groups_size_maybe_push(na_count, p_group_infos);
  }

  // Accumulate counts, skip zeros
  for (uint32_t i = 0; i < range; ++i) {
    r_ssize count = p_counts[j];

    if (count == 0) {
      j += direction;
      continue;
    }

    // Insert current cumulative value, then increment
    p_counts[j] = cumulative;
    cumulative += count;

    // At this point we will handle this group completely
    groups_size_maybe_push(count, p_group_infos);

    j += direction;
  }

  // `na_last = true` pushes NA counts to the back
  if (na_last && na_count != 0) {
    p_counts[na_bucket] = cumulative;
    groups_size_maybe_push(na_count, p_group_infos);
  }

  // If order is not initialized, we are on the first column / atomic vector
  // and can place the order directly into the result. Much faster than
  // initializing, placing in `p_o_aux`, and copying back over.
  if (initialized) {
    for (r_ssize i = 0; i < size; ++i) {
      const int elt = p_x[i];
      uint32_t bucket = (elt == NA_INTEGER) ? na_bucket : elt - x_min;
      const r_ssize loc = p_counts[bucket]++;
      p_o_aux[loc] = p_o[i];
    }

    r_memcpy(p_o, p_o_aux, size * sizeof(*p_o_aux));
  } else {
    for (r_ssize i = 0; i < size; ++i) {
      const int elt = p_x[i];
      uint32_t bucket = (elt == NA_INTEGER) ? na_bucket : elt - x_min;
      const r_ssize loc = p_counts[bucket]++;
      p_o[loc] = i + 1;
    }
  }

  // Reset counts for next column.
  // Only reset what we might have touched.
  // `+ 1` to reset the NA bucket too.
  r_memset(p_counts, 0, (range + 1) * sizeof(r_ssize));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/order.c:979

ord_as_ordered timeout

timing: 20.00 s
source
SEXP ord_as_ordered(const struct cast_opts* p_opts) {
  SEXP x_levels = PROTECT(Rf_getAttrib(p_opts->x, R_LevelsSymbol));
  SEXP to_levels = PROTECT(Rf_getAttrib(p_opts->to, R_LevelsSymbol));

  SEXP out;
  if (ord_ptype2_validate(
    x_levels,
    to_levels,
    p_opts->x,
    p_opts->to,
    p_opts->p_x_arg,
    p_opts->p_to_arg
  )) {
    out = p_opts->x;
  } else {
    out = vec_cast_default(
      p_opts->x,
      p_opts->to,
      p_opts->p_x_arg,
      p_opts->p_to_arg,
      p_opts->call,
      p_opts->s3_fallback
    );
  }

  UNPROTECT(2);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-factor.c:277

p_bool_which timeout

timing: 20.00 s
source
r_obj* p_bool_which(const bool* v_x, r_ssize size) {
  const r_ssize out_size = p_bool_sum(v_x, size);

  r_obj* out = KEEP(r_alloc_integer(out_size));
  int* v_out = r_int_begin(out);

  for (r_ssize i = 0, j = 0; i < size && j < out_size; ++i) {
    v_out[j] = i + 1;
    j += v_x[i];
  }

  FREE(1);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/vec-bool.h:100

r_lazy_is_null timeout

timing: 20.00 s
source
bool r_lazy_is_null(struct r_lazy call) {
  return !call.x && !call.env;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/rlang/eval.h:180

r_stop_unexpected_type timeout

timing: 20.00 s
(definition not located in src/)

r_stop_unimplemented_type timeout

timing: 20.00 s
(definition not located in src/)

stop_unimplemented_type timeout

timing: 20.00 s
source
void stop_unimplemented_type(const char* fn, SEXPTYPE type) {
  r_stop_internal("Unimplemented type `%s`.", Rf_type2char(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/utils.h:109

stop_unimplemented_vctrs_type timeout

timing: 20.00 s
source
void stop_unimplemented_vctrs_type(const char* fn, enum vctrs_type type) {
  r_stop_internal("Unsupported vctrs type `%s`.", vec_type_as_str(type));
}
/__w/r-typing/r-typing/work/sources/vctrs/src/type-info.c:116

vctrs_type2_as_str timeout

timing: 20.00 s
source
const char* vctrs_type2_as_str(enum vctrs_type2 type) {
  switch (type) {
  case VCTRS_TYPE2_null_null:               return "VCTRS_TYPE2_null_null";
  case VCTRS_TYPE2_null_logical:            return "VCTRS_TYPE2_null_logical";
  case VCTRS_TYPE2_null_integer:            return "VCTRS_TYPE2_null_integer";
  case VCTRS_TYPE2_null_double:             return "VCTRS_TYPE2_null_double";
  case VCTRS_TYPE2_null_complex:            return "VCTRS_TYPE2_null_complex";
  case VCTRS_TYPE2_null_character:          return "VCTRS_TYPE2_null_character";
  case VCTRS_TYPE2_null_raw:                return "VCTRS_TYPE2_null_raw";
  case VCTRS_TYPE2_null_list:               return "VCTRS_TYPE2_null_list";
  case VCTRS_TYPE2_null_dataframe:          return "VCTRS_TYPE2_null_dataframe";
  case VCTRS_TYPE2_null_s3:                 return "VCTRS_TYPE2_null_s3";
  case VCTRS_TYPE2_null_unspecified:        return "VCTRS_TYPE2_null_unspecified";
  case VCTRS_TYPE2_null_scalar:             return "VCTRS_TYPE2_null_scalar";

  case VCTRS_TYPE2_unspecified_logical:     return "VCTRS_TYPE2_unspecified_logical";
  case VCTRS_TYPE2_unspecified_integer:     return "VCTRS_TYPE2_unspecified_integer";
  case VCTRS_TYPE2_unspecified_double:      return "VCTRS_TYPE2_unspecified_double";
  case VCTRS_TYPE2_unspecified_complex:     return "VCTRS_TYPE2_unspecified_complex";
  case VCTRS_TYPE2_unspecified_character:   return "VCTRS_TYPE2_unspecified_character";
  case VCTRS_TYPE2_unspecified_raw:         return "VCTRS_TYPE2_unspecified_raw";
  case VCTRS_TYPE2_unspecified_list:        return "VCTRS_TYPE2_unspecified_list";
  case VCTRS_TYPE2_unspecified_dataframe:   return "VCTRS_TYPE2_unspecified_dataframe";
  case VCTRS_TYPE2_unspecified_s3:          return "VCTRS_TYPE2_unspecified_s3";
  case VCTRS_TYPE2_unspecified_unspecified: return "VCTRS_TYPE2_unspecified_unspecified";
  case VCTRS_TYPE2_unspecified_scalar:      return "VCTRS_TYPE2_unspecified_scalar";

  case VCTRS_TYPE2_logical_logical:         return "VCTRS_TYPE2_logical_logical";
  case VCTRS_TYPE2_logical_integer:         return "VCTRS_TYPE2_logical_integer";
  case VCTRS_TYPE2_logical_double:          return "VCTRS_TYPE2_logical_double";
  case VCTRS_TYPE2_logical_complex:         return "VCTRS_TYPE2_logical_complex";
  case VCTRS_TYPE2_logical_character:       return "VCTRS_TYPE2_logical_character";
  case VCTRS_TYPE2_logical_raw:             return "VCTRS_TYPE2_logical_raw";
  case VCTRS_TYPE2_logical_list:            return "VCTRS_TYPE2_logical_list";
  case VCTRS_TYPE2_logical_dataframe:       return "VCTRS_TYPE2_logical_dataframe";
  case VCTRS_TYPE2_logical_s3:              return "VCTRS_TYPE2_logical_s3";
  case VCTRS_TYPE2_logical_scalar:          return "VCTRS_TYPE2_logical_scalar";

  case VCTRS_TYPE2_integer_integer:         return "VCTRS_TYPE2_integer_integer";
  case VCTRS_TYPE2_integer_double:          return "VCTRS_TYPE2_integer_double";
  case VCTRS_TYPE2_integer_complex:         return "VCTRS_TYPE2_integer_complex";
  case VCTRS_TYPE2_integer_character:       return "VCTRS_TYPE2_integer_character";
  case VCTRS_TYPE2_integer_raw:             return "VCTRS_TYPE2_integer_raw";
  case VCTRS_TYPE2_integer_list:            return "VCTRS_TYPE2_integer_list";
  case VCTRS_TYPE2_integer_dataframe:       return "VCTRS_TYPE2_integer_dataframe";
  case VCTRS_TYPE2_integer_s3:              return "VCTRS_TYPE2_integer_s3";
  case VCTRS_TYPE2_integer_scalar:          return "VCTRS_TYPE2_integer_scalar";

  case VCTRS_TYPE2_double_double:           return "VCTRS_TYPE2_double_double";
  case VCTRS_TYPE2_double_complex:          return "VCTRS_TYPE2_double_complex";
  case VCTRS_TYPE2_double_character:        return "VCTRS_TYPE2_double_character";
  case VCTRS_TYPE2_double_raw:              return "VCTRS_TYPE2_double_raw";
  case VCTRS_TYPE2_double_list:             return "VCTRS_TYPE2_double_list";
  case VCTRS_TYPE2_double_dataframe:        return "VCTRS_TYPE2_double_dataframe";
  case VCTRS_TYPE2_double_s3:               return "VCTRS_TYPE2_double_s3";
  case VCTRS_TYPE2_double_scalar:           return "VCTRS_TYPE2_double_scalar";

  case VCTRS_TYPE2_complex_complex:         return "VCTRS_TYPE2_complex_complex";
  case VCTRS_TYPE2_complex_character:       return "VCTRS_TYPE2_complex_character";
  case VCTRS_TYPE2_complex_raw:             return "VCTRS_TYPE2_complex_raw";
  case VCTRS_TYPE2_complex_list:            return "VCTRS_TYPE2_complex_list";
  case VCTRS_TYPE2_complex_dataframe:       return "VCTRS_TYPE2_complex_dataframe";
  case VCTRS_TYPE2_complex_s3:              return "VCTRS_TYPE2_complex_s3";
  case VCTRS_TYPE2_complex_scalar:          return "VCTRS_TYPE2_complex_scalar";

  case VCTRS_TYPE2_character_character:     return "VCTRS_TYPE2_character_character";
  case VCTRS_TYPE2_character_raw:           return "VCTRS_TYPE2_character_raw";
  case VCTRS_TYPE2_character_list:          return "VCTRS_TYPE2_character_list";
  case VCTRS_TYPE2_character_dataframe:     return "VCTRS_TYPE2_character_dataframe";
  case VCTRS_TYPE2_character_s3:            return "VCTRS_TYPE2_character_s3";
  case VCTRS_TYPE2_character_scalar:        return "VCTRS_TYPE2_character_scalar";

  case VCTRS_TYPE2_raw_raw:                 return "VCTRS_TYPE2_raw_raw";
  case VCTRS_TYPE2_raw_list:                return "VCTRS_TYPE2_raw_list";
  case VCTRS_TYPE2_raw_dataframe:           return "VCTRS_TYPE2_raw_dataframe";
  case VCTRS_TYPE2_raw_s3:                  return "VCTRS_TYPE2_raw_s3";
  case VCTRS_TYPE2_raw_scalar:              return "VCTRS_TYPE2_raw_scalar";

  case VCTRS_TYPE2_list_list:               return "VCTRS_TYPE2_list_list";
  case VCTRS_TYPE2_list_dataframe:          return "VCTRS_TYPE2_list_dataframe";
  case VCTRS_TYPE2_list_s3:                 return "VCTRS_TYPE2_list_s3";
  case VCTRS_TYPE2_list_scalar:             return "VCTRS_TYPE2_list_scalar";

  case VCTRS_TYPE2_dataframe_dataframe:     return "VCTRS_TYPE2_dataframe_dataframe";
  case VCTRS_TYPE2_dataframe_s3:            return "VCTRS_TYPE2_dataframe_s3";
  case VCTRS_TYPE2_dataframe_scalar:        return "VCTRS_TYPE2_dataframe_scalar";

  case VCTRS_TYPE2_S3_s3:                   return "VCTRS_TYPE2_S3_s3";
  case VCTRS_TYPE2_S3_scalar:               return "VCTRS_TYPE2_S3_scalar";

  case VCTRS_TYPE2_scalar_scalar:           return "VCTRS_TYPE2_scalar_scalar";
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2.c:226

vctrs_type2_s3_as_str timeout

timing: 20.00 s
source
const char* vctrs_type2_s3_as_str(enum vctrs_type2_s3 type) {
  switch (type) {
  case VCTRS_TYPE2_S3_null_bare_factor:            return "VCTRS_TYPE2_S3_null_bare_factor";
  case VCTRS_TYPE2_S3_null_bare_ordered:           return "VCTRS_TYPE2_S3_null_bare_ordered";
  case VCTRS_TYPE2_S3_null_bare_date:              return "VCTRS_TYPE2_S3_null_bare_date";
  case VCTRS_TYPE2_S3_null_bare_posixct:           return "VCTRS_TYPE2_S3_null_bare_posixct";
  case VCTRS_TYPE2_S3_null_bare_posixlt:           return "VCTRS_TYPE2_S3_null_bare_posixlt";
  case VCTRS_TYPE2_S3_null_bare_tibble:            return "VCTRS_TYPE2_S3_null_bare_tibble";
  case VCTRS_TYPE2_S3_null_unknown:                return "VCTRS_TYPE2_S3_null_unknown";

  case VCTRS_TYPE2_S3_unspecified_bare_factor:     return "VCTRS_TYPE2_S3_unspecified_bare_factor";
  case VCTRS_TYPE2_S3_unspecified_bare_ordered:    return "VCTRS_TYPE2_S3_unspecified_bare_ordered";
  case VCTRS_TYPE2_S3_unspecified_bare_date:       return "VCTRS_TYPE2_S3_unspecified_bare_date";
  case VCTRS_TYPE2_S3_unspecified_bare_posixct:    return "VCTRS_TYPE2_S3_unspecified_bare_posixct";
  case VCTRS_TYPE2_S3_unspecified_bare_posixlt:    return "VCTRS_TYPE2_S3_unspecified_bare_posixlt";
  case VCTRS_TYPE2_S3_unspecified_bare_tibble:     return "VCTRS_TYPE2_S3_unspecified_bare_tibble";
  case VCTRS_TYPE2_S3_unspecified_unknown:         return "VCTRS_TYPE2_S3_unspecified_unknown";

  case VCTRS_TYPE2_S3_logical_bare_factor:         return "VCTRS_TYPE2_S3_logical_bare_factor";
  case VCTRS_TYPE2_S3_logical_bare_ordered:        return "VCTRS_TYPE2_S3_logical_bare_ordered";
  case VCTRS_TYPE2_S3_logical_bare_date:           return "VCTRS_TYPE2_S3_logical_bare_date";
  case VCTRS_TYPE2_S3_logical_bare_posixct:        return "VCTRS_TYPE2_S3_logical_bare_posixct";
  case VCTRS_TYPE2_S3_logical_bare_posixlt:        return "VCTRS_TYPE2_S3_logical_bare_posixlt";
  case VCTRS_TYPE2_S3_logical_bare_tibble:         return "VCTRS_TYPE2_S3_logical_bare_tibble";
  case VCTRS_TYPE2_S3_logical_unknown:             return "VCTRS_TYPE2_S3_logical_unknown";

  case VCTRS_TYPE2_S3_integer_bare_factor:         return "VCTRS_TYPE2_S3_integer_bare_factor";
  case VCTRS_TYPE2_S3_integer_bare_ordered:        return "VCTRS_TYPE2_S3_integer_bare_ordered";
  case VCTRS_TYPE2_S3_integer_bare_date:           return "VCTRS_TYPE2_S3_integer_bare_date";
  case VCTRS_TYPE2_S3_integer_bare_posixct:        return "VCTRS_TYPE2_S3_integer_bare_posixct";
  case VCTRS_TYPE2_S3_integer_bare_posixlt:        return "VCTRS_TYPE2_S3_integer_bare_posixlt";
  case VCTRS_TYPE2_S3_integer_bare_tibble:         return "VCTRS_TYPE2_S3_integer_bare_tibble";
  case VCTRS_TYPE2_S3_integer_unknown:             return "VCTRS_TYPE2_S3_integer_unknown";

  case VCTRS_TYPE2_S3_double_bare_factor:          return "VCTRS_TYPE2_S3_double_bare_factor";
  case VCTRS_TYPE2_S3_double_bare_ordered:         return "VCTRS_TYPE2_S3_double_bare_ordered";
  case VCTRS_TYPE2_S3_double_bare_date:            return "VCTRS_TYPE2_S3_double_bare_date";
  case VCTRS_TYPE2_S3_double_bare_posixct:         return "VCTRS_TYPE2_S3_double_bare_posixct";
  case VCTRS_TYPE2_S3_double_bare_posixlt:         return "VCTRS_TYPE2_S3_double_bare_posixlt";
  case VCTRS_TYPE2_S3_double_bare_tibble:          return "VCTRS_TYPE2_S3_double_bare_tibble";
  case VCTRS_TYPE2_S3_double_unknown:              return "VCTRS_TYPE2_S3_double_unknown";

  case VCTRS_TYPE2_S3_complex_bare_factor:         return "VCTRS_TYPE2_S3_complex_bare_factor";
  case VCTRS_TYPE2_S3_complex_bare_ordered:        return "VCTRS_TYPE2_S3_complex_bare_ordered";
  case VCTRS_TYPE2_S3_complex_bare_date:           return "VCTRS_TYPE2_S3_complex_bare_date";
  case VCTRS_TYPE2_S3_complex_bare_posixct:        return "VCTRS_TYPE2_S3_complex_bare_posixct";
  case VCTRS_TYPE2_S3_complex_bare_posixlt:        return "VCTRS_TYPE2_S3_complex_bare_posixlt";
  case VCTRS_TYPE2_S3_complex_bare_tibble:         return "VCTRS_TYPE2_S3_complex_bare_tibble";
  case VCTRS_TYPE2_S3_complex_unknown:             return "VCTRS_TYPE2_S3_complex_unknown";

  case VCTRS_TYPE2_S3_character_bare_factor:       return "VCTRS_TYPE2_S3_character_bare_factor";
  case VCTRS_TYPE2_S3_character_bare_ordered:      return "VCTRS_TYPE2_S3_character_bare_ordered";
  case VCTRS_TYPE2_S3_character_bare_date:         return "VCTRS_TYPE2_S3_character_bare_date";
  case VCTRS_TYPE2_S3_character_bare_posixct:      return "VCTRS_TYPE2_S3_character_bare_posixct";
  case VCTRS_TYPE2_S3_character_bare_posixlt:      return "VCTRS_TYPE2_S3_character_bare_posixlt";
  case VCTRS_TYPE2_S3_character_bare_tibble:       return "VCTRS_TYPE2_S3_character_bare_tibble";
  case VCTRS_TYPE2_S3_character_unknown:           return "VCTRS_TYPE2_S3_character_unknown";

  case VCTRS_TYPE2_S3_raw_bare_factor:             return "VCTRS_TYPE2_S3_raw_bare_factor";
  case VCTRS_TYPE2_S3_raw_bare_ordered:            return "VCTRS_TYPE2_S3_raw_bare_ordered";
  case VCTRS_TYPE2_S3_raw_bare_date:               return "VCTRS_TYPE2_S3_raw_bare_date";
  case VCTRS_TYPE2_S3_raw_bare_posixct:            return "VCTRS_TYPE2_S3_raw_bare_posixct";
  case VCTRS_TYPE2_S3_raw_bare_posixlt:            return "VCTRS_TYPE2_S3_raw_bare_posixlt";
  case VCTRS_TYPE2_S3_raw_bare_tibble:             return "VCTRS_TYPE2_S3_raw_bare_tibble";
  case VCTRS_TYPE2_S3_raw_unknown:                 return "VCTRS_TYPE2_S3_raw_unknown";

  case VCTRS_TYPE2_S3_list_bare_factor:            return "VCTRS_TYPE2_S3_list_bare_factor";
  case VCTRS_TYPE2_S3_list_bare_ordered:           return "VCTRS_TYPE2_S3_list_bare_ordered";
  case VCTRS_TYPE2_S3_list_bare_date:              return "VCTRS_TYPE2_S3_list_bare_date";
  case VCTRS_TYPE2_S3_list_bare_posixct:           return "VCTRS_TYPE2_S3_list_bare_posixct";
  case VCTRS_TYPE2_S3_list_bare_posixlt:           return "VCTRS_TYPE2_S3_list_bare_posixlt";
  case VCTRS_TYPE2_S3_list_bare_tibble:            return "VCTRS_TYPE2_S3_list_bare_tibble";
  case VCTRS_TYPE2_S3_list_unknown:                return "VCTRS_TYPE2_S3_list_unknown";

  case VCTRS_TYPE2_S3_dataframe_bare_factor:       return "VCTRS_TYPE2_S3_dataframe_bare_factor";
  case VCTRS_TYPE2_S3_dataframe_bare_ordered:      return "VCTRS_TYPE2_S3_dataframe_bare_ordered";
  case VCTRS_TYPE2_S3_dataframe_bare_date:         return "VCTRS_TYPE2_S3_dataframe_bare_date";
  case VCTRS_TYPE2_S3_dataframe_bare_posixct:      return "VCTRS_TYPE2_S3_dataframe_bare_posixct";
  case VCTRS_TYPE2_S3_dataframe_bare_posixlt:      return "VCTRS_TYPE2_S3_dataframe_bare_posixlt";
  case VCTRS_TYPE2_S3_dataframe_bare_tibble:       return "VCTRS_TYPE2_S3_dataframe_bare_tibble";
  case VCTRS_TYPE2_S3_dataframe_unknown:           return "VCTRS_TYPE2_S3_dataframe_unknown";

  case VCTRS_TYPE2_S3_scalar_bare_factor:          return "VCTRS_TYPE2_S3_scalar_bare_factor";
  case VCTRS_TYPE2_S3_scalar_bare_ordered:         return "VCTRS_TYPE2_S3_scalar_bare_ordered";
  case VCTRS_TYPE2_S3_scalar_bare_date:            return "VCTRS_TYPE2_S3_scalar_bare_date";
  case VCTRS_TYPE2_S3_scalar_bare_posixct:         return "VCTRS_TYPE2_S3_scalar_bare_posixct";
  case VCTRS_TYPE2_S3_scalar_bare_posixlt:         return "VCTRS_TYPE2_S3_scalar_bare_posixlt";
  case VCTRS_TYPE2_S3_scalar_bare_tibble:          return "VCTRS_TYPE2_S3_scalar_bare_tibble";
  case VCTRS_TYPE2_S3_scalar_unknown:              return "VCTRS_TYPE2_S3_scalar_unknown";

  case VCTRS_TYPE2_S3_bare_factor_bare_factor:     return "VCTRS_TYPE2_S3_bare_factor_bare_factor";
  case VCTRS_TYPE2_S3_bare_factor_bare_ordered:    return "VCTRS_TYPE2_S3_bare_factor_bare_ordered";
  case VCTRS_TYPE2_S3_bare_factor_bare_date:       return "VCTRS_TYPE2_S3_bare_factor_bare_date";
  case VCTRS_TYPE2_S3_bare_factor_bare_posixct:    return "VCTRS_TYPE2_S3_bare_factor_bare_posixct";
  case VCTRS_TYPE2_S3_bare_factor_bare_posixlt:    return "VCTRS_TYPE2_S3_bare_factor_bare_posixlt";
  case VCTRS_TYPE2_S3_bare_factor_bare_tibble:     return "VCTRS_TYPE2_S3_bare_factor_bare_tibble";
  case VCTRS_TYPE2_S3_bare_factor_unknown:         return "VCTRS_TYPE2_S3_bare_factor_unknown";

  case VCTRS_TYPE2_S3_bare_ordered_bare_ordered:   return "VCTRS_TYPE2_S3_bare_ordered_bare_ordered";
  case VCTRS_TYPE2_S3_bare_ordered_bare_date:      return "VCTRS_TYPE2_S3_bare_ordered_bare_date";
  case VCTRS_TYPE2_S3_bare_ordered_bare_posixct:   return "VCTRS_TYPE2_S3_bare_ordered_bare_posixct";
  case VCTRS_TYPE2_S3_bare_ordered_bare_posixlt:   return "VCTRS_TYPE2_S3_bare_ordered_bare_posixlt";
  case VCTRS_TYPE2_S3_bare_ordered_bare_tibble:    return "VCTRS_TYPE2_S3_bare_ordered_bare_tibble";
  case VCTRS_TYPE2_S3_bare_ordered_unknown:        return "VCTRS_TYPE2_S3_bare_ordered_unknown";

  case VCTRS_TYPE2_S3_bare_date_bare_date:         return "VCTRS_TYPE2_S3_bare_date_bare_date";
  case VCTRS_TYPE2_S3_bare_date_bare_posixct:      return "VCTRS_TYPE2_S3_bare_date_bare_posixct";
  case VCTRS_TYPE2_S3_bare_date_bare_posixlt:      return "VCTRS_TYPE2_S3_bare_date_bare_posixlt";
  case VCTRS_TYPE2_S3_bare_date_bare_tibble:       return "VCTRS_TYPE2_S3_bare_date_bare_tibble";
  case VCTRS_TYPE2_S3_bare_date_unknown:           return "VCTRS_TYPE2_S3_bare_date_unknown";

  case VCTRS_TYPE2_S3_bare_posixct_bare_posixct:   return "VCTRS_TYPE2_S3_bare_posixct_bare_posixct";
  case VCTRS_TYPE2_S3_bare_posixct_bare_posixlt:   return "VCTRS_TYPE2_S3_bare_posixct_bare_posixlt";
  case VCTRS_TYPE2_S3_bare_posixct_bare_tibble:    return "VCTRS_TYPE2_S3_bare_posixct_bare_tibble";
  case VCTRS_TYPE2_S3_bare_posixct_unknown:        return "VCTRS_TYPE2_S3_bare_posixct_unknown";

  case VCTRS_TYPE2_S3_bare_posixlt_bare_posixlt:   return "VCTRS_TYPE2_S3_bare_posixlt_bare_posixlt";
  case VCTRS_TYPE2_S3_bare_posixlt_bare_tibble:    return "VCTRS_TYPE2_S3_bare_posixlt_bare_tibble";
  case VCTRS_TYPE2_S3_bare_posixlt_unknown:        return "VCTRS_TYPE2_S3_bare_posixlt_unknown";

  case VCTRS_TYPE2_S3_bare_tibble_bare_tibble:     return "VCTRS_TYPE2_S3_bare_tibble_bare_tibble";
  case VCTRS_TYPE2_S3_bare_tibble_unknown:         return "VCTRS_TYPE2_S3_bare_tibble_unknown";

  case VCTRS_TYPE2_S3_unknown_unknown:             return "VCTRS_TYPE2_S3_unknown_unknown";
  }

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2-s3.c:331

vec_assign_opts timeout

timing: 20.00 s
source
r_obj* vec_assign_opts(r_obj* x,
                       r_obj* index,
                       r_obj* value,
                       const struct vec_assign_opts* p_opts) {
  if (x == r_null) {
    return r_null;
  }

  struct r_lazy call = r_lazy_is_null(p_opts->call) ? lazy_calls.vec_assign : p_opts->call;
  struct vctrs_arg* x_arg = r_lazy_is_null(p_opts->call) ? vec_args.x : p_opts->x_arg;
  struct vctrs_arg* value_arg = r_lazy_is_null(p_opts->call) ? vec_args.value : p_opts->value_arg;

  obj_check_vector(x, VCTRS_ALLOW_NULL_no, x_arg, call);
  obj_check_vector(value, VCTRS_ALLOW_NULL_no, value_arg, call);

  const r_ssize x_size = vec_size(x);

  // Determine index style. Logical condition indices follow an optimized path.
  enum vctrs_index_style index_style =
    (is_condition_index(index) && r_length(index) == x_size) ?
    VCTRS_INDEX_STYLE_condition :
    VCTRS_INDEX_STYLE_location;

  if (index_style == VCTRS_INDEX_STYLE_location) {
    // Validate and convert to integer locations with `vec_as_location()`
    r_obj* x_names = KEEP(vec_names(x));
    const struct location_opts location_opts = new_location_opts_assign();
    index = vec_as_location_opts(
      index,
      x_size,
      x_names,
      &location_opts
    );
    FREE(1);
  }
  KEEP(index);

  // We won't be proxying recursively
  const bool recursively_proxied = false;

  struct vec_proxy_assign_opts assign_opts = {
    .assign_names = p_opts->assign_names,
    .ignore_outer_names = p_opts->ignore_outer_names,
    .call = call,
    .x_arg = x_arg,
    .value_arg = value_arg,
    .index_style = index_style,
    .slice_value = p_opts->slice_value,
    .ownership = p_opts->ownership,
    .recursively_proxied = recursively_proxied
  };
  struct vec_restore_opts restore_opts = {
    .ownership = p_opts->ownership,
    .recursively_proxied = recursively_proxied
  };

  // Cast `value` and check that it can recycle
  value = KEEP(vec_cast(value, x, assign_opts.value_arg, assign_opts.x_arg, assign_opts.call));

  check_recyclable_against_index(
    value,
    index,
    x_size,
    assign_opts.slice_value,
    assign_opts.index_style,
    assign_opts.value_arg,
    assign_opts.call
  );

  r_obj* proxy = KEEP(vec_proxy(x));
  proxy = KEEP(vec_proxy_assign_opts(proxy, index, value, &assign_opts));
  r_obj* out = vec_restore_opts(proxy, x, &restore_opts);

  FREE(4);
  return out;
}
/__w/r-typing/r-typing/work/sources/vctrs/src/slice-assign.c:6

vec_fill_missing_down_with_max_fill timeout

timing: 20.00 s
source
void vec_fill_missing_down_with_max_fill(const int* p_na, r_ssize size, bool leading, int max_fill, int* p_loc) {
  r_ssize loc = 0;

  if (leading) {
    // Increment `loc` to the first non-missing value
    for (r_ssize i = 0; i < size; ++i) {
      if (!p_na[i]) {
        loc = i;
        break;
      }
    }

    // Back-fill with first non-missing value with a max_fill
    r_ssize n_fill = 0;

    for (r_ssize i = loc - 1; i >= 0; --i) {
      if (n_fill == max_fill) {
        p_loc[i] = i + 1;
      } else {
        p_loc[i] = loc + 1;
        ++n_fill;
      }
    }
  }

  r_ssize n_fill = 0;

  for (r_ssize i = loc; i < size; ++i) {
    if (!p_na[i]) {
      loc = i;
      n_fill = 0;
      p_loc[i] = i + 1;
      continue;
    }

    if (n_fill == max_fill) {
      p_loc[i] = i + 1;
    } else {
      p_loc[i] = loc + 1;
      ++n_fill;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:86

vec_fill_missing_up timeout

timing: 20.00 s
source
void vec_fill_missing_up(const int* p_na, r_ssize size, bool leading, int* p_loc) {
  r_ssize loc = size - 1;

  if (leading) {
    // Decrement `loc` to the last non-missing value
    for (r_ssize i = size - 1; i >= 0; --i) {
      if (!p_na[i]) {
        loc = i;
        break;
      }
    }

    // Forward-fill with last non-missing value
    for (r_ssize i = loc + 1; i < size; ++i) {
      p_loc[i] = loc + 1;
    }
  }

  for (r_ssize i = loc; i >= 0; --i) {
    if (!p_na[i]) {
      loc = i;
    }

    p_loc[i] = loc + 1;
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:131

vec_fill_missing_up_with_max_fill timeout

timing: 20.00 s
source
void vec_fill_missing_up_with_max_fill(const int* p_na, r_ssize size, bool leading, int max_fill, int* p_loc) {
  r_ssize loc = size - 1;

  if (leading) {
    // Decrement `loc` to the last non-missing value
    for (r_ssize i = size - 1; i >= 0; --i) {
      if (!p_na[i]) {
        loc = i;
        break;
      }
    }

    // Forward-fill with last non-missing value with a max_fill
    r_ssize n_fill = 0;

    for (r_ssize i = loc + 1; i < size; ++i) {
      if (n_fill == max_fill) {
        p_loc[i] = i + 1;
      } else {
        p_loc[i] = loc + 1;
        ++n_fill;
      }
    }
  }

  r_ssize n_fill = 0;

  for (r_ssize i = loc; i >= 0; --i) {
    if (!p_na[i]) {
      loc = i;
      n_fill = 0;
      p_loc[i] = i + 1;
      continue;
    }

    if (n_fill == max_fill) {
      p_loc[i] = i + 1;
    } else {
      p_loc[i] = loc + 1;
      ++n_fill;
    }
  }
}
/__w/r-typing/r-typing/work/sources/vctrs/src/fill.c:159

vec_typeof2_impl timeout

timing: 20.00 s
source
enum vctrs_type2 vec_typeof2_impl(enum vctrs_type type_x,
                                  enum vctrs_type type_y,
                                  int* left) {
  switch (type_x) {
  case VCTRS_TYPE_null: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left = -1; return VCTRS_TYPE2_null_null;
    case VCTRS_TYPE_unspecified: *left =  0; return VCTRS_TYPE2_null_unspecified;
    case VCTRS_TYPE_logical:     *left =  0; return VCTRS_TYPE2_null_logical;
    case VCTRS_TYPE_integer:     *left =  0; return VCTRS_TYPE2_null_integer;
    case VCTRS_TYPE_double:      *left =  0; return VCTRS_TYPE2_null_double;
    case VCTRS_TYPE_complex:     *left =  0; return VCTRS_TYPE2_null_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_null_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_null_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_null_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_null_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_null_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_null_scalar;
    }
  }
  case VCTRS_TYPE_unspecified: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_unspecified;
    case VCTRS_TYPE_unspecified: *left = -1; return VCTRS_TYPE2_unspecified_unspecified;
    case VCTRS_TYPE_logical:     *left =  0; return VCTRS_TYPE2_unspecified_logical;
    case VCTRS_TYPE_integer:     *left =  0; return VCTRS_TYPE2_unspecified_integer;
    case VCTRS_TYPE_double:      *left =  0; return VCTRS_TYPE2_unspecified_double;
    case VCTRS_TYPE_complex:     *left =  0; return VCTRS_TYPE2_unspecified_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_unspecified_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_unspecified_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_unspecified_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_unspecified_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_unspecified_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_unspecified_scalar;
    }
  }
  case VCTRS_TYPE_logical: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_logical;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_logical;
    case VCTRS_TYPE_logical:     *left = -1; return VCTRS_TYPE2_logical_logical;
    case VCTRS_TYPE_integer:     *left =  0; return VCTRS_TYPE2_logical_integer;
    case VCTRS_TYPE_double:      *left =  0; return VCTRS_TYPE2_logical_double;
    case VCTRS_TYPE_complex:     *left =  0; return VCTRS_TYPE2_logical_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_logical_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_logical_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_logical_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_logical_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_logical_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_logical_scalar;
    }
  }
  case VCTRS_TYPE_integer: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_integer;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_integer;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_integer;
    case VCTRS_TYPE_integer:     *left = -1; return VCTRS_TYPE2_integer_integer;
    case VCTRS_TYPE_double:      *left =  0; return VCTRS_TYPE2_integer_double;
    case VCTRS_TYPE_complex:     *left =  0; return VCTRS_TYPE2_integer_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_integer_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_integer_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_integer_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_integer_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_integer_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_integer_scalar;
    }
  }
  case VCTRS_TYPE_double: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_double;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_double;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_double;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_double;
    case VCTRS_TYPE_double:      *left = -1; return VCTRS_TYPE2_double_double;
    case VCTRS_TYPE_complex:     *left =  0; return VCTRS_TYPE2_double_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_double_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_double_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_double_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_double_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_double_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_double_scalar;
    }
  }
  case VCTRS_TYPE_complex: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_complex;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_complex;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_complex;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_complex;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_complex;
    case VCTRS_TYPE_complex:     *left = -1; return VCTRS_TYPE2_complex_complex;
    case VCTRS_TYPE_character:   *left =  0; return VCTRS_TYPE2_complex_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_complex_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_complex_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_complex_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_complex_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_complex_scalar;
    }
  }
  case VCTRS_TYPE_character: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_character;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_character;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_character;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_character;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_character;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_character;
    case VCTRS_TYPE_character:   *left = -1; return VCTRS_TYPE2_character_character;
    case VCTRS_TYPE_raw:         *left =  0; return VCTRS_TYPE2_character_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_character_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_character_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_character_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_character_scalar;
    }
  }
  case VCTRS_TYPE_raw: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_raw;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_raw;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_raw;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_raw;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_raw;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_raw;
    case VCTRS_TYPE_character:   *left =  1; return VCTRS_TYPE2_character_raw;
    case VCTRS_TYPE_raw:         *left = -1; return VCTRS_TYPE2_raw_raw;
    case VCTRS_TYPE_list:        *left =  0; return VCTRS_TYPE2_raw_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_raw_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_raw_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_raw_scalar;
    }
  }
  case VCTRS_TYPE_list: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_list;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_list;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_list;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_list;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_list;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_list;
    case VCTRS_TYPE_character:   *left =  1; return VCTRS_TYPE2_character_list;
    case VCTRS_TYPE_raw:         *left =  1; return VCTRS_TYPE2_raw_list;
    case VCTRS_TYPE_list:        *left = -1; return VCTRS_TYPE2_list_list;
    case VCTRS_TYPE_dataframe:   *left =  0; return VCTRS_TYPE2_list_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_list_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_list_scalar;
    }
  }
  case VCTRS_TYPE_dataframe: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_dataframe;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_dataframe;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_dataframe;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_dataframe;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_dataframe;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_dataframe;
    case VCTRS_TYPE_character:   *left =  1; return VCTRS_TYPE2_character_dataframe;
    case VCTRS_TYPE_raw:         *left =  1; return VCTRS_TYPE2_raw_dataframe;
    case VCTRS_TYPE_list:        *left =  1; return VCTRS_TYPE2_list_dataframe;
    case VCTRS_TYPE_dataframe:   *left = -1; return VCTRS_TYPE2_dataframe_dataframe;
    case VCTRS_TYPE_s3:          *left =  0; return VCTRS_TYPE2_dataframe_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_dataframe_scalar;
    }
  }
  case VCTRS_TYPE_s3: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_s3;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_s3;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_s3;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_s3;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_s3;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_s3;
    case VCTRS_TYPE_character:   *left =  1; return VCTRS_TYPE2_character_s3;
    case VCTRS_TYPE_raw:         *left =  1; return VCTRS_TYPE2_raw_s3;
    case VCTRS_TYPE_list:        *left =  1; return VCTRS_TYPE2_list_s3;
    case VCTRS_TYPE_dataframe:   *left =  1; return VCTRS_TYPE2_dataframe_s3;
    case VCTRS_TYPE_s3:          *left = -1; return VCTRS_TYPE2_S3_s3;
    case VCTRS_TYPE_scalar:      *left =  0; return VCTRS_TYPE2_S3_scalar;
    }
  }
  case VCTRS_TYPE_scalar: {
    switch (type_y) {
    case VCTRS_TYPE_null:        *left =  1; return VCTRS_TYPE2_null_scalar;
    case VCTRS_TYPE_unspecified: *left =  1; return VCTRS_TYPE2_unspecified_scalar;
    case VCTRS_TYPE_logical:     *left =  1; return VCTRS_TYPE2_logical_scalar;
    case VCTRS_TYPE_integer:     *left =  1; return VCTRS_TYPE2_integer_scalar;
    case VCTRS_TYPE_double:      *left =  1; return VCTRS_TYPE2_double_scalar;
    case VCTRS_TYPE_complex:     *left =  1; return VCTRS_TYPE2_complex_scalar;
    case VCTRS_TYPE_character:   *left =  1; return VCTRS_TYPE2_character_scalar;
    case VCTRS_TYPE_raw:         *left =  1; return VCTRS_TYPE2_raw_scalar;
    case VCTRS_TYPE_list:        *left =  1; return VCTRS_TYPE2_list_scalar;
    case VCTRS_TYPE_dataframe:   *left =  1; return VCTRS_TYPE2_dataframe_scalar;
    case VCTRS_TYPE_s3:          *left =  1; return VCTRS_TYPE2_S3_scalar;
    case VCTRS_TYPE_scalar:      *left = -1; return VCTRS_TYPE2_scalar_scalar;
    }
  }}

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2.c:21

vec_typeof2_s3_impl2 timeout typed → timeout

timing: 20.00 s
source
enum vctrs_type2_s3 vec_typeof2_s3_impl2(r_obj* x,
                                         r_obj* y,
                                         enum vctrs_type type_y,
                                         int* left) {
  switch (class_type(x)) {
  case VCTRS_CLASS_bare_factor: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_factor;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_factor;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_factor;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_factor;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_factor;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_factor;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_factor;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_factor;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_factor;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_factor;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_factor;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left = -1; return VCTRS_TYPE2_S3_bare_factor_bare_factor;
      case VCTRS_CLASS_bare_ordered: *left =  0; return VCTRS_TYPE2_S3_bare_factor_bare_ordered;
      case VCTRS_CLASS_bare_date:    *left =  0; return VCTRS_TYPE2_S3_bare_factor_bare_date;
      case VCTRS_CLASS_bare_posixct: *left =  0; return VCTRS_TYPE2_S3_bare_factor_bare_posixct;
      case VCTRS_CLASS_bare_posixlt: *left =  0; return VCTRS_TYPE2_S3_bare_factor_bare_posixlt;
      case VCTRS_CLASS_bare_tibble:  *left =  0; return VCTRS_TYPE2_S3_bare_factor_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_factor_unknown;
      }
    }}
  }
  case VCTRS_CLASS_bare_ordered: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_ordered;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_ordered;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_ordered;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_ordered;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_ordered;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_ordered;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_ordered;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_ordered;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_ordered;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_ordered;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_ordered;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_bare_ordered;
      case VCTRS_CLASS_bare_ordered: *left = -1; return VCTRS_TYPE2_S3_bare_ordered_bare_ordered;
      case VCTRS_CLASS_bare_date:    *left =  0; return VCTRS_TYPE2_S3_bare_ordered_bare_date;
      case VCTRS_CLASS_bare_posixct: *left =  0; return VCTRS_TYPE2_S3_bare_ordered_bare_posixct;
      case VCTRS_CLASS_bare_posixlt: *left =  0; return VCTRS_TYPE2_S3_bare_ordered_bare_posixlt;
      case VCTRS_CLASS_bare_tibble:  *left =  0; return VCTRS_TYPE2_S3_bare_ordered_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_ordered_unknown;
      }
    }}
  }
  case VCTRS_CLASS_bare_date: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_date;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_date;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_date;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_date;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_date;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_date;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_date;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_date;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_date;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_date;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_date;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_bare_date;
      case VCTRS_CLASS_bare_ordered: *left =  1; return VCTRS_TYPE2_S3_bare_ordered_bare_date;
      case VCTRS_CLASS_bare_date:    *left = -1; return VCTRS_TYPE2_S3_bare_date_bare_date;
      case VCTRS_CLASS_bare_posixct: *left =  0; return VCTRS_TYPE2_S3_bare_date_bare_posixct;
      case VCTRS_CLASS_bare_posixlt: *left =  0; return VCTRS_TYPE2_S3_bare_date_bare_posixlt;
      case VCTRS_CLASS_bare_tibble:  *left =  0; return VCTRS_TYPE2_S3_bare_date_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_date_unknown;
      }
    }}
  }
  case VCTRS_CLASS_bare_posixct: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_posixct;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_posixct;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_posixct;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_posixct;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_posixct;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_posixct;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_posixct;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_posixct;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_posixct;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_posixct;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_posixct;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_bare_posixct;
      case VCTRS_CLASS_bare_ordered: *left =  1; return VCTRS_TYPE2_S3_bare_ordered_bare_posixct;
      case VCTRS_CLASS_bare_date:    *left =  1; return VCTRS_TYPE2_S3_bare_date_bare_posixct;
      case VCTRS_CLASS_bare_posixct: *left = -1; return VCTRS_TYPE2_S3_bare_posixct_bare_posixct;
      case VCTRS_CLASS_bare_posixlt: *left =  0; return VCTRS_TYPE2_S3_bare_posixct_bare_posixlt;
      case VCTRS_CLASS_bare_tibble:  *left =  0; return VCTRS_TYPE2_S3_bare_posixct_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_posixct_unknown;
      }
    }}
  }
  case VCTRS_CLASS_bare_posixlt: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_posixlt;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_posixlt;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_posixlt;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_posixlt;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_posixlt;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_posixlt;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_posixlt;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_posixlt;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_posixlt;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_posixlt;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_posixlt;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_bare_posixlt;
      case VCTRS_CLASS_bare_ordered: *left =  1; return VCTRS_TYPE2_S3_bare_ordered_bare_posixlt;
      case VCTRS_CLASS_bare_date:    *left =  1; return VCTRS_TYPE2_S3_bare_date_bare_posixlt;
      case VCTRS_CLASS_bare_posixct: *left =  1; return VCTRS_TYPE2_S3_bare_posixct_bare_posixlt;
      case VCTRS_CLASS_bare_posixlt: *left = -1; return VCTRS_TYPE2_S3_bare_posixlt_bare_posixlt;
      case VCTRS_CLASS_bare_tibble:  *left =  0; return VCTRS_TYPE2_S3_bare_posixlt_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_posixlt_unknown;
      }
    }}
  }
  case VCTRS_CLASS_bare_tibble: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_bare_tibble;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_bare_tibble;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_bare_tibble;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_bare_tibble;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_bare_tibble;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_bare_tibble;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_bare_tibble;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_bare_tibble;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_bare_tibble;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_bare_tibble;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_bare_tibble;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_bare_tibble;
      case VCTRS_CLASS_bare_ordered: *left =  1; return VCTRS_TYPE2_S3_bare_ordered_bare_tibble;
      case VCTRS_CLASS_bare_date:    *left =  1; return VCTRS_TYPE2_S3_bare_date_bare_tibble;
      case VCTRS_CLASS_bare_posixct: *left =  1; return VCTRS_TYPE2_S3_bare_posixct_bare_tibble;
      case VCTRS_CLASS_bare_posixlt: *left =  1; return VCTRS_TYPE2_S3_bare_posixlt_bare_tibble;
      case VCTRS_CLASS_bare_tibble:  *left = -1; return VCTRS_TYPE2_S3_bare_tibble_bare_tibble;
      default:                       *left =  0; return VCTRS_TYPE2_S3_bare_tibble_unknown;
      }
    }}
  }
  default: {
    switch (type_y) {
    case VCTRS_TYPE_null:            *left =  1; return VCTRS_TYPE2_S3_null_unknown;
    case VCTRS_TYPE_unspecified:     *left =  1; return VCTRS_TYPE2_S3_unspecified_unknown;
    case VCTRS_TYPE_logical:         *left =  1; return VCTRS_TYPE2_S3_logical_unknown;
    case VCTRS_TYPE_integer:         *left =  1; return VCTRS_TYPE2_S3_integer_unknown;
    case VCTRS_TYPE_double:          *left =  1; return VCTRS_TYPE2_S3_double_unknown;
    case VCTRS_TYPE_complex:         *left =  1; return VCTRS_TYPE2_S3_complex_unknown;
    case VCTRS_TYPE_character:       *left =  1; return VCTRS_TYPE2_S3_character_unknown;
    case VCTRS_TYPE_raw:             *left =  1; return VCTRS_TYPE2_S3_raw_unknown;
    case VCTRS_TYPE_list:            *left =  1; return VCTRS_TYPE2_S3_list_unknown;
    case VCTRS_TYPE_dataframe:       *left =  1; return VCTRS_TYPE2_S3_dataframe_unknown;
    case VCTRS_TYPE_scalar:          *left =  1; return VCTRS_TYPE2_S3_scalar_unknown;
    case VCTRS_TYPE_s3: {
      switch (class_type(y)) {
      case VCTRS_CLASS_bare_factor:  *left =  1; return VCTRS_TYPE2_S3_bare_factor_unknown;
      case VCTRS_CLASS_bare_ordered: *left =  1; return VCTRS_TYPE2_S3_bare_ordered_unknown;
      case VCTRS_CLASS_bare_date:    *left =  1; return VCTRS_TYPE2_S3_bare_date_unknown;
      case VCTRS_CLASS_bare_posixct: *left =  1; return VCTRS_TYPE2_S3_bare_posixct_unknown;
      case VCTRS_CLASS_bare_posixlt: *left =  1; return VCTRS_TYPE2_S3_bare_posixlt_unknown;
      case VCTRS_CLASS_bare_tibble:  *left =  1; return VCTRS_TYPE2_S3_bare_tibble_unknown;
      default:                       *left = -1; return VCTRS_TYPE2_S3_unknown_unknown;
      }
    }}
  }}

  r_stop_unreachable();
}
/__w/r-typing/r-typing/work/sources/vctrs/src/typeof2-s3.c:140

R definitions 1126

R/aaa.R

replace_from untypeabletyped

unbound variable (line 1)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((what: any, pkg: any, to: any?) -> any)<>
timing: 0.015 s
source
replace_from <- function(what, pkg, to = topenv(caller_env())) {
  if (what %in% getNamespaceExports(pkg)) {
    env <- ns_env(pkg)
  } else {
    env <- to
  }
  env_get(env, what, inherit = TRUE)
}
R/aaa.R:1

fn_inline_formals untypeabletyped

unbound variable (line 17)
unbound: formals — a name the prelude does not declare
error detail
name: formals
gradual mode: typed
((fn: any, names: any) -> any)<>
timing: 0.132 s
source
fn_inline_formals <- function(fn, names) {
  stopifnot(typeof(fn) == "closure")

  fmls <- formals(fn)
  fmls[names] <- lapply(fmls[names], eval)

  formals(fn) <- fmls
  fn
}
R/aaa.R:14
R/altrep-lazy-character.R

new_lazy_character untypeabletyped

unbound variable (line 22)
unbound: as_function — a name the prelude does not declare
error detail
name: as_function
gradual mode: typed
((fn: any) -> any)<>
timing: 0.002 s
source
new_lazy_character <- function(fn) {
  fn <- as_function(fn)
  .Call(ffi_altrep_new_lazy_character, fn)
}
R/altrep-lazy-character.R:21

lazy_character_is_materialized typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.013 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
source
lazy_character_is_materialized <- function(x) {
  .Call(ffi_altrep_lazy_character_is_materialized, x)
}
R/altrep-lazy-character.R:26
R/altrep-rle.R

new_chr_rle untypeabletyped

unbound variable (line 6)
unbound: is.integer — a name the prelude does not declare
error detail
name: is.integer
gradual mode: typed
((x: any_sexp) -> any_sexp)<>
timing: 0.002 s
source
new_chr_rle <- function(x) {
  stopifnot(is.integer(x), is_named(x))
  .Call(vctrs_altrep_rle_Make, x)
}
R/altrep-rle.R:5

chr_rle untypeabletyped

unbound variable (line 2)
unbound: new_chr_rle — one of the package’s own names, itself untyped
error detail
name: new_chr_rle
gradual mode: typed
((...: list | null) | (...: vec | null) -> any_sexp)<>
timing: 0.033 s
source
chr_rle <- function(...) {
  new_chr_rle(c(...))
}
R/altrep-rle.R:1

chr_rle_is_materialized typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.010 s
fuzzing: 8 inside (8 ok) · 6 outside (6 rejected)
source
chr_rle_is_materialized <- function(x) {
  .Call(vctrs_altrep_rle_is_materialized, x)
}
R/altrep-rle.R:10
R/altrep.R

is_altrep typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.011 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
is_altrep <- function(x) {
  .Call(vctrs_is_altrep, x)
}
R/altrep.R:1
R/equal.R

vec_proxy_equal untypeabletyped

unbound variable (line 32)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_proxy_equal <- function(x, ...) {
  check_dots_empty0(...)
  return(.Call(vctrs_proxy_equal, x))
  UseMethod("vec_proxy_equal")
}
R/equal.R:31

vec_proxy_equal.default untypeabletyped

unbound variable (line 38)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_equal.default <- function(x, ...) {
  stop_native_implementation("vec_proxy_equal.default")
}
R/equal.R:37

vec_equal typed fuzz ok

((x: any_sexp, y: any_sexp, na_equal: LGL?, .ptype: any_sexp?) -> any_sexp)<>
timing: 0.054 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
vec_equal(function(...) as.name("x"), quote(f(x)))error_pkgvctrs::vec_equal: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_equal(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NA)error_pkgvctrs::vec_equal: `na_equal` must be `TRUE` or `FALSE`.
vec_equal(quote(f(x)), NULL, logical(0), quote(f(x)))error_pkgvctrs::vec_equal: `na_equal` must be `TRUE` or `FALSE`.
vec_equal(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "y" = NULL, "na_equal" = FALSE, ".ptype" = list(as.name("x")))error_pkgvctrs::vec_equal: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_equal(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), "y" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_equal: `y` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_equal(complex(real = 1, imaginary = -2), quote(f(x)), "na_equal" = c(FALSE, TRUE), ".ptype" = NULL)error_pkgvctrs::vec_equal: `na_equal` must be `TRUE` or `FALSE`.
and 2 more
source
vec_equal <- function(x, y, na_equal = FALSE, .ptype = NULL) {
  .Call(ffi_vec_equal, x, y, na_equal, .ptype, environment())
}
R/equal.R:72

obj_equal typed fuzz ok

((x: any_sexp, y: any_sexp) -> ^LGL1)<>
timing: 0.016 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)
source
obj_equal <- function(x, y) {
  .Call(ffi_obj_equal, x, y)
}
R/equal.R:76
R/fields.R

fields typed fuzz ok

(((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null) -> CHR | null)&((x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null) -> empty))<>
timing: 0.023 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
source
fields <- function(x) {
  .Call(vctrs_fields, x)
}
R/fields.R:19

n_fields typed fuzz ok

(((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null) -> ^INT1)&((x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null) -> empty))<>
timing: 0.024 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
n_fields <- function(x) {
  .Call(vctrs_n_fields, x)
}
R/fields.R:25

field typed fuzz ok

∀'a. (((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, i: (~(CHR | DBL | INT))<...> | sym | null) | (x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, i: any_sexp) -> empty)&((x: p(CHR) | (env | externalptr | lang | vec | { 'a } | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null) -> 'a))<>
timing: 0.081 s
fuzzing: 19 inside (19 ok) · 8 outside (8 rejected)
type drawn from: (((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, i: (~(CHR | DBL | INT))<...> | sym | null) | (x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, i: any_sexp) -> empty) & ((x: p(CHR) | (env | externalptr | lang | vec | { 'I110938 } | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null) -> 'I110938))<>
source
field <- function(x, i) {
  .Call(vctrs_field_get, x, i)
}
R/fields.R:31

field<- typed fuzz ok

∀'a,'b. (((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'a & (p(CHR) | <> | sym | null)) | (x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, i: any_sexp, value: 'a & any_sexp) -> empty)&((x: p(CHR) | (env | externalptr | lang | vec | expr | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & (lang<> | sym)) -> expr)&((x: p(CHR) | (env | externalptr | lang | vec | { 'b } | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & (p(CHR) | <> | sym | null)) -> { 'b | 'a }))<>
timing: 0.373 s
fuzzing: 20 inside (19 ok, 1 error type) · 8 outside (8 rejected)
type drawn from: (((x: p(CHR) | (env | externalptr | lang | list | vec | arrow) | sym | null, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'value & (p(CHR) | <> | sym | null)) | (x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, i: any_sexp, value: 'value & any_sexp) -> empty) & ((x: p(CHR) | (env | externalptr | lang | vec | expr | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & (lang<> | sym)) -> expr) & ((x: p(CHR) | (env | externalptr | lang | vec | { 'I110952 } | arrow) | sym | null, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & (p(CHR) | <> | sym | null)) -> { 'I110952 | 'value }))<>

Other calls inside the domain

callverdicterror
field<-("x" = list(c(1000000, 0, 42, 0, 1000000), 0.5), "i" = 1000000L, "value" = as.raw(c(255)))error_typeInvalid value: incorrect length.
source
`field<-` <- function(x, i, value) {
  .Call(vctrs_field_set, x, i, value)
}
R/fields.R:37
R/import-standalone-purrr.R

map untypeabletyped

unbound variable (line 40)
unbound: global_env — a name the prelude does not declare
error detail
name: global_env
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.004 s
source
map <- function(.x, .f, ...) {
  .f <- as_function(.f, env = global_env())
  lapply(.x, .f, ...)
}
R/import-standalone-purrr.R:39

walk untypeabletyped

unbound variable (line 44)
unbound: map — one of the package’s own names, itself untyped
error detail
name: map
gradual mode: typed
∀'a. ((.x: 'a, .f: any, ...: any) -> 'a)<>
timing: 0.005 s
source
walk <- function(.x, .f, ...) {
  map(.x, .f, ...)
  invisible(.x)
}
R/import-standalone-purrr.R:43

.rlang_purrr_map_mold skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
.rlang_purrr_map_mold <- function(.x, .f, .mold, ...) {
  .f <- as_function(.f, env = global_env())
  out <- vapply(.x, .f, .mold, ..., USE.NAMES = FALSE)
  names(out) <- names(.x)
  out
}
R/import-standalone-purrr.R:60

map_lgl untypeabletyped

unbound variable (line 49)
unbound: .rlang_purrr_map_mold — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_map_mold
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.008 s
source
map_lgl <- function(.x, .f, ...) {
  .rlang_purrr_map_mold(.x, .f, logical(1), ...)
}
R/import-standalone-purrr.R:48

map_int untypeabletyped

unbound variable (line 52)
unbound: .rlang_purrr_map_mold — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_map_mold
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.008 s
source
map_int <- function(.x, .f, ...) {
  .rlang_purrr_map_mold(.x, .f, integer(1), ...)
}
R/import-standalone-purrr.R:51

map_dbl untypeabletyped

unbound variable (line 55)
unbound: .rlang_purrr_map_mold — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_map_mold
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.008 s
source
map_dbl <- function(.x, .f, ...) {
  .rlang_purrr_map_mold(.x, .f, double(1), ...)
}
R/import-standalone-purrr.R:54

map_chr untypeabletyped

unbound variable (line 58)
unbound: .rlang_purrr_map_mold — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_map_mold
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.008 s
source
map_chr <- function(.x, .f, ...) {
  .rlang_purrr_map_mold(.x, .f, character(1), ...)
}
R/import-standalone-purrr.R:57

map2 untypeabletyped

unbound variable (line 68)
unbound: global_env — a name the prelude does not declare
error detail
name: global_env
gradual mode: typed
((.x: any, .y: any, .f: any, ...: any) -> any)<>
timing: 0.009 s
source
map2 <- function(.x, .y, .f, ...) {
  .f <- as_function(.f, env = global_env())
  out <- mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
  if (length(out) == length(.x)) {
    set_names(out, names(.x))
  } else {
    set_names(out, NULL)
  }
}
R/import-standalone-purrr.R:67

map2_lgl untypeabletyped

unbound variable (line 77)
unbound: map2 — one of the package’s own names, itself untyped
error detail
name: map2
gradual mode: typed
((.x: any, .y: any, .f: any, ...: any) -> any)<>
timing: 0.008 s
source
map2_lgl <- function(.x, .y, .f, ...) {
  as.vector(map2(.x, .y, .f, ...), "logical")
}
R/import-standalone-purrr.R:76

map2_int untypeabletyped

unbound variable (line 80)
unbound: map2 — one of the package’s own names, itself untyped
error detail
name: map2
gradual mode: typed
((.x: any, .y: any, .f: any, ...: any) -> any)<>
timing: 0.007 s
source
map2_int <- function(.x, .y, .f, ...) {
  as.vector(map2(.x, .y, .f, ...), "integer")
}
R/import-standalone-purrr.R:79

map2_dbl untypeabletyped

unbound variable (line 83)
unbound: map2 — one of the package’s own names, itself untyped
error detail
name: map2
gradual mode: typed
((.x: any, .y: any, .f: any, ...: any) -> any)<>
timing: 0.007 s
source
map2_dbl <- function(.x, .y, .f, ...) {
  as.vector(map2(.x, .y, .f, ...), "double")
}
R/import-standalone-purrr.R:82

map2_chr untypeabletyped

unbound variable (line 86)
unbound: map2 — one of the package’s own names, itself untyped
error detail
name: map2
gradual mode: typed
((.x: any, .y: any, .f: any, ...: any) -> any)<>
timing: 0.007 s
source
map2_chr <- function(.x, .y, .f, ...) {
  as.vector(map2(.x, .y, .f, ...), "character")
}
R/import-standalone-purrr.R:85

imap untypeabletyped

unbound variable (line 89)
unbound: map2 — one of the package’s own names, itself untyped
error detail
name: map2
gradual mode: typed
((.x: any, .f: any, ...: any) -> any)<>
timing: 0.019 s
source
imap <- function(.x, .f, ...) {
  map2(.x, names(.x) %||% seq_along(.x), .f, ...)
}
R/import-standalone-purrr.R:88

.rlang_purrr_args_recycle untypeable

unbound variable (line 102)
unbound: map_int — one of the package’s own names, itself untyped
error detail
name: map_int
timing: 0.010 s
source
.rlang_purrr_args_recycle <- function(args) {
  lengths <- map_int(args, length)
  n <- max(lengths)

  stopifnot(all(lengths == 1L | lengths == n))
  to_recycle <- lengths == 1L
  args[to_recycle] <- map(args[to_recycle], function(x) rep.int(x, n))

  args
}
R/import-standalone-purrr.R:101

pmap skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
pmap <- function(.l, .f, ...) {
  .f <- as.function(.f)
  args <- .rlang_purrr_args_recycle(.l)
  do.call("mapply", c(
    FUN = list(quote(.f)),
    args, MoreArgs = quote(list(...)),
    SIMPLIFY = FALSE, USE.NAMES = FALSE
  ))
}
R/import-standalone-purrr.R:92

.rlang_purrr_probe untypeabletyped

unbound variable (line 125)
unbound: is_logical — a name the prelude does not declare
error detail
name: is_logical
gradual mode: typed
((.x: any, .p: any, ...: any) -> any)<>
timing: 0.006 s
source
.rlang_purrr_probe <- function(.x, .p, ...) {
  if (is_logical(.p)) {
    stopifnot(length(.p) == length(.x))
    .p
  } else {
    .p <- as_function(.p, env = global_env())
    map_lgl(.x, .p, ...)
  }
}
R/import-standalone-purrr.R:124

keep untypeabletyped

unbound variable (line 113)
unbound: .rlang_purrr_probe — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_probe
gradual mode: typed
((.x: <@"[", ...>, .f: any, ...: any) -> any)<>
timing: 0.006 s
source
keep <- function(.x, .f, ...) {
  .x[.rlang_purrr_probe(.x, .f, ...)]
}
R/import-standalone-purrr.R:112

discard untypeable

unbound variable (line 116)
unbound: .rlang_purrr_probe — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_probe
timing: 0.008 s
source
discard <- function(.x, .p, ...) {
  sel <- .rlang_purrr_probe(.x, .p, ...)
  .x[is.na(sel) | !sel]
}
R/import-standalone-purrr.R:115

map_if untypeable

unbound variable (line 120)
unbound: .rlang_purrr_probe — one of the package’s own names, itself untyped
error detail
name: .rlang_purrr_probe
timing: 0.008 s
source
map_if <- function(.x, .p, .f, ...) {
  matches <- .rlang_purrr_probe(.x, .p)
  .x[matches] <- map(.x[matches], .f, ...)
  .x
}
R/import-standalone-purrr.R:119

compact untypeabletyped

unbound variable (line 135)
unbound: Filter — a name the prelude does not declare
error detail
name: Filter
gradual mode: typed
((.x: any) -> any)<>
timing: 0.002 s
source
compact <- function(.x) {
  Filter(length, .x)
}
R/import-standalone-purrr.R:134

transpose typed accepts outside

∀'a. ((.l: 'a & { }<~@"[[", ...>) -> { }<~@"[[", ...> & 'a)<>
timing: 0.303 s
fuzzing: 2 inside (2 ok) · 7 outside (3 rejected, 4 accepted)
type drawn from: ((.l: '.l & { }<~@"[[", ...>) -> { }<~@"[[", ...> & '.l)<>

Accepted outside the domain .l: 4

parameterchangecallreturned
.lkind:chrtranspose("fuzz"){ { "fuzz"<> with { } }<> with { } }<> with { }
.lkind:envtranspose(".l" = new.env())env<> with { }
.lkind:langtranspose(quote(f(x))){ { sym }<> with { } }<> with { }
.lkind:nulltranspose(".l" = NULL)null
source
transpose <- function(.l) {
  if (!length(.l)) {
    return(.l)
  }

  inner_names <- names(.l[[1]])

  if (is.null(inner_names)) {
    fields <- seq_along(.l[[1]])
  } else {
    fields <- set_names(inner_names)
    .l <- map(.l, function(x) {
      if (is.null(names(x))) {
        set_names(x, inner_names)
      } else {
        x
      }
    })
  }

  # This way missing fields are subsetted as `NULL` instead of causing
  # an error
  .l <- map(.l, as.list)

  map(fields, function(i) {
    map(.l, .subset2, i)
  })
}
R/import-standalone-purrr.R:138

every untypeabletyped

unbound variable (line 168)
unbound: global_env — a name the prelude does not declare
error detail
name: global_env
gradual mode: typed
((.x: <@"[[", ...>, .p: any, ...: any) | (.x: list<~@"[[", ...>, .p: any, ...: any) | (.x: vec<~@"[[", ...>, .p: any, ...: any) -> ff<> | tt<>)<>
timing: 0.016 s
source
every <- function(.x, .p, ...) {
  .p <- as_function(.p, env = global_env())

  for (i in seq_along(.x)) {
    if (!rlang::is_true(.p(.x[[i]], ...))) return(FALSE)
  }
  TRUE
}
R/import-standalone-purrr.R:167

some untypeabletyped

unbound variable (line 176)
unbound: global_env — a name the prelude does not declare
error detail
name: global_env
gradual mode: typed
((.x: <@"[[", ...>, .p: any, ...: any) | (.x: list<~@"[[", ...>, .p: any, ...: any) | (.x: vec<~@"[[", ...>, .p: any, ...: any) -> ff<> | tt<>)<>
timing: 0.008 s
source
some <- function(.x, .p, ...) {
  .p <- as_function(.p, env = global_env())

  for (i in seq_along(.x)) {
    if (rlang::is_true(.p(.x[[i]], ...))) return(TRUE)
  }
  FALSE
}
R/import-standalone-purrr.R:175

negate untypeable

unbound variable (line 184)
unbound: global_env — a name the prelude does not declare
error detail
name: global_env
timing: 0.005 s
source
negate <- function(.p) {
  .p <- as_function(.p, env = global_env())
  function(...) !.p(...)
}
R/import-standalone-purrr.R:183

reduce untypeabletyped

unbound variable (line 190)
unbound: Reduce — a name the prelude does not declare
error detail
name: Reduce
gradual mode: typed
((.x: any, .f: arrow, ...: any, .init: any) -> any)<>
timing: 0.039 s
source
reduce <- function(.x, .f, ..., .init) {
  f <- function(x, y) .f(x, y, ...)
  Reduce(f, .x, init = .init)
}
R/import-standalone-purrr.R:188

reduce_right untypeabletyped

unbound variable (line 194)
unbound: Reduce — a name the prelude does not declare
error detail
name: Reduce
gradual mode: typed
((.x: any, .f: arrow, ...: any, .init: any) -> any)<>
timing: 0.040 s
source
reduce_right <- function(.x, .f, ..., .init) {
  f <- function(x, y) .f(y, x, ...)
  Reduce(f, .x, init = .init, right = TRUE)
}
R/import-standalone-purrr.R:192

accumulate untypeabletyped

unbound variable (line 198)
unbound: Reduce — a name the prelude does not declare
error detail
name: Reduce
gradual mode: typed
((.x: any, .f: arrow, ...: any, .init: any) -> any)<>
timing: 0.039 s
source
accumulate <- function(.x, .f, ..., .init) {
  f <- function(x, y) .f(x, y, ...)
  Reduce(f, .x, init = .init, accumulate = TRUE)
}
R/import-standalone-purrr.R:196

accumulate_right untypeabletyped

unbound variable (line 202)
unbound: Reduce — a name the prelude does not declare
error detail
name: Reduce
gradual mode: typed
((.x: any, .f: arrow, ...: any, .init: any) -> any)<>
timing: 0.040 s
source
accumulate_right <- function(.x, .f, ..., .init) {
  f <- function(x, y) .f(y, x, ...)
  Reduce(f, .x, init = .init, right = TRUE, accumulate = TRUE)
}
R/import-standalone-purrr.R:200

.rlang_purrr_index typed any: x, right fuzz ok

(((x: any, right: any?) -> INT)&((x: any, right: ff?) -> INT<>))<>
timing: 0.044 s
fuzzing: 7 inside (5 ok, 2 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
.rlang_purrr_index(as.name("x"), as.name("x"))error_typebase::if: argument is not interpretable as logical
.rlang_purrr_index("x" = NULL, "right" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::if: argument is not interpretable as logical
source
.rlang_purrr_index <- function(x, right = FALSE) {
  idx <- seq_along(x)
  if (right) {
    idx <- rev(idx)
  }
  idx
}
R/import-standalone-purrr.R:227

detect untypeabletyped

unbound variable (line 205)
unbound: is_true — a name the prelude does not declare
error detail
name: is_true
gradual mode: typed
∀'a,'b. (((.x: <@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) -> any) & ((.x: v('b)<~@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) -> null | v1('b)<> | 'a) & ((.x: { null | 'a }<~@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) -> null | 'a))<>
timing: 0.014 s
source
detect <- function(.x, .f, ..., .right = FALSE, .p = is_true) {
  .p <- as_function(.p, env = global_env())
  .f <- as_function(.f, env = global_env())

  for (i in .rlang_purrr_index(.x, .right)) {
    if (.p(.f(.x[[i]], ...))) {
      return(.x[[i]])
    }
  }
  NULL
}
R/import-standalone-purrr.R:205

detect_index untypeabletyped

unbound variable (line 216)
unbound: is_true — a name the prelude does not declare
error detail
name: is_true
gradual mode: typed
((.x: <@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) | (.x: list<~@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) | (.x: vec<~@"[[", ...>, .f: any, ...: any, .right: any?, .p: any?) -> INT1)<>
timing: 0.013 s
source
detect_index <- function(.x, .f, ..., .right = FALSE, .p = is_true) {
  .p <- as_function(.p, env = global_env())
  .f <- as_function(.f, env = global_env())

  for (i in .rlang_purrr_index(.x, .right)) {
    if (.p(.f(.x[[i]], ...))) {
      return(i)
    }
  }
  0L
}
R/import-standalone-purrr.R:216

list_c untypeabletyped

unbound variable (line 236)
unbound: inject — a name the prelude does not declare
error detail
name: inject
gradual mode: typed
((x: dbl) -> any)<>
timing: 0.091 s
source
list_c <- function(x) {
  inject(c(!!!x))
}
R/import-standalone-purrr.R:235
R/dim.R

<statement> typed

timing: 0.000 s
source
NULL
R/dim.R:26

vec_dim untypeabletyped

unbound variable (line 30)
unbound: vctrs_dim — a native symbol tyr could not bind
error detail
name: vctrs_dim
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_dim <- function(x) {
  .Call(vctrs_dim, x)
}
R/dim.R:29

vec_dim_n typed fuzz ok

((x: any_sexp) -> INT1)<>
timing: 0.010 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
source
vec_dim_n <- function(x) {
  .Call(vctrs_dim_n, x)
}
R/dim.R:32

has_dim typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.010 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
has_dim <- function(x) {
  .Call(vctrs_has_dim, x)
}
R/dim.R:35

dim2 typed any: x fuzz ok

(((x: any with { dim: absent, any } | any with { dim: null, any }) -> INT1<>)&((x: any) -> INT<>))<>
timing: 0.054 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
source
dim2 <- function(x) {
  dim(x) %||% length(x)
}
R/dim.R:60
R/missing.R

<statement> typed

timing: 0.000 s
source
NULL
R/missing.R:49

vec_detect_missing untypeabletyped

unbound variable (line 54)
unbound: ffi_vec_detect_missing — a native symbol tyr could not bind
error detail
name: ffi_vec_detect_missing
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_detect_missing <- function(x) {
  .Call(ffi_vec_detect_missing, x)
}
R/missing.R:53

vec_any_missing typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.010 s
fuzzing: 6 inside (2 ok, 4 error pkg) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
vec_any_missing(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_any_missing(new.env())error_pkgvctrs::vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_any_missing(as.name("x"))error_pkgvctrs::vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_any_missing("x" = quote(f(x)))error_pkgvctrs::vec_any_missing: Unsupported vctrs type `scalar`. ℹ In file 'type-info.c' at line 117. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.

Side effects

gzfile
source
vec_any_missing <- function(x) {
  .Call(ffi_vec_any_missing, x)
}
R/missing.R:59
R/ptype-abbr-full.R

vec_ptype_full untypeabletyped

unbound variable (line 34)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_ptype_full <- function(x, ...) {
  check_dots_empty0(...)

  # Data frames and their subclasses have internal handling in the
  # default method to get the inner types format
  method <- s3_method_specific(x, "vec_ptype_full", ns = "vctrs")
  return(method(x, ...))

  UseMethod("vec_ptype_full")
}
R/ptype-abbr-full.R:33

vec_ptype_shape untypeabletyped

unbound variable (line 149)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any) -> CHR1<>)<>
timing: 0.067 s
source
vec_ptype_shape <- function(x) {
  dim <- dim2(x)
  if (length(dim) == 1) {
    if (is_null(dim(x))) {
      ""
    } else {
      "[1d]"
    }
  } else {
    paste0("[,", paste(dim[-1], collapse = ","), "]")
  }
}
R/ptype-abbr-full.R:146

vec_ptype_abbr untypeabletyped

unbound variable (line 47)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any, prefix_named: any?, suffix_shape: any?) -> CHR<>)<>
timing: 0.019 s
source
vec_ptype_abbr <- function(x, ..., prefix_named = FALSE, suffix_shape = TRUE) {
  check_dots_empty0(...)

  method <- s3_method_specific(x, "vec_ptype_abbr", ns = "vctrs")
  abbr <- method(x, ...)

  named <- if ((prefix_named || is_bare_list(x)) && !is.null(vec_names(x))) {
    "named "
  }
  shape <- if (suffix_shape) vec_ptype_shape(x)
  abbr <- paste0(named, abbr, shape)

  return(abbr)
  UseMethod("vec_ptype_abbr")
}
R/ptype-abbr-full.R:46

vec_ptype_full.NULL typed any: x accepts outside

((x: any, ...: any) -> "NULL"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_full.NULL("fuzz_dot1" = function(...) quote(f(x)), "fuzz_dot2" = new.env())"NULL"<> with { }
xdropvec_ptype_full.NULL("fuzz_dot1" = as.name("x"))"NULL"<> with { }
xdropvec_ptype_full.NULL("fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"NULL"<> with { }
xdropvec_ptype_full.NULL("fuzz_dot1" = new.env(), "fuzz_dot2" = c(-1L, 42L))"NULL"<> with { }
xdropvec_ptype_full.NULL("fuzz_dot1" = new.env(), "fuzz_dot2" = function(...) NULL)"NULL"<> with { }
source
vec_ptype_full.NULL <- function(x, ...) "NULL"
R/ptype-abbr-full.R:63

vec_ptype_abbr.NULL typed any: x accepts outside

((x: any, ...: any) -> "NULL"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 8 outside (8 accepted)

Accepted outside the domain x: 8

parameterchangecallreturned
xdropvec_ptype_abbr.NULL("fuzz_dot1" = new.env())"NULL"<> with { }
xdropvec_ptype_abbr.NULL("fuzz_dot1" = as.name("x"))"NULL"<> with { }
xdropvec_ptype_abbr.NULL("fuzz_dot1" = list(function(...) as.name("x"), NULL), "fuzz_dot2" = NULL)"NULL"<> with { }
xdropvec_ptype_abbr.NULL("fuzz_dot1" = as.name("x"), "fuzz_dot2" = quote(f(x)))"NULL"<> with { }
xdropvec_ptype_abbr.NULL("fuzz_dot1" = quote(f(x)))"NULL"<> with { }
xdropvec_ptype_abbr.NULL("fuzz_dot1" = NULL, "fuzz_dot2" = as.name("x"))"NULL"<> with { }
and 2 more
source
vec_ptype_abbr.NULL <- function(x, ...) "NULL"
R/ptype-abbr-full.R:66

vec_ptype_full_data_frame untypeable

unbound variable (line 105)
unbound: vec_ptype_full — one of the package’s own names, itself untyped
error detail
name: vec_ptype_full
timing: 0.106 s
source
vec_ptype_full_data_frame <- function(x, ...) {
  if (length(x) == 0) {
    return(paste0(class(x)[[1]], "<>"))
  } else if (length(x) == 1) {
    return(paste0(
      class(x)[[1]],
      "<",
      names(x),
      ":",
      vec_ptype_full(x[[1]]),
      ">"
    ))
  }

  # Needs to handle recursion with indenting
  types <- map_chr(x, vec_ptype_full)
  needs_indent <- grepl("\n", types)
  types[needs_indent] <- map(types[needs_indent], function(x) {
    indent(paste0("\n", x), 4)
  })

  names <- paste0("  ", format(names(x)))

  paste0(
    class(x)[[1]],
    "<\n",
    paste0(names, ": ", types, collapse = "\n"),
    "\n>"
  )
}
R/ptype-abbr-full.R:96

vec_ptype_full.default untypeabletyped

unbound variable (line 73)
unbound: is.data.frame — a name the prelude does not declare
error detail
name: is.data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.010 s
source
vec_ptype_full.default <- function(x, ...) {
  if (is.data.frame(x)) {
    vec_ptype_full_data_frame(x, ...)
  } else if (is.object(x)) {
    class(x)[[1]]
  } else if (is_vector(x)) {
    paste0(typeof(x), vec_ptype_shape(x))
  } else {
    abort("Not a vector.")
  }
}
R/ptype-abbr-full.R:72

vec_ptype_abbr_bare skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_ptype_abbr_bare <- function(x, ...) {
  switch(
    typeof(x),
    list = "list",
    logical = "lgl",
    integer = "int",
    double = "dbl",
    character = "chr",
    complex = "cpl",
    list = "list",
    expression = "expr",
    raw = "raw",
    typeof(x)
  )
}
R/ptype-abbr-full.R:127

vec_ptype_abbr.default untypeabletyped

unbound variable (line 86)
unbound: is.object — a name the prelude does not declare
error detail
name: is.object
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.007 s
source
vec_ptype_abbr.default <- function(x, ...) {
  if (is.object(x)) {
    type <- class(x)[[1]]
  } else if (is_vector(x)) {
    type <- vec_ptype_abbr_bare(x, ...)
  } else {
    abort("Not a vector.")
  }
  unname(abbreviate(type, 8))
}
R/ptype-abbr-full.R:85
R/utils-cli.R

paren typed any: x, left fuzz ok

((x: any, left: any?) -> CHR<>)<>
timing: 0.581 s
fuzzing: 8 inside (2 ok, 6 error type) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
paren("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_type::paste0: cannot coerce type 'externalptr' to vector of type 'character'
paren(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL)error_typebase::if: argument is of length zero
paren(c(0, -1, Inf, Inf, 0.5), "left" = quote(f(x)))error_typebase::if: the condition has length > 1
paren(quote(f(x)), "left" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::if: argument is not interpretable as logical
paren(list(), "left" = quote(f(x)))error_typebase::if: the condition has length > 1
paren(c("a", "", "", "x y", "a"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::if: argument is not interpretable as logical
source
paren <- function(x, left = TRUE) {
  if (length(x) <= 1) {
    if (left) {
      paste0("( ", x)
    } else {
      paste0(x, " )")
    }
  } else {
    if (left) {
      paste0(c("\u250c ", rep("\u2502 ", length(x) - 2), "\u2514 "), x)
    } else {
      paste0(format(x), c(" \u2510", rep(" \u2502", length(x) - 2), " \u2518"))
    }
  }
}
R/utils-cli.R:7

parens untypeabletyped

unbound variable (line 3)
unbound: map — one of the package’s own names, itself untyped
error detail
name: map
gradual mode: typed
((x: vec, left: any?) -> any)<>
timing: 0.021 s
source
parens <- function(x, left = TRUE) {
  x_lines <- strsplit(x, "\n")
  x_lines <- map(x_lines, paren, left = left)
  map_chr(x_lines, paste0, collapse = "\n")
}
R/utils-cli.R:1

pad_height untypeable

unbound variable (line 27)
unbound: map_int — one of the package’s own names, itself untyped
error detail
name: map_int
timing: 1.57 s
source
pad_height <- function(x) {
  pad <- function(x, n) c(x, rep("", n - length(x)))

  lines <- strsplit(x, "\n")
  height <- max(map_int(lines, length))
  lines <- map(lines, pad, height)
  map_chr(lines, paste0, "\n", collapse = "")
}
R/utils-cli.R:23

pad_width untypeable

unbound variable (line 36)
unbound: map_int — one of the package’s own names, itself untyped
error detail
name: map_int
timing: 0.038 s
source
pad_width <- function(x) {
  lines <- strsplit(x, "\n", fixed = TRUE)

  # fix up strsplit bug
  n <- map_int(lines, length)
  lines[n == 0] <- ""

  width <- max(unlist(map(lines, nchar)))
  lines <- map(lines, format, width = width)
  map_chr(lines, paste, collapse = "\n")
}
R/utils-cli.R:32

str_backtick typed any: x fuzz ok

(((x: any) -> CHR<>)&((x: vec1) -> CHR1<>))<>
timing: 0.024 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
str_backtick <- function(x) {
  paste0("`", x, "`")
}
R/utils-cli.R:44

str_is_multiline typed accepts outside

(((x: vec) -> LGL<>)&((x: vec1) -> LGL1<>))<>
timing: 0.036 s
fuzzing: 8 inside (8 ok) · 8 outside (4 rejected, 4 accepted)

Accepted outside the domain x: 4

parameterchangecallreturned
xkind:liststr_is_multiline(list())(LGL & ~vec1)<> with { }
xkind:symstr_is_multiline("x" = as.name("x"))ff<> with { }
xwrapstr_is_multiline("x" = list(FALSE))ff<> with { }
xwrapstr_is_multiline("x" = list(integer(0)))ff<> with { }
source
str_is_multiline <- function(x) {
  grepl("\n", x)
}
R/utils-cli.R:47
R/type.R

vec_ptype untypeabletyped

unbound variable (line 152)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any_sexp, ...: any, x_arg: (CHR | null)?, call: any?) -> any_sexp)<>
timing: 0.008 s
source
vec_ptype <- function(x, ..., x_arg = "", call = caller_env()) {
  check_dots_empty0(...)
  return(.Call(ffi_ptype, x, x_arg, environment()))
  UseMethod("vec_ptype")
}
R/type.R:152

vec_ptype_common untypeabletyped

unbound variable (line 165)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((...: any, .ptype: any?, .finalise: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.006 s
source
vec_ptype_common <- function(
  ...,
  .ptype = NULL,
  .finalise = TRUE,
  .arg = "",
  .call = caller_env()
) {
  .External2(ffi_ptype_common, list2(...), .ptype, .finalise)
}
R/type.R:160

vec_ptype_common_params untypeabletyped

unbound variable (line 174)
unbound: fallback_opts — one of the package’s own names, itself untyped
error detail
name: fallback_opts
gradual mode: typed
((...: any, .ptype: any?, .finalise: any?, .fallback_opts: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.007 s
source
vec_ptype_common_params <- function(
  ...,
  .ptype = NULL,
  .finalise = TRUE,
  .fallback_opts = fallback_opts(),
  .arg = "",
  .call = caller_env()
) {
  .External2(
    ffi_ptype_common_params,
    list2(...),
    .ptype,
    .finalise,
    .fallback_opts
  )
}
R/type.R:170

vec_ptype_common_fallback skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_ptype_common_fallback <- function(
  ...,
  .ptype = NULL,
  .arg = "",
  .call = caller_env()
) {
  vec_ptype_common_params(
    ...,
    .ptype = .ptype,
    .fallback_opts = enabled_fallback_opts(),
    .arg = .arg,
    .call = .call
  )
}
R/type.R:187

vec_ptype_show untypeabletyped

unbound variable (line 205)
unbound: list2 — a name the prelude does not declare
error detail
name: list2
gradual mode: typed
((...: any) -> null)<>
timing: 0.054 s
source
vec_ptype_show <- function(...) {
  args <- compact(list2(...))
  n <- length(args)
  if (n == 0) {
    cat_line("Prototype: NULL")
  } else if (n == 1) {
    cat_line("Prototype: ", vec_ptype_full(args[[1]]))
  } else {
    in_types <- map(args, vec_ptype)
    out_types <- vector("list", length(in_types))
    out_types[[1]] <- in_types[[1]]
    for (i in seq2(2, n)) {
      out_types[[i]] <- vec_ptype2(out_types[[i - 1]], in_types[[i]])
    }

    in_full <- paste0("<", map_chr(in_types, vec_ptype_full), ">")
    out_full <- paste0("<", map_chr(out_types, vec_ptype_full), ">")

    out <- cbind(
      n = paste0(seq(0, n - 1), ". "),
      lhs = c("", out_full[-n]),
      comma = " , ",
      rhs = in_full,
      equals = " = ",
      res = c(in_full[[1]], out_full[-1])
    )
    out <- t(apply(out, 1, pad_height))
    out <- apply(out, 2, pad_width)

    out[, "lhs"] <- parens(out[, "lhs"])
    out[, "rhs"] <- parens(out[, "rhs"], FALSE)

    lines <- strsplit(out, "\n")
    dim(lines) <- dim(out)

    steps <- apply(lines, 1, function(x) do.call(cbind, x))
    if (is.list(steps)) {
      step_lines <- unlist(lapply(steps, function(x) {
        apply(x, 1, paste0, collapse = "")
      }))
    } else {
      step_lines <- apply(steps, 2, paste0, collapse = "")
    }

    cat_line("Prototype: ", out_full[[n]])
    cat_line(step_lines)
  }

  invisible()
}
R/type.R:204

vec_typeof typed accepts outside

((x: LGL<> | null) -> "character" | "complex" | "dataframe" | "double" | "integer" | "list" | "logical" | "null" | "raw" | "s3" | "scalar" | "unspecified")<>
timing: 0.017 s
fuzzing: 8 inside (8 ok) · 8 outside (2 rejected, 6 accepted)

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:envvec_typeof("x" = new.env())"scalar"<> with { }
xretype:lgl>clxvec_typeof(c(NA_complex_, NA_complex_, NA_complex_, NA_complex_, complex(real = 0, imaginary = 0)))"complex"<> with { }
xretype:lgl>dblvec_typeof("x" = c(1000000, NA_real_))"double"<> with { }
xretype:lgl>intvec_typeof(c(42L, 42L, -1L, 1000000L, NA_integer_))"integer"<> with { }
xretype:lgl>intvec_typeof(c(-2147483647L, -2147483647L))"integer"<> with { }
xretype:lgl>rawvec_typeof(as.raw(c(255, 255, 255, 255, 255)))"raw"<> with { }
source
vec_typeof <- function(x) {
  .Call(vctrs_typeof, x, TRUE)
}
R/type.R:255

vec_typeof_bare typed accepts outside

((x: LGL<> | null) -> "character" | "complex" | "dataframe" | "double" | "integer" | "list" | "logical" | "null" | "raw" | "s3" | "scalar" | "unspecified")<>
timing: 0.016 s
fuzzing: 6 inside (6 ok) · 8 outside (3 rejected, 5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xkind:funvec_typeof_bare("x" = function(...) NULL)"scalar"<> with { }
xkind:langvec_typeof_bare("x" = quote(f(x)))"scalar"<> with { }
xretype:lgl>dblvec_typeof_bare("x" = NA_real_)"double"<> with { }
xretype:lgl>intvec_typeof_bare(c(NA_integer_, -2147483647L))"integer"<> with { }
xwrapvec_typeof_bare(list(c(FALSE, TRUE, NA, FALSE, FALSE)))"list"<> with { }
source
vec_typeof_bare <- function(x) {
  .Call(vctrs_typeof, x, FALSE)
}
R/type.R:258

vec_type_info untypeabletyped

unbound variable (line 263)
unbound: ffi_type_info — a native symbol tyr could not bind
error detail
name: ffi_type_info
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
vec_type_info <- function(x) {
  .Call(ffi_type_info, x)
}
R/type.R:262

vec_proxy_info untypeabletyped

unbound variable (line 266)
unbound: ffi_proxy_info — a native symbol tyr could not bind
error detail
name: ffi_proxy_info
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_proxy_info <- function(x) {
  .Call(ffi_proxy_info, x)
}
R/type.R:265
R/type2.R

check_ptype2_dots_empty untypeabletyped

unbound variable (line 301)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((...: any, vctrs:::from_dispatch: any, vctrs:::s3_fallback: any) -> any)<>
timing: 0.003 s
source
check_ptype2_dots_empty <- function(
  ...,
  `vctrs:::from_dispatch`,
  `vctrs:::s3_fallback`
) {
  check_dots_empty0(...)
}
R/type2.R:296

S3_FALLBACK_false typed

0L<>
timing: 0.002 s
source
S3_FALLBACK_false <- 0L
R/type2.R:381

fallback_opts typed accepts outside

((s3_fallback: null?) -> { s3_fallback: 0L<> }<>)<>
timing: 0.020 s
fuzzing: 2 inside (2 ok) · 5 outside (2 rejected, 3 accepted)

Accepted outside the domain s3_fallback: 3

parameterchangecallreturned
s3_fallbackkind:funfallback_opts(function(...) NULL){ s3_fallback: arrow<> with { } }<> with { names: "s3_fallback"<> with { } }
s3_fallbackkind:listfallback_opts(list()){ s3_fallback: { }<> with { } }<> with { names: "s3_fallback"<> with { } }
s3_fallbackwrapfallback_opts(list(NULL)){ s3_fallback: { null }<> with { } }<> with { names: "s3_fallback"<> with { } }
source
fallback_opts <- function(s3_fallback = NULL) {
  # Order is important for the C side
  list(
    s3_fallback = s3_fallback %||% S3_FALLBACK_false
  )
}
R/type2.R:312

match_fallback_opts typed accepts outside

((...: any, vctrs:::s3_fallback: null?) -> { s3_fallback: 0L<> }<>)<>
timing: 0.015 s
fuzzing: 8 inside (8 ok) · 6 outside (6 accepted)

Accepted outside the domain vctrs:::s3_fallback: 6

parameterchangecallreturned
vctrs:::s3_fallbackkind:chrmatch_fallback_opts(list(as.name("x"), list(NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))), as.name("x"), "vctrs:::s3_fallback" = "fuzz", "fuzz_dot1" = quote(f(x))){ s3_fallback: "fuzz"<> with { } }<> with { names: "s3_fallback"<> with { } }
vctrs:::s3_fallbackkind:dblmatch_fallback_opts(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"), "vctrs:::s3_fallback" = 1.5, "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = NULL){ s3_fallback: (^DBL1 \ (..))<> with { } }<> with { names: "s3_fallback"<> with { } }
vctrs:::s3_fallbackkind:funmatch_fallback_opts(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "vctrs:::s3_fallback" = function(...) NULL, "fuzz_dot1" = list(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))){ s3_fallback: arrow<> with { } }<> with { names: "s3_fallback"<> with { } }
vctrs:::s3_fallbackkind:funmatch_fallback_opts(as.name("x"), as.name("x"), "vctrs:::s3_fallback" = function(...) NULL){ s3_fallback: arrow<> with { } }<> with { names: "s3_fallback"<> with { } }
vctrs:::s3_fallbackkind:symmatch_fallback_opts(quote(f(x)), NULL, "vctrs:::s3_fallback" = as.name("x"), "fuzz_dot1" = NA_complex_, "fuzz_dot2" = NULL){ s3_fallback: sym }<> with { names: "s3_fallback"<> with { } }
vctrs:::s3_fallbackwrapmatch_fallback_opts(NULL, "vctrs:::s3_fallback" = list(NULL)){ s3_fallback: { null }<> with { } }<> with { names: "s3_fallback"<> with { } }
source
match_fallback_opts <- function(..., `vctrs:::s3_fallback` = NULL) {
  fallback_opts(
    s3_fallback = `vctrs:::s3_fallback`
  )
}
R/type2.R:303

vec_ptype2_opts untypeabletyped

unbound variable (line 332)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, opts: { INT }, x_arg: any?, y_arg: any?, call: any?) -> any_sexp)<>
timing: 0.013 s
source
vec_ptype2_opts <- function(
  x,
  y,
  ...,
  opts,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  .Call(ffi_ptype2_opts, x, y, opts, environment())
}
R/type2.R:325

vec_ptype2 untypeable

unbound variable (line 35)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
timing: 0.031 s
source
vec_ptype2 <- function(
  x,
  y,
  ...,
  x_arg = caller_arg(x),
  y_arg = caller_arg(y),
  call = caller_env()
) {
  if (!missing(...)) {
    check_ptype2_dots_empty(...)
    return(vec_ptype2_opts(
      x,
      y,
      opts = match_fallback_opts(...),
      x_arg = x_arg,
      y_arg = y_arg,
      call = call
    ))
  }
  return(.Call(ffi_ptype2, x, y, environment()))
  UseMethod("vec_ptype2")
}
R/type2.R:31

vec_ptype2_dispatch_s3 untypeabletyped

unbound variable (line 59)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?, call: any?) -> any)<>
timing: 0.011 s
source
vec_ptype2_dispatch_s3 <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  UseMethod("vec_ptype2")
}
R/type2.R:53

vec_ptype2_dispatch_native untypeable

unbound variable (line 70)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.011 s
source
vec_ptype2_dispatch_native <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  fallback_opts <- match_fallback_opts(...)
  .Call(
    ffi_ptype2_dispatch_native,
    x,
    y,
    fallback_opts,
    frame = environment()
  )
}
R/type2.R:64

can_fall_back untypeabletyped

unbound variable (line 229)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
can_fall_back <- function(x) {
  UseMethod("can_fall_back")
}
R/type2.R:228

can_fall_back_2 untypeable

unbound variable (line 221)
unbound: can_fall_back — one of the package’s own names, itself untyped
error detail
name: can_fall_back
timing: 4.33 s
source
can_fall_back_2 <- function(x, y) {
  if (!identical(typeof(x), typeof(y))) {
    return(FALSE)
  }

  if (!can_fall_back(x) || !can_fall_back(y)) {
    return(FALSE)
  }

  TRUE
}
R/type2.R:216

is_common_class_fallback typed any: x fuzz ok

((x: any) -> LGL1<>)<>
timing: 0.010 s
fuzzing: 5 inside (5 ok) · 6 outside (6 rejected)
source
is_common_class_fallback <- function(x) {
  inherits(x, "vctrs:::common_class_fallback")
}
R/type2.R:277

fallback_class typed accepts outside

∀'a. ((x: any with { fallback_class: 'a, any }) -> CHR<> | 'a)<>
timing: 0.026 s
fuzzing: 20 inside (20 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: ((x: any with { fallback_class: 'I112075, any }) -> CHR<> | 'I112075)<>

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:fallback_classfallback_class("x" = function(...) as.name("x"))"function"<> with { }
xattr:drop:fallback_classfallback_class(character(0))"character"<> with { }
xkind:envfallback_class("x" = new.env())"environment"<> with { }
xkind:symfallback_class("x" = as.name("x"))"name"<> with { }
xwrapfallback_class("x" = list(structure(quote(f(x)), "fallback_class" = "x y")))"list"<> with { }
xwrapfallback_class(list(structure(function(...) NULL, "fallback_class" = "")))"list"<> with { }
source
fallback_class <- function(x) {
  if (is_common_class_fallback(x)) {
    attr(x, "fallback_class")
  } else {
    class(x)
  }
}
R/type2.R:283

common_class_suffix untypeabletyped

unbound variable (line 281)
unbound: vec_common_suffix — one of the package’s own names, itself untyped
error detail
name: vec_common_suffix
gradual mode: typed
((x: any with { fallback_class: any, any }, y: any with { fallback_class: any, any }) -> any)<>
timing: 0.020 s
source
common_class_suffix <- function(x, y) {
  vec_common_suffix(fallback_class(x), fallback_class(y))
}
R/type2.R:280

fallback_class_remove untypeabletyped

unbound variable (line 292)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
gradual mode: typed
((x: any with { fallback_class: null, any }) | (x: any with { fallback_class: vec, any }) -> any)<>
timing: 0.036 s
source
fallback_class_remove <- function(x) {
  class(x) <- attr(x, "fallback_class", exact = TRUE)
  attr(x, "fallback_class") <- NULL
  x
}
R/type2.R:290

match_from_dispatch typed fuzz ok

∀'a. ((...: any, vctrs:::from_dispatch: 'a?) -> ff<> | 'a)<>
timing: 0.007 s
fuzzing: 19 inside (19 ok) · 0 outside (none)
type drawn from: ((...: any, vctrs:::from_dispatch: 'vctrs:::from_dispatch?) -> ff<> | 'vctrs:::from_dispatch)<>
source
match_from_dispatch <- function(..., `vctrs:::from_dispatch` = FALSE) {
  `vctrs:::from_dispatch`
}
R/type2.R:308

new_common_class_fallback untypeabletyped

unbound variable (line 267)
unbound: vec_ptype — one of the package’s own names, itself untyped
error detail
name: vec_ptype
gradual mode: typed
((x: any_sexp, fallback_class: any) -> any)<>
timing: 0.003 s
source
new_common_class_fallback <- function(x, fallback_class) {
  structure(
    vec_ptype(x),
    class = "vctrs:::common_class_fallback",
    fallback_class = fallback_class
  )
}
R/type2.R:265

vec_default_ptype2 untypeableskipped

unbound variable (line 113)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: skipped
timing: 0.120 s
source
vec_default_ptype2 <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  if (is_asis(x)) {
    return(vec_ptype2_asis_left(
      x,
      y,
      x_arg = x_arg,
      y_arg = y_arg,
      call = call
    ))
  }
  if (is_asis(y)) {
    return(vec_ptype2_asis_right(
      x,
      y,
      x_arg = x_arg,
      y_arg = y_arg,
      call = call
    ))
  }

  opts <- match_fallback_opts(...)

  if (opts$s3_fallback && can_fall_back_2(x, y)) {
    common <- common_class_suffix(x, y)
    if (length(common)) {
      return(new_common_class_fallback(x, common))
    }
  }

  if (is.data.frame(x) && is.data.frame(y)) {
    out <- vec_ptype2_df_fallback(
      x,
      y,
      opts,
      x_arg = x_arg,
      y_arg = y_arg,
      call = call
    )

    if (identical(non_df_attrib(x), non_df_attrib(y))) {
      attributes(out) <- c(df_attrib(out), non_df_attrib(x))
    }

    return(out)
  }

  if (is_same_type(x, y)) {
    return(vec_ptype(x, x_arg = x_arg))
  }

  if (opts$s3_fallback) {
    # Undo common class fallback class for error messages
    if (is_common_class_fallback(x)) {
      x <- fallback_class_remove(x)
    }
    if (is_common_class_fallback(y)) {
      y <- fallback_class_remove(y)
    }
  }

  # The from-dispatch parameter is set only when called from our S3
  # dispatch mechanism, when no method is found to dispatch to. It
  # indicates whether the error message should provide advice about
  # diverging attributes.
  withRestarts(
    stop_incompatible_type(
      x,
      y,
      x_arg = x_arg,
      y_arg = y_arg,
      `vctrs:::from_dispatch` = match_from_dispatch(...),
      call = call
    ),
    vctrs_restart_ptype2 = function(ptype) {
      ptype
    }
  )
}
R/type2.R:107

vec_incompatible_ptype2 untypeabletyped

unbound variable (line 202)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?, call: any?) -> any)<>
timing: 0.010 s
source
vec_incompatible_ptype2 <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  stop_incompatible_type(
    x,
    y,
    x_arg = x_arg,
    y_arg = y_arg,
    call = call
  )
}
R/type2.R:196

can_fall_back.vctrs_vctr typed any: x accepts outside

((x: any) -> ff<>)<>
timing: 0.005 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropcan_fall_back.vctrs_vctr()ff<> with { }
source
can_fall_back.vctrs_vctr <- function(x) {
  # Work around bad interaction when `c()` method calls back into `vec_c()`
  FALSE
}
R/type2.R:233

can_fall_back.ts typed any: x accepts outside

((x: any) -> ff<>)<>
timing: 0.005 s
fuzzing: 8 inside (8 ok) · 5 outside (4 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropcan_fall_back.ts()ff<> with { }
source
can_fall_back.ts <- function(x) {
  # Work around bug with hard-coded `tsp` attribute in Rf_setAttrib()
  FALSE
}
R/type2.R:238

can_fall_back.data.frame typed any: x accepts outside

((x: any) -> ff<>)<>
timing: 0.005 s
fuzzing: 6 inside (6 ok) · 7 outside (6 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropcan_fall_back.data.frame()ff<> with { }
source
can_fall_back.data.frame <- function(x) {
  # The `c()` fallback is only for 1D vectors
  FALSE
}
R/type2.R:243

can_fall_back.vctrs:::common_class_fallback typed any: x accepts outside

((x: any) -> tt<>)<>
timing: 0.005 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropcan_fall_back.vctrs:::common_class_fallback()tt<> with { }
source
`can_fall_back.vctrs:::common_class_fallback` <- function(x) {
  TRUE
}
R/type2.R:249

can_fall_back.default untypeabletyped

unbound variable (line 262)
unbound: s3_get_method — one of the package’s own names, itself untyped
error detail
name: s3_get_method
gradual mode: typed
((x: any) -> any)<>
timing: 0.010 s
source
can_fall_back.default <- function(x) {
  # Don't fall back for classes that directly implement a proxy.
  #
  # NOTE: That's suboptimal. For instance this forces us to override
  # `can_fall_back()` for `vctrs_vctr` to avoid recursing into
  # `vec_c()` through `c()`. Maybe we want to avoid falling back for
  # any vector that inherits a `vec_proxy()` method implemented
  # _outside_ of vctrs, i.e. not for a base class?
  is_null(s3_get_method(class(x)[[1]], "vec_proxy", ns = "vctrs"))
}
R/type2.R:254

vec_proxy.vctrs:::common_class_fallback typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.006 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
`vec_proxy.vctrs:::common_class_fallback` <- function(x, ...) {
  x
}
R/type2.R:273

S3_FALLBACK_true typed

1L<>
timing: 0.002 s
source
S3_FALLBACK_true <- 1L
R/type2.R:382

enabled_fallback_opts untypeable

untypeable application (line 319)
error detail
function: (s3_fallback: null?) --> { s3_fallback: 0L<> }<>
argument: @(s3_fallback: 1L<>)
argument (not in the domain) may be: (s3_fallback = 1L)
timing: 0.010 s
source
enabled_fallback_opts <- function() {
  fallback_opts(
    s3_fallback = S3_FALLBACK_true
  )
}
R/type2.R:319

vec_ptype2_params untypeabletyped

unbound variable (line 343)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
(((x: any, y: any, ...: any, s3_fallback: null?, x_arg: any?, y_arg: any?, call: absent) -> any)&((x: any_sexp, y: any_sexp, ...: any, s3_fallback: null?, x_arg: any?, y_arg: any?, call: any?) -> any_sexp))<>
timing: 0.013 s
source
vec_ptype2_params <- function(
  x,
  y,
  ...,
  s3_fallback = NULL,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  opts <- fallback_opts(
    s3_fallback = s3_fallback
  )
  vec_ptype2_opts(
    x,
    y,
    opts = opts,
    x_arg = x_arg,
    y_arg = y_arg,
    call = call
  )
}
R/type2.R:336

vec_ptype2_no_fallback skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_ptype2_no_fallback <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  opts <- fallback_opts(
    s3_fallback = S3_FALLBACK_false
  )
  vec_ptype2_opts(
    x,
    y,
    ...,
    ,
    opts = opts,
    x_arg = x_arg,
    y_arg = y_arg,
    call = call
  )
}
R/type2.R:358

vec_typeof2 typed accepts outside

((x: LGL<> | null, y: LGL<> | null) -> ^CHR1)<>
timing: 0.019 s
fuzzing: 8 inside (8 ok) · 8 outside (8 accepted)

Accepted outside the domain x: 2, y: 6

parameterchangecallreturned
xretype:lgl>rawvec_typeof2(raw(0), "y" = NULL)"VCTRS_TYPE2_null_raw"<> with { }
xwrapvec_typeof2(list(TRUE), "y" = logical(0))"VCTRS_TYPE2_logical_list"<> with { }
yclass:addvec_typeof2(NULL, "y" = structure(FALSE, class = "fuzz_cls"))"VCTRS_TYPE2_null_s3"<> with { }
yclass:addvec_typeof2(c(FALSE, NA, TRUE, FALSE, TRUE), structure(c(NA, TRUE), class = "fuzz_cls"))"VCTRS_TYPE2_logical_s3"<> with { }
yclass:addvec_typeof2(NA, structure(logical(0), class = "fuzz_cls"))"VCTRS_TYPE2_unspecified_s3"<> with { }
ykind:listvec_typeof2(NULL, "y" = list())"VCTRS_TYPE2_null_list"<> with { }
and 2 more
source
vec_typeof2 <- function(x, y) {
  .Call(ffi_typeof2, x, y)
}
R/type2.R:385

vec_typeof2_s3 typed accepts outside

((x: LGL<> | null, y: LGL<> | null) -> ^CHR1)<>
timing: 0.027 s
fuzzing: 8 inside (8 ok) · 8 outside (8 accepted)

Accepted outside the domain x: 3, y: 5

parameterchangecallreturned
xclass:addvec_typeof2_s3(structure(c(TRUE, NA, FALSE, NA, TRUE), class = "fuzz_cls"), "y" = TRUE)"VCTRS_TYPE2_S3_logical_unknown"<> with { }
xkind:symvec_typeof2_s3(as.name("x"), logical(0))"VCTRS_TYPE2_S3_scalar_unknown"<> with { }
xretype:lgl>rawvec_typeof2_s3("x" = as.raw(c(255, 255)), "y" = c(TRUE, FALSE))"VCTRS_TYPE2_S3_raw_unknown"<> with { }
yclass:addvec_typeof2_s3(NA, structure(FALSE, class = "fuzz_cls"))"VCTRS_TYPE2_S3_unspecified_unknown"<> with { }
ykind:envvec_typeof2_s3(NULL, new.env())"VCTRS_TYPE2_S3_null_unknown"<> with { }
yretype:lgl>intvec_typeof2_s3("x" = c(FALSE, FALSE, FALSE, FALSE, FALSE), "y" = NA_integer_)"VCTRS_TYPE2_S3_logical_unknown"<> with { }
and 2 more
source
vec_typeof2_s3 <- function(x, y) {
  .Call(ffi_typeof2_s3, x, y)
}
R/type2.R:389

vec_is_coercible untypeabletyped

unbound variable (line 401)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, opts: { INT }?, x_arg: any?, y_arg: any?, call: any?) -> ^LGL1)<>
timing: 0.022 s
source
vec_is_coercible <- function(
  x,
  y,
  ...,
  opts = fallback_opts(),
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  check_dots_empty0(...)

  .Call(
    ffi_is_coercible,
    x,
    y,
    opts,
    environment()
  )
}
R/type2.R:394

vec_is_subtype skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_is_subtype <- function(x, super, ..., x_arg = "", super_arg = "") {
  tryCatch(
    vctrs_error_incompatible_type = function(...) FALSE,
    {
      common <- vctrs::vec_ptype2(
        x,
        super,
        ...,
        x_arg = x_arg,
        y_arg = super_arg
      )
      vec_is(common, super)
    }
  )
}
R/type2.R:414

vec_implements_ptype2 typed accepts outside

((x: LGL<> | null) -> ^LGL1)<>
timing: 0.017 s
fuzzing: 4 inside (4 ok) · 8 outside (2 rejected, 6 accepted)

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:dblvec_implements_ptype2("x" = 1.5)tt<> with { }
xkind:funvec_implements_ptype2(function(...) NULL)ff<> with { }
xkind:symvec_implements_ptype2("x" = as.name("x"))ff<> with { }
xretype:lgl>chrvec_implements_ptype2("x" = c(NA_character_, NA_character_))tt<> with { }
xretype:lgl>intvec_implements_ptype2(c(-1L, 42L, 0L, NA_integer_, 2L))tt<> with { }
xwrapvec_implements_ptype2("x" = list(NULL))tt<> with { }
source
vec_implements_ptype2 <- function(x) {
  .Call(vctrs_implements_ptype2, x)
}
R/type2.R:430
R/type-data-frame.R

new_data_frame untypeabletyped

unbound variable (line 29)
unbound: ffi_new_data_frame — a native symbol tyr could not bind
error detail
name: ffi_new_data_frame
gradual mode: typed
((x: any?, n: any?, ...: any, class: any?) -> any)<>
timing: 0.009 s
source
new_data_frame <- function(x = list(), n = NULL, ..., class = NULL) {
  .External(ffi_new_data_frame, x, n, class, ...)
}
R/type-data-frame.R:28

new_data_frame untypeabletyped

unbound variable (line 31)
unbound: new_data_frame — one of the package’s own names, itself untyped
error detail
name: new_data_frame
gradual mode: typed
any
timing: 0.000 s
source
new_data_frame <- fn_inline_formals(new_data_frame, "x")
R/type-data-frame.R:31

df_list untypeabletyped

unbound variable (line 101)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .size: any?, .unpack: any?, .name_repair: any?, .error_call: any?) -> any)<>
timing: 0.022 s
source
df_list <- function(
  ...,
  .size = NULL,
  .unpack = TRUE,
  .name_repair = c(
    "check_unique",
    "unique",
    "universal",
    "minimal",
    "unique_quiet",
    "universal_quiet"
  ),
  .error_call = current_env()
) {
  .Call(ffi_df_list, list2(...), .size, .unpack, .name_repair, environment())
}
R/type-data-frame.R:89

df_list untypeabletyped

unbound variable (line 105)
unbound: df_list — one of the package’s own names, itself untyped
error detail
name: df_list
gradual mode: typed
any
timing: 0.000 s
source
df_list <- fn_inline_formals(df_list, ".name_repair")
R/type-data-frame.R:105

data_frame untypeabletyped

unbound variable (line 185)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .size: any?, .name_repair: any?, .error_call: any?) -> any)<>
timing: 0.021 s
source
data_frame <- function(
  ...,
  .size = NULL,
  .name_repair = c(
    "check_unique",
    "unique",
    "universal",
    "minimal",
    "unique_quiet",
    "universal_quiet"
  ),
  .error_call = current_env()
) {
  .Call(ffi_data_frame, list2(...), .size, .name_repair, environment())
}
R/type-data-frame.R:174

data_frame untypeabletyped

unbound variable (line 189)
unbound: data_frame — one of the package’s own names, itself untyped
error detail
name: data_frame
gradual mode: typed
any
timing: 0.000 s
source
data_frame <- fn_inline_formals(data_frame, ".name_repair")
R/type-data-frame.R:189

vec_ptype_abbr.data.frame typed any: x accepts outside

((x: any, ...: any) -> "df"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_abbr.data.frame()"df"<> with { }
xdropvec_ptype_abbr.data.frame("fuzz_dot1" = as.name("x"), "fuzz_dot2" = NULL)"df"<> with { }
xdropvec_ptype_abbr.data.frame("fuzz_dot1" = as.name("x"))"df"<> with { }
xdropvec_ptype_abbr.data.frame("fuzz_dot1" = "a")"df"<> with { }
xdropvec_ptype_abbr.data.frame("fuzz_dot1" = NULL)"df"<> with { }
source
vec_ptype_abbr.data.frame <- function(x, ...) {
  "df"
}
R/type-data-frame.R:192

df_proxy typed empty return

((x: any_sexp, kind: p(CHR) | (~INT)<...> | sym | null) -> empty)<>
timing: 0.019 s
source
df_proxy <- function(x, kind) {
  .Call(ffi_df_proxy, x, kind)
}
R/type-data-frame.R:198

VCTRS_PROXY_KIND_equal typed

0L<>
timing: 0.002 s
source
VCTRS_PROXY_KIND_equal <- 0L
R/type-data-frame.R:201

VCTRS_PROXY_KIND_compare typed

1L<>
timing: 0.002 s
source
VCTRS_PROXY_KIND_compare <- 1L
R/type-data-frame.R:202

VCTRS_PROXY_KIND_order typed

2L<>
timing: 0.002 s
source
VCTRS_PROXY_KIND_order <- 2L
R/type-data-frame.R:203

df_is_coercible untypeable

unbound variable (line 207)
unbound: new_data_frame — one of the package’s own names, itself untyped
error detail
name: new_data_frame
timing: 0.005 s
source
df_is_coercible <- function(x, y, opts) {
  vec_is_coercible(
    new_data_frame(x),
    new_data_frame(y),
    opts = opts
  )
}
R/type-data-frame.R:205

df_ptype2 skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
df_ptype2 <- function(x, y, ..., x_arg = "", y_arg = "", call = caller_env()) {
  .Call(
    ffi_df_ptype2_opts,
    x,
    y,
    opts = match_fallback_opts(...),
    environment()
  )
}
R/type-data-frame.R:240

df_cast skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
df_cast <- function(x, to, ..., x_arg = "", to_arg = "", call = caller_env()) {
  .Call(
    ffi_df_cast_opts,
    x,
    to,
    opts = match_fallback_opts(...),
    environment()
  )
}
R/type-data-frame.R:251

df_ptype2_opts skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
df_ptype2_opts <- function(
  x,
  y,
  ...,
  opts,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  .Call(ffi_df_ptype2_opts, x, y, opts = opts, environment())
}
R/type-data-frame.R:261

df_cast_opts untypeabletyped

unbound variable (line 280)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any_sexp, to: any_sexp, ...: any, opts: any_sexp?, x_arg: any?, to_arg: any?, call: any?) -> any_sexp)<>
timing: 0.015 s
source
df_cast_opts <- function(
  x,
  to,
  ...,
  opts = fallback_opts(),
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  .Call(
    ffi_df_cast_opts,
    x,
    to,
    opts,
    environment()
  )
}
R/type-data-frame.R:273

df_cast_params untypeabletyped

unbound variable (line 299)
unbound: df_cast_opts — one of the package’s own names, itself untyped
error detail
name: df_cast_opts
gradual mode: typed
((x: any_sexp, to: any_sexp, ...: any, x_arg: any?, to_arg: any?, s3_fallback: null?) -> any_sexp)<>
timing: 0.026 s
source
df_cast_params <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  s3_fallback = NULL
) {
  opts <- fallback_opts(s3_fallback = s3_fallback)
  df_cast_opts(x, to, opts = opts, x_arg = x_arg, to_arg = to_arg)
}
R/type-data-frame.R:290

<statement> typed

timing: 0.000 s
source
NULL
R/type-data-frame.R:309

vec_ptype2.data.frame untypeabletyped

unbound variable (line 316)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.data.frame <- function(x, y, ...) {
  UseMethod("vec_ptype2.data.frame")
}
R/type-data-frame.R:315

vec_ptype2.data.frame.data.frame untypeabletyped

unbound variable (line 321)
unbound: df_ptype2 — one of the package’s own names, itself untyped
error detail
name: df_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.data.frame.data.frame <- function(x, y, ...) {
  df_ptype2(x, y, ...)
}
R/type-data-frame.R:320

vec_ptype2_df_fallback untypeabletyped

unbound variable (line 331)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, y: any, opts: { s3_fallback: any, any }, x_arg: any?, y_arg: any?, call: any?) -> any)<>
timing: 0.029 s
source
vec_ptype2_df_fallback <- function(
  x,
  y,
  opts,
  x_arg = "",
  y_arg = "",
  call = caller_env()
) {
  vec_ptype2_params(
    as_base_df(x),
    as_base_df(y),
    s3_fallback = opts$s3_fallback,
    x_arg = x_arg,
    y_arg = y_arg,
    call = call
  )
}
R/type-data-frame.R:325

as_base_df untypeable

unbound variable (line 344)
unbound: new_data_frame — one of the package’s own names, itself untyped
error detail
name: new_data_frame
timing: 0.019 s
source
as_base_df <- function(x) {
  if (inherits(x, "tbl_df")) {
    new_data_frame(x, class = c("tbl_df", "tbl"))
  } else {
    new_data_frame(x)
  }
}
R/type-data-frame.R:342

vec_cast.data.frame untypeabletyped

unbound variable (line 358)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast.data.frame <- function(x, to, ...) {
  UseMethod("vec_cast.data.frame")
}
R/type-data-frame.R:357

vec_cast.data.frame.data.frame skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_cast.data.frame.data.frame <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = ""
) {
  df_cast(x, to, ..., x_arg = x_arg, to_arg = to_arg)
}
R/type-data-frame.R:362

vec_restore.data.frame typed fuzz ok

(((x: any_sexp, to: LGL<> | null, ...: any) -> empty)&((x: any_sexp, to: any_sexp, ...: any) -> any_sexp))<>
timing: 0.038 s
fuzzing: 8 inside (4 ok, 4 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
vec_restore.data.frame(as.name("x"), "to" = quote(f(x)))error_pkgvctrs::vec_restore.data.frame: Attempt to restore data frame from a symbol. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_restore.data.frame("x" = NULL, "to" = quote(f(x)), "fuzz_dot1" = quote(f(x)))error_pkgvctrs::vec_restore.data.frame: Attempt to restore data frame from a NULL. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_restore.data.frame(quote(f(x)), "to" = new.env())error_pkgvctrs::vec_restore.data.frame: Attempt to restore data frame from a language. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
vec_restore.data.frame("x" = NULL, "to" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = NULL, "fuzz_dot2" = new.env())error_pkgvctrs::vec_restore.data.frame: Attempt to restore data frame from a NULL. ℹ In file 'proxy-restore.c' at line 196. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.

Side effects

gzfile
source
vec_restore.data.frame <- function(x, to, ...) {
  .Call(ffi_vec_bare_df_restore, x, to)
}
R/type-data-frame.R:373

df_size typed accepts outside

((x: { any_sexp }) -> INT1)<>
timing: 0.013 s
fuzzing: 5 inside (2 ok, 3 error type) · 6 outside (5 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xunwrapdf_size("x" = NULL)0L<> with { }

Other calls inside the domain

callverdicterror
df_size("x" = list(as.name("x"), quote(f(x))))error_type::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
df_size("x" = list(as.name("x"), function(...) list()))error_type::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
df_size(list(as.name("x")))error_type::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
df_size <- function(x) {
  .Call(vctrs_df_size, x)
}
R/type-data-frame.R:379

df_lossy_cast untypeabletyped

unbound variable (line 390)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((out: any, x: any, to: any, ...: any, x_arg: any?, to_arg: any?, call: any?) -> any)<>
timing: 0.018 s
source
df_lossy_cast <- function(
  out,
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  extra <- setdiff(names(x), names(to))

  maybe_lossy_cast(
    result = out,
    x = x,
    to = to,
    lossy = length(extra) > 0,
    locations = int(),
    x_arg = x_arg,
    to_arg = to_arg,
    call = call,
    details = inline_list("Dropped variables: ", extra, quote = "`"),
    class = "vctrs_error_cast_lossy_dropped"
  )
}
R/type-data-frame.R:383

df_attrib typed no call in domain

∀'a. (((x: <...> with { class: any?, CHR | 'a }) -> { CHR | 'a }<>)&((x: <> with ({ 'a } & ~{ })) -> { 'a }<>))<>
timing: 0.226 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: (((x: <...> with { class: any?, CHR | 'I112566 }) -> { CHR | 'I112566 }<>) & ((x: <> with ({ 'I112566 } & ~{ })) -> { 'I112566 }<>))<>
source
df_attrib <- function(x) {
  attributes(x)[c("row.names", "names")]
}
R/type-data-frame.R:408

non_df_attrib untypeabletyped

unbound variable (line 416)
unbound: order — a name the prelude does not declare
error detail
name: order
gradual mode: typed
((x: <...>) | (x: <> with (list & ~{ })) -> any)<>
timing: 0.312 s
source
non_df_attrib <- function(x) {
  attrib <- attributes(x)
  attrib <- attrib[!names(attrib) %in% c("row.names", "names")]

  # Sort to allow comparison
  attrib[order(names(attrib))]
}
R/type-data-frame.R:411
R/proxy.R

vec_proxy untypeabletyped

unbound variable (line 138)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
∀'a. ((x: 'a & (LGL<> | null), ...: any) -> 'a)<>
timing: 0.004 s
source
vec_proxy <- function(x, ...) {
  check_dots_empty0(...)
  return(.Call(ffi_vec_proxy, x))
  UseMethod("vec_proxy")
}
R/proxy.R:137

vec_proxy.default typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.006 s
fuzzing: 20 inside (20 ok) · 4 outside (4 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.default <- function(x, ...) {
  x
}
R/proxy.R:143

vec_restore untypeabletyped

unbound variable (line 151)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, to: p(CHR) | <> | sym | null, ...: any) -> any_sexp)<>
timing: 0.006 s
source
vec_restore <- function(x, to, ...) {
  check_dots_empty0(...)
  return(.Call(ffi_vec_restore, x, to))
  UseMethod("vec_restore", to)
}
R/proxy.R:150

vec_restore_dispatch untypeabletyped

unbound variable (line 156)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_restore_dispatch <- function(x, to, ...) {
  UseMethod("vec_restore", to)
}
R/proxy.R:155

vec_restore.default typed fuzz ok

((x: any_sexp, to: any_sexp, ...: any) -> any_sexp)<>
timing: 0.018 s
fuzzing: 8 inside (8 ok) · 4 outside (4 rejected)
source
vec_restore.default <- function(x, to, ...) {
  .Call(ffi_vec_restore_default, x, to)
}
R/proxy.R:159

vec_restore_default typed fuzz ok

((x: any_sexp, to: any_sexp, ...: any) -> any_sexp)<>
timing: 0.018 s
fuzzing: 8 inside (8 ok) · 7 outside (7 rejected)
source
vec_restore_default <- function(x, to, ...) {
  .Call(ffi_vec_restore_default, x, to)
}
R/proxy.R:162

vec_proxy_recurse typed accepts outside

∀'a. ((x: 'a & (LGL<> | null), ...: any) -> 'a & (LGL<> | null))<>
timing: 0.015 s
fuzzing: 18 inside (18 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: ((x: 'x & (LGL<> | null), ...: any) -> 'x & (LGL<> | null))<>

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:funvec_proxy_recurse(function(...) NULL, NULL, integer(0), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = NULL)arrow<> with { }
xkind:langvec_proxy_recurse("x" = quote(f(x)), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))lang<> with { }
xkind:langvec_proxy_recurse("x" = quote(f(x)), "fuzz_dot1" = list(), "fuzz_dot2" = c(FALSE, NA))lang<> with { }
xkind:symvec_proxy_recurse("x" = as.name("x"), "fuzz_dot1" = quote(f(x)))sym
xwrapvec_proxy_recurse(list(NULL), NULL, NULL, "fuzz_dot1" = new.env(), "fuzz_dot2" = quote(f(x))){ null }<> with { }
xwrapvec_proxy_recurse("x" = list(c(TRUE, NA, NA, TRUE, TRUE)), "fuzz_dot1" = quote(f(x))){ (LGL & ~vec1)<> with { } }<> with { }
source
vec_proxy_recurse <- function(x, ...) {
  .Call(ffi_vec_proxy_recurse, x)
}
R/proxy.R:166

vec_restore_recurse typed accepts outside

((x: any_sexp, to: p(CHR) | <> | sym | null, ...: any) -> any_sexp)<>
timing: 0.021 s
fuzzing: 8 inside (8 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain to: 3

parameterchangecallreturned
toclass:addvec_restore_recurse(list(), "to" = structure("a", class = "fuzz_cls"), "fuzz_dot1" = list()){ }<fuzz_cls> with { }
toclass:addvec_restore_recurse(as.name("x"), "to" = structure(list(list(), new.env()), class = "fuzz_cls"))sym
toclass:addvec_restore_recurse("x" = NULL, "to" = structure(list(as.name("x")), class = "fuzz_cls"), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
source
vec_restore_recurse <- function(x, to, ...) {
  .Call(ffi_vec_restore_recurse, x, to)
}
R/proxy.R:169

as_not_s4 untypeabletyped

unbound variable (line 220)
unbound: ffi_as_not_s4 — a native symbol tyr could not bind
error detail
name: ffi_as_not_s4
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
as_not_s4 <- function(x) {
  .Call(ffi_as_not_s4, x)
}
R/proxy.R:219

vec_data untypeable

unbound variable (line 203)
unbound: obj_check_vector — one of the package’s own names, itself untyped
error detail
name: obj_check_vector
timing: 0.009 s
source
vec_data <- function(x) {
  obj_check_vector(x)
  x <- vec_proxy(x)

  if (is.data.frame(x)) {
    return(new_data_frame(x, row.names = .row_names_info(x, 0L)))
  }

  if (has_dim(x)) {
    x <- vec_set_attributes(x, list(dim = dim(x), dimnames = dimnames(x)))
  } else {
    x <- vec_set_attributes(x, list(names = names(x)))
  }

  # Unset S4 bit in vector-like S4 objects
  as_not_s4(x)
}
R/proxy.R:202
R/subscript.R

vec_as_subscript untypeabletyped

unbound variable (line 35)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((i: any, ...: any, logical: any?, numeric: any?, character: any?, arg: any?, call: any?) -> any)<>
timing: 0.039 s
source
vec_as_subscript <- function(
  i,
  ...,
  logical = c("cast", "error"),
  numeric = c("cast", "error"),
  character = c("cast", "error"),
  arg = NULL,
  call = caller_env()
) {
  check_dots_empty0(...)

  .Call(
    ffi_as_subscript,
    i = i,
    logical = logical,
    numeric = numeric,
    character = character,
    frame = environment()
  )
}
R/subscript.R:28

vec_as_subscript_result untypeable

untypeable application (line 48)
error detail
function: (x1: any_sexp, x2: CHR, x3: CHR, x4: CHR, x5: any_sexp) --> any_sexp
argument: @(i: 'i, frame: env, character: 'character, numeric: 'numeric, logical: 'logical)
argument (not in the domain) may be: (i = new.env(),
frame = new.env(),
character = new.env(),
numeric = new.env(),
logical = new.env())
timing: 0.040 s
source
vec_as_subscript_result <- function(i, arg, call, logical, numeric, character) {
  .Call(
    ffi_as_subscript_result,
    i = i,
    logical = logical,
    numeric = numeric,
    character = character,
    frame = environment()
  )
}
R/subscript.R:48

vec_as_subscript2_result untypeabletyped

unbound variable (line 96)
unbound: arg_match0 — a name the prelude does not declare
error detail
name: arg_match0
gradual mode: typed
((i: any, arg: any, call: any, numeric: any?, character: any?) -> any)<>
timing: 0.037 s
source
vec_as_subscript2_result <- function(
  i,
  arg,
  call,
  numeric = "cast",
  character = "cast"
) {
  numeric <- arg_match0(numeric, c("cast", "error"))
  character <- arg_match0(character, c("cast", "error"))

  result <- vec_as_subscript_result(
    i,
    arg = arg,
    call = call,
    logical = "error",
    numeric = numeric,
    character = character
  )

  # This should normally be a `vctrs_error_subscript`. Indicate to
  # message methods that this error refers to a `[[` subscript.
  if (!is_null(result$err)) {
    result$err$subscript_scalar <- TRUE
  }

  result
}
R/subscript.R:89

vec_as_subscript2 skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_as_subscript2 <- function(
  i,
  ...,
  numeric = c("cast", "error"),
  character = c("cast", "error"),
  arg = NULL,
  call = caller_env()
) {
  check_dots <- function(..., logical = "error", call = caller_env()) {
    if (!is_string(logical, "error")) {
      abort(
        "`vctrs::vec_as_subscript2(logical = 'cast')` is deprecated.",
        call = caller_env()
      )
    }
    check_dots_empty0(..., call = call)
  }
  check_dots(...)

  result_get(vec_as_subscript2_result(
    i,
    arg,
    call,
    numeric = numeric,
    character = character
  ))
}
R/subscript.R:62

subscript_type_opts typed

CHR<>
timing: 0.012 s
source
subscript_type_opts <- c("logical", "numeric", "character")
R/subscript.R:118

subscript_type_opts_indefinite_singular typed

CHR<>
timing: 0.014 s
source
subscript_type_opts_indefinite_singular <- c(
  "a logical flag",
  "a location",
  "a name"
)
R/subscript.R:119

subscript_type_opts_indefinite_plural typed

CHR<>
timing: 0.013 s
source
subscript_type_opts_indefinite_plural <- c(
  "logical flags",
  "locations",
  "names"
)
R/subscript.R:124

as_opts_subscript_type untypeabletyped

unbound variable (line 134)
unbound: new_opts — one of the package’s own names, itself untyped
error detail
name: new_opts
gradual mode: typed
((x: any, arg: any?) -> any)<>
timing: 0.021 s
source
as_opts_subscript_type <- function(x, arg = NULL) {
  if (inherits(x, "vctrs_opts_subscript_type")) {
    return(x)
  }
  new_opts(
    x,
    subscript_type_opts,
    subclass = "vctrs_opts_subscript_type",
    arg = arg
  )
}
R/subscript.R:130

as_opts_subscript2_type untypeabletyped

unbound variable (line 143)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
((x: vec | null, arg: any?) -> any)<>
timing: 0.016 s
source
as_opts_subscript2_type <- function(x, arg = NULL) {
  if ("logical" %in% x) {
    abort("Logical subscripts can't be converted to a single location.")
  }
  as_opts_subscript_type(x, arg = arg)
}
R/subscript.R:141

stop_subscript skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_subscript <- function(i, ..., class = NULL, call = caller_env()) {
  abort(
    class = c(class, "vctrs_error_subscript"),
    i = i,
    ...,
    call = call
  )
}
R/subscript.R:149

new_error_subscript untypeabletyped

unbound variable (line 158)
unbound: error_cnd — a name the prelude does not declare
error detail
name: error_cnd
gradual mode: typed
((class: (vec | null)?, i: any, ...: any) -> any)<>
timing: 0.021 s
source
new_error_subscript <- function(class = NULL, i, ...) {
  error_cnd(
    c(class, "vctrs_error_subscript"),
    i = i,
    ...
  )
}
R/subscript.R:157

new_error_subscript_type skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_error_subscript_type <- function(
  i,
  logical = "cast",
  numeric = "cast",
  character = "cast",
  ...,
  call = NULL,
  class = NULL
) {
  new_error_subscript(
    class = c(class, "vctrs_error_subscript_type"),
    i = i,
    logical = logical,
    numeric = numeric,
    character = character,
    ...,
    call = call
  )
}
R/subscript.R:164

cnd_subscript_scalar untypeabletyped

unbound variable (line 409)
unbound: is_bool — a name the prelude does not declare
error detail
name: is_bool
gradual mode: typed
∀'a. (((cnd: { subscript_scalar: 'a & null, any }) -> ff<>)&((cnd: { subscript_scalar: 'a \ null, any }) -> 'a))<>
timing: 0.025 s
source
cnd_subscript_scalar <- function(cnd) {
  out <- cnd$subscript_scalar %||% FALSE

  if (!is_bool(out)) {
    abort("Internal error: `cnd$subscript_scalar` must be a boolean.")
  }

  out
}
R/subscript.R:406

subscript_actions typed

CHR<>
timing: 0.021 s
source
subscript_actions <- c(
  "select",
  "subset",
  "extract",
  "assign",
  "rename",
  "relocate",
  "remove",
  "negate"
)
R/subscript.R:338

cnd_subscript_action untypeabletyped

unbound variable (line 351)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
∀'a. (((cnd: { subscript_scalar: ff, subscript_action: "subset"<> | 'a, any }, assign_to: any?) | (cnd: { subscript_scalar: null, subscript_action: "subset"<> | 'a, any }, assign_to: any?) -> ("assign to"<> | "subset"<>) | 'a)&((cnd: { subscript_scalar: null, subscript_action: ("extract"<> | "subset"<>) | 'a \ "assign", any } | { subscript_scalar: ~null, subscript_action: ("extract"<> | "subset"<>) | 'a \ "assign", any }, assign_to: any?) -> ("extract"<> | "subset"<>) | 'a \ "assign")&((cnd: { subscript_scalar: null, subscript_action: ("extract"<> | "subset"<>) | 'a, any } | { subscript_scalar: ~null, subscript_action: ("extract"<> | "subset"<>) | 'a, any }, assign_to: any?) -> ("assign to"<> | "extract"<> | "subset"<>) | 'a)&((cnd: { subscript_scalar: tt, subscript_action: "extract"<> | 'a, any }, assign_to: any?) -> ("assign to"<> | "extract"<>) | 'a))<>
timing: 0.032 s
source
cnd_subscript_action <- function(cnd, assign_to = TRUE) {
  action <- cnd$subscript_action

  if (is_null(action)) {
    if (cnd_subscript_scalar(cnd)) {
      action <- "extract"
    } else {
      action <- "subset"
    }
  }

  if (!is_string(action, subscript_actions)) {
    cli::cli_abort(
      "`cnd$subscript_action` must be one of {.or {.arg {subscript_actions}}}.",
      .internal = TRUE
    )
  }

  if (assign_to && action == "assign") {
    "assign to"
  } else {
    action
  }
}
R/subscript.R:348

cnd_subscript_element untypeabletyped

unbound variable (line 281)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((cnd: { subscript_elt: null, any }, capital: any?) | (cnd: { subscript_elt: vec1, any }, capital: any?) -> CHR<> | null)<>
timing: 0.086 s
source
cnd_subscript_element <- function(cnd, capital = FALSE) {
  elt <- cnd$subscript_elt %||% "element"

  if (!is_string(elt, c("element", "row", "column", "table"))) {
    abort(paste0(
      "Internal error: `cnd$subscript_elt` must be one of ",
      "`element`, `row`, `column` or `table`."
    ))
  }

  if (capital) {
    switch(
      elt,
      element = c("Element", "Elements"),
      row = c("Row", "Rows"),
      column = c("Column", "Columns"),
      table = c("Table", "Tables")
    )
  } else {
    switch(
      elt,
      element = c("element", "elements"),
      row = c("row", "rows"),
      column = c("column", "columns"),
      table = c("table", "tables")
    )
  }
}
R/subscript.R:278

is_subscript_arg untypeabletyped

unbound variable (line 391)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any) -> ff<> | tt<>)<>
timing: 0.010 s
source
is_subscript_arg <- function(x) {
  !is_null(x) && !is_string(x, "")
}
R/subscript.R:390

cnd_header.vctrs_error_subscript_type untypeabletimeout

unbound variable (line 187)
unbound: is_subscript_arg — one of the package’s own names, itself untyped
error detail
name: is_subscript_arg
gradual mode: timeout
timing: 0.069 s
source
cnd_header.vctrs_error_subscript_type <- function(cnd, ...) {
  arg <- cnd[["subscript_arg"]]
  if (is_subscript_arg(arg)) {
    with <- glue::glue(" with {format_subscript_arg(arg)}")
  } else {
    with <- ""
  }

  action <- cnd_subscript_action(cnd, assign_to = FALSE)
  elt <- cnd_subscript_element(cnd)

  if (cnd_subscript_scalar(cnd)) {
    glue::glue("Can't {action} {elt[[1]]}{with}.")
  } else {
    glue::glue("Can't {action} {elt[[2]]}{with}.")
  }
}
R/subscript.R:185

format_subscript_arg untypeabletyped

unbound variable (line 377)
unbound: is_subscript_arg — one of the package’s own names, itself untyped
error detail
name: is_subscript_arg
gradual mode: typed
((arg: any, capitalise: any?) -> any)<>
timing: 0.012 s
source
format_subscript_arg <- function(arg, capitalise = TRUE) {
  if (is_subscript_arg(arg)) {
    if (!is_string(arg)) {
      arg <- as_label(arg)
    }
    cli::format_inline("{.arg {arg}}")
  } else {
    if (capitalise) {
      "Subscript"
    } else {
      "subscript"
    }
  }
}
R/subscript.R:376

cnd_subscript_arg untypeabletyped

unbound variable (line 374)
unbound: format_subscript_arg — one of the package’s own names, itself untyped
error detail
name: format_subscript_arg
gradual mode: typed
((cnd: <@"[[", ...>) | (cnd: list<~@"[[", ...>) | (cnd: vec<~@"[[", ...>) -> any)<>
timing: 0.075 s
source
cnd_subscript_arg <- function(cnd, ...) {
  format_subscript_arg(cnd[["subscript_arg"]], ...)
}
R/subscript.R:373

cnd_subscript_expected_types typed accepts outside

((cnd: <@"[", ...>) | (cnd: list<~@"[", ...>) | (cnd: vec<~@"[", ...>) -> CHR<>)<>
timing: 0.083 s
fuzzing: 8 inside (8 ok) · 6 outside (4 rejected, 2 accepted)

Accepted outside the domain cnd: 2

parameterchangecallreturned
cndkind:langcnd_subscript_expected_types("cnd" = quote(f(x)))(CHR & ~vec1)<> with { }
cndkind:langcnd_subscript_expected_types(quote(f(x)))(CHR & ~vec1)<> with { }
source
cnd_subscript_expected_types <- function(cnd) {
  types <- c("logical", "numeric", "character")
  allowed <- cnd[types] != "error"
  types[allowed]
}
R/subscript.R:229

cnd_body.vctrs_error_subscript_type untypeabletyped

unbound variable (line 204)
unbound: cnd_subscript_arg — one of the package’s own names, itself untyped
error detail
name: cnd_subscript_arg
gradual mode: typed
((cnd: { i: any, any }, ...: any) -> any)<>
timing: 0.005 s
source
cnd_body.vctrs_error_subscript_type <- function(cnd, ...) {
  arg <- cnd_subscript_arg(cnd)
  type <- obj_type_friendly(cnd$i)
  expected_types <- cnd_subscript_expected_types(cnd)

  format_error_bullets(c(
    x = cli::format_inline("{arg} must be {.or {expected_types}}, not {type}.")
  ))
}
R/subscript.R:203

new_cnd_bullets_subscript_lossy_cast untypeabletyped

unbound variable (line 214)
unbound: cnd_header — a name the prelude does not declare
error detail
name: cnd_header
gradual mode: typed
((lossy_err: any) -> ((cnd: any, ...: any) -> any)<>)<>
timing: 0.006 s
source
new_cnd_bullets_subscript_lossy_cast <- function(lossy_err) {
  function(cnd, ...) {
    format_error_bullets(c(x = cnd_header(lossy_err)))
  }
}
R/subscript.R:212

collapse_subscript_type untypeabletyped

unbound variable (line 227)
unbound: glue::glue_collapse — a name the prelude does not declare
error detail
name: glue::glue_collapse
gradual mode: typed
((cnd: list<~@"[", ...> | vec<~@"[", ...> | <@"[", ...>) -> any)<>
timing: 0.027 s
source
collapse_subscript_type <- function(cnd) {
  types <- cnd_subscript_expected_types(cnd)

  if (length(types) == 2) {
    last <- " or "
  } else {
    last <- ", or "
  }

  glue::glue_collapse(types, sep = ", ", last = last)
}
R/subscript.R:218

new_error_subscript_size untypeable

unbound variable (line 236)
unbound: new_error_subscript — one of the package’s own names, itself untyped
error detail
name: new_error_subscript
timing: 0.019 s
source
new_error_subscript_size <- function(i, ..., class = NULL) {
  new_error_subscript(
    class = c(class, "vctrs_error_subscript_size"),
    i = i,
    ...
  )
}
R/subscript.R:235

cnd_header.vctrs_error_subscript_size untypeabletyped

unbound variable (line 244)
unbound: cnd_header.vctrs_error_subscript_type — one of the package’s own names, itself untyped
error detail
name: cnd_header.vctrs_error_subscript_type
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.003 s
source
cnd_header.vctrs_error_subscript_size <- function(cnd, ...) {
  cnd_header.vctrs_error_subscript_type(cnd, ...)
}
R/subscript.R:243

new_error_subscript2_type untypeabletyped

unbound variable (line 248)
unbound: new_error_subscript_type — one of the package’s own names, itself untyped
error detail
name: new_error_subscript_type
gradual mode: typed
((i: any, numeric: any, character: any, ...: any) -> any)<>
timing: 0.008 s
source
new_error_subscript2_type <- function(i, numeric, character, ...) {
  new_error_subscript_type(
    i = i,
    logical = "error",
    numeric = numeric,
    character = character,
    subscript_scalar = TRUE,
    ...
  )
}
R/subscript.R:247

cnd_body_subscript_dim untypeabletyped

unbound variable (line 259)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { i: any, subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.019 s
source
cnd_body_subscript_dim <- function(cnd, ...) {
  arg <- append_arg("Subscript", cnd$subscript_arg)

  dim <- length(dim(cnd$i))
  if (dim < 2) {
    abort(
      "Internal error: Unexpected dimensionality in `cnd_body_subcript_dim()`."
    )
  }
  if (dim == 2) {
    shape <- "a matrix"
  } else {
    shape <- "an array"
  }

  format_error_bullets(c(
    x = glue::glue("{arg} must be a simple vector, not {shape}.")
  ))
}
R/subscript.R:258

cnd_subscript_element_cli untypeabletyped

unbound variable (line 310)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((n: any, cnd: { subscript_elt: null, any }, capital: any?) | (n: any, cnd: { subscript_elt: vec1, any }, capital: any?) -> any)<>
timing: 0.078 s
source
cnd_subscript_element_cli <- function(n, cnd, capital = FALSE) {
  elt <- cnd$subscript_elt %||% "element"

  if (!is_string(elt, c("element", "row", "column", "table"))) {
    abort(paste0(
      "Internal error: `cnd$subscript_elt` must be one of ",
      "`element`, `row`, `column` or `table`."
    ))
  }

  if (capital) {
    elt <- switch(
      elt,
      element = "Element{?s}",
      row = "Row{?s}",
      column = "Column{?s}",
      table = "Table{?s}"
    )
  } else {
    elt <- switch(
      elt,
      element = "element{?s}",
      row = "row{?s}",
      column = "column{?s}",
      table = "table{?s}"
    )
  }

  cli::pluralize("{n} ", elt)
}
R/subscript.R:307

cnd_subscript_type untypeabletyped

unbound variable (line 397)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
∀'a. ((cnd: { subscript_type: 'a, any }) -> 'a)<>
timing: 0.025 s
source
cnd_subscript_type <- function(cnd) {
  type <- cnd$subscript_type

  if (!is_string(type, c("logical", "numeric", "character"))) {
    abort(
      "Internal error: `cnd$subscript_type` must be `logical`, `numeric`, or `character`."
    )
  }

  type
}
R/subscript.R:394
R/subscript-loc.R

vec_as_location untypeabletyped

unbound variable (line 79)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((i: any, n: any, names: any?, ...: any, missing: any?, arg: any?, call: any?) -> any)<>
timing: 0.028 s
source
vec_as_location <- function(
  i,
  n,
  names = NULL,
  ...,
  missing = c("propagate", "remove", "error"),
  arg = caller_arg(i),
  call = caller_env()
) {
  check_dots_empty0(...)

  .Call(
    ffi_as_location,
    i = i,
    n = n,
    names = names,
    loc_negative = "invert",
    loc_oob = "error",
    loc_zero = "remove",
    missing = missing,
    frame = environment()
  )
}
R/subscript-loc.R:73

num_as_location untypeabletyped

unbound variable (line 127)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((i: any, n: any, ...: any, missing: any?, negative: any?, oob: any?, zero: any?, arg: any?, call: any?) -> any)<>
timing: 0.083 s
source
num_as_location <- function(
  i,
  n,
  ...,
  missing = c("propagate", "remove", "error"),
  negative = c("invert", "error", "ignore"),
  oob = c("error", "remove", "extend"),
  zero = c("remove", "error", "ignore"),
  arg = caller_arg(i),
  call = caller_env()
) {
  check_dots_empty0(...)

  if (is.object(i) || !(is_integer(i) || is_double(i))) {
    abort("`i` must be a numeric vector.")
  }
  .Call(
    ffi_as_location,
    i = i,
    n = n,
    names = NULL,
    loc_negative = negative,
    loc_oob = oob,
    loc_zero = zero,
    missing = missing,
    env = environment()
  )
}
R/subscript-loc.R:119

cnd_bullets_location2_need_positive untypeabletyped

unbound variable (line 377)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.011 s
source
cnd_bullets_location2_need_positive <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)
  format_error_bullets(c(
    x = glue::glue_data(
      cnd,
      "{subscript_arg} must be a positive location, not {i}."
    )
  ))
}
R/subscript-loc.R:376

cnd_bullets_location2_need_present untypeabletyped

unbound variable (line 368)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.012 s
source
cnd_bullets_location2_need_present <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)
  format_error_bullets(c(
    x = glue::glue_data(
      cnd,
      "{subscript_arg} must be a location, not {obj_type_friendly(i)}."
    )
  ))
}
R/subscript-loc.R:367

cnd_bullets_location2_need_scalar untypeabletyped

unbound variable (line 362)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.012 s
source
cnd_bullets_location2_need_scalar <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)
  format_error_bullets(c(
    x = glue::glue_data(cnd, "{subscript_arg} must be size 1, not {length(i)}.")
  ))
}
R/subscript-loc.R:361

new_error_location2_type untypeable

unbound variable (line 353)
unbound: new_error_subscript2_type — one of the package’s own names, itself untyped
error detail
name: new_error_subscript2_type
timing: 0.005 s
source
new_error_location2_type <- function(i, ..., class = NULL) {
  new_error_subscript2_type(
    class = class,
    i = i,
    numeric = "cast",
    character = "cast",
    ...
  )
}
R/subscript-loc.R:352

vec_as_location2_result untypeable

unbound variable (line 198)
unbound: arg_match0 — a name the prelude does not declare
error detail
name: arg_match0
timing: 1.25 s
source
vec_as_location2_result <- function(i, n, names, missing, negative, arg, call) {
  allow_missing <- arg_match0(missing, c("error", "propagate")) == "propagate"
  allow_negative <- arg_match0(negative, c("error", "ignore")) == "ignore"

  result <- vec_as_subscript2_result(
    i = i,
    arg = arg,
    call = call
  )

  if (!is_null(result$err)) {
    parent <- result$err
    return(result(
      err = new_error_location2_type(
        i = i,
        subscript_arg = arg,
        body = parent$body,
        call = call
      )
    ))
  }

  # Locations must be size 1, can't be NA, and must be positive
  i <- result$ok

  if (length(i) != 1L) {
    return(result(
      err = new_error_location2_type(
        i = i,
        subscript_arg = arg,
        body = cnd_bullets_location2_need_scalar,
        call = call
      )
    ))
  }

  neg <- typeof(i) == "integer" && !is.na(i) && i < 0L
  if (allow_negative && neg) {
    i <- -i
  }

  if (is.na(i)) {
    if (!allow_missing && is.na(i)) {
      result <- result(
        err = new_error_location2_type(
          i = i,
          subscript_arg = arg,
          body = cnd_bullets_location2_need_present,
          call = call
        )
      )
    } else {
      result <- result(i)
    }
    return(result)
  }

  if (identical(i, 0L)) {
    return(result(
      err = new_error_location2_type(
        i = i,
        subscript_arg = arg,
        body = cnd_bullets_location2_need_positive,
        call = call
      )
    ))
  }

  if (!allow_negative && neg) {
    return(result(
      err = new_error_location2_type(
        i = i,
        subscript_arg = arg,
        body = cnd_bullets_location2_need_positive,
        call = call
      )
    ))
  }

  err <- NULL
  i <- tryCatch(
    vec_as_location(i, n, names = names, arg = arg, call = call),
    vctrs_error_subscript = function(err) {
      err[["subscript_scalar"]] <- TRUE
      err <<- err
      i
    }
  )
  if (!is_null(err)) {
    return(result(err = err))
  }

  if (neg) {
    i <- -i
  }

  result(i)
}
R/subscript-loc.R:197

vec_as_location2 untypeabletyped

unbound variable (line 156)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((i: any, n: any, names: any?, ...: any, missing: any?, arg: any?, call: any?) -> any)<>
timing: 0.026 s
source
vec_as_location2 <- function(
  i,
  n,
  names = NULL,
  ...,
  missing = c("error", "propagate"),
  arg = caller_arg(i),
  call = caller_env()
) {
  check_dots_empty0(...)
  result_get(vec_as_location2_result(
    i,
    n = n,
    names = names,
    negative = "error",
    missing = missing,
    arg = arg,
    call = call
  ))
}
R/subscript-loc.R:150

num_as_location2 untypeabletyped

unbound variable (line 178)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((i: any, n: any, ...: any, negative: any?, missing: any?, arg: any?, call: any?) -> any)<>
timing: 0.059 s
source
num_as_location2 <- function(
  i,
  n,
  ...,
  negative = c("error", "ignore"),
  missing = c("error", "propagate"),
  arg = caller_arg(i),
  call = caller_env()
) {
  check_dots_empty0(...)

  if (!is_integer(i) && !is_double(i)) {
    abort("`i` must be a numeric vector.", call = call)
  }
  result_get(vec_as_location2_result(
    i,
    n = n,
    names = NULL,
    negative = negative,
    missing = missing,
    arg = arg,
    call = call
  ))
}
R/subscript-loc.R:172

cnd_body_vctrs_error_location_negative_missing untypeable

unbound variable (line 307)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
timing: 0.078 s
source
cnd_body_vctrs_error_location_negative_missing <- function(cnd, ...) {
  missing_loc <- which(is.na(cnd$i))
  arg <- append_arg("Subscript", cnd$subscript_arg)

  if (length(missing_loc) == 1) {
    loc <- glue::glue("{arg} has a missing value at location {missing_loc}.")
  } else {
    n_loc <- length(missing_loc)
    missing_loc <- ensure_full_stop(enumerate(missing_loc))
    loc <- glue::glue(
      "{arg} has {n_loc} missing values at locations {missing_loc}"
    )
  }
  format_error_bullets(c(
    x = "Negative locations can't have missing values.",
    i = loc
  ))
}
R/subscript-loc.R:305

stop_location_negative_missing skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_location_negative_missing <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i,
    ...,
    body = cnd_body_vctrs_error_location_negative_missing,
    call = call
  ))
}
R/subscript-loc.R:297

cnd_body_vctrs_error_location_negative_positive untypeable

unbound variable (line 334)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
timing: 0.091 s
source
cnd_body_vctrs_error_location_negative_positive <- function(cnd, ...) {
  positive_loc <- which(cnd$i > 0)
  arg <- append_arg("Subscript", cnd$subscript_arg)

  if (length(positive_loc) == 1) {
    loc <- glue::glue("{arg} has a positive value at location {positive_loc}.")
  } else {
    n_loc <- length(positive_loc)
    positive_loc <- ensure_full_stop(enumerate(positive_loc))
    loc <- glue::glue(
      "{arg} has {n_loc} positive values at locations {positive_loc}"
    )
  }
  format_error_bullets(c(
    x = "Negative and positive locations can't be mixed.",
    i = loc
  ))
}
R/subscript-loc.R:332

stop_location_negative_positive skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_location_negative_positive <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i,
    ...,
    body = cnd_body_vctrs_error_location_negative_positive,
    call = call
  ))
}
R/subscript-loc.R:324

cnd_bullets_location_need_non_negative untypeabletyped

unbound variable (line 395)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.011 s
source
cnd_bullets_location_need_non_negative <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)
  format_error_bullets(c(
    x = glue::glue_data(
      cnd,
      "{subscript_arg} can't contain negative locations."
    )
  ))
}
R/subscript-loc.R:394

stop_location_negative skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_location_negative <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i,
    body = cnd_bullets_location_need_non_negative,
    ...,
    call = call
  ))
}
R/subscript-loc.R:386

cnd_bullets_location_need_non_zero untypeabletyped

unbound variable (line 415)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { i: 0, subscript_arg: any, any }, ...: any) | (cnd: { i: ~0, subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.081 s
source
cnd_bullets_location_need_non_zero <- function(cnd, ...) {
  zero_loc <- which(cnd$i == 0)
  zero_loc_size <- length(zero_loc)
  arg <- append_arg("Subscript", cnd$subscript_arg)

  if (zero_loc_size == 1) {
    loc <- glue::glue("It has a `0` value at location {zero_loc}.")
  } else {
    zero_loc <- ensure_full_stop(enumerate(zero_loc))
    loc <- glue::glue(
      "It has {zero_loc_size} `0` values at locations {zero_loc}"
    )
  }
  format_error_bullets(c(
    x = glue::glue("{arg} can't contain `0` values."),
    i = loc
  ))
}
R/subscript-loc.R:412

stop_location_zero skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_location_zero <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i,
    body = cnd_bullets_location_need_non_zero,
    ...,
    call = call
  ))
}
R/subscript-loc.R:404

cnd_bullets_subscript_missing untypeable

unbound variable (line 440)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
timing: 0.017 s
source
cnd_bullets_subscript_missing <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)

  missing_loc <- which(is.na(cnd$i))
  if (length(missing_loc) == 1) {
    missing_line <- glue::glue(
      "It has a missing value at location {missing_loc}."
    )
  } else {
    missing_enum <- ensure_full_stop(enumerate(missing_loc))
    missing_line <- glue::glue(
      "It has missing values at locations {missing_enum}"
    )
  }

  format_error_bullets(c(
    x = glue::glue_data(cnd, "{subscript_arg} can't contain missing values."),
    x = missing_line
  ))
}
R/subscript-loc.R:439

stop_subscript_missing skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_subscript_missing <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i = i,
    body = cnd_bullets_subscript_missing,
    ...,
    call = call
  ))
}
R/subscript-loc.R:431

cnd_bullets_subscript_empty untypeable

unbound variable (line 469)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
timing: 0.016 s
source
cnd_bullets_subscript_empty <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Subscript", cnd$subscript_arg)

  loc <- which(cnd$i == "")
  if (length(loc) == 1) {
    line <- glue::glue("It has an empty string at location {loc}.")
  } else {
    enum <- ensure_full_stop(enumerate(loc))
    line <- glue::glue("It has an empty string at locations {enum}")
  }

  format_error_bullets(c(
    x = glue::glue_data(cnd, "{subscript_arg} can't contain the empty string."),
    x = line
  ))
}
R/subscript-loc.R:468

stop_subscript_empty skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_subscript_empty <- function(i, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_type(
    i = i,
    body = cnd_bullets_subscript_empty,
    ...,
    call = call
  ))
}
R/subscript-loc.R:460

cnd_body_vctrs_error_indicator_size untypeabletyped

unbound variable (line 495)
unbound: append_arg — one of the package’s own names, itself untyped
error detail
name: append_arg
gradual mode: typed
((cnd: { subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.010 s
source
cnd_body_vctrs_error_indicator_size <- function(cnd, ...) {
  cnd$subscript_arg <- append_arg("Logical subscript", cnd$subscript_arg)
  glue_data_bullets(
    cnd,
    x = "{subscript_arg} must be size 1 or {n}, not {vec_size(i)}."
  )
}
R/subscript-loc.R:494

stop_indicator_size skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_indicator_size <- function(i, n, ..., call = caller_env()) {
  cnd_signal(new_error_subscript_size(
    i,
    n = n,
    ...,
    body = cnd_body_vctrs_error_indicator_size,
    call = call
  ))
}
R/subscript-loc.R:485

stop_subscript_oob skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_subscript_oob <- function(i, subscript_type, ..., call = caller_env()) {
  stop_subscript(
    class = "vctrs_error_subscript_oob",
    i = i,
    subscript_type = subscript_type,
    ...,
    call = call
  )
}
R/subscript-loc.R:502

cnd_header_vctrs_error_subscript_oob_non_consecutive untypeabletyped

unbound variable (line 604)
unbound: cnd_subscript_action — one of the package’s own names, itself untyped
error detail
name: cnd_subscript_action
gradual mode: typed
((cnd: { subscript_scalar: null, subscript_action: any, subscript_elt: null, any } | { subscript_scalar: null, subscript_action: any, subscript_elt: vec1, any } | { subscript_scalar: ~null, subscript_action: any, subscript_elt: null, any } | { subscript_scalar: ~null, subscript_action: any, subscript_elt: vec1, any }, ...: any) -> any)<>
timing: 0.002 s
source
cnd_header_vctrs_error_subscript_oob_non_consecutive <- function(cnd, ...) {
  action <- cnd_subscript_action(cnd)
  elt <- cnd_subscript_element(cnd)
  glue::glue(
    "Can't {action} {elt[[2]]} beyond the end with non-consecutive locations."
  )
}
R/subscript-loc.R:603

cnd_subscript_oob_non_consecutive untypeabletyped

unbound variable (line 637)
unbound: check_bool — one of the package’s own names, itself untyped
error detail
name: check_bool
gradual mode: typed
∀'a. (((cnd: { subscript_oob_non_consecutive: 'a & null, any }) -> ff<>)&((cnd: { subscript_oob_non_consecutive: 'a \ null, any }) -> 'a))<>
timing: 0.018 s
source
cnd_subscript_oob_non_consecutive <- function(cnd) {
  out <- cnd$subscript_oob_non_consecutive %||% FALSE
  check_bool(out)
  out
}
R/subscript-loc.R:635

cnd_header.vctrs_error_subscript_oob untypeabletimeout

unbound variable (line 514)
unbound: cnd_subscript_oob_non_consecutive — one of the package’s own names, itself untyped
error detail
name: cnd_subscript_oob_non_consecutive
gradual mode: timeout
timing: 0.026 s
source
cnd_header.vctrs_error_subscript_oob <- function(cnd, ...) {
  if (cnd_subscript_oob_non_consecutive(cnd)) {
    return(cnd_header_vctrs_error_subscript_oob_non_consecutive(cnd, ...))
  }

  elt <- cnd_subscript_element(cnd)
  action <- cnd_subscript_action(cnd)
  type <- cnd_subscript_type(cnd)

  if (action %in% c("rename", "relocate") || type == "character") {
    glue::glue("Can't {action} {elt[[2]]} that don't exist.")
  } else {
    glue::glue("Can't {action} {elt[[2]]} past the end.")
  }
}
R/subscript-loc.R:513

vctrs_cli_vec skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.001 s
source
vctrs_cli_vec <- function(x, ..., vec_trunc = 5) {
  cli::cli_vec(as.character(x), list(..., vec_trunc = vec_trunc))
}
R/subscript-loc.R:583

cnd_body_vctrs_error_subscript_oob_location untypeabletimeout

unbound variable (line 548)
unbound: cnd_subscript_action — one of the package’s own names, itself untyped
error detail
name: cnd_subscript_action
gradual mode: timeout
timing: 0.180 s
source
cnd_body_vctrs_error_subscript_oob_location <- function(cnd, ...) {
  i <- cnd$i

  # In case of missing locations
  i <- i[!is.na(i)]

  if (cnd_subscript_action(cnd) == "negate") {
    # Only report negative indices
    i <- i[i < 0L]
  }

  # In case of negative indexing
  i <- abs(i)

  oob <- i[i > cnd$size]
  oob_enum <- vctrs_cli_vec(oob)

  n_loc <- length(oob)
  n <- cnd$size
  elt <- cnd_subscript_element_cli(n, cnd)

  # TODO: Switch to `format_inline()` and format bullets lazily through rlang
  cli::format_error(c(
    "i" = "{cli::qty(n_loc)} Location{?s} {oob_enum} do{?esn't/n't} exist.",
    "i" = "There {cli::qty(n)} {?is/are} only {elt}."
  ))
}
R/subscript-loc.R:542

cnd_body_vctrs_error_subscript_oob_name untypeabletyped

unbound variable (line 570)
unbound: cnd_subscript_element — one of the package’s own names, itself untyped
error detail
name: cnd_subscript_element
gradual mode: typed
((cnd: { i: vec<@"[", ...>, names: vec | null, subscript_elt: null, any } | { i: vec<@"[", ...>, names: vec | null, subscript_elt: vec1, any }, ...: any) | (cnd: { i: vec<~@"[", ...>, names: vec | null, subscript_elt: null, any } | { i: vec<~@"[", ...>, names: vec | null, subscript_elt: vec1, any }, ...: any) -> any)<>
timing: 0.010 s
source
cnd_body_vctrs_error_subscript_oob_name <- function(cnd, ...) {
  elt <- cnd_subscript_element(cnd, capital = TRUE)
  oob <- cnd$i[!cnd$i %in% cnd$names]
  oob_enum <- enumerate(glue::backtick(oob))

  format_error_bullets(c(
    x = glue::glue(ngettext(
      length(oob),
      "{elt[[1]]} {oob_enum} doesn't exist.",
      "{elt[[2]]} {oob_enum} don't exist."
    ))
  ))
}
R/subscript-loc.R:569

cnd_body_vctrs_error_subscript_oob_non_consecutive untypeabletyped

unbound variable (line 611)
unbound: sort — a name the prelude does not declare
error detail
name: sort
gradual mode: typed
((cnd: { i: any, size: any, subscript_arg: any, any }, ...: any) -> any)<>
timing: 0.019 s
source
cnd_body_vctrs_error_subscript_oob_non_consecutive <- function(cnd, ...) {
  i <- sort(cnd$i)
  i <- i[i > cnd$size]

  non_consecutive <- i[c(TRUE, diff(i) != 1L)]

  arg <- append_arg("Subscript", cnd$subscript_arg)
  if (length(non_consecutive) == 1) {
    x_line <- glue::glue(
      "{arg} contains non-consecutive location {non_consecutive}."
    )
  } else {
    non_consecutive <- ensure_full_stop(enumerate(non_consecutive))
    x_line <- glue::glue(
      "{arg} contains non-consecutive locations {non_consecutive}"
    )
  }

  glue_data_bullets(
    cnd,
    i = "Input has size {size}.",
    x = x_line
  )
}
R/subscript-loc.R:610

cnd_body.vctrs_error_subscript_oob skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
cnd_body.vctrs_error_subscript_oob <- function(cnd, ...) {
  switch(
    cnd_subscript_type(cnd),
    numeric = if (cnd_subscript_oob_non_consecutive(cnd)) {
      cnd_body_vctrs_error_subscript_oob_non_consecutive(cnd, ...)
    } else {
      cnd_body_vctrs_error_subscript_oob_location(cnd, ...)
    },
    character = cnd_body_vctrs_error_subscript_oob_name(cnd, ...),
    abort("Internal error: subscript type can't be `logical` for OOB errors.")
  )
}
R/subscript-loc.R:530

stop_location_oob_non_consecutive skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_location_oob_non_consecutive <- function(
  i,
  size,
  ...,
  call = caller_env()
) {
  stop_subscript_oob(
    i = i,
    size = size,
    subscript_type = "numeric",
    subscript_oob_non_consecutive = TRUE,
    ...,
    call = call
  )
}
R/subscript-loc.R:587
R/slice.R

vec_slice untypeabletyped

unbound variable (line 159)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, i: any_sexp, ...: any, error_call: any?) -> any_sexp)<>
timing: 0.006 s
source
vec_slice <- function(x, i, ..., error_call = current_env()) {
  check_dots_empty0(...)
  .Call(ffi_slice, x, i, environment())
}
R/slice.R:159

vec_slice_fallback untypeable

unbound variable (line 166)
unbound: vec_proxy — one of the package’s own names, itself untyped
error detail
name: vec_proxy
timing: 0.015 s
source
vec_slice_fallback <- function(x, i) {
  out <- unclass(vec_proxy(x))
  obj_check_vector(out)

  d <- vec_dim_n(out)
  if (d == 2) {
    out <- out[i, , drop = FALSE]
  } else {
    miss_args <- rep(list(missing_arg()), d - 1)
    out <- eval_bare(expr(out[i, !!!miss_args, drop = FALSE]))
  }

  vec_restore(out, x)
}
R/slice.R:165

vec_slice_fallback_integer64 untypeable

unbound variable (line 186)
unbound: missing_arg — a name the prelude does not declare
error detail
name: missing_arg
timing: 0.105 s
source
vec_slice_fallback_integer64 <- function(x, i) {
  d <- vec_dim_n(x)

  if (d == 2) {
    out <- x[i, , drop = FALSE]
  } else {
    miss_args <- rep(list(missing_arg()), d - 1)
    out <- eval_bare(expr(x[i, !!!miss_args, drop = FALSE]))
  }

  is_na <- is.na(i)

  if (!any(is_na)) {
    return(out)
  }

  if (d == 2) {
    out[is_na, ] <- bit64::NA_integer64_
  } else {
    eval_bare(expr(out[is_na, !!!miss_args] <- bit64::NA_integer64_))
  }

  out
}
R/slice.R:180

vec_slice_dispatch_integer64 untypeabletyped

unbound variable (line 217)
unbound: bit64::NA_integer64_ — a name the prelude does not declare
error detail
name: bit64::NA_integer64_
gradual mode: typed
((x: <@"[", ...>, i: any) | (x: list<~@"[", ...>, i: CHR | DBL | INT | LGL | RAW) | (x: vec<~@"[", ...>, i: CHR | DBL | INT | LGL | RAW) -> any)<>
timing: 0.158 s
source
vec_slice_dispatch_integer64 <- function(x, i) {
  out <- x[i]

  is_na <- is.na(i)

  if (!any(is_na)) {
    return(out)
  }

  out[is_na] <- bit64::NA_integer64_

  out
}
R/slice.R:208

vec_slice_altrep untypeabletyped

unbound variable (line 239)
unbound: .subset — a name the prelude does not declare
error detail
name: .subset
gradual mode: typed
((x: any, i: any) -> any)<>
timing: 0.002 s
source
vec_slice_altrep <- function(x, i) {
  # We have already validated `i`, it is one of:
  # - Integer vector from `vec_as_location()`
  # - Integer vector from materializing a `compact_rep()`
  # - Integer vector from materializing a `compact_seq()`
  # - Logical vector from materializing a `compact_condition()`
  #   (which `VectorSubset()` will convert to an integer vector)

  # For the main case we care about (an ALTREP vector with an Extract_Subset
  # method, like vroom), `.subset()` will:
  # - Call `do_subset_dflt()` (bypassing S3 dispatch!)
  # - Call `VectorSubset()`
  # - Call `ExtractSubset()`
  # - Call `ALTVEC_EXTRACT_SUBSET()`
  # - If that returns `NULL`, i.e. if this ALTREP class has not implemented an
  #   ALTREP `Extract_Subset` method, then it will use the `Elt` method to
  #   subset
  .subset(x, i)
}
R/slice.R:222

vec_slice<- untypeabletyped

unbound variable (line 247)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
gradual mode: typed
((x: any_sexp, i: any_sexp, value: any_sexp) -> any_sexp)<>
timing: 0.005 s
source
`vec_slice<-` <- function(x, i, value) {
  x_arg <- "" # Substitution is `*tmp*`
  delayedAssign("value_arg", as_label(substitute(value)))
  slice_value <- FALSE
  .Call(ffi_assign, x, i, value, slice_value, environment())
}
R/slice.R:245

vec_assign untypeabletyped

unbound variable (line 262)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, i: any_sexp, value: any_sexp, ...: any, slice_value: LGL?, x_arg: any?, value_arg: any?) -> any_sexp)<>
timing: 0.017 s
source
vec_assign <- function(
  x,
  i,
  value,
  ...,
  slice_value = FALSE,
  x_arg = "",
  value_arg = ""
) {
  check_dots_empty0(...)
  .Call(ffi_assign, x, i, value, slice_value, environment())
}
R/slice.R:253

vec_assign_fallback untypeable

unbound variable (line 302)
unbound: vec_slice — one of the package’s own names, itself untyped
error detail
name: vec_slice
timing: 0.199 s
source
vec_assign_fallback <- function(x, i, value, slice_value, index_style) {
  if (index_style == "condition") {
    # Convert logical condition `i` to integer location `i`. Must use
    # `vec_as_location()` rather than `which()` because we want `NA` values to
    # propagate, which is consistent with how `value`'s size is checked
    # internally (i.e. when `slice_value = FALSE`, `value` was checked to have
    # size equal to the number of `TRUE` or `NA` values in `i`). Propagated
    # `NA`s are later dropped before calling `[<-` to work around a base `[<-`
    # issue, but we need them to slice both `i` and `value` consistently.
    i <- vec_as_location(i, n = vec_size(x), missing = "propagate")
  }

  if (slice_value && vec_size(value) != 1L) {
    # `value` has same size as `x` rather than same size as `i`.
    # We need to pre-slice it down to same size as `i` to match what `[<-` expects.
    # Effectively we are preemptively doing the RHS of this:
    # vec_slice(x, i) <- vec_slice(value, i)
    value <- vec_slice(value, i)
  }

  # Work around issue in base `[<-` that errors on `NA_integer_` in subassign
  # indices. Only do this as necessary, as `vec_slice()` will typically call
  # back to `[` when slicing `value` here, which is somewhat slow.
  if (vec_any_missing(i)) {
    existing <- !is.na(i)
    i <- vec_slice(i, existing)
    if (vec_size(value) != 1L) {
      value <- vec_slice(value, existing)
    }
  }

  d <- vec_dim_n(x)
  miss_args <- rep(list(missing_arg()), d - 1)
  eval_bare(expr(x[i, !!!miss_args] <- value))
  x
}
R/slice.R:277

vec_assign_seq untypeabletyped

unbound variable (line 323)
unbound: ffi_assign_seq — a native symbol tyr could not bind
error detail
name: ffi_assign_seq
gradual mode: typed
((x: any, value: any, start: any, size: any, increasing: any?, slice_value: any?) -> any)<>
timing: 0.024 s
source
vec_assign_seq <- function(
  x,
  value,
  start,
  size,
  increasing = TRUE,
  slice_value = FALSE
) {
  .Call(ffi_assign_seq, x, value, start, size, increasing, slice_value)
}
R/slice.R:315

compact_seq typed fuzz ok

((start: any_sexp, size: any_sexp, increasing: LGL?) -> INT)<>
timing: 0.034 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
compact_seq(as.name("x"), as.name("x"), TRUE)error_pkgvctrs::compact_seq: `size` must be a scalar integer or double.
compact_seq(list(as.name("x")), NULL)error_pkgvctrs::compact_seq: `size` must be a scalar integer or double.
compact_seq(list(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), "size" = NA_complex_)error_pkgvctrs::compact_seq: `size` must be a scalar integer or double.
compact_seq("start" = NULL, "size" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::compact_seq: `size` must be a scalar integer or double.
compact_seq(c(TRUE, FALSE, FALSE, FALSE, TRUE), new.env())error_pkgvctrs::compact_seq: `size` must be a scalar integer or double.
compact_seq("start" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "size" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "increasing" = c(NA, TRUE))error_pkgvctrs::compact_seq: `increasing` must be `TRUE` or `FALSE`.
and 2 more
source
compact_seq <- function(start, size, increasing = TRUE) {
  .Call(ffi_compact_seq, start, size, increasing)
}
R/slice.R:327

vec_assign_compact_condition untypeabletyped

unbound variable (line 337)
unbound: ffi_assign_compact_condition — a native symbol tyr could not bind
error detail
name: ffi_assign_compact_condition
gradual mode: typed
((x: any, i: any, value: any, slice_value: any?) -> any)<>
timing: 0.009 s
source
vec_assign_compact_condition <- function(
  x,
  i,
  value,
  slice_value = FALSE
) {
  .Call(ffi_assign_compact_condition, x, i, value, slice_value)
}
R/slice.R:331

as_compact_condition typed fuzz ok

((x: LGL) -> raw)<>
timing: 0.013 s
fuzzing: 7 inside (4 ok, 3 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
as_compact_condition("x" = c(TRUE, NA, NA, FALSE, TRUE))error_pkgvctrs::as_compact_condition: Can't use `NA` when creating a `compact_condition`. ℹ In file 'utils.c' at line 956. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
as_compact_condition(c(TRUE, TRUE, NA, FALSE, FALSE))error_pkgvctrs::as_compact_condition: Can't use `NA` when creating a `compact_condition`. ℹ In file 'utils.c' at line 956. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
as_compact_condition("x" = NA)error_pkgvctrs::as_compact_condition: Can't use `NA` when creating a `compact_condition`. ℹ In file 'utils.c' at line 956. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.

Side effects

gzfile
source
as_compact_condition <- function(x) {
  .Call(ffi_as_compact_condition, x)
}
R/slice.R:340

vec_assign_params untypeabletyped

unbound variable (line 358)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, i: any_sexp, value: any_sexp, ...: any, assign_names: LGL?, slice_value: LGL?, x_arg: any?, value_arg: any?) -> any_sexp)<>
timing: 0.021 s
source
vec_assign_params <- function(
  x,
  i,
  value,
  ...,
  assign_names = FALSE,
  slice_value = FALSE,
  x_arg = "",
  value_arg = ""
) {
  check_dots_empty0(...)
  .Call(
    ffi_assign_params,
    x,
    i,
    value,
    assign_names,
    slice_value,
    environment()
  )
}
R/slice.R:348

vec_remove untypeable

unbound variable (line 371)
unbound: vec_as_location — one of the package’s own names, itself untyped
error detail
name: vec_as_location
timing: 0.010 s
source
vec_remove <- function(x, i) {
  vec_slice(x, -vec_as_location(i, length(x), names(x)))
}
R/slice.R:370

vec_index skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_index <- function(x, i, ...) {
  i <- maybe_missing(i, TRUE)
  out <- vec_slice(x, i)

  if (!dots_n(...)) {
    return(out)
  }

  # Need to unclass to avoid infinite recursion through `[`
  proxy <- vec_data(out)
  out <- proxy[, ..., drop = FALSE]

  vec_restore(out, x)
}
R/slice.R:374

vec_init untypeabletyped

unbound variable (line 406)
unbound: ffi_init — a native symbol tyr could not bind
error detail
name: ffi_init
gradual mode: typed
((x: any, n: any?) -> any)<>
timing: 0.004 s
source
vec_init <- function(x, n = 1L) {
  .Call(ffi_init, x, n, environment())
}
R/slice.R:405

vec_slice_seq untypeabletyped

unbound variable (line 411)
unbound: ffi_slice_seq — a native symbol tyr could not bind
error detail
name: ffi_slice_seq
gradual mode: typed
((x: any, start: any, size: any, increasing: any?) -> any)<>
timing: 0.008 s
source
vec_slice_seq <- function(x, start, size, increasing = TRUE) {
  .Call(ffi_slice_seq, x, start, size, increasing)
}
R/slice.R:410

vec_slice_rep untypeabletyped

unbound variable (line 416)
unbound: ffi_slice_rep — a native symbol tyr could not bind
error detail
name: ffi_slice_rep
gradual mode: typed
((x: any, i: any, n: any) -> any)<>
timing: 0.004 s
source
vec_slice_rep <- function(x, i, n) {
  .Call(ffi_slice_rep, x, i, n)
}
R/slice.R:415

base_vec_rep untypeabletyped

unbound variable (line 421)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
base_vec_rep <- function(x, ...) {
  i <- rep(seq_len(vec_size(x)), ...)
  vec_slice(x, i)
}
R/slice.R:420

vec_size_assign untypeable

unbound variable (line 427)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
timing: 0.015 s
source
vec_size_assign <- function(x, n) {
  x_size <- vec_size(x)

  if (n > x_size) {
    i <- seq_len(x_size)
    i <- c(i, vec_init(int(), n - x_size))
  } else {
    i <- seq_len(n)
  }

  vec_slice(x, i)
}
R/slice.R:426
R/size.R

vec_size untypeabletyped

unbound variable (line 85)
unbound: ffi_size — a native symbol tyr could not bind
error detail
name: ffi_size
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
vec_size <- function(x) {
  .Call(ffi_size, x, environment())
}
R/size.R:84

vec_size_common untypeabletyped

unbound variable (line 95)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((...: any, .size: any?, .absent: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.008 s
source
vec_size_common <- function(
  ...,
  .size = NULL,
  .absent = 0L,
  .arg = "",
  .call = caller_env()
) {
  .External2(ffi_size_common, list2(...), .size, .absent)
}
R/size.R:90

list_sizes typed fuzz ok

((x: any_sexp) -> any_sexp)<>
timing: 0.014 s
fuzzing: 6 inside (6 error pkg) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
list_sizes("x" = new.env())error_pkgvctrs::list_sizes: `x` must be a list, not an environment.
list_sizes("x" = NULL)error_pkgvctrs::list_sizes: `x` must be a list, not `NULL`.
list_sizes(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::list_sizes: `x` must be a list, not a pointer.
list_sizes(quote(f(x)))error_pkgvctrs::list_sizes: `x` must be a list, not a call.
list_sizes(list(as.name("x")))error_pkgvctrs::list_sizes: `x[[1]]` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
list_sizes("x" = quote(f(x)))error_pkgvctrs::list_sizes: `x` must be a list, not a call.
source
list_sizes <- function(x) {
  .Call(ffi_list_sizes, x, environment())
}
R/size.R:102

vec_is_empty untypeabletyped

unbound variable (line 109)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
gradual mode: typed
((x: any) -> ff<> | tt<>)<>
timing: 0.002 s
source
vec_is_empty <- function(x) {
  vec_size(x) == 0L
}
R/size.R:108

%0% untypeabletyped

unbound variable (line 126)
unbound: vec_is_empty — one of the package’s own names, itself untyped
error detail
name: vec_is_empty
gradual mode: typed
∀'a,'b. ((x: 'b, y: 'a) -> 'a | 'b)<>
timing: 0.005 s
source
`%0%` <- function(x, y) {
  if (vec_is_empty(x)) y else x
}
R/size.R:125

vec_seq_along untypeable

unbound variable (line 148)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
timing: 0.002 s
source
vec_seq_along <- function(x) {
  seq_len(vec_size(x))
}
R/size.R:147

vec_init_along untypeabletyped

unbound variable (line 154)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
gradual mode: typed
((x: any, y: any?) -> any)<>
timing: 0.006 s
source
vec_init_along <- function(x, y = x) {
  vec_slice(x, rep_len(NA_integer_, vec_size(y)))
}
R/size.R:153

vec_as_short_length untypeabletyped

unbound variable (line 157)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((n: any, arg: any?, call: any?) -> any)<>
timing: 0.010 s
source
vec_as_short_length <- function(n, arg = caller_arg(n), call = caller_env()) {
  .Call(ffi_as_short_length, n, environment())
}
R/size.R:157
R/order.R

<statement> typed

timing: 0.000 s
source
NULL
R/order.R:145

vec_order_radix untypeabletyped

unbound variable (line 156)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, ...: any, direction: any_sexp?, na_value: any_sexp?, nan_distinct: any_sexp?, chr_proxy_collate: any_sexp?) -> any_sexp)<>
timing: 0.012 s
source
vec_order_radix <- function(
  x,
  ...,
  direction = "asc",
  na_value = "largest",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL
) {
  check_dots_empty0(...)
  .Call(vctrs_order, x, direction, na_value, nan_distinct, chr_proxy_collate)
}
R/order.R:148

vec_sort_radix untypeabletyped

unbound variable (line 169)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, ...: any, direction: any_sexp?, na_value: any_sexp?, nan_distinct: any_sexp?, chr_proxy_collate: any_sexp?) -> any_sexp)<>
timing: 0.010 s
source
vec_sort_radix <- function(
  x,
  ...,
  direction = "asc",
  na_value = "largest",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL
) {
  check_dots_empty0(...)

  idx <- vec_order_radix(
    x = x,
    direction = direction,
    na_value = na_value,
    nan_distinct = nan_distinct,
    chr_proxy_collate = chr_proxy_collate
  )

  vec_slice(x, idx)
}
R/order.R:161

vec_locate_sorted_groups untypeabletyped

unbound variable (line 233)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, ...: any, direction: any_sexp?, na_value: any_sexp?, nan_distinct: any_sexp?, chr_proxy_collate: any_sexp?) -> any_sexp)<>
timing: 0.010 s
source
vec_locate_sorted_groups <- function(
  x,
  ...,
  direction = "asc",
  na_value = "largest",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL
) {
  check_dots_empty0(...)

  .Call(
    vctrs_locate_sorted_groups,
    x,
    direction,
    na_value,
    nan_distinct,
    chr_proxy_collate
  )
}
R/order.R:225

vec_order_info untypeabletyped

unbound variable (line 255)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, ...: any, direction: any_sexp?, na_value: any_sexp?, nan_distinct: any_sexp?, chr_proxy_collate: any_sexp?) -> any_sexp)<>
timing: 0.010 s
source
vec_order_info <- function(
  x,
  ...,
  direction = "asc",
  na_value = "largest",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL
) {
  check_dots_empty0(...)
  .Call(
    vctrs_order_info,
    x,
    direction,
    na_value,
    nan_distinct,
    chr_proxy_collate
  )
}
R/order.R:247

vec_order untypeabletyped

unbound variable (line 317)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any, direction: any?, na_value: any?) -> any)<>
timing: 0.174 s
source
vec_order <- function(
  x,
  ...,
  direction = c("asc", "desc"),
  na_value = c("largest", "smallest")
) {
  check_dots_empty0(...)

  direction <- arg_match0(direction, c("asc", "desc"))
  na_value <- arg_match0(na_value, c("largest", "smallest"))

  decreasing <- !identical(direction, "asc")
  na.last <- identical(na_value, "largest")
  if (decreasing) {
    na.last <- !na.last
  }

  proxy <- vec_proxy_order(x)

  if (is.data.frame(proxy)) {
    if (length(proxy) == 0L) {
      # Work around type-instability in `base::order()`
      return(vec_seq_along(proxy))
    }
    args <- map(unstructure(proxy), function(.x) {
      if (is.data.frame(.x)) {
        .x <- order(vec_order(.x, direction = direction, na_value = na_value))
      }
      .x
    })
    exec("order", !!!args, decreasing = decreasing, na.last = na.last)
  } else if (
    is_character(proxy) ||
      is_logical(proxy) ||
      is_integer(proxy) ||
      is_double(proxy) ||
      is.complex(proxy)
  ) {
    if (is.object(proxy)) {
      proxy <- unstructure(proxy)
    }
    order(proxy, decreasing = decreasing, na.last = na.last)
  } else {
    abort("Invalid type returned by `vec_proxy_order()`.")
  }
}
R/order.R:311

vec_sort untypeabletyped

unbound variable (line 366)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any, direction: any?, na_value: any?) -> any)<>
timing: 0.034 s
source
vec_sort <- function(
  x,
  ...,
  direction = c("asc", "desc"),
  na_value = c("largest", "smallest")
) {
  check_dots_empty0(...)

  direction <- arg_match0(direction, c("asc", "desc"))
  na_value <- arg_match0(na_value, c("largest", "smallest"))

  idx <- vec_order(x, direction = direction, na_value = na_value)
  vec_slice(x, idx)
}
R/order.R:360
R/dictionary.R

vec_count_impl untypeabletyped

unbound variable (line 83)
unbound: vctrs_count — a native symbol tyr could not bind
error detail
name: vctrs_count
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_count_impl <- function(x) {
  .Call(vctrs_count, x)
}
R/dictionary.R:82

vec_count untypeable

unbound variable (line 48)
unbound: arg_match0 — a name the prelude does not declare
error detail
name: arg_match0
timing: 0.038 s
source
vec_count <- function(x, sort = c("count", "key", "location", "none")) {
  sort <- arg_match0(sort, c("count", "key", "location", "none"))

  # Returns info pair giving index of first occurrence value and count
  info <- vec_count_impl(x)

  # Sorting based on rearranging `info`
  if (sort == "location") {
    loc <- vec_order(info$loc)
    info <- vec_slice(info, loc)
  } else if (sort == "count") {
    # Order by descending count, but ascending original location.
    # This retains stable ordering in case of ties in the `count`.
    # Need `vec_order_radix()` to handle different `direction`s.
    loc <- vec_order_radix(
      info[c("count", "loc")],
      direction = c("desc", "asc")
    )
    info <- vec_slice(info, loc)
  }

  out <- data_frame(
    key = vec_slice(x, info$loc),
    count = info$count
  )

  # Sorting based on rearranging `out`
  if (sort == "key") {
    loc <- vec_order(out$key)
    out <- vec_slice(out, loc)
  }

  out
}
R/dictionary.R:47

<statement> typed

timing: 0.000 s
source
NULL
R/dictionary.R:134

vec_duplicate_any typed fuzz ok

((x: any_sexp) -> ^LGL1)<>
timing: 0.010 s
fuzzing: 7 inside (3 ok, 4 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
vec_duplicate_any("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_type::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_duplicate_any("x" = as.name("x"))error_type::vec_size: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_duplicate_any(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_type::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_duplicate_any("x" = quote(f(x)))error_type::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
vec_duplicate_any <- function(x) {
  .Call(vctrs_duplicated_any, x)
}
R/dictionary.R:138

vec_duplicate_detect untypeabletyped

unbound variable (line 145)
unbound: vctrs_duplicated — a native symbol tyr could not bind
error detail
name: vctrs_duplicated
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_duplicate_detect <- function(x) {
  .Call(vctrs_duplicated, x)
}
R/dictionary.R:144

vec_duplicate_id untypeabletyped

unbound variable (line 151)
unbound: vctrs_id — a native symbol tyr could not bind
error detail
name: vctrs_id
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_duplicate_id <- function(x) {
  .Call(vctrs_id, x)
}
R/dictionary.R:150

vec_unique_loc untypeabletyped

unbound variable (line 200)
unbound: vctrs_unique_loc — a native symbol tyr could not bind
error detail
name: vctrs_unique_loc
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_unique_loc <- function(x) {
  .Call(vctrs_unique_loc, x)
}
R/dictionary.R:199

vec_unique untypeable

unbound variable (line 194)
unbound: vec_unique_loc — one of the package’s own names, itself untyped
error detail
name: vec_unique_loc
timing: 0.001 s
source
vec_unique <- function(x) {
  vec_slice(x, vec_unique_loc(x))
}
R/dictionary.R:193

vec_unique_count untypeabletyped

unbound variable (line 206)
unbound: vctrs_n_distinct — a native symbol tyr could not bind
error detail
name: vctrs_n_distinct
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_unique_count <- function(x) {
  .Call(vctrs_n_distinct, x)
}
R/dictionary.R:205

vec_match untypeabletyped

unbound variable (line 267)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((needles: any_sexp, haystack: any_sexp, ...: any, na_equal: (LGL | null)?, needles_arg: any?, haystack_arg: any?) -> any_sexp)<>
timing: 0.011 s
source
vec_match <- function(
  needles,
  haystack,
  ...,
  na_equal = TRUE,
  needles_arg = "",
  haystack_arg = ""
) {
  check_dots_empty0(...)
  .Call(vctrs_match, needles, haystack, na_equal, environment())
}
R/dictionary.R:259

vec_in untypeabletyped

unbound variable (line 281)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((needles: any_sexp, haystack: any_sexp, ...: any, na_equal: (LGL | null)?, needles_arg: any?, haystack_arg: any?) -> any_sexp)<>
timing: 0.012 s
source
vec_in <- function(
  needles,
  haystack,
  ...,
  na_equal = TRUE,
  needles_arg = "",
  haystack_arg = ""
) {
  check_dots_empty0(...)
  .Call(vctrs_in, needles, haystack, na_equal, environment())
}
R/dictionary.R:273
R/names.R

vec_as_names untypeabletyped

unbound variable (line 174)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((names: CHR, ...: any, repair: (CHR | null)?, repair_arg: any?, quiet: LGL?, call: any?) -> any_sexp)<>
timing: 0.024 s
source
vec_as_names <- function(
  names,
  ...,
  repair = c(
    "minimal",
    "unique",
    "universal",
    "check_unique",
    "unique_quiet",
    "universal_quiet"
  ),
  repair_arg = NULL,
  quiet = FALSE,
  call = caller_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_as_names,
    names,
    repair,
    quiet,
    environment()
  )
}
R/names.R:161

validate_name_repair_arg typed fuzz ok

((repair: CHR | null) -> any_sexp)<>
timing: 0.011 s
fuzzing: 6 inside (6 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
validate_name_repair_arg("repair" = "NA")error_type::vec_as_names: `repair` can't be "NA". See `?vctrs::vec_as_names`.
validate_name_repair_arg(NULL)error_type::vec_as_names: `repair` must be a string or a function. See `?vctrs::vec_as_names`.
validate_name_repair_arg("repair" = c("é", "x y", "x y", "a", "é"))error_type::vec_as_names: `repair` can't be "é". See `?vctrs::vec_as_names`.
validate_name_repair_arg("repair" = NULL)error_type::vec_as_names: `repair` must be a string or a function. See `?vctrs::vec_as_names`.
validate_name_repair_arg("a")error_type::vec_as_names: `repair` can't be "a". See `?vctrs::vec_as_names`.
validate_name_repair_arg("repair" = c("a", "NA"))error_type::vec_as_names: `repair` can't be "a". See `?vctrs::vec_as_names`.
source
validate_name_repair_arg <- function(repair) {
  .Call(vctrs_validate_name_repair_arg, repair)
}
R/names.R:187

validate_minimal_names typed fuzz ok

∀'a. (((names: 'a & (CHR | null), n: (INT | null)?) -> 'a & (CHR | null))&((names: 'a & null, n: (INT | null)?) -> empty))<>
timing: 0.057 s
fuzzing: 18 inside (16 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: (((names: 'names & (CHR | null), n: (INT | null)?) -> 'names & (CHR | null)) & ((names: 'names & null, n: (INT | null)?) -> empty))<>

Other calls inside the domain

callverdicterror
validate_minimal_names(character(0), integer(0))error_pkgvctrs::validate_minimal_names: `n` must be a single number. ℹ In file 'names.c' at line 1015. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
validate_minimal_names("NA", "n" = c(1000000L, 0L, 1000000L, 42L, 2147483647L))error_pkgvctrs::validate_minimal_names: `n` must be a single number. ℹ In file 'names.c' at line 1015. ℹ This is an internal error that was detected in the vctrs package. Please report it at <https://github.com/r-lib/vctrs/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.

Side effects

gzfile
source
validate_minimal_names <- function(names, n = NULL) {
  .Call(vctrs_validate_minimal_names, names, n)
}
R/names.R:190

detect_dot_dot untypeabletyped

unbound variable (line 216)
unbound: grep — a name the prelude does not declare
error detail
name: grep
gradual mode: typed
((names: any) -> any)<>
timing: 0.002 s
source
detect_dot_dot <- function(names) {
  grep("^[.][.](?:[.]|[1-9][0-9]*)$", names)
}
R/names.R:215

detect_empty_names typed fuzz ok

((names: "") | (names: ~"") -> INT<>)<>
timing: 0.015 s
fuzzing: 4 inside (4 ok) · 5 outside (5 rejected)
source
detect_empty_names <- function(names) {
  which(names == "")
}
R/names.R:212

validate_unique untypeabletyped

unbound variable (line 193)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
∀'a. (((names: 'a & (CHR | null), arg: any?, n: (INT | null)?, call: any?) -> 'a)&((names: 'a & null, arg: any?, n: (INT | null)?, call: any?) -> empty))<>
timing: 0.016 s
source
validate_unique <- function(names, arg = "", n = NULL, call = caller_env()) {
  validate_minimal_names(names, n)

  empty_names <- detect_empty_names(names)
  if (has_length(empty_names)) {
    stop_names_cannot_be_empty(names, call = call)
  }

  dot_dot_name <- detect_dot_dot(names)
  if (has_length(dot_dot_name)) {
    stop_names_cannot_be_dot_dot(names, call = call)
  }

  if (anyDuplicated(names)) {
    stop_names_must_be_unique(names, arg, call = call)
  }

  invisible(names)
}
R/names.R:193

append_pos typed fuzz ok

∀'a,'b,`a. (((names: (CHR | v('b))<@"[", `a>, needs_suffix: lgl) -> (CHR | v('b))<`a>) & ((names: v('a)<@"[", `a>, needs_suffix: lgl) -> (CHR | v('a))<`a>))<>
timing: 0.223 s
fuzzing: 12 inside (4 ok, 8 error type) · 8 outside (8 rejected)
type drawn from: (((names: (CHR | v('I114725))<@"[", `I450>, needs_suffix: lgl) -> (CHR | v('I114725))<`I450>) & ((names: v('I114723)<@"[", `I450>, needs_suffix: lgl) -> (CHR | v('I114723))<`I450>))<>

Other calls inside the domain

callverdicterror
append_pos("names" = c(NaN, -1, 2, -2147483647, -2.5), "needs_suffix" = as.raw(c(255)))error_type::which: argument to 'which' is not logical
append_pos("names" = NA, "needs_suffix" = as.raw(c(255, 255)))error_type::which: argument to 'which' is not logical
append_pos("names" = complex(real = 1, imaginary = -2), "needs_suffix" = as.raw(c(255, 255)))error_type::which: argument to 'which' is not logical
append_pos(raw(0), as.raw(c(255, 0)))error_type::which: argument to 'which' is not logical
append_pos(integer(0), "needs_suffix" = as.raw(c(0)))error_type::which: argument to 'which' is not logical
append_pos("names" = 2, "needs_suffix" = as.raw(c(0)))error_type::which: argument to 'which' is not logical
and 2 more
source
append_pos <- function(names, needs_suffix) {
  need_append_pos <- which(needs_suffix)
  names[need_append_pos] <- paste0(
    names[need_append_pos],
    "...",
    need_append_pos
  )
  names
}
R/names.R:362

describe_repair untypeabletyped

unbound variable (line 452)
unbound: names_inform_repair — a name the prelude does not declare
error detail
name: names_inform_repair
gradual mode: typed
((orig_names: any, names: any) -> any)<>
timing: 0.003 s
source
describe_repair <- function(orig_names, names) {
  names_inform_repair(orig_names, names)
}
R/names.R:451

re_match untypeable

untypeable application of base::regexpr (line 419)
error detail
argument: @('pattern & CHR, CHR<>, perl: tt<> | 'perl, ...: ('_ell, empty? | `_ell))
failing call: base::regexpr(NA_character_, NA_character_, perl = TRUE)
timing: 0.722 s
source
re_match <- function(text, pattern, perl = TRUE, ...) {
  stopifnot(
    is.character(pattern),
    length(pattern) == 1,
    !is.na(pattern)
  )
  text <- as.character(text)

  match <- regexpr(pattern, text, perl = perl, ...)

  start <- as.vector(match)
  length <- attr(match, "match.length")
  end <- start + length - 1L

  matchstr <- substring(text, start, end)
  matchstr[start == -1] <- NA_character_

  res <- data.frame(
    stringsAsFactors = FALSE,
    .text = text,
    .match = matchstr
  )

  if (!is.null(attr(match, "capture.start"))) {
    gstart <- attr(match, "capture.start")
    glength <- attr(match, "capture.length")
    gend <- gstart + glength - 1L

    groupstr <- substring(text, gstart, gend)
    groupstr[gstart == -1] <- NA_character_
    dim(groupstr) <- dim(gstart)

    res <- cbind(groupstr, res, stringsAsFactors = FALSE)
  }

  names(res) <- c(attr(match, "capture.names"), ".text", ".match")
  res
}
R/names.R:411

make_syntactic untypeabletyped

unbound variable (line 383)
unbound: make.names — a name the prelude does not declare
error detail
name: make.names
gradual mode: typed
((names: vec) -> CHR<>)<>
timing: 0.165 s
source
make_syntactic <- function(names) {
  names[is.na(names)] <- ""
  names[names == ""] <- "."
  names[names == "..."] <- "...."
  names <- sub("^_", "._", names)

  new_names <- make.names(names)

  X_prefix <- grepl("^X", new_names) & !grepl("^X", names)
  new_names[X_prefix] <- sub("^X", "", new_names[X_prefix])

  dot_suffix <- which(new_names == paste0(names, "."))
  new_names[dot_suffix] <- sub("^(.*)[.]$", ".\\1", new_names[dot_suffix])
  # Illegal characters have been replaced with '.' via make.names()
  # however, we have:
  #   * Declined its addition of 'X' prefixes.
  #   * Turned its '.' suffixes to '.' prefixes.

  regex <- paste0(
    "^(?<leading_dots>[.]{0,2})",
    "(?<numbers>[0-9]*)",
    "(?<leftovers>[^0-9]?.*$)"
  )

  re <- re_match(new_names, pattern = regex)
  needs_dots <- which(re$numbers != "")
  needs_third_dot <- (re$leftovers[needs_dots] == "")
  re$leading_dots[needs_dots] <- ifelse(needs_third_dot, "...", "..")
  new_names <- paste0(re$leading_dots, re$numbers, re$leftovers)

  new_names
}
R/names.R:377

strip_pos untypeabletyped

unbound variable
unbound: %|% — a name the prelude does not declare
error detail
name: %|%
gradual mode: typed
((names: vec) -> any)<>
timing: 0.022 s
source
strip_pos <- function(names) {
  rx <- "([.][.][.][1-9][0-9]*)+$"
  gsub(rx, "", names) %|% ""
}
R/names.R:371

two_to_three_dots typed accepts outside

(((names: vec) -> CHR<>)&((names: vec1) -> CHR1<>))<>
timing: 0.034 s
fuzzing: 7 inside (7 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain names: 3

parameterchangecallreturned
nameskind:symtwo_to_three_dots("names" = as.name("x"))"x"<> with { }
nameswraptwo_to_three_dots("names" = list(42L))"42"<> with { }
nameswraptwo_to_three_dots(list(-2147483647L))"-2147483647"<> with { }
source
two_to_three_dots <- function(names) {
  sub("(^[.][.][1-9][0-9]*$)", ".\\1", names)
}
R/names.R:359

as_universal_names untypeable

unbound variable (line 344)
unbound: strip_pos — one of the package’s own names, itself untyped
error detail
name: strip_pos
timing: 0.081 s
source
as_universal_names <- function(names, quiet = FALSE) {
  new_names <- names
  new_names[] <- ""

  naked_names <- strip_pos(two_to_three_dots(names))
  empty <- naked_names %in% c("", "...")

  new_names[!empty] <- make_syntactic(naked_names[!empty])

  needs_suffix <- empty | vec_duplicate_detect(new_names)
  new_names <- append_pos(new_names, needs_suffix = needs_suffix)

  if (!quiet) {
    describe_repair(names, new_names)
  }

  new_names
}
R/names.R:340

minimal_names untypeabletyped

unbound variable (line 322)
unbound: ffi_minimal_names — a native symbol tyr could not bind
error detail
name: ffi_minimal_names
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
minimal_names <- function(x) {
  .Call(ffi_minimal_names, x)
}
R/names.R:321

unique_names typed fuzz crash

((x: any_sexp, quiet: LGL?) -> any_sexp)<>
timing: 0.026 s
fuzzing: 8 inside (3 ok, 4 error type, 1 crash) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
unique_names("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "quiet" = TRUE)error_type::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
unique_names(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), TRUE)error_type::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
unique_names(quote(f(x)))error_type::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
unique_names("x" = function(...) as.name("x"))error_type::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
unique_names(c(0L, 1L), logical(0))crash
source
unique_names <- function(x, quiet = FALSE) {
  .Call(ffi_unique_names, x, quiet)
}
R/names.R:324

vec_names2 untypeable

unbound variable (line 277)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
timing: 0.043 s
source
vec_names2 <- function(
  x,
  ...,
  repair = c(
    "minimal",
    "unique",
    "universal",
    "check_unique",
    "unique_quiet",
    "universal_quiet"
  ),
  quiet = FALSE
) {
  check_dots_empty0(...)
  repair <- validate_name_repair_arg(repair)

  if (is_function(repair)) {
    names <- minimal_names(x)
    new_names <- validate_minimal_names(repair(names), n = length(names))

    if (!quiet) {
      describe_repair(names, new_names)
    }

    return(new_names)
  }

  switch(
    repair,
    minimal = minimal_names(x),
    unique = unique_names(x, quiet = quiet),
    universal = as_universal_names(minimal_names(x), quiet = quiet),
    check_unique = validate_unique(minimal_names(x)),
    unique_quiet = unique_names(x, quiet = TRUE),
    universal_quiet = as_universal_names(minimal_names(x), quiet = TRUE)
  )
}
R/names.R:264

vec_set_names untypeabletyped

unbound variable (line 488)
unbound: ffi_vec_set_names — a native symbol tyr could not bind
error detail
name: ffi_vec_set_names
gradual mode: typed
((x: any, names: any) -> any)<>
timing: 0.002 s
source
vec_set_names <- function(x, names) {
  .Call(ffi_vec_set_names, x, names)
}
R/names.R:487

vec_repair_names skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_repair_names <- function(
  x,
  repair = c(
    "minimal",
    "unique",
    "universal",
    "check_unique",
    "unique_quiet",
    "universal_quiet"
  ),
  ...,
  quiet = FALSE
) {
  if (is.data.frame(x)) {
    x
  } else {
    vec_set_names(x, vec_names2(x, ..., repair = repair, quiet = quiet))
  }
}
R/names.R:301

vec_names typed fuzz ok

((x: any_sexp) -> any_sexp)<>
timing: 0.009 s
fuzzing: 5 inside (5 ok) · 6 outside (6 rejected)
source
vec_names <- function(x) {
  .Call(vctrs_names, x)
}
R/names.R:330

as_minimal_names typed fuzz ok

∀'a. ((names: 'a & CHR) -> 'a)<>
timing: 0.014 s
fuzzing: 14 inside (14 ok) · 8 outside (8 rejected)
type drawn from: ((names: 'names & CHR) -> 'names)<>
source
as_minimal_names <- function(names) {
  .Call(ffi_as_minimal_names, names)
}
R/names.R:334

as_unique_names typed fuzz ok

((names: CHR, quiet: LGL?) -> any_sexp)<>
timing: 0.030 s
fuzzing: 8 inside (8 ok) · 8 outside (8 rejected)

Side effects

gzfile
source
as_unique_names <- function(names, quiet = FALSE) {
  .Call(vctrs_as_unique_names, names, quiet)
}
R/names.R:337

bullets untypeable

untypeable application of base::[[]]<- (line 460)
error detail
argument: @({ 'I114884 }<> | null, 6L<>, v: "..."<>)
failing call: base::[[]]<-(list(), 6L, v = "...")
timing: 0.229 s
source
bullets <- function(..., header = NULL) {
  problems <- c(...)
  MAX_BULLETS <- 6L
  if (length(problems) >= MAX_BULLETS) {
    n_more <- length(problems) - MAX_BULLETS + 1L
    problems[[MAX_BULLETS]] <- "..."
    length(problems) <- MAX_BULLETS
  }

  info <- paste0("* ", problems, collapse = "\n")

  if (!is.null(header)) {
    info <- paste0(header, "\n", info)
  }

  info
}
R/names.R:455

set_rownames_dispatch untypeabletyped

unbound variable (line 475)
unbound: rownames<- — a name the prelude does not declare
error detail
name: rownames<-
gradual mode: typed
((x: any, names: any) -> any)<>
timing: 0.003 s
source
set_rownames_dispatch <- function(x, names) {
  rownames(x) <- names
  x
}
R/names.R:474

set_names_dispatch typed unsound

∀'a. ((x: 'a, names: vec | null) -> 'a)<>
timing: 0.020 s
fuzzing: 20 inside (7 ok, 4 unsound, 7 error type, 2 invalid) · 8 outside (5 rejected, 3 accepted)
type drawn from: ((x: 'x, names: vec | null) -> 'x)<>

Counterexamples

callpredictedreturned
set_names_dispatch("x" = c(complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), NA_complex_, NA_complex_), "names" = 42)CLX<> with { }(CLX & ~vec1)<> with { names: (CHR & ~vec1)<> with { } }
set_names_dispatch("x" = as.raw(c(255, 0)), "names" = 42L)raw<> with { }(raw & ~vec1)<> with { names: (CHR & ~vec1)<> with { } }
set_names_dispatch(2147483647, "names" = raw(0))^DBL1<> with { }2147483647.<> with { names: na_string<> with { } }
set_names_dispatch(structure(numeric(0), "dim" = c(0L, 1L)), "names" = complex(0))DBL<> with { dim: INT<> with { } }(DBL & ~vec1)<> with { dim: (INT & ~vec1)<> with { }, names: (CHR & ~vec1)<> with { } }

Accepted outside the domain names: 3

parameterchangecallreturned
nameskind:listset_names_dispatch("x" = c(complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), NA_complex_, NA_complex_), "names" = list())(CLX & ~vec1)<> with { names: (CHR & ~vec1)<> with { } }
nameskind:symset_names_dispatch("x" = as.raw(c(255, 0)), "names" = as.name("x"))(raw & ~vec1)<> with { names: (CHR & ~vec1)<> with { } }
nameswrapset_names_dispatch(2147483647L, "names" = list(NULL))2147483647L<> with { names: "NULL"<> with { } }

Other calls inside the domain

callverdicterror
set_names_dispatch("x" = numeric(0), "names" = complex(real = 0, imaginary = 0))error_typebase::<-: 'names' attribute [1] must be the same length as the vector [0]
set_names_dispatch("x" = "x y", "names" = c(-2147483647L, 2L))error_typebase::<-: 'names' attribute [2] must be the same length as the vector [1]
set_names_dispatch(NULL, "names" = integer(0))error_typebase::<-: attempt to set an attribute on NULL
set_names_dispatch(as.name("x"), c(Inf, 42))error_typebase::<-: names() applied to a non-vector
set_names_dispatch(list(NULL, function(...) as.name("x")), "names" = NA)invalid
set_names_dispatch("x" = list("a" = NULL), "names" = NA_integer_)invalid
and 3 more
source
set_names_dispatch <- function(x, names) {
  names(x) <- names
  x
}
R/names.R:480

vec_as_names_legacy untypeabletyped

unbound variable (line 525)
unbound: make.unique — a name the prelude does not declare
error detail
name: make.unique
gradual mode: typed
((names: ""<@"[", ...>, prefix: any?, sep: any?) | (names: ""<~@"[", ...>, prefix: any?, sep: any?) | (names: (vec & ~"")<~@"[", ...>, prefix: any?, sep: any?) | (names: (~"")<@"[", ...>, prefix: any?, sep: any?) | (names: list<~@"[", ...>, prefix: any?, sep: any?) -> any)<>
timing: 0.297 s
source
vec_as_names_legacy <- function(names, prefix = "V", sep = "") {
  if (length(names) == 0) {
    return(character())
  }

  blank <- names == ""
  names[!blank] <- make.unique(names[!blank], sep = sep)

  new_nms <- setdiff(paste(prefix, seq_along(names), sep = sep), names)
  names[blank] <- new_nms[seq_len(sum(blank))]

  names
}
R/names.R:519

<statement> typed

timing: 0.000 s
source
NULL
R/names.R:622

apply_name_spec untypeabletyped

unbound variable (line 625)
unbound: ffi_apply_name_spec — a native symbol tyr could not bind
error detail
name: ffi_apply_name_spec
gradual mode: typed
((name_spec: any, outer: any, inner: any, n: any?) -> any)<>
timing: 0.030 s
source
apply_name_spec <- function(name_spec, outer, inner, n = length(inner)) {
  .Call(ffi_apply_name_spec, name_spec, outer, inner, n)
}
R/names.R:624

glue_as_name_spec untypeabletyped

unbound variable (line 630)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((_spec: any) -> ((inner: any, outer: any) -> any)<>)<>
timing: 0.006 s
source
glue_as_name_spec <- function(`_spec`) {
  function(inner, outer) {
    glue::glue(`_spec`)
  }
}
R/names.R:628

<statement> typed

timing: 0.000 s
source
environment(glue_as_name_spec) <- baseenv()
R/names.R:635
R/recycle.R

vec_recycle untypeabletyped

unbound variable (line 38)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: null, size: any_sexp, ...: any, x_arg: any?, call: any?) | (x: any_sexp, size: null, ...: any, x_arg: any?, call: any?) -> null)<>
timing: 0.009 s
source
vec_recycle <- function(x, size, ..., x_arg = "", call = caller_env()) {
  check_dots_empty0(...)
  .Call(ffi_recycle, x, size, environment())
}
R/recycle.R:38

vec_recycle_common untypeabletyped

unbound variable (line 49)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((...: any, .size: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.005 s
source
vec_recycle_common <- function(
  ...,
  .size = NULL,
  .arg = "",
  .call = caller_env()
) {
  .External2(ffi_recycle_common, list2(...), .size)
}
R/recycle.R:45
R/utils.R

str_dup typed any: times accepts outside

((x: list, times: any) | (x: null, times: any) | (x: vec, times: any) -> CHR1<>)<>
timing: 0.078 s
fuzzing: 8 inside (5 ok, 3 error type) · 7 outside (6 rejected, 1 accepted)

Accepted outside the domain times: 1

parameterchangecallreturned
timesdropstr_dup(character(0))""<> with { }

Other calls inside the domain

callverdicterror
str_dup("x" = list(NULL, NA), "times" = NULL)error_typebase::rep: invalid 'times' argument
str_dup("x" = list(-2.5), "times" = NULL)error_typebase::rep: invalid 'times' argument
str_dup(NA, "times" = new.env())error_type::paste0: environments cannot be coerced to other types
source
str_dup <- function(x, times) {
  paste0(rep(x, times = times), collapse = "")
}
R/utils.R:1

indent untypeabletyped

unbound variable (line 7)
unbound: map_chr — one of the package’s own names, itself untyped
error detail
name: map_chr
gradual mode: typed
((x: any, n: any) -> any)<>
timing: 0.057 s
source
indent <- function(x, n) {
  pad <- str_dup(" ", n)
  map_chr(x, gsub, pattern = "(\n+)", replacement = paste0("\\1", pad))
}
R/utils.R:5

ones untypeable

untypeable application of base::array (line 10)
error detail
argument: @(1.<>, dim: null)
failing call: base::array(1, dim = NULL)
timing: 0.056 s
source
ones <- function(...) {
  array(1, dim = c(...))
}
R/utils.R:10

ones_list untypeable

untypeable application of base::array (line 13)
error detail
argument: @({ 1.<> }<>, dim: null)
failing call: base::array(list(), dim = NULL)
timing: 0.059 s
source
ones_list <- function(...) {
  array(list(1), dim = c(...))
}
R/utils.R:13

vec_coerce_bare untypeabletyped

unbound variable (line 19)
unbound: ns_env — a name the prelude does not declare
error detail
name: ns_env
gradual mode: typed
((x: any, type: any) -> any)<>
timing: 0.004 s
source
vec_coerce_bare <- function(x, type) {
  # FIXME! Unexported wrapper around Rf_coerceVector()
  coerce <- env_get(ns_env("rlang"), "vec_coerce")
  coerce(x, type)
}
R/utils.R:17

outer_names untypeabletyped

unbound variable (line 27)
unbound: int — a name the prelude does not declare
error detail
name: int
gradual mode: typed
((names: any, outer: any, n: any) -> any)<>
timing: 0.005 s
source
outer_names <- function(names, outer, n) {
  .Call(ffi_outer_names, names, outer, vec_cast(n, int()))
}
R/utils.R:26

has_inner_names untypeable

unbound variable (line 31)
unbound: map — one of the package’s own names, itself untyped
error detail
name: map
timing: 0.011 s
source
has_inner_names <- function(x) {
  !all(map_lgl(map(x, vec_names), is.null))
}
R/utils.R:30

cat_line skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
cat_line <- function(...) {
  cat(paste0(..., "\n", collapse = ""))
}
R/utils.R:34

set_partition typed accepts outside

∀'a,'b,'c. (((x: null, y: null) -> { both: null, only_x: null, only_y: null }<>)&((x: null, y: v('a)) -> { both: null, only_x: null, only_y: v('a)<> }<>)&((x: null, y: v('c)) -> { both: null, only_x: null, only_y: v('c)<> }<>)&((x: v('a) & v('b), y: v('a) & v('c)) -> { both: v('a)<>, only_x: v('b)<>, only_y: v('c)<> }<>)&((x: v('a), y: null) -> { both: null, only_x: v('a)<>, only_y: null }<>)&((x: v('b), y: null) -> { both: null, only_x: v('b)<>, only_y: null }<>))<>
timing: 0.870 s
fuzzing: 20 inside (20 ok) · 8 outside (7 rejected, 1 accepted)
type drawn from: (((x: null, y: null) -> { both: null, only_x: null, only_y: null }<>) & ((x: null, y: v('I115129)) -> { both: null, only_x: null, only_y: v('I115129)<> }<>) & ((x: null, y: v('I115131)) -> { both: null, only_x: null, only_y: v('I115131)<> }<>) & ((x: v('I115129) & v('I115130), y: v('I115129) & v('I115131)) -> { both: v('I115129)<>, only_x: v('I115130)<>, only_y: v('I115131)<> }<>) & ((x: v('I115129), y: null) -> { both: null, only_x: v('I115129)<>, only_y: null }<>) & ((x: v('I115130), y: null) -> { both: null, only_x: v('I115130)<>, only_y: null }<>))<>

Accepted outside the domain y: 1

parameterchangecallreturned
ywrapset_partition("x" = c(-1L, 42L, -1L, 2L, 1000000L), "y" = list(NULL)){ both: { }<> with { }, only_x: (INT & ~vec1)<> with { }, only_y: { null }<> with { } }<> with { names: (CHR & ~vec1)<> with { } }
source
set_partition <- function(x, y) {
  list(
    both = intersect(x, y),
    only_x = setdiff(x, y),
    only_y = setdiff(y, x)
  )
}
R/utils.R:39

all_equal typed accepts outside

(((x: <@"[[", ...>) | (x: list<~@"[[", ...>) | (x: vec<~@"[[", ...>) -> LGL1<>) & ((x: { }<~@"[[", ...>) -> empty))<>
timing: 0.102 s
fuzzing: 6 inside (4 ok, 2 error type) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xkind:langall_equal("x" = quote(f(x)))ff<> with { }
xkind:nullall_equal("x" = NULL)tt<> with { }

Other calls inside the domain

callverdicterror
all_equal("x" = list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_typebase::==: comparison (==) is possible only for atomic and list types
all_equal("x" = logical(0))error_typebase::[[: subscript out of bounds
source
all_equal <- function(x) all(x == x[[1]])
R/utils.R:47

inline_list untypeable

untypeable application of base::- (line 50)
error detail
argument: @(null | 'width, INT<>)
failing call: base::-(NULL, NA_integer_)
timing: 0.596 s
source
inline_list <- function(title, x, width = getOption("width"), quote = "") {
  label_width <- width - nchar(title)
  x <- glue::glue_collapse(
    encodeString(x, quote = quote),
    sep = ", ",
    width = label_width
  )
  paste0(title, x)
}
R/utils.R:49

has_unique_names untypeabletyped

unbound variable (line 70)
unbound: anyDuplicated — a name the prelude does not declare
error detail
name: anyDuplicated
gradual mode: typed
((x: any) -> any)<>
timing: 0.029 s
source
has_unique_names <- function(x) {
  nms <- names(x)

  if (length(nms) != length(x)) {
    return(FALSE)
  }

  if (any(is.na(nms) | nms == "")) {
    return(FALSE)
  }

  !anyDuplicated(nms)
}
R/utils.R:59

compact untypeable

unbound variable (line 74)
unbound: map_lgl — one of the package’s own names, itself untyped
error detail
name: map_lgl
timing: 0.005 s
source
compact <- function(x) {
  is_null <- map_lgl(x, is.null)
  x[!is_null]
}
R/utils.R:73

paste_line untypeabletyped

unbound variable (line 79)
unbound: chr — a name the prelude does not declare
error detail
name: chr
gradual mode: typed
((...: any) -> CHR1<>)<>
timing: 0.003 s
source
paste_line <- function(...) {
  paste(chr(...), collapse = "\n")
}
R/utils.R:78

result typed any: ok fuzz ok

∀'a. (((ok: (null | 'a)?, err: 'a?) -> { null | 'a })&((ok: any?, err: 'a?) -> any))<>
timing: 0.048 s
fuzzing: 19 inside (19 ok) · 8 outside (8 rejected)
type drawn from: (((ok: (null | 'err)?, err: 'err?) -> { null | 'err }) & ((ok: any?, err: 'err?) -> any))<>
source
result <- function(ok = NULL, err = NULL) {
  structure(
    list(ok = ok, err = err),
    class = "rlang_result"
  )
}
R/utils.R:83

result_get untypeabletyped

unbound variable (line 90)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
∀'a. ((x: { err: any, ok: 'a, any }) -> 'a)<>
timing: 0.022 s
source
result_get <- function(x) {
  if (!is_null(x$err)) {
    cnd_signal(x$err)
  }
  x$ok
}
R/utils.R:89

obj_type untypeabletyped

unbound variable (line 97)
unbound: vec_is — one of the package’s own names, itself untyped
error detail
name: vec_is
gradual mode: typed
((x: any) -> any)<>
timing: 0.010 s
source
obj_type <- function(x) {
  if (vec_is(x)) {
    vec_ptype_full(x)
  } else if (is.object(x)) {
    paste(class(x), collapse = "/")
  } else if (is_function(x)) {
    "function"
  } else {
    typeof(x)
  }
}
R/utils.R:96

new_opts untypeable

unbound variable (line 110)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.080 s
source
new_opts <- function(x, opts, subclass = NULL, arg = NULL) {
  if (!all(x %in% opts)) {
    if (is_null(arg)) {
      arg <- "Argument"
    } else {
      arg <- glue::glue("`{arg}`")
    }
    opts <- encodeString(opts, quote = "\"")
    opts <- glue::glue_collapse(opts, sep = ", ", last = " or ")
    abort(glue::glue("{arg} must be one of {opts}."))
  }

  structure(
    set_names(opts %in% x, opts),
    class = c(subclass, "vctrs_opts")
  )
}
R/utils.R:108

glue_data_bullets skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
glue_data_bullets <- function(.data, ..., .env = caller_env()) {
  glue_data <- function(...) glue::glue_data(.data, ..., .envir = .env)
  format_error_bullets(map_chr(chr(...), glue_data))
}
R/utils.R:126

unstructure untypeabletyped

unbound variable (line 132)
unbound: attributes<- — a name the prelude does not declare
error detail
name: attributes<-
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
unstructure <- function(x) {
  attributes(x) <- NULL
  x
}
R/utils.R:131

data.frame skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
data.frame <- function(..., stringsAsFactors = NULL) {
  stringsAsFactors <- stringsAsFactors %||% FALSE
  base::data.frame(..., stringsAsFactors = stringsAsFactors)
}
R/utils.R:141

try_catch_callback typed fuzz crash

((data: externalptr, cnd: any_sexp) -> null)<>
timing: 0.016 s
fuzzing: 7 inside (7 crash) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
try_catch_callback("data" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "cnd" = NULL)crash
try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "cnd" = NULL)crash
try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), NULL)crash
try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "cnd" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))crash
try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "cnd" = as.name("x"))crash
try_catch_callback(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))crash
and 1 more
source
try_catch_callback <- function(data, cnd) {
  .Call(vctrs_try_catch_callback, data, cnd)
}
R/utils.R:146

try_catch_hnd typed accepts outside

((data: externalptr) -> ((cnd: any_sexp) -> null)<>)<>
timing: 0.019 s
fuzzing: 2 inside (2 unknown) · 7 outside (1 accepted, 6 not forced)

Accepted outside the domain data: 1

parameterchangecallreturned
datadroptry_catch_hnd()arrow<> with { srcref: (INT & ~vec1)<srcref> with { srcfile: env<srcfilealias, srcfile> with { } } }

Other calls inside the domain

callverdicterror
try_catch_hnd("data" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))unknown
try_catch_hnd(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))unknown
source
try_catch_hnd <- function(data) {
  function(cnd) {
    try_catch_callback(data, cnd)
  }
}
R/utils.R:150

try_catch_impl untypeabletyped

unbound variable (line 156)
unbound: tryCatch — a name the prelude does not declare
error detail
name: tryCatch
gradual mode: typed
((data: externalptr, ...: any) -> any)<>
timing: 0.008 s
source
try_catch_impl <- function(data, ...) {
  tryCatch(
    try_catch_callback(data, NULL),
    ...
  )
}
R/utils.R:155

ns_methods untypeabletyped

unbound variable (line 163)
unbound: ns_env — a name the prelude does not declare
error detail
name: ns_env
gradual mode: typed
((name: any) -> any)<>
timing: 0.001 s
source
ns_methods <- function(name) {
  ns_env(name)$.__S3MethodsTable__.
}
R/utils.R:162

s3_find_method untypeabletyped

unbound variable (line 168)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((x: any, generic: any, ns: any?) -> any)<>
timing: 0.007 s
source
s3_find_method <- function(x, generic, ns = "base") {
  stopifnot(
    is_string(generic),
    is_string(ns)
  )
  table <- ns_methods(ns_env(ns))
  .Call(vctrs_s3_find_method, generic, x, table)
}
R/utils.R:166

s3_get_method untypeabletyped

unbound variable (line 176)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((class: any, generic: any, ns: any?) -> any)<>
timing: 0.007 s
source
s3_get_method <- function(class, generic, ns = "base") {
  stopifnot(
    is_string(class),
    is_string(generic),
    is_string(ns)
  )
  table <- ns_methods(ns_env(ns))
  .Call(ffi_s3_get_method, generic, class, table)
}
R/utils.R:174

s3_method_specific untypeabletyped

unbound variable (line 192)
unbound: s3_get_method — one of the package’s own names, itself untyped
error detail
name: s3_get_method
gradual mode: typed
((x: any, generic: any, ns: any?, default: any?) -> any)<>
timing: 0.116 s
source
s3_method_specific <- function(x, generic, ns = "base", default = TRUE) {
  classes <- class(x)[[1]]

  if (default) {
    classes <- c(classes, "default")
  }

  for (class in classes) {
    method <- s3_get_method(class, generic, ns = ns)
    if (!is_null(method)) {
      return(method)
    }
  }

  cli::cli_abort("Can't find {.fn {generic}} method for {.cls {class}}.")
}
R/utils.R:184

df_has_base_subset untypeabletyped

unbound variable (line 202)
unbound: s3_find_method — one of the package’s own names, itself untyped
error detail
name: s3_find_method
gradual mode: typed
((x: any) -> ff<> | tt<>)<>
timing: 0.003 s
source
df_has_base_subset <- function(x) {
  method <- s3_find_method(x, "[", ns = "base")
  is_null(method) || identical(method, `[.data.frame`)
}
R/utils.R:201

last typed accepts outside

∀'a,'b. (((x: <@"[[", ...>) -> any) & ((x: v('b)<~@"[[", ...>) -> v1('b)<>) & ((x: { 'a }<~@"[[", ...>) -> 'a))<>
timing: 0.053 s
fuzzing: 13 inside (9 ok, 4 error type) · 8 outside (6 rejected, 2 accepted)
type drawn from: (((x: <@"[[", ...>) -> any) & ((x: v('I115473)<~@"[[", ...>) -> v1('I115473)<>) & ((x: { 'I115461 }<~@"[[", ...>) -> 'I115461))<>

Accepted outside the domain x: 2

parameterchangecallreturned
xkind:langlast(quote(f(x)))sym
xkind:nulllast(NULL)null

Other calls inside the domain

callverdicterror
last("x" = raw(0))error_typebase::[[: attempt to select less than one element in integerOneIndex
last("x" = numeric(0))error_typebase::[[: attempt to select less than one element in integerOneIndex
last("x" = list())error_typebase::[[: attempt to select less than one element in integerOneIndex
last("x" = complex(0))error_typebase::[[: attempt to select less than one element in integerOneIndex
source
last <- function(x) {
  x[[length(x)]]
}
R/utils.R:206

vec_common_suffix untypeable

unbound variable (line 212)
unbound: vec_cast_common — one of the package’s own names, itself untyped
error detail
name: vec_cast_common
timing: 0.040 s
source
vec_common_suffix <- function(x, y) {
  common <- vec_cast_common(x = x, y = y)
  x <- common$x
  y <- common$y

  x_size <- vec_size(x)
  y_size <- vec_size(y)
  n <- min(x_size, y_size)

  if (!n) {
    return(vec_slice(x, int()))
  }

  # Truncate the start of the vectors so they have equal size
  if (x_size < y_size) {
    y <- vec_slice(y, seq2(y_size - x_size + 1, y_size))
  } else if (y_size < x_size) {
    x <- vec_slice(x, seq2(x_size - y_size + 1, x_size))
  }

  # Find locations of unequal elements. Elements after the last
  # location are the common suffix.
  common <- vec_equal(x, y)
  i <- which(!common)

  # Slice the suffix after the last unequal element
  if (length(i)) {
    vec_slice(x, seq2(max(i) + 1, n))
  } else {
    x
  }
}
R/utils.R:211

import_from untypeabletyped

unbound variable (line 244)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((ns: any, names: any, env: any?) -> any)<>
timing: 0.010 s
source
import_from <- function(ns, names, env = caller_env()) {
  objs <- env_get_list(ns_env(ns), names)
  env_bind(env, !!!objs)
}
R/utils.R:244

fast_c typed fuzz ok

∀'a,'b. (((x: 'b & ((~(CHR & ~CHR1))<...> | sym | null), y: 'a & null) -> 'b & ((externalptr | vec1 | arrow) | sym))&((x: 'b & ((~CHR)<...> | sym | null), y: 'a & any_sexp) -> empty)&((x: 'b & (p(CHR) | (~CHR)<...> | sym | null), y: 'a & null) -> null & 'a | p(CHR) & 'b)&((x: 'b & any_sexp, y: 'a & null) -> null & 'a | 'b & (<...> | p(CHR) | sym)))<>
timing: 0.138 s
fuzzing: 20 inside (18 ok, 2 error pkg) · 8 outside (8 rejected)
type drawn from: (((x: 'x & ((~(CHR & ~CHR1))<...> | sym | null), y: 'y & null) -> 'x & ((externalptr | vec1 | arrow) | sym)) & ((x: 'x & ((~CHR)<...> | sym | null), y: 'y & any_sexp) -> empty) & ((x: 'x & (p(CHR) | (~CHR)<...> | sym | null), y: 'y & null) -> null & 'y | p(CHR) & 'x) & ((x: 'x & any_sexp, y: 'y & null) -> null & 'y | 'x & (<...> | p(CHR) | sym)))<>

Other calls inside the domain

callverdicterror
fast_c(NA_character_, "y" = NULL)error_pkgvctrs::fast_c: `x` and `y` must have the same types.
fast_c("x y", "y" = NULL)error_pkgvctrs::fast_c: `x` and `y` must have the same types.
source
fast_c <- function(x, y) {
  .Call(vctrs_fast_c, x, y)
}
R/utils.R:249

tolerance untypeabletyped

unbound variable (line 297)
unbound: sqrt — a name the prelude does not declare
error detail
name: sqrt
gradual mode: typed
any
timing: 0.007 s
source
tolerance <- sqrt(.Machine$double.eps)
R/utils.R:297

byte_units typed

DBL | null
timing: 0.065 s
source
byte_units <- c(
  'B' = 1,
  'K' = 1024,
  'M' = 1024^2,
  'G' = 1024^3,
  'T' = 1024^4,
  'P' = 1024^5,
  'E' = 1024^6,
  'Z' = 1024^7,
  'Y' = 1024^8
)
R/utils.R:306

find_unit skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
find_unit <- function(x, units) {
  if (is.na(x) || is.nan(x) || x <= 0 || is.infinite(x)) {
    return(NA_character_)
  }
  epsilon <- 1 - (x * (1 / units))
  names(utils::tail(n = 1, which(epsilon < tolerance)))
}
R/utils.R:298

format.vctrs_bytes untypeabletyped

unbound variable (line 266)
unbound: find_unit — one of the package’s own names, itself untyped
error detail
name: find_unit
gradual mode: typed
((x: (~0)<...>, scientific: any?, digits: any?, drop0trailing: any?, ...: any) | (x: 0, scientific: any?, digits: any?, drop0trailing: any?, ...: any) -> any)<>
timing: 0.069 s
source
format.vctrs_bytes <- function(
  x,
  scientific = FALSE,
  digits = 3,
  drop0trailing = TRUE,
  ...
) {
  nms <- names(x)

  bytes <- unclass(x)

  unit <- map_chr(x, find_unit, byte_units)
  res <- round(bytes / byte_units[unit], digits = digits)

  ## Zero bytes
  res[bytes == 0] <- 0
  unit[bytes == 0] <- "B"

  ## NA and NaN bytes
  res[is.na(bytes)] <- NA_real_
  res[is.nan(bytes)] <- NaN
  unit[is.na(bytes)] <- "" # Includes NaN as well

  # Append an extra B to each unit
  large_units <- unit %in% names(byte_units)[-1]
  unit[large_units] <- paste0(unit[large_units], "B")

  res <- format(
    res,
    scientific = scientific,
    digits = digits,
    drop0trailing = drop0trailing,
    ...
  )

  stats::setNames(paste0(res, unit), nms)
}
R/utils.R:255

print.vctrs_bytes typed any: x fuzz ok

(((x: any, ...: any) -> CHR<>)&((x: vec1, ...: any) -> CHR1<>))<>
timing: 0.028 s
fuzzing: 8 inside (8 ok) · 4 outside (4 rejected)
source
print.vctrs_bytes <- function(x, ...) {
  print(format(x, ...), quote = FALSE)
}
R/utils.R:293

new_vctrs_bytes typed any: x fuzz ok

∀'a,'b. (((x: any) -> any)&((x: v('b)) -> v('b))&((x: { 'a }) -> { 'a }))<>
timing: 0.047 s
fuzzing: 20 inside (18 ok, 2 error type) · 8 outside (8 rejected)
type drawn from: (((x: any) -> any) & ((x: v('I115581)) -> v('I115581)) & ((x: { 'I115580 }) -> { 'I115580 }))<>

Other calls inside the domain

callverdicterror
new_vctrs_bytes("x" = as.name("x"))error_typebase::<-: cannot set an attribute on a 'symbol'
new_vctrs_bytes("x" = NULL)error_type::structure: attempt to set an attribute on NULL
source
new_vctrs_bytes <- function(x) {
  structure(x, class = c("vctrs_bytes", "numeric"))
}
R/utils.R:318

named untypeabletyped

unbound variable (line 323)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any) -> any)<>
timing: 0.006 s
source
named <- function(x) {
  if (is_null(names(x))) {
    names(x) <- names2(x)
  }
  x
}
R/utils.R:322

browser skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
browser <- function(..., skipCalls = 0, frame = parent.frame()) {
  if (!identical(stdout(), getConnection(1))) {
    sink(getConnection(1))
    withr::defer(sink(), envir = frame)
  }

  # Calling `browser()` on exit avoids RStudio displaying the
  # `browser2()` location. We still need one `n` to get to the
  # expected place. Ideally `skipCalls` would not skip but exit the
  # contexts.
  on.exit(base::browser(..., skipCalls = skipCalls + 1))
}
R/utils.R:329

vec_paste0 untypeable

unbound variable (line 343)
unbound: vec_recycle_common — one of the package’s own names, itself untyped
error detail
name: vec_recycle_common
timing: 0.006 s
source
vec_paste0 <- function(...) {
  args <- vec_recycle_common(...)
  exec(paste0, !!!args)
}
R/utils.R:342

vec_set_attributes untypeabletyped

unbound variable (line 351)
unbound: attributes<- — a name the prelude does not declare
error detail
name: attributes<-
gradual mode: typed
((x: any, attrib: any) -> any)<>
timing: 0.002 s
source
vec_set_attributes <- function(x, attrib) {
  attributes(x) <- attrib
  x
}
R/utils.R:350
R/import-standalone-obj-type.R

.rlang_as_friendly_type skipped

error detail
File "Rsem/lang/PAst.ml", line 145, characters 25-31: Assertion failed
timing: 0.000 s
source
.rlang_as_friendly_type <- function(type) {
  switch(
    type,

    list = "a list",

    NULL = "`NULL`",
    environment = "an environment",
    externalptr = "a pointer",
    weakref = "a weak reference",
    S4 = "an S4 object",

    name = ,
    symbol = "a symbol",
    language = "a call",
    pairlist = "a pairlist node",
    expression = "an expression vector",

    char = "an internal string",
    promise = "an internal promise",
    ... = "an internal dots object",
    any = "an internal `any` object",
    bytecode = "an internal bytecode object",

    primitive = ,
    builtin = ,
    special = "a primitive function",
    closure = "a function",

    type
  )
}
R/import-standalone-obj-type.R:235

.rlang_stop_unexpected_typeof untypeabletyped

unbound variable (line 268)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, call: any?) -> any)<>
timing: 0.005 s
source
.rlang_stop_unexpected_typeof <- function(x, call = caller_env()) {
  abort(
    sprintf("Unexpected type <%s>.", typeof(x)),
    call = call
  )
}
R/import-standalone-obj-type.R:268

vec_type_friendly untypeabletyped

unbound variable (line 179)
unbound: is_vector — a name the prelude does not declare
error detail
name: is_vector
gradual mode: typed
((x: list, length: any?) -> CHR1<>)<>
timing: 0.269 s
source
vec_type_friendly <- function(x, length = FALSE) {
  if (!is_vector(x)) {
    abort("`x` must be a vector.")
  }
  type <- typeof(x)
  n_dim <- length(dim(x))

  add_length <- function(type) {
    if (length && !n_dim) {
      paste0(type, sprintf(" of length %s", length(x)))
    } else {
      type
    }
  }

  if (type == "list") {
    if (n_dim == 0) {
      return(add_length("a list"))
    } else if (n_dim == 2) {
      if (is.data.frame(x)) {
        return("a data frame")
      } else {
        return("a list matrix")
      }
    } else {
      return(sprintf("a list %sD array", n_dim))
    }
  }

  type <- switch(
    type,
    logical = "a logical %s",
    integer = "an integer %s",
    numeric = ,
    double = "a double %s",
    complex = "a complex %s",
    character = "a character %s",
    raw = "a raw %s",
    type = paste0("a ", type, " %s")
  )

  if (n_dim == 0) {
    kind <- "vector"
  } else if (n_dim == 2) {
    kind <- "matrix"
  } else {
    kind <- sprintf("%sD array", n_dim)
  }
  out <- sprintf(type, kind)

  if (n_dim >= 2) {
    out
  } else {
    add_length(out)
  }
}
R/import-standalone-obj-type.R:178

obj_type_friendly skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.002 s
source
obj_type_friendly <- function(x, value = TRUE) {
  if (is_missing(x)) {
    return("absent")
  }

  if (is.object(x)) {
    if (inherits(x, "quosure")) {
      type <- "quosure"
    } else {
      type <- class(x)[[1L]]
    }
    return(sprintf("a <%s> object", type))
  }

  if (!is_vector(x)) {
    return(.rlang_as_friendly_type(typeof(x)))
  }

  n_dim <- length(dim(x))

  if (!n_dim) {
    if (!is_list(x) && length(x) == 1) {
      if (is_na(x)) {
        return(switch(
          typeof(x),
          logical = "`NA`",
          integer = "an integer `NA`",
          double = if (is.nan(x)) {
            "`NaN`"
          } else {
            "a numeric `NA`"
          },
          complex = "a complex `NA`",
          character = "a character `NA`",
          .rlang_stop_unexpected_typeof(x)
        ))
      }

      show_infinites <- function(x) {
        if (x > 0) {
          "`Inf`"
        } else {
          "`-Inf`"
        }
      }
      str_encode <- function(x, width = 30, ...) {
        if (nchar(x) > width) {
          x <- substr(x, 1, width - 3)
          x <- paste0(x, "...")
        }
        encodeString(x, ...)
      }

      if (value) {
        if (is.numeric(x) && is.infinite(x)) {
          return(show_infinites(x))
        }

        if (is.numeric(x) || is.complex(x)) {
          number <- as.character(round(x, 2))
          what <- if (is.complex(x)) "the complex number" else "the number"
          return(paste(what, number))
        }

        return(switch(
          typeof(x),
          logical = if (x) "`TRUE`" else "`FALSE`",
          character = {
            what <- if (nzchar(x)) "the string" else "the empty string"
            paste(what, str_encode(x, quote = "\""))
          },
          raw = paste("the raw value", as.character(x)),
          .rlang_stop_unexpected_typeof(x)
        ))
      }

      return(switch(
        typeof(x),
        logical = "a logical value",
        integer = "an integer",
        double = if (is.infinite(x)) show_infinites(x) else "a number",
        complex = "a complex number",
        character = if (nzchar(x)) "a string" else "\"\"",
        raw = "a raw value",
        .rlang_stop_unexpected_typeof(x)
      ))
    }

    if (length(x) == 0) {
      return(switch(
        typeof(x),
        logical = "an empty logical vector",
        integer = "an empty integer vector",
        double = "an empty numeric vector",
        complex = "an empty complex vector",
        character = "an empty character vector",
        raw = "an empty raw vector",
        list = "an empty list",
        .rlang_stop_unexpected_typeof(x)
      ))
    }
  }

  vec_type_friendly(x)
}
R/import-standalone-obj-type.R:72

obj_type_oo untypeabletyped

unbound variable (line 281)
unbound: is.object — a name the prelude does not declare
error detail
name: is.object
gradual mode: typed
((x: any) -> "R6"<> | "S3"<> | "S4"<> | "S7"<> | "bare"<>)<>
timing: 1.01 s
source
obj_type_oo <- function(x) {
  if (!is.object(x)) {
    return("bare")
  }

  class <- inherits(x, c("R6", "S7_object"), which = TRUE)

  if (class[[1]]) {
    "R6"
  } else if (class[[2]]) {
    "S7"
  } else if (isS4(x)) {
    "S4"
  } else {
    "S3"
  }
}
R/import-standalone-obj-type.R:280

oxford_comma typed any: final accepts outside

∀'a,'b. ((chr: CHR<> | 'a & (CHR | v('b))<~@"[", ...>, sep: (vec1 | null)?, final: any?) -> CHR<> | (CHR | v('b))<~@"[", ...> & 'a)<>
timing: 0.561 s
fuzzing: 20 inside (15 ok, 5 error type) · 8 outside (4 rejected, 3 accepted, 1 not forced)
type drawn from: ((chr: CHR<> | 'chr & (CHR | v('I115783))<~@"[", ...>, sep: (vec1 | null)?, final: any?) -> CHR<> | (CHR | v('I115783))<~@"[", ...> & 'chr)<>

Accepted outside the domain chr: 3

parameterchangecallreturned
chrkind:envoxford_comma("chr" = new.env(), "sep" = NULL)env<> with { }
chrwrapoxford_comma("chr" = list(c("é", ""))){ (CHR & ~vec1)<> with { } }<> with { }
chrwrapoxford_comma(list("x y"), "sep" = NA_complex_, "final" = function(...) as.name("x")){ "x y"<> with { } }<> with { }

Other calls inside the domain

callverdicterror
oxford_comma("chr" = c(NA_character_, "x y"), "sep" = -Inf)error_type::paste: invalid 'collapse' argument
oxford_comma(c("NA", "NA", "", "x y", ""), Inf)error_type::paste: invalid 'collapse' argument
oxford_comma(c("a", "NA"), TRUE, "final" = NA)error_type::paste: invalid 'collapse' argument
oxford_comma(c("é", NA_character_), complex(real = 1, imaginary = -2), quote(f(x)))error_type::paste: invalid 'collapse' argument
oxford_comma(c("a", NA_character_), 1000000, NULL)error_type::paste: invalid 'collapse' argument
source
oxford_comma <- function(chr, sep = ", ", final = "or") {
  n <- length(chr)

  if (n < 2) {
    return(chr)
  }

  head <- chr[seq_len(n - 1)]
  last <- chr[n]

  head <- paste(head, collapse = sep)

  # Write a or b. But a, b, or c.
  if (n > 2) {
    paste0(head, sep, final, " ", last)
  } else {
    paste0(head, " ", final, " ", last)
  }
}
R/import-standalone-obj-type.R:350

stop_input_type skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_input_type <- function(
  x,
  what,
  ...,
  allow_na = FALSE,
  allow_null = FALSE,
  show_value = TRUE,
  arg = caller_arg(x),
  call = caller_env()
) {
  # From standalone-cli.R
  cli <- env_get_list(
    nms = c("format_arg", "format_code"),
    last = topenv(),
    default = function(x) sprintf("`%s`", x),
    inherit = TRUE
  )

  if (allow_na) {
    what <- c(what, cli$format_code("NA"))
  }
  if (allow_null) {
    what <- c(what, cli$format_code("NULL"))
  }
  if (length(what)) {
    what <- oxford_comma(what)
  }
  if (inherits(arg, "AsIs")) {
    format_arg <- identity
  } else {
    format_arg <- cli$format_arg
  }

  message <- sprintf(
    "%s must be %s, not %s.",
    format_arg(arg),
    what,
    obj_type_friendly(x, value = show_value)
  )

  abort(message, ..., call = call, arg = arg)
}
R/import-standalone-obj-type.R:307
R/import-standalone-types-check.R

.standalone_types_check_dot_call untypeabletyped

unbound variable (line 69)
unbound: .Call — a name the prelude does not declare
error detail
name: .Call
gradual mode: typed
any
timing: 0.000 s
source
.standalone_types_check_dot_call <- .Call
R/import-standalone-types-check.R:69

check_bool skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_bool <- function(
  x,
  ...,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (
    !missing(x) &&
      .standalone_types_check_dot_call(
        ffi_standalone_is_bool_1.0.7,
        x,
        allow_na,
        allow_null
      )
  ) {
    return(invisible(NULL))
  }

  stop_input_type(
    x,
    c("`TRUE`", "`FALSE`"),
    ...,
    allow_na = allow_na,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:71

.rlang_check_is_string untypeabletyped

unbound variable (line 135)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((x: any, allow_empty: any, allow_na: any, allow_null: any) -> ff<> | tt<>)<>
timing: 0.082 s
source
.rlang_check_is_string <- function(x, allow_empty, allow_na, allow_null) {
  if (is_string(x)) {
    if (allow_empty || !is_string(x, "")) {
      return(TRUE)
    }
  }

  if (allow_null && is_null(x)) {
    return(TRUE)
  }

  if (allow_na && (identical(x, NA) || identical(x, na_chr))) {
    return(TRUE)
  }

  FALSE
}
R/import-standalone-types-check.R:134

check_string skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_string <- function(
  x,
  ...,
  allow_empty = TRUE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    is_string <- .rlang_check_is_string(
      x,
      allow_empty = allow_empty,
      allow_na = allow_na,
      allow_null = allow_null
    )
    if (is_string) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a single string",
    ...,
    allow_na = allow_na,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:102

check_name skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_name <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    is_string <- .rlang_check_is_string(
      x,
      allow_empty = FALSE,
      allow_na = FALSE,
      allow_null = allow_null
    )
    if (is_string) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a valid name",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:152

IS_NUMBER_true typed

0.<>
timing: 0.002 s
source
IS_NUMBER_true <- 0
R/import-standalone-types-check.R:182

IS_NUMBER_false typed

1.<>
timing: 0.002 s
source
IS_NUMBER_false <- 1
R/import-standalone-types-check.R:183

IS_NUMBER_oob typed

2.<>
timing: 0.002 s
source
IS_NUMBER_oob <- 2
R/import-standalone-types-check.R:184

.stop_not_number skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
.stop_not_number <- function(
  x,
  ...,
  exit_code,
  allow_decimal,
  min,
  max,
  allow_na,
  allow_null,
  arg,
  call
) {
  if (allow_decimal) {
    what <- "a number"
  } else {
    what <- "a whole number"
  }

  if (exit_code == IS_NUMBER_oob) {
    min <- min %||% -Inf
    max <- max %||% Inf

    if (min > -Inf && max < Inf) {
      what <- sprintf("%s between %s and %s", what, min, max)
    } else if (x < min) {
      what <- sprintf("%s larger than or equal to %s", what, min)
    } else if (x > max) {
      what <- sprintf("%s smaller than or equal to %s", what, max)
    } else {
      abort("Unexpected state in OOB check", .internal = TRUE)
    }
  }

  stop_input_type(
    x,
    what,
    ...,
    allow_na = allow_na,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:272

check_number_decimal skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_number_decimal <- function(
  x,
  ...,
  min = NULL,
  max = NULL,
  allow_infinite = TRUE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (missing(x)) {
    exit_code <- IS_NUMBER_false
  } else if (
    0 ==
      (exit_code <- .standalone_types_check_dot_call(
        ffi_standalone_check_number_1.0.7,
        x,
        allow_decimal = TRUE,
        min,
        max,
        allow_infinite,
        allow_na,
        allow_null
      ))
  ) {
    return(invisible(NULL))
  }

  .stop_not_number(
    x,
    ...,
    exit_code = exit_code,
    allow_decimal = TRUE,
    min = min,
    max = max,
    allow_na = allow_na,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:186

check_number_whole skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_number_whole <- function(
  x,
  ...,
  min = NULL,
  max = NULL,
  allow_infinite = FALSE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (missing(x)) {
    exit_code <- IS_NUMBER_false
  } else if (
    0 ==
      (exit_code <- .standalone_types_check_dot_call(
        ffi_standalone_check_number_1.0.7,
        x,
        allow_decimal = FALSE,
        min,
        max,
        allow_infinite,
        allow_na,
        allow_null
      ))
  ) {
    return(invisible(NULL))
  }

  .stop_not_number(
    x,
    ...,
    exit_code = exit_code,
    allow_decimal = FALSE,
    min = min,
    max = max,
    allow_na = allow_na,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:229

check_symbol skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_symbol <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_symbol(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a symbol",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:316

check_arg skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_arg <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_symbol(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "an argument name",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:343

check_call skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_call <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_call(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a defused call",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:370

check_environment skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_environment <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_environment(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "an environment",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:397

check_function skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_function <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_function(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a function",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:424

check_closure skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_closure <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_closure(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "an R function",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:451

check_formula skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_formula <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_formula(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a formula",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:478

check_character skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_character <- function(
  x,
  ...,
  allow_na = TRUE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_character(x)) {
      if (!allow_na && any(is.na(x))) {
        abort(
          sprintf("`%s` can't contain NA values.", arg),
          arg = arg,
          call = call
        )
      }

      return(invisible(NULL))
    }

    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a character vector",
    ...,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:510

check_logical skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_logical <- function(
  x,
  ...,
  allow_na = TRUE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is_logical(x)) {
      if (!allow_na && any(is.na(x))) {
        abort(
          sprintf("`%s` can't contain NA values.", arg),
          arg = arg,
          call = call
        )
      }
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a logical vector",
    ...,
    allow_na = FALSE,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:546

check_data_frame skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
check_data_frame <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!missing(x)) {
    if (is.data.frame(x)) {
      return(invisible(NULL))
    }
    if (allow_null && is_null(x)) {
      return(invisible(NULL))
    }
  }

  stop_input_type(
    x,
    "a data frame",
    ...,
    allow_null = allow_null,
    arg = arg,
    call = call
  )
}
R/import-standalone-types-check.R:581
R/compare.R

vec_proxy_compare untypeabletyped

unbound variable (line 61)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_proxy_compare <- function(x, ...) {
  check_dots_empty0(...)
  return(.Call(vctrs_proxy_compare, x))
  UseMethod("vec_proxy_compare")
}
R/compare.R:60

vec_proxy_compare.default untypeabletyped

unbound variable (line 67)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_compare.default <- function(x, ...) {
  stop_native_implementation("vec_proxy_compare.default")
}
R/compare.R:66

vec_proxy_order untypeabletyped

unbound variable (line 73)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_proxy_order <- function(x, ...) {
  check_dots_empty0(...)
  return(.Call(vctrs_proxy_order, x))
  UseMethod("vec_proxy_order")
}
R/compare.R:72

vec_proxy_order.default untypeabletyped

unbound variable (line 80)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_order.default <- function(x, ...) {
  stop_native_implementation("vec_proxy_order.default")
}
R/compare.R:79

vec_compare untypeable

unbound variable (line 115)
unbound: obj_check_vector — one of the package’s own names, itself untyped
error detail
name: obj_check_vector
timing: 0.017 s
source
vec_compare <- function(x, y, na_equal = FALSE, .ptype = NULL) {
  obj_check_vector(x)
  obj_check_vector(y)
  check_bool(na_equal)

  args <- vec_recycle_common(x, y)
  args <- vec_cast_common_params(!!!args, .to = .ptype)

  .Call(
    ffi_vec_compare,
    vec_proxy_compare(args[[1]]),
    vec_proxy_compare(args[[2]]),
    na_equal
  )
}
R/compare.R:114

cmp typed accepts outside

(((x: vec, y: vec) -> INT<>)&((x: vec1, y: vec1) -> INT1<>))<>
timing: 0.105 s
fuzzing: 8 inside (6 ok, 2 error type) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain y: 1

parameterchangecallreturned
ywrapcmp("x" = 0, "y" = list(TRUE))-1L<> with { }

Other calls inside the domain

callverdicterror
cmp(complex(real = 1, imaginary = -2), 1000000)error_typebase::>: invalid comparison with complex values
cmp(42L, "y" = c(complex(real = 1, imaginary = -2), complex(real = 0, imaginary = 0), NA_complex_, NA_complex_, complex(real = 0, imaginary = 0)))error_typebase::>: invalid comparison with complex values
source
cmp <- function(x, y) (x > y) - (x < y)
R/compare.R:134
R/type-asis.R

<statement> typed

timing: 0.000 s
source
NULL
R/type-asis.R:8

asis_strip typed no call in domain

∀'a. ((x: 'a<...>) -> 'a<...>)<>
timing: 0.022 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: ((x: 'I116119<...>) -> 'I116119<...>)<>
source
asis_strip <- function(x) {
  class(x) <- setdiff(class(x), "AsIs")
  x
}
R/type-asis.R:110

vec_ptype_full.AsIs untypeabletyped

unbound variable (line 16)
unbound: vec_ptype_full — one of the package’s own names, itself untyped
error detail
name: vec_ptype_full
gradual mode: typed
((x: <...>, ...: any) -> CHR<>)<>
timing: 0.009 s
source
vec_ptype_full.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  paste0("I<", vec_ptype_full(x), ">")
}
R/type-asis.R:14

vec_ptype_abbr.AsIs untypeabletyped

unbound variable (line 22)
unbound: vec_ptype_abbr — one of the package’s own names, itself untyped
error detail
name: vec_ptype_abbr
gradual mode: typed
((x: <...>, ...: any) -> CHR<>)<>
timing: 0.009 s
source
vec_ptype_abbr.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  paste0("I<", vec_ptype_abbr(x), ">")
}
R/type-asis.R:20

vec_proxy.AsIs untypeable

unbound variable (line 33)
unbound: vec_proxy — one of the package’s own names, itself untyped
error detail
name: vec_proxy
timing: 0.007 s
source
vec_proxy.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  vec_proxy(x)
}
R/type-asis.R:31

asis_restore untypeabletyped

unbound variable (line 118)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
gradual mode: typed
((x: any) -> any)<>
timing: 0.003 s
source
asis_restore <- function(x) {
  # Using `oldClass()` here to return `NULL` for atomics
  # so that their implicit class isn't added
  class(x) <- c("AsIs", oldClass(x))
  x
}
R/type-asis.R:115

vec_restore.AsIs untypeabletyped

unbound variable (line 38)
unbound: asis_restore — one of the package’s own names, itself untyped
error detail
name: asis_restore
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.AsIs <- function(x, to, ...) {
  asis_restore(x)
}
R/type-asis.R:37

vec_proxy_equal.AsIs untypeabletyped

unbound variable (line 44)
unbound: vec_proxy_equal — one of the package’s own names, itself untyped
error detail
name: vec_proxy_equal
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.007 s
source
vec_proxy_equal.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  vec_proxy_equal(x)
}
R/type-asis.R:42

vec_proxy_compare.AsIs untypeabletyped

unbound variable (line 50)
unbound: vec_proxy_compare — one of the package’s own names, itself untyped
error detail
name: vec_proxy_compare
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.007 s
source
vec_proxy_compare.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  vec_proxy_compare(x)
}
R/type-asis.R:48

vec_proxy_order.AsIs untypeabletyped

unbound variable (line 56)
unbound: vec_proxy_order — one of the package’s own names, itself untyped
error detail
name: vec_proxy_order
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.007 s
source
vec_proxy_order.AsIs <- function(x, ...) {
  x <- asis_strip(x)
  vec_proxy_order(x)
}
R/type-asis.R:54

vec_ptype2.AsIs untypeabletyped

unbound variable (line 67)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.AsIs <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.AsIs")
}
R/type-asis.R:66

vec_ptype2_asis untypeabletyped

unbound variable (line 86)
unbound: vec_ptype2 — one of the package’s own names, itself untyped
error detail
name: vec_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_asis <- function(x, y, ...) {
  out <- vec_ptype2(x, y, ...)
  asis_restore(out)
}
R/type-asis.R:85

vec_ptype2.AsIs.AsIs skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_ptype2.AsIs.AsIs <- function(x, y, ..., x_arg = "", y_arg = "") {
  x <- asis_strip(x)
  y <- asis_strip(y)
  vec_ptype2_asis(x, y, ..., x_arg = x_arg, y_arg = y_arg)
}
R/type-asis.R:71

vec_ptype2_asis_left untypeabletyped

unbound variable (line 79)
unbound: vec_ptype2_asis — one of the package’s own names, itself untyped
error detail
name: vec_ptype2_asis
gradual mode: typed
((x: <...>, y: any, ...: any) -> any)<>
timing: 0.012 s
source
vec_ptype2_asis_left <- function(x, y, ...) {
  x <- asis_strip(x)
  vec_ptype2_asis(x, y, ...)
}
R/type-asis.R:77

vec_ptype2_asis_right untypeabletyped

unbound variable (line 83)
unbound: vec_ptype2_asis — one of the package’s own names, itself untyped
error detail
name: vec_ptype2_asis
gradual mode: typed
((x: any, y: <...>, ...: any) -> any)<>
timing: 0.012 s
source
vec_ptype2_asis_right <- function(x, y, ...) {
  y <- asis_strip(y)
  vec_ptype2_asis(x, y, ...)
}
R/type-asis.R:81

vec_cast_from_asis skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_cast_from_asis <- function(x, to, ..., call = caller_env()) {
  x <- asis_strip(x)
  vec_cast(x, to, ..., call = call)
}
R/type-asis.R:93

vec_cast_to_asis skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_cast_to_asis <- function(x, to, ..., call = caller_env()) {
  to <- asis_strip(to)
  out <- vec_cast(x, to, ..., call = call)
  asis_restore(out)
}
R/type-asis.R:98

is_asis typed any: x fuzz ok

((x: any) -> LGL1<>)<>
timing: 0.008 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
is_asis <- function(x) {
  inherits(x, "AsIs")
}
R/type-asis.R:106
R/type-tibble.R

tib_ptype2 untypeable

unbound variable (line 3)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.010 s
source
tib_ptype2 <- function(x, y, ..., x_arg = "", y_arg = "", call = caller_env()) {
  .Call(
    ffi_tib_ptype2,
    x = x,
    y = y,
    x_arg = x_arg,
    y_arg = y_arg,
    frame = environment()
  )
}
R/type-tibble.R:3

tib_cast untypeable

unbound variable (line 15)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.011 s
source
tib_cast <- function(x, to, ..., x_arg = "", to_arg = "", call = caller_env()) {
  .Call(
    ffi_tib_cast,
    x = x,
    to = to,
    x_arg = x_arg,
    to_arg = to_arg,
    frame = environment()
  )
}
R/type-tibble.R:15

df_as_tibble typed no call in domain

∀'a. ((df: 'a<...>) -> 'a<...>)<>
timing: 0.024 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: ((df: 'I116280<...>) -> 'I116280<...>)<>
source
df_as_tibble <- function(df) {
  class(df) <- c("tbl_df", "tbl", "data.frame")
  df
}
R/type-tibble.R:26

vec_ptype2_tbl_df_tbl_df untypeabletyped

unbound variable (line 34)
unbound: vec_ptype2_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_ptype2_dispatch_native
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_tbl_df_tbl_df <- function(x, y, ...) {
  vec_ptype2_dispatch_native(x, y, ...)
}
R/type-tibble.R:33

vec_ptype2_tbl_df_data.frame untypeabletyped

unbound variable (line 37)
unbound: vec_ptype2_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_ptype2_dispatch_native
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2_tbl_df_data.frame <- function(x, y, ...) {
  vec_ptype2_dispatch_native(x, y, ...)
}
R/type-tibble.R:36

vec_ptype2_data.frame_tbl_df untypeabletyped

unbound variable (line 40)
unbound: vec_ptype2_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_ptype2_dispatch_native
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2_data.frame_tbl_df <- function(x, y, ...) {
  vec_ptype2_dispatch_native(x, y, ...)
}
R/type-tibble.R:39

vec_cast_tbl_df_tbl_df untypeabletyped

unbound variable (line 44)
unbound: vec_cast_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_cast_dispatch_native
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast_tbl_df_tbl_df <- function(x, to, ...) {
  vec_cast_dispatch_native(x, to, ...)
}
R/type-tibble.R:43

vec_cast_data.frame_tbl_df untypeabletyped

unbound variable (line 47)
unbound: vec_cast_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_cast_dispatch_native
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast_data.frame_tbl_df <- function(x, to, ...) {
  vec_cast_dispatch_native(x, to, ...)
}
R/type-tibble.R:46

vec_cast_tbl_df_data.frame untypeabletyped

unbound variable (line 50)
unbound: vec_cast_dispatch_native — one of the package’s own names, itself untyped
error detail
name: vec_cast_dispatch_native
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast_tbl_df_data.frame <- function(x, to, ...) {
  vec_cast_dispatch_native(x, to, ...)
}
R/type-tibble.R:49
R/c.R

vec_c untypeabletyped

unbound variable (line 81)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .ptype: any?, .name_spec: any?, .name_repair: any?, .error_arg: any?, .error_call: any?) -> any)<>
timing: 0.022 s
source
vec_c <- function(
  ...,
  .ptype = NULL,
  .name_spec = NULL,
  .name_repair = c(
    "minimal",
    "unique",
    "check_unique",
    "universal",
    "unique_quiet",
    "universal_quiet"
  ),
  .error_arg = "",
  .error_call = current_env()
) {
  .External2(ffi_vec_c, list2(...), .ptype, .name_spec, .name_repair)
}
R/c.R:68

vec_c untypeabletyped

unbound variable (line 85)
unbound: vec_c — one of the package’s own names, itself untyped
error detail
name: vec_c
gradual mode: typed
any
timing: 0.000 s
source
vec_c <- fn_inline_formals(vec_c, ".name_repair")
R/c.R:85
R/numeric.R

vec_math untypeabletyped

unbound variable (line 44)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math <- function(.fn, .x, ...) {
  UseMethod("vec_math", .x)
}
R/numeric.R:43

is_logical_dispatch untypeabletyped

unbound variable (line 64)
unbound: is_logical — a name the prelude does not declare
error detail
name: is_logical
gradual mode: typed
((fn: vec | null, x: any) -> ff<> | tt<>)<>
timing: 0.006 s
source
is_logical_dispatch <- function(fn, x) {
  is_logical(x) && fn %in% c("any", "all")
}
R/numeric.R:63

vec_math_base untypeabletyped

unbound variable (line 70)
unbound: getExportedValue — a name the prelude does not declare
error detail
name: getExportedValue
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math_base <- function(.fn, .x, ...) {
  .fn <- getExportedValue("base", .fn)
  .fn(vec_data(.x), ...)
}
R/numeric.R:69

vec_math.default untypeable

unbound variable (line 49)
unbound: is_double — a name the prelude does not declare
error detail
name: is_double
timing: 0.034 s
source
vec_math.default <- function(.fn, .x, ...) {
  if (!is_double(.x) && !is_logical_dispatch(.fn, .x)) {
    stop_unimplemented(.x, "vec_math")
  }

  out <- vec_math_base(.fn, .x, ...)

  # Don't restore output of logical predicates like `any()`,
  # `is.finite()`, or `is.nan()`
  if (is_double(out)) {
    out <- vec_restore(out, .x)
  }

  out
}
R/numeric.R:48
R/print-str.R

obj_print_data untypeabletyped

unbound variable (line 36)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_print_data <- function(x, ...) {
  UseMethod("obj_print_data")
}
R/print-str.R:35

obj_print_footer untypeabletyped

unbound variable (line 54)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_print_footer <- function(x, ...) {
  UseMethod("obj_print_footer")
}
R/print-str.R:53

obj_print_header untypeabletyped

unbound variable (line 24)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_print_header <- function(x, ...) {
  UseMethod("obj_print_header")
}
R/print-str.R:23

obj_print untypeabletyped

unbound variable (line 15)
unbound: obj_print_header — one of the package’s own names, itself untyped
error detail
name: obj_print_header
gradual mode: typed
∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.003 s
source
obj_print <- function(x, ...) {
  obj_print_header(x, ...)
  obj_print_data(x, ...)
  obj_print_footer(x, ...)
  invisible(x)
}
R/print-str.R:14

obj_print_header.default untypeabletyped

unbound variable (line 29)
unbound: vec_ptype_full — one of the package’s own names, itself untyped
error detail
name: vec_ptype_full
gradual mode: typed
∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.003 s
source
obj_print_header.default <- function(x, ...) {
  cat_line("<", vec_ptype_full(x), "[", vec_size(x), "]>")
  invisible(x)
}
R/print-str.R:28

obj_print_data.default untypeabletyped

unbound variable (line 45)
unbound: stats::setNames — a name the prelude does not declare
error detail
name: stats::setNames
gradual mode: typed
∀'a. (((x: 'a & vec1, ...: any) -> vec1 & 'a)&((x: 'a, ...: any) -> 'a))<>
timing: 0.034 s
source
obj_print_data.default <- function(x, ...) {
  if (length(x) == 0) {
    return(invisible(x))
  }

  out <- stats::setNames(format(x), names(x))
  print(out, quote = FALSE)

  invisible(x)
}
R/print-str.R:40

obj_print_footer.default typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.008 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
obj_print_footer.default <- function(x, ...) {
  invisible(x)
}
R/print-str.R:58

obj_str_data untypeabletyped

unbound variable (line 87)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_str_data <- function(x, ...) {
  UseMethod("obj_str_data")
}
R/print-str.R:86

obj_str_footer untypeabletyped

unbound variable (line 134)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_str_footer <- function(x, ...) {
  UseMethod("obj_str_footer")
}
R/print-str.R:133

obj_str_header untypeabletyped

unbound variable (line 76)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
obj_str_header <- function(x, ...) {
  UseMethod("obj_str_header")
}
R/print-str.R:75

obj_str untypeabletyped

unbound variable (line 68)
unbound: obj_str_header — one of the package’s own names, itself untyped
error detail
name: obj_str_header
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
obj_str <- function(x, ...) {
  obj_str_header(x, ...)
  obj_str_data(x, ...)
  obj_str_footer(x, ...)
}
R/print-str.R:67

obj_str_header.default typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.008 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
obj_str_header.default <- function(x, ...) {
  invisible(x)
}
R/print-str.R:80

obj_str_leaf untypeable

untypeable application of base::- (line 115)
error detail
argument: @(null | 'width, INT<>)
failing call: base::-(NULL, NA_integer_)
timing: 0.575 s
source
obj_str_leaf <- function(x, ..., indent.str = "", width = getOption("width")) {
  width <- width - nchar(indent.str) - 2

  # Avoid spending too much time formatting elements that won't see
  length <- ceiling(width / 2)
  if (length(x) > length) {
    out <- x[seq2(1, length)]
  } else {
    out <- x
  }

  title <- glue::glue(" {vec_ptype_abbr(x)} [1:{length(x)}] ")
  cat_line(inline_list(title, format(out), width = width))

  invisible(x)
}
R/print-str.R:114

obj_str_recursive skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
obj_str_recursive <- function(x, ..., indent.str = "", nest.lev = 0) {
  if (nest.lev != 0L) {
    cat(" ")
  }
  cat_line(glue::glue("{vec_ptype_abbr(x)} [1:{vec_size(x)}] "))

  utils::str(
    vec_data(x),
    no.list = TRUE,
    ...,
    nest.lev = nest.lev + 1L,
    indent.str = indent.str
  )
}
R/print-str.R:99

obj_str_data.default untypeabletyped

unbound variable (line 93)
unbound: obj_str_recursive — one of the package’s own names, itself untyped
error detail
name: obj_str_recursive
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.015 s
source
obj_str_data.default <- function(x, ...) {
  if (is.list(x)) {
    obj_str_recursive(x, ...)
  } else {
    obj_str_leaf(x, ...)
  }
}
R/print-str.R:91

obj_str_footer.default skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
obj_str_footer.default <- function(x, ..., indent.str = "", nest.lev = 0) {
  attr <- attributes(x)
  attr[["class"]] <- NULL
  attr[["names"]] <- NULL

  if (length(attr) == 0) {
    return(invisible(x))
  }

  if (!is.list(x)) {
    indent.str <- paste0(" ", indent.str)
  }

  utils::str(
    attr,
    no.list = TRUE,
    ...,
    comp.str = "@ ",
    nest.lev = nest.lev + 1L,
    indent.str = indent.str
  )

  invisible(x)
}
R/print-str.R:138
R/rank.R

vec_rank untypeabletyped

unbound variable (line 98)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any, ...: any, ties: any?, incomplete: any?, direction: any?, na_value: any?, nan_distinct: any?, chr_proxy_collate: any?) -> any)<>
timing: 0.039 s
source
vec_rank <- function(
  x,
  ...,
  ties = c("min", "max", "sequential", "dense"),
  incomplete = c("rank", "na"),
  direction = "asc",
  na_value = "largest",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL
) {
  check_dots_empty0(...)

  ties <- arg_match0(ties, c("min", "max", "sequential", "dense"), "ties")
  incomplete <- arg_match0(incomplete, c("rank", "na"), "incomplete")

  .Call(
    vctrs_rank,
    x,
    ties,
    incomplete,
    direction,
    na_value,
    nan_distinct,
    chr_proxy_collate
  )
}
R/rank.R:88
R/slice-chop.R

check_dots_chop skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.001 s
source
check_dots_chop <- function(..., indices = NULL, call = caller_env()) {
  if (!is_null(indices)) {
    # Definitely can't supply both `indices` and `...`
    check_dots_empty0(..., call = call)
  }

  if (dots_n(...) != 1L) {
    # Backwards compatible case doesn't allow for length >1 `...`.
    # This must be an error case.
    check_dots_empty0(..., call = call)
  }

  # TODO: Soft-deprecate this after dplyr/tidyr have updated all `vec_chop()`
  # calls to be explicit about `indices =`

  # Assume this is an old style `vec_chop(x, indices)` call, before we
  # added the `...`
  indices <- list(...)[[1L]]

  indices
}
R/slice-chop.R:68

vec_chop skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.002 s
source
vec_chop <- function(x, ..., indices = NULL, sizes = NULL) {
  if (!missing(...)) {
    indices <- check_dots_chop(..., indices = indices)
  }
  .Call(ffi_vec_chop, x, indices, sizes)
}
R/slice-chop.R:61

vec_chop_seq untypeable

unbound variable (line 92)
unbound: vec_recycle_common — one of the package’s own names, itself untyped
error detail
name: vec_recycle_common
timing: 0.011 s
source
vec_chop_seq <- function(x, starts, sizes, increasings = TRUE) {
  args <- vec_recycle_common(starts, sizes, increasings)
  .Call(ffi_vec_chop_seq, x, args[[1]], args[[2]], args[[3]])
}
R/slice-chop.R:91
R/type-date-time.R

new_date untypeable

untypeable application (line 26)
error detail
function: (x1: p(CHR) | (~DBL)<...> | sym | null) --> empty
argument: @(DBL<> | 'x)
argument (not in the domain) may be: (new.env())
timing: 0.015 s
source
new_date <- function(x = double()) {
  .Call(vctrs_new_date, x)
}
R/type-date-time.R:26

tzone typed accepts outside

∀'a,'b. (((x: any with { tzone: <@"[[", ...>, any }) -> ~null) & ((x: any with { tzone: v('b)<~@"[[", ...>, any }) -> v1('b)<>) & ((x: any with { tzone: { }<~@"[[", ...>, any }) -> empty) & ((x: any with { tzone: { 'a & null }<~@"[[", ...>, any }) -> ""<>) & ((x: any with { tzone: { 'a \ null }<~@"[[", ...>, any }) -> 'a))<>
timing: 0.264 s
fuzzing: 16 inside (14 ok, 2 error type) · 8 outside (2 rejected, 6 accepted)
type drawn from: (((x: any with { tzone: <@"[[", ...>, any }) -> ~null) & ((x: any with { tzone: v('I116631)<~@"[[", ...>, any }) -> v1('I116631)<>) & ((x: any with { tzone: { }<~@"[[", ...>, any }) -> empty) & ((x: any with { tzone: { 'I116615 & null }<~@"[[", ...>, any }) -> ""<>) & ((x: any with { tzone: { 'I116615 \ null }<~@"[[", ...>, any }) -> 'I116615))<>

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:tzonetzone(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))""<> with { }
xattr:drop:tzonetzone(list(c("NA", NA_character_, "", NA_character_, NA_character_)))""<> with { }
xkind:chrtzone("x" = "fuzz")""<> with { }
xkind:dbltzone(1.5)""<> with { }
xkind:langtzone("x" = quote(f(x)))""<> with { }
xwraptzone("x" = list(structure(numeric(0), "tzone" = list())))""<> with { }

Other calls inside the domain

callverdicterror
tzone("x" = structure(quote(f(x)), "tzone" = integer(0)))error_typebase::[[: subscript out of bounds
tzone("x" = structure(list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x")), "tzone" = numeric(0)))error_typebase::[[: subscript out of bounds
source
tzone <- function(x) {
  attr(x, "tzone")[[1]] %||% ""
}
R/type-date-time.R:567

new_datetime untypeable

untypeable application (line 32)
error detail
function: (x1: any_sexp, x2: (~CHR)<...> | sym) | (x1: p(CHR) | (~DBL)<...> | sym | null, x2: any_sexp) --> empty
argument: @(DBL<> | 'x, ""<> | 'tzone)
argument (not in the domain) may be: (new.env(), new.env())
timing: 0.038 s
source
new_datetime <- function(x = double(), tzone = "") {
  .Call(vctrs_new_datetime, x, tzone)
}
R/type-date-time.R:32

new_duration untypeabletyped

unbound variable (line 42)
unbound: is.double — a name the prelude does not declare
error detail
name: is.double
gradual mode: typed
((x: any?, units: any?) -> any)<>
timing: 0.022 s
source
new_duration <- function(
  x = double(),
  units = c("secs", "mins", "hours", "days", "weeks")
) {
  stopifnot(is.double(x))
  units <- arg_match0(units, c("secs", "mins", "hours", "days", "weeks"))

  structure(
    x,
    units = units,
    class = "difftime"
  )
}
R/type-date-time.R:38

date_validate untypeabletyped

unbound variable (line 592)
unbound: vctrs_date_validate — a native symbol tyr could not bind
error detail
name: vctrs_date_validate
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
date_validate <- function(x) {
  .Call(vctrs_date_validate, x)
}
R/type-date-time.R:591

vec_proxy.Date untypeabletyped

unbound variable (line 54)
unbound: date_validate — one of the package’s own names, itself untyped
error detail
name: date_validate
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy.Date <- function(x, ...) {
  date_validate(x)
}
R/type-date-time.R:53

datetime_validate typed empty return

((x: any_sexp) -> empty)<>
timing: 0.007 s
source
datetime_validate <- function(x) {
  .Call(vctrs_datetime_validate, x)
}
R/type-date-time.R:595

vec_proxy.POSIXct typed empty return

((x: any_sexp, ...: any) -> empty)<>
timing: 0.011 s
source
vec_proxy.POSIXct <- function(x, ...) {
  datetime_validate(x)
}
R/type-date-time.R:58

vec_proxy.POSIXlt untypeable

unbound variable (line 64)
unbound: new_data_frame — one of the package’s own names, itself untyped
error detail
name: new_data_frame
timing: 0.007 s
source
vec_proxy.POSIXlt <- function(x, ...) {
  new_data_frame(unclass(x))
}
R/type-date-time.R:63

vec_proxy_equal.POSIXlt untypeabletyped

unbound variable (line 68)
unbound: new_datetime — one of the package’s own names, itself untyped
error detail
name: new_datetime
gradual mode: typed
((x: any with { tzone: <@"[[", ...>, any } | any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any } | any with { tzone: { ~null }<~@"[[", ...>, any }, ...: any) -> any)<>
timing: 0.396 s
source
vec_proxy_equal.POSIXlt <- function(x, ...) {
  x <- vec_cast(x, new_datetime(tzone = tzone(x)))
  vec_proxy_equal(x, ...)
}
R/type-date-time.R:67

vec_proxy_compare.POSIXlt untypeabletyped

unbound variable (line 73)
unbound: new_datetime — one of the package’s own names, itself untyped
error detail
name: new_datetime
gradual mode: typed
((x: any with { tzone: <@"[[", ...>, any } | any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any } | any with { tzone: { ~null }<~@"[[", ...>, any }, ...: any) -> any)<>
timing: 0.357 s
source
vec_proxy_compare.POSIXlt <- function(x, ...) {
  x <- vec_cast(x, new_datetime(tzone = tzone(x)))
  vec_proxy_compare(x)
}
R/type-date-time.R:72

vec_restore.Date untypeabletyped

unbound variable (line 79)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.Date <- function(x, to, ...) {
  NextMethod()
}
R/type-date-time.R:78

vec_restore.POSIXct untypeabletyped

unbound variable (line 84)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.POSIXct <- function(x, to, ...) {
  NextMethod()
}
R/type-date-time.R:83

vec_restore.POSIXlt untypeabletyped

unbound variable (line 89)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.POSIXlt <- function(x, to, ...) {
  NextMethod()
}
R/type-date-time.R:88

vec_ptype_full.Date typed any: x accepts outside

((x: any, ...: any) -> "date"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 4 outside (4 accepted)

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype_full.Date()"date"<> with { }
xdropvec_ptype_full.Date("fuzz_dot1" = new.env())"date"<> with { }
xdropvec_ptype_full.Date("fuzz_dot1" = new.env(), "fuzz_dot2" = new.env())"date"<> with { }
xdropvec_ptype_full.Date("fuzz_dot1" = new.env(), "fuzz_dot2" = NULL)"date"<> with { }
source
vec_ptype_full.Date <- function(x, ...) {
  "date"
}
R/type-date-time.R:95

vec_ptype_abbr.Date typed any: x accepts outside

((x: any, ...: any) -> "date"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 1 outside (1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropvec_ptype_abbr.Date()"date"<> with { }
source
vec_ptype_abbr.Date <- function(x, ...) {
  "date"
}
R/type-date-time.R:100

tzone_is_local typed accepts outside

(((x: any with { tzone: <@"[[", ...>, any } | any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any } | any with { tzone: { ~null }<~@"[[", ...>, any }) -> LGL1<>) & ((x: any with { tzone: { }<~@"[[", ...>, any }) -> empty))<>
timing: 0.564 s
fuzzing: 5 inside (5 ok) · 7 outside (3 rejected, 4 accepted)

Accepted outside the domain x: 4

parameterchangecallreturned
xattr:drop:tzonetzone_is_local(quote(f(x)))tt<> with { }
xkind:dbltzone_is_local("x" = 1.5)tt<> with { }
xkind:symtzone_is_local(as.name("x"))tt<> with { }
xwraptzone_is_local("x" = list(structure(as.raw(c(0)), "tzone" = list(NULL, NULL))))tt<> with { }
source
tzone_is_local <- function(x) {
  identical(tzone(x), "")
}
R/type-date-time.R:571

vec_ptype_full.POSIXct typed accepts outside

(((x: any with { tzone: <@"[[", ...>, any } | any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any } | any with { tzone: { ~null }<~@"[[", ...>, any }, ...: any) -> CHR<>) & ((x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { vec1 }<~@"[[", ...>, any }, ...: any) -> CHR1<>) & ((x: any with { tzone: { }<~@"[[", ...>, any }, ...: any) -> empty))<>
timing: 2.59 s
fuzzing: 8 inside (8 ok) · 8 outside (1 rejected, 7 accepted)

Accepted outside the domain x: 7

parameterchangecallreturned
xattr:drop:tzonevec_ptype_full.POSIXct("x" = list(as.name("x"), NULL))"datetime<local>"<> with { }
xkind:dblvec_ptype_full.POSIXct(1.5, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = new.env())"datetime<local>"<> with { }
xkind:envvec_ptype_full.POSIXct(new.env(), quote(f(x)))"datetime<local>"<> with { }
xkind:symvec_ptype_full.POSIXct("x" = as.name("x"))"datetime<local>"<> with { }
xwrapvec_ptype_full.POSIXct("x" = list(structure(function(...) NULL, "tzone" = list())), "fuzz_dot1" = new.env())"datetime<local>"<> with { }
xwrapvec_ptype_full.POSIXct(list(structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "tzone" = c(-1L, 2147483647L))), as.name("x"))"datetime<local>"<> with { }
and 1 more
source
vec_ptype_full.POSIXct <- function(x, ...) {
  tzone <- if (tzone_is_local(x)) "local" else tzone(x)
  paste0("datetime<", tzone, ">")
}
R/type-date-time.R:105

vec_ptype_full.POSIXlt typed accepts outside

(((x: any with { tzone: <@"[[", ...>, any } | any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any } | any with { tzone: { ~null }<~@"[[", ...>, any }, ...: any) -> CHR<>) & ((x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { null }<~@"[[", ...>, any }, ...: any) | (x: any with { tzone: vec<~@"[[", ...>, any } | any with { tzone: { vec1 }<~@"[[", ...>, any }, ...: any) -> CHR1<>) & ((x: any with { tzone: { }<~@"[[", ...>, any }, ...: any) -> empty))<>
timing: 2.44 s
fuzzing: 8 inside (8 ok) · 7 outside (1 rejected, 6 accepted)

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:tzonevec_ptype_full.POSIXlt("x" = quote(f(x)), "fuzz_dot1" = list(quote(f(x))), "fuzz_dot2" = list(function(...) list(), list()))"POSIXlt<local>"<> with { }
xattr:drop:tzonevec_ptype_full.POSIXlt(list(), as.name("x"), as.name("x"), "fuzz_dot1" = function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"POSIXlt<local>"<> with { }
xkind:langvec_ptype_full.POSIXlt("x" = quote(f(x)))"POSIXlt<local>"<> with { }
xkind:listvec_ptype_full.POSIXlt(list(), NULL, c("x y", "a"))"POSIXlt<local>"<> with { }
xwrapvec_ptype_full.POSIXlt(list(structure(quote(f(x)), "tzone" = list())), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = as.name("x"))"POSIXlt<local>"<> with { }
xwrapvec_ptype_full.POSIXlt("x" = list(structure(list(function(...) quote(f(x))), "tzone" = as.raw(c(0, 0, 255, 255, 255)))))"POSIXlt<local>"<> with { }
source
vec_ptype_full.POSIXlt <- function(x, ...) {
  tzone <- if (tzone_is_local(x)) "local" else tzone(x)
  paste0("POSIXlt<", tzone, ">")
}
R/type-date-time.R:111

vec_ptype_abbr.POSIXct typed any: x accepts outside

((x: any, ...: any) -> "dttm"<>)<>
timing: 0.008 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_abbr.POSIXct()"dttm"<> with { }
xdropvec_ptype_abbr.POSIXct("fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = function(...) NULL)"dttm"<> with { }
xdropvec_ptype_abbr.POSIXct("fuzz_dot1" = function(...) quote(f(x)))"dttm"<> with { }
xdropvec_ptype_abbr.POSIXct("fuzz_dot1" = quote(f(x)))"dttm"<> with { }
xdropvec_ptype_abbr.POSIXct("fuzz_dot1" = NULL, "fuzz_dot2" = function(...) quote(f(x)))"dttm"<> with { }
source
vec_ptype_abbr.POSIXct <- function(x, ...) {
  "dttm"
}
R/type-date-time.R:117

vec_ptype_abbr.POSIXlt typed any: x accepts outside

((x: any, ...: any) -> "dttm"<>)<>
timing: 0.008 s
fuzzing: 8 inside (8 ok) · 4 outside (4 accepted)

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype_abbr.POSIXlt("fuzz_dot1" = new.env(), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"dttm"<> with { }
xdropvec_ptype_abbr.POSIXlt("fuzz_dot1" = logical(0), "fuzz_dot2" = NULL)"dttm"<> with { }
xdropvec_ptype_abbr.POSIXlt()"dttm"<> with { }
xdropvec_ptype_abbr.POSIXlt("fuzz_dot1" = as.raw(c(0)))"dttm"<> with { }
source
vec_ptype_abbr.POSIXlt <- function(x, ...) {
  "dttm"
}
R/type-date-time.R:122

vec_ptype_full.difftime typed accepts outside

(((x: any with { units: any, any }, ...: any) -> CHR<>)&((x: any with { units: vec1, any }, ...: any) -> CHR1<>))<>
timing: 0.059 s
fuzzing: 8 inside (7 ok, 1 error type) · 8 outside (1 rejected, 7 accepted)

Accepted outside the domain x: 7

parameterchangecallreturned
xattr:drop:unitsvec_ptype_full.difftime(new.env(), new.env(), "fuzz_dot1" = new.env(), "fuzz_dot2" = function(...) as.name("x"))"duration<>"<> with { }
xattr:drop:unitsvec_ptype_full.difftime("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = list(), "fuzz_dot2" = as.name("x"))"duration<>"<> with { }
xkind:dblvec_ptype_full.difftime(1.5, "fuzz_dot1" = NULL, "fuzz_dot2" = NULL)"duration<>"<> with { }
xkind:funvec_ptype_full.difftime(function(...) NULL, as.name("x"))"duration<>"<> with { }
xwrapvec_ptype_full.difftime("x" = list(structure(new.env(), "units" = complex(real = 0, imaginary = 0))), "fuzz_dot1" = list())"duration<>"<> with { }
xwrapvec_ptype_full.difftime(list(structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "units" = NA_integer_)), function(...) function(...) quote(f(x)), new.env(), "fuzz_dot1" = list(function(...) NULL), "fuzz_dot2" = quote(f(x)))"duration<>"<> with { }
and 1 more

Other calls inside the domain

callverdicterror
vec_ptype_full.difftime("x" = structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "units" = new.env()), "fuzz_dot1" = list(), "fuzz_dot2" = as.name("x"))error_type::paste0: environments cannot be coerced to other types
source
vec_ptype_full.difftime <- function(x, ...) {
  paste0("duration<", attr(x, "units"), ">")
}
R/type-date-time.R:127

vec_ptype_abbr.difftime typed any: x accepts outside

((x: any, ...: any) -> "drtn"<>)<>
timing: 0.009 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_abbr.difftime()"drtn"<> with { }
xdropvec_ptype_abbr.difftime("fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"drtn"<> with { }
xdropvec_ptype_abbr.difftime("fuzz_dot1" = new.env(), "fuzz_dot2" = new.env())"drtn"<> with { }
xdropvec_ptype_abbr.difftime("fuzz_dot1" = quote(f(x)), "fuzz_dot2" = NULL)"drtn"<> with { }
xdropvec_ptype_abbr.difftime("fuzz_dot1" = -Inf)"drtn"<> with { }
source
vec_ptype_abbr.difftime <- function(x, ...) {
  "drtn"
}
R/type-date-time.R:132

vec_ptype.POSIXlt typed accepts outside

∀'a,'b. (((x: <@"[", ...>, ...: any) -> any) & ((x: v('b)<~@"[", ...>, ...: any) -> v('b)<>) & ((x: { 'a }<~@"[", ...>, ...: any) -> { 'a }<>))<>
timing: 0.076 s
fuzzing: 13 inside (13 ok) · 8 outside (7 rejected, 1 accepted)
type drawn from: (((x: <@"[", ...>, ...: any) -> any) & ((x: v('I116805)<~@"[", ...>, ...: any) -> v('I116805)<>) & ((x: { 'I116804 }<~@"[", ...>, ...: any) -> { 'I116804 }<>))<>

Accepted outside the domain x: 1

parameterchangecallreturned
xdropvec_ptype.POSIXlt(NULL)null
source
vec_ptype.POSIXlt <- function(x, ...) {
  # `vec_ptype2()` pushes towards `POSIXct`. In theory, maybe `vec_ptype()`
  # should as well so that `vec_c(<POSIXlt>)` and `vec_c(<POSIXlt>, <POSIXlt>)`
  # are consistent and both return `POSIXct`. In practice this broke a number of
  # packages (datetimeoffset, slider, nanoarrow), and also generally means that
  # you wouldn't be able to provide a `POSIXlt` as a `ptype` argument to
  # anything and expect it to return a `POSIXlt` as output. So we've decided to
  # just leave this inconsistency. Getting `POSIXlt` attributes exactly right
  # is very tricky, and very R version dependent, so we just consistency align
  # with `[` here and in tests.
  x[0]
}
R/type-date-time.R:139

vec_ptype2.Date untypeabletyped

unbound variable (line 159)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.Date <- function(x, y, ...) {
  UseMethod("vec_ptype2.Date")
}
R/type-date-time.R:158

vec_ptype2.Date.Date untypeabletyped

unbound variable (line 164)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.Date.Date <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.Date.Date")
}
R/type-date-time.R:163

vec_ptype2.Date.POSIXct untypeabletyped

unbound variable (line 169)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.Date.POSIXct <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.Date.POSIXct")
}
R/type-date-time.R:168

vec_ptype2.Date.POSIXlt untypeabletyped

unbound variable (line 174)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.Date.POSIXlt <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.Date.POSIXlt")
}
R/type-date-time.R:173

vec_ptype2.POSIXct untypeabletyped

unbound variable (line 182)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXct <- function(x, y, ...) {
  UseMethod("vec_ptype2.POSIXct")
}
R/type-date-time.R:181

vec_ptype2.POSIXct.POSIXct untypeabletyped

unbound variable (line 187)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXct.POSIXct <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXct.POSIXct")
}
R/type-date-time.R:186

vec_ptype2.POSIXct.Date untypeabletyped

unbound variable (line 192)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXct.Date <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXct.Date")
}
R/type-date-time.R:191

vec_ptype2.POSIXct.POSIXlt untypeabletyped

unbound variable (line 197)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXct.POSIXlt <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXct.POSIXlt")
}
R/type-date-time.R:196

vec_ptype2.POSIXlt untypeabletyped

unbound variable (line 205)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXlt <- function(x, y, ...) {
  UseMethod("vec_ptype2.POSIXlt")
}
R/type-date-time.R:204

vec_ptype2.POSIXlt.POSIXlt untypeabletyped

unbound variable (line 210)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXlt.POSIXlt <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXlt.POSIXlt")
}
R/type-date-time.R:209

vec_ptype2.POSIXlt.Date untypeabletyped

unbound variable (line 215)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXlt.Date <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXlt.Date")
}
R/type-date-time.R:214

vec_ptype2.POSIXlt.POSIXct untypeabletyped

unbound variable (line 220)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.POSIXlt.POSIXct <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.POSIXlt.POSIXct")
}
R/type-date-time.R:219

vec_ptype2.difftime untypeabletyped

unbound variable (line 227)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.difftime <- function(x, y, ...) UseMethod("vec_ptype2.difftime")
R/type-date-time.R:227

units_union typed fuzz ok

∀'a. ((x: <difftime, ...> with { units: 'a, any }, y: <difftime, ...> with { units: any, any }) -> "secs"<> | 'a)<>
timing: 0.058 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: <difftime, ...> with { units: 'I116908, any }, y: <difftime, ...> with { units: any, any }) -> "secs"<> | 'I116908)<>
source
units_union <- function(x, y) {
  if (identical(units(x), units(y))) {
    units(x)
  } else {
    "secs"
  }
}
R/type-date-time.R:583

vec_ptype2.difftime.difftime untypeabletyped

unbound variable (line 231)
unbound: new_duration — one of the package’s own names, itself untyped
error detail
name: new_duration
gradual mode: typed
((x: <difftime, ...> with { units: any, any }, y: <difftime, ...> with { units: any, any }, ...: any) -> any)<>
timing: 0.018 s
source
vec_ptype2.difftime.difftime <- function(x, y, ...) {
  new_duration(units = units_union(x, y))
}
R/type-date-time.R:230

vec_cast.Date untypeabletyped

unbound variable (line 241)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.Date <- function(x, to, ...) {
  UseMethod("vec_cast.Date")
}
R/type-date-time.R:240

vec_cast.Date.Date untypeabletyped

unbound variable (line 246)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.Date.Date <- function(x, to, ...) {
  stop_native_implementation("vec_cast.Date.Date")
}
R/type-date-time.R:245

date_cast typedtimeout empty return any: to, x_arg, to_arg

((x: any with { tzone: { }<~@"[[", ...>, any }, to: any, ...: any, x_arg: any?, to_arg: any?) -> empty)<>
gradual mode: timeout
timing: 12.44 s
source
date_cast <- function(x, to, ..., x_arg = "", to_arg = "") {
  out <- as.Date(x, tz = tzone(x))

  x_ct <- as.POSIXct(x)
  out_ct <- as.POSIXct(as.character(out), tz = tzone(x))
  lossy <- abs(x_ct - out_ct) > 1e-9 & !is.na(x)

  maybe_lossy_cast(out, x, to, lossy, x_arg = x_arg, to_arg = to_arg)
}
R/type-date-time.R:262

vec_cast.Date.POSIXct typed empty return any: to

((x: any with { tzone: { }<~@"[[", ...>, any }, to: any, ...: any) -> empty)<>
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.023 s
source
vec_cast.Date.POSIXct <- function(x, to, ...) {
  # TODO: Mark with `stop_native_implementation()` when we use lazy errors
  date_cast(x, to, ...)
}
R/type-date-time.R:250

vec_cast.Date.POSIXlt typed empty return any: to

((x: any with { tzone: { }<~@"[[", ...>, any }, to: any, ...: any) -> empty)<>
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.023 s
source
vec_cast.Date.POSIXlt <- function(x, to, ...) {
  # TODO: Mark with `stop_native_implementation()` when we use lazy errors
  date_cast(x, to, ...)
}
R/type-date-time.R:256

vec_cast.POSIXct untypeabletyped

unbound variable (line 277)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.POSIXct <- function(x, to, ...) {
  UseMethod("vec_cast.POSIXct")
}
R/type-date-time.R:276

vec_cast.POSIXct.Date untypeabletyped

unbound variable (line 282)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXct.Date <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXct.Date")
}
R/type-date-time.R:281

vec_cast.POSIXct.POSIXlt untypeabletyped

unbound variable (line 287)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXct.POSIXlt <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXct.POSIXlt")
}
R/type-date-time.R:286

vec_cast.POSIXct.POSIXct untypeabletyped

unbound variable (line 292)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXct.POSIXct <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXct.POSIXct")
}
R/type-date-time.R:291

vec_cast.POSIXlt untypeabletyped

unbound variable (line 300)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXlt <- function(x, to, ...) {
  UseMethod("vec_cast.POSIXlt")
}
R/type-date-time.R:299

vec_cast.POSIXlt.Date untypeabletyped

unbound variable (line 305)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXlt.Date <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXlt.Date")
}
R/type-date-time.R:304

vec_cast.POSIXlt.POSIXlt untypeabletyped

unbound variable (line 310)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXlt.POSIXlt <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXlt.POSIXlt")
}
R/type-date-time.R:309

vec_cast.POSIXlt.POSIXct untypeabletyped

unbound variable (line 315)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.POSIXlt.POSIXct <- function(x, to, ...) {
  stop_native_implementation("vec_cast.POSIXlt.POSIXct")
}
R/type-date-time.R:314

vec_cast.difftime untypeabletyped

unbound variable (line 324)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.difftime <- function(x, to, ...) {
  UseMethod("vec_cast.difftime")
}
R/type-date-time.R:323

vec_cast.difftime.difftime typed no call in domain

∀'a. (((x: 'a & DBL1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'a \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~DBL)<difftime, ...> with { units: any, any }))&((x: 'a & DBL<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'a \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~DBL)<difftime, ...> with { units: any, any }))&((x: 'a & LGL1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'a \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~LGL)<difftime, ...> with { units: any, any } & ~DBL1<difftime> with { units: CHR1, any }))&((x: 'a & LGL<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'a \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~LGL)<difftime, ...> with { units: any, any } & ~DBL<difftime> with { units: CHR1, any }))&((x: 'a & raw1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'a \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~raw)<difftime, ...> with { units: any, any } & ~DBL1<difftime> with { units: CHR1, any }))&((x: 'a & raw<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'a \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~raw)<difftime, ...> with { units: any, any } & ~DBL<difftime> with { units: CHR1, any })))<>
timing: 5.20 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: (((x: 'x & DBL1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'x \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~DBL)<difftime, ...> with { units: any, any })) & ((x: 'x & DBL<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'x \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~DBL)<difftime, ...> with { units: any, any })) & ((x: 'x & LGL1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'x \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~LGL)<difftime, ...> with { units: any, any } & ~DBL1<difftime> with { units: CHR1, any })) & ((x: 'x & LGL<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'x \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~LGL)<difftime, ...> with { units: any, any } & ~DBL<difftime> with { units: CHR1, any })) & ((x: 'x & raw1<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime1 | 'x \ (<difftime, ...> with { units: any, any } & ~dbl1<~POSIXt, ...> | (~raw)<difftime, ...> with { units: any, any } & ~DBL1<difftime> with { units: CHR1, any })) & ((x: 'x & raw<difftime, ~POSIXt, ...> with { units: any, any }, to: <difftime, ...> with { units: vec1, any }, ...: any) -> difftime | 'x \ (<difftime, ...> with { units: any, any } & ~dbl<~POSIXt, ...> | (~raw)<difftime, ...> with { units: any, any } & ~DBL<difftime> with { units: CHR1, any })))<>
source
vec_cast.difftime.difftime <- function(x, to, ...) {
  if (identical(units(x), units(to))) {
    if (typeof(x) == "integer") {
      # Catch corrupt difftime objects (#1602)
      storage.mode(x) <- "double"
    }
    x
  } else {
    # Hack: I can't see any obvious way of changing the units
    origin <- as.POSIXct(0, origin = "1970-01-01")
    difftime(origin, origin - x, units = units(to))
  }
}
R/type-date-time.R:328

vec_arith.Date untypeabletyped

unbound variable (line 349)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.Date <- function(op, x, y, ...) UseMethod("vec_arith.Date", y)
R/type-date-time.R:349

vec_arith.POSIXct untypeabletyped

unbound variable (line 354)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.007 s
source
vec_arith.POSIXct <- function(op, x, y, ...) UseMethod("vec_arith.POSIXct", y)
R/type-date-time.R:354

vec_arith.POSIXlt untypeabletyped

unbound variable (line 359)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.007 s
source
vec_arith.POSIXlt <- function(op, x, y, ...) UseMethod("vec_arith.POSIXlt", y)
R/type-date-time.R:359

vec_arith.difftime untypeabletyped

unbound variable (line 364)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.009 s
source
vec_arith.difftime <- function(op, x, y, ...) UseMethod("vec_arith.difftime", y)
R/type-date-time.R:364

vec_arith.Date.default untypeabletyped

unbound variable (line 368)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.007 s
source
vec_arith.Date.default <- function(op, x, y, ...) stop_incompatible_op(op, x, y)
R/type-date-time.R:368

vec_arith.POSIXct.default untypeabletyped

unbound variable (line 372)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.POSIXct.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/type-date-time.R:371

vec_arith.POSIXlt.default untypeabletyped

unbound variable (line 377)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.POSIXlt.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/type-date-time.R:376

vec_arith.difftime.default untypeabletyped

unbound variable (line 382)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.difftime.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/type-date-time.R:381

vec_arith.Date.Date skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.Date.Date <- function(op, x, y, ...) {
  switch(
    op,
    `-` = difftime(x, y, units = "days"),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:387

vec_arith.POSIXct.POSIXct skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.POSIXct.POSIXct <- function(op, x, y, ...) {
  switch(
    op,
    `-` = difftime(x, y, units = "secs"),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:396

vec_arith.POSIXlt.POSIXlt untypeabletyped

unbound variable (line 405)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXlt.POSIXlt <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:405

vec_arith.POSIXct.Date untypeabletyped

unbound variable (line 408)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXct.Date <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:408

vec_arith.Date.POSIXct untypeabletyped

unbound variable (line 411)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.Date.POSIXct <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:411

vec_arith.POSIXlt.Date untypeabletyped

unbound variable (line 414)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXlt.Date <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:414

vec_arith.Date.POSIXlt untypeabletyped

unbound variable (line 417)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.Date.POSIXlt <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:417

vec_arith.POSIXlt.POSIXct untypeabletyped

unbound variable (line 420)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXlt.POSIXct <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:420

vec_arith.POSIXct.POSIXlt untypeabletyped

unbound variable (line 423)
unbound: vec_arith.POSIXct.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.POSIXct
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXct.POSIXlt <- vec_arith.POSIXct.POSIXct
R/type-date-time.R:423

vec_arith.Date.numeric skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.Date.numeric <- function(op, x, y, ...) {
  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, x, y), x),
    `-` = vec_restore(vec_arith_base(op, x, y), x),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:427

vec_arith.numeric.Date skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.numeric.Date <- function(op, x, y, ...) {
  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, x, y), y),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:437

vec_arith.POSIXct.numeric untypeabletyped

unbound variable (line 446)
unbound: vec_arith.Date.numeric — one of the package’s own names, itself untyped
error detail
name: vec_arith.Date.numeric
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.POSIXct.numeric <- vec_arith.Date.numeric
R/type-date-time.R:446

vec_arith.numeric.POSIXct untypeabletyped

unbound variable (line 449)
unbound: vec_arith.numeric.Date — one of the package’s own names, itself untyped
error detail
name: vec_arith.numeric.Date
gradual mode: typed
any
timing: 0.000 s
source
vec_arith.numeric.POSIXct <- vec_arith.numeric.Date
R/type-date-time.R:449

vec_arith.POSIXlt.numeric untypeable

unbound variable (line 453)
unbound: vec_arith.POSIXct.numeric — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.numeric
timing: 0.025 s
source
vec_arith.POSIXlt.numeric <- function(op, x, y, ...) {
  vec_arith.POSIXct.numeric(op, as.POSIXct(x), y, ...)
}
R/type-date-time.R:452

vec_arith.numeric.POSIXlt untypeable

unbound variable (line 458)
unbound: vec_arith.numeric.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.numeric.POSIXct
timing: 0.025 s
source
vec_arith.numeric.POSIXlt <- function(op, x, y, ...) {
  vec_arith.numeric.POSIXct(op, x, as.POSIXct(y), ...)
}
R/type-date-time.R:457

lossy_floor untypeabletyped

unbound variable (line 620)
unbound: maybe_lossy_cast — one of the package’s own names, itself untyped
error detail
name: maybe_lossy_cast
gradual mode: typed
((x: dbl, to: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.090 s
source
lossy_floor <- function(x, to, x_arg = "", to_arg = "") {
  x_floor <- floor(x)
  lossy <- x != x_floor
  maybe_lossy_cast(x_floor, x, to, lossy, x_arg = x_arg, to_arg = to_arg)
}
R/type-date-time.R:617

vec_arith.Date.difftime skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.Date.difftime <- function(op, x, y, ...) {
  y <- vec_cast(y, new_duration(units = "days"))

  switch(
    op,
    `+` = ,
    `-` = vec_restore(vec_arith_base(op, x, lossy_floor(y, x)), x),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:463

vec_arith.difftime.Date skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.difftime.Date <- function(op, x, y, ...) {
  x <- vec_cast(x, new_duration(units = "days"))

  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, lossy_floor(x, y), y), y),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:475

vec_arith.POSIXct.difftime skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.POSIXct.difftime <- function(op, x, y, ...) {
  y <- vec_cast(y, new_duration(units = "secs"))

  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, x, y), x),
    `-` = vec_restore(vec_arith_base(op, x, y), x),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:486

vec_arith.difftime.POSIXct skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.difftime.POSIXct <- function(op, x, y, ...) {
  x <- vec_cast(x, new_duration(units = "secs"))

  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, x, y), y),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:498

vec_arith.POSIXlt.difftime untypeabletyped

unbound variable (line 510)
unbound: vec_arith.POSIXct.difftime — one of the package’s own names, itself untyped
error detail
name: vec_arith.POSIXct.difftime
gradual mode: typed
((op: any, x: vec, y: any, ...: any) -> any)<>
timing: 0.026 s
source
vec_arith.POSIXlt.difftime <- function(op, x, y, ...) {
  vec_arith.POSIXct.difftime(op, as.POSIXct(x), y, ...)
}
R/type-date-time.R:509

vec_arith.difftime.POSIXlt untypeabletyped

unbound variable (line 515)
unbound: vec_arith.difftime.POSIXct — one of the package’s own names, itself untyped
error detail
name: vec_arith.difftime.POSIXct
gradual mode: typed
((op: any, x: any, y: vec, ...: any) -> any)<>
timing: 0.025 s
source
vec_arith.difftime.POSIXlt <- function(op, x, y, ...) {
  vec_arith.difftime.POSIXct(op, x, as.POSIXct(y), ...)
}
R/type-date-time.R:514

vec_arith.difftime.difftime skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.difftime.difftime <- function(op, x, y, ...) {
  # Ensure x and y have same units
  args <- vec_cast_common(x, y)
  x <- args[[1L]]
  y <- args[[2L]]

  switch(
    op,
    `+` = vec_restore(vec_arith_base(op, x, y), x),
    `-` = vec_restore(vec_arith_base(op, x, y), x),
    `/` = vec_arith_base(op, x, y),
    `%/%` = vec_arith_base(op, x, y),
    `%%` = vec_arith_base(op, x, y),
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:520

vec_arith.difftime.MISSING skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.difftime.MISSING <- function(op, x, y, ...) {
  switch(
    op,
    `-` = vec_restore(-vec_data(x), x),
    `+` = x,
    stop_incompatible_op(op, x, y)
  )
}
R/type-date-time.R:539

vec_arith.difftime.numeric untypeabletyped

unbound variable (line 551)
unbound: vec_arith_base — one of the package’s own names, itself untyped
error detail
name: vec_arith_base
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.difftime.numeric <- function(op, x, y, ...) {
  vec_restore(vec_arith_base(op, x, y), x)
}
R/type-date-time.R:550

vec_arith.numeric.difftime skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_arith.numeric.difftime <- function(op, x, y, ...) {
  switch(
    op,
    `/` = stop_incompatible_op(op, x, y),
    vec_restore(vec_arith_base(op, x, y), y)
  )
}
R/type-date-time.R:555

tzone_union timeout

timing: 20.00 s
source
tzone_union <- function(x, y) {
  if (tzone_is_local(x)) {
    tzone(y)
  } else {
    tzone(x)
  }
}
R/type-date-time.R:575

date_as_character typed any: x fuzz ok

(((x: any) -> CHR<>)&((x: vec1) -> CHR1<>))<>
timing: 0.019 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
date_as_character <- function(x) {
  format(x, format = "%Y-%m-%d")
}
R/type-date-time.R:601

chr_date_as_posixlt untypeabletyped

unbound variable (line 608)
unbound: as.POSIXlt.character — a name the prelude does not declare
error detail
name: as.POSIXlt.character
gradual mode: typed
((x: any, tzone: any) -> any)<>
timing: 0.003 s
source
chr_date_as_posixlt <- function(x, tzone) {
  as.POSIXlt.character(x, tz = tzone, format = "%Y-%m-%d")
}
R/type-date-time.R:607

chr_date_as_posixct untypeabletyped

unbound variable (line 613)
unbound: chr_date_as_posixlt — one of the package’s own names, itself untyped
error detail
name: chr_date_as_posixlt
gradual mode: typed
((x: any, tzone: any) -> any)<>
timing: 0.003 s
source
chr_date_as_posixct <- function(x, tzone) {
  out <- chr_date_as_posixlt(x, tzone)
  as.POSIXct.POSIXlt(out, tzone)
}
R/type-date-time.R:612

as_posixlt untypeabletyped

unbound variable (line 627)
unbound: as.POSIXlt — a name the prelude does not declare
error detail
name: as.POSIXlt
gradual mode: typed
((x: vec, tz: any?) -> any)<>
timing: 0.017 s
source
as_posixlt <- function(x, tz = "") {
  as.POSIXlt(as.POSIXct(x, tz))
}
R/type-date-time.R:626

vec_math.Date untypeabletyped

unbound variable (line 634)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math.Date <- function(.fn, .x, ...) {
  stop_unsupported(.x, .fn)
}
R/type-date-time.R:633

vec_math.POSIXct untypeabletyped

unbound variable (line 638)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math.POSIXct <- function(.fn, .x, ...) {
  stop_unsupported(.x, .fn)
}
R/type-date-time.R:637

vec_math.POSIXlt untypeabletyped

unbound variable (line 642)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math.POSIXlt <- function(.fn, .x, ...) {
  stop_unsupported(.x, .fn)
}
R/type-date-time.R:641
R/type-factor.R

new_factor skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_factor <- function(
  x = integer(),
  levels = character(),
  ...,
  class = character()
) {
  stopifnot(is.integer(x))
  stopifnot(is.character(levels))

  structure(
    x,
    levels = levels,
    ...,
    class = c(class, "factor")
  )
}
R/type-factor.R:19

new_ordered untypeabletyped

unbound variable (line 39)
unbound: new_factor — one of the package’s own names, itself untyped
error detail
name: new_factor
gradual mode: typed
((x: any?, levels: any?) -> any)<>
timing: 0.009 s
source
new_ordered <- function(x = integer(), levels = character()) {
  new_factor(x = x, levels = levels, class = "ordered")
}
R/type-factor.R:38

vec_proxy.factor typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.005 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.factor <- function(x, ...) {
  x
}
R/type-factor.R:43

vec_proxy.ordered typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.005 s
fuzzing: 20 inside (20 ok) · 7 outside (7 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.ordered <- function(x, ...) {
  x
}
R/type-factor.R:48

vec_restore.factor untypeabletyped

unbound variable (line 54)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.factor <- function(x, to, ...) {
  NextMethod()
}
R/type-factor.R:53

vec_restore.ordered untypeabletyped

unbound variable (line 59)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.ordered <- function(x, to, ...) {
  NextMethod()
}
R/type-factor.R:58

hash_label untypeabletyped

unbound variable (line 253)
unbound: rlang::hash — a name the prelude does not declare
error detail
name: rlang::hash
gradual mode: typed
((x: any, length: any?) -> any)<>
timing: 0.012 s
source
hash_label <- function(x, length = 5) {
  if (length(x) == 0) {
    ""
  } else {
    # Can't use obj_hash() because it hashes the string pointers
    # for performance, so the values in the test change each time
    substr(rlang::hash(x), 1, length)
  }
}
R/type-factor.R:247

vec_ptype_full.factor untypeabletyped

unbound variable (line 66)
unbound: hash_label — one of the package’s own names, itself untyped
error detail
name: hash_label
gradual mode: typed
((x: any, ...: any) -> CHR<>)<>
timing: 0.011 s
source
vec_ptype_full.factor <- function(x, ...) {
  paste0("factor<", hash_label(levels(x)), ">", vec_ptype_shape(x))
}
R/type-factor.R:65

vec_ptype_abbr.factor typed any: x accepts outside

((x: any, ...: any) -> "fct"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 8 outside (8 accepted)

Accepted outside the domain x: 8

parameterchangecallreturned
xdropvec_ptype_abbr.factor("fuzz_dot1" = list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env()), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"fct"<> with { }
xdropvec_ptype_abbr.factor("fuzz_dot1" = raw(0))"fct"<> with { }
xdropvec_ptype_abbr.factor("fuzz_dot1" = integer(0), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"fct"<> with { }
xdropvec_ptype_abbr.factor("fuzz_dot1" = as.name("x"), "fuzz_dot2" = as.raw(c(0, 0, 255, 255, 255)))"fct"<> with { }
xdropvec_ptype_abbr.factor()"fct"<> with { }
xdropvec_ptype_abbr.factor("fuzz_dot1" = as.name("x"))"fct"<> with { }
and 2 more
source
vec_ptype_abbr.factor <- function(x, ...) {
  "fct"
}
R/type-factor.R:70

vec_ptype_full.ordered untypeabletyped

unbound variable (line 76)
unbound: hash_label — one of the package’s own names, itself untyped
error detail
name: hash_label
gradual mode: typed
((x: any, ...: any) -> CHR<>)<>
timing: 0.012 s
source
vec_ptype_full.ordered <- function(x, ...) {
  paste0("ordered<", hash_label(levels(x)), ">", vec_ptype_shape(x))
}
R/type-factor.R:75

vec_ptype_abbr.ordered typed any: x accepts outside

((x: any, ...: any) -> "ord"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 3 outside (3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xdropvec_ptype_abbr.ordered("fuzz_dot1" = TRUE, "fuzz_dot2" = new.env())"ord"<> with { }
xdropvec_ptype_abbr.ordered("fuzz_dot1" = new.env(), "fuzz_dot2" = function(...) quote(f(x)))"ord"<> with { }
xdropvec_ptype_abbr.ordered()"ord"<> with { }
source
vec_ptype_abbr.ordered <- function(x, ...) {
  "ord"
}
R/type-factor.R:80

vec_ptype2.factor untypeabletyped

unbound variable (line 91)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.factor <- function(x, y, ...) {
  UseMethod("vec_ptype2.factor")
}
R/type-factor.R:90

vec_ptype2.factor.factor untypeabletyped

unbound variable (line 95)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.factor.factor <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.factor.factor")
}
R/type-factor.R:94

vec_ptype2.character.factor untypeabletyped

unbound variable (line 99)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.character.factor <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.character.factor")
}
R/type-factor.R:98

vec_ptype2.factor.character untypeabletyped

unbound variable (line 103)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.factor.character <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.factor.character")
}
R/type-factor.R:102

vec_ptype2.ordered untypeabletyped

unbound variable (line 111)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.ordered <- function(x, y, ...) {
  UseMethod("vec_ptype2.ordered")
}
R/type-factor.R:110

vec_ptype2.ordered.ordered untypeabletyped

unbound variable (line 115)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.ordered.ordered <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.ordered.ordered")
}
R/type-factor.R:114

vec_ptype2.ordered.character untypeabletyped

unbound variable (line 119)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.ordered.character <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.ordered.character")
}
R/type-factor.R:118

vec_ptype2.character.ordered untypeabletyped

unbound variable (line 123)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.character.ordered <- function(x, y, ...) {
  stop_native_implementation("vec_ptype2.character.ordered")
}
R/type-factor.R:122

vec_ptype2.ordered.factor untypeabletyped

unbound variable (line 128)
unbound: vec_default_ptype2 — one of the package’s own names, itself untyped
error detail
name: vec_default_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.ordered.factor <- function(x, y, ...) {
  vec_default_ptype2(x, y, ...)
}
R/type-factor.R:127

vec_ptype2.factor.ordered untypeabletyped

unbound variable (line 132)
unbound: vec_default_ptype2 — one of the package’s own names, itself untyped
error detail
name: vec_default_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_ptype2.factor.ordered <- function(x, y, ...) {
  vec_default_ptype2(x, y, ...)
}
R/type-factor.R:131

vec_cast.factor untypeabletyped

unbound variable (line 143)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.factor <- function(x, to, ...) {
  UseMethod("vec_cast.factor")
}
R/type-factor.R:142

fct_cast_impl untypeabletyped

unbound variable (line 157)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: vec<factor, ...> with { levels: vec, any }, to: <factor, ...> with { levels: vec, any }, ...: any, x_arg: any?, to_arg: any?, ordered: ff?, call: any?) -> any)<>
timing: 0.041 s
source
fct_cast_impl <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  ordered = FALSE,
  call = caller_env()
) {
  if (length(levels(to)) == 0L) {
    levels <- levels(x)
    if (is.null(levels)) {
      exclude <- NA
      levels <- unique(x)
    } else {
      exclude <- NULL
    }
    factor(
      as.character(x),
      levels = levels,
      ordered = ordered,
      exclude = exclude
    )
  } else {
    lossy <- !(x %in% levels(to) | is.na(x))
    out <- factor(
      x,
      levels = levels(to),
      ordered = ordered,
      exclude = NULL
    )
    maybe_lossy_cast(
      out,
      x,
      to,
      lossy,
      loss_type = "generality",
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    )
  }
}
R/type-factor.R:150

fct_cast skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
fct_cast <- function(x, to, ..., call = caller_env()) {
  fct_cast_impl(x, to, ..., ordered = FALSE, call = call)
}
R/type-factor.R:146

vec_cast.factor.factor untypeabletyped

unbound variable (line 196)
unbound: fct_cast — one of the package’s own names, itself untyped
error detail
name: fct_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.factor.factor <- function(x, to, ...) {
  fct_cast(x, to, ...)
}
R/type-factor.R:195

vec_cast.factor.character untypeabletyped

unbound variable (line 200)
unbound: fct_cast — one of the package’s own names, itself untyped
error detail
name: fct_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.factor.character <- function(x, to, ...) {
  fct_cast(x, to, ...)
}
R/type-factor.R:199

vec_cast.character.factor untypeabletyped

unbound variable (line 204)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.character.factor <- function(x, to, ...) {
  stop_native_implementation("vec_cast.character.factor")
}
R/type-factor.R:203

vec_cast.ordered untypeabletyped

unbound variable (line 212)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.ordered <- function(x, to, ...) {
  UseMethod("vec_cast.ordered")
}
R/type-factor.R:211

ord_cast skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
ord_cast <- function(x, to, ..., call = caller_env()) {
  fct_cast_impl(x, to, ..., ordered = TRUE, call = call)
}
R/type-factor.R:215

vec_cast.ordered.ordered untypeabletyped

unbound variable (line 221)
unbound: ord_cast — one of the package’s own names, itself untyped
error detail
name: ord_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.ordered.ordered <- function(x, to, ...) {
  ord_cast(x, to, ...)
}
R/type-factor.R:220

vec_cast.ordered.character untypeabletyped

unbound variable (line 226)
unbound: ord_cast — one of the package’s own names, itself untyped
error detail
name: ord_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast.ordered.character <- function(x, to, ...) {
  ord_cast(x, to, ...)
}
R/type-factor.R:225

vec_cast.character.ordered untypeabletyped

unbound variable (line 230)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.character.ordered <- function(x, to, ...) {
  stop_native_implementation("vec_cast.character.ordered")
}
R/type-factor.R:229

vec_math.factor untypeabletyped

unbound variable (line 237)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math.factor <- function(.fn, .x, ...) {
  stop_unsupported(.x, .fn)
}
R/type-factor.R:236

vec_arith.factor untypeabletyped

unbound variable (line 242)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.factor <- function(op, x, y, ...) {
  stop_unsupported(x, op)
}
R/type-factor.R:241

levels_union typed any: x, y fuzz ok

(((x: <factor, ...> with { levels: null, any }, y: <factor, ...> with { levels: null, any }) -> null)&((x: any, y: any) -> CHR<> | null))<>
timing: 0.099 s
fuzzing: 8 inside (4 ok, 4 invalid) · 8 outside (4 rejected, 4 invalid)

Other calls inside the domain

callverdicterror
levels_union("x" = structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "levels" = NULL, class = "factor"), "y" = structure(quote(f(x)), "levels" = NULL, class = "factor"))invalidadding class "factor" to an invalid object
levels_union(structure(new.env(), "levels" = NULL, class = "factor"), "y" = structure(new.env(), "levels" = NULL, class = "factor"))invalidadding class "factor" to an invalid object
levels_union(structure(function(...) function(...) NULL, "levels" = NULL, class = "factor"), structure(as.raw(c(0)), "levels" = NULL, class = "factor"))invalidadding class "factor" to an invalid object
levels_union(structure(function(...) list(), "levels" = NULL, class = "factor"), structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "levels" = NULL, class = "factor"))invalidadding class "factor" to an invalid object
source
levels_union <- function(x, y) {
  union(levels(x), levels(y))
}
R/type-factor.R:257
R/type-vctr.R

names_repair_missing typed accepts outside

∀'a. ((x: 'a & null) -> 'a)<>
timing: 0.031 s
fuzzing: 2 inside (2 ok) · 7 outside (6 rejected, 1 accepted)
type drawn from: ((x: 'x & null) -> 'x)<>

Accepted outside the domain x: 1

parameterchangecallreturned
xkind:dblnames_repair_missing(1.5)(^DBL1 \ (..))<> with { }

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
names_repair_missing <- function(x) {
  if (is.null(x)) {
    return(x)
  }

  if (vec_any_missing(x)) {
    # We never want to allow `NA_character_` names to slip through, but
    # erroring on them has caused issues. Instead, we repair them to the
    # empty string (#784).
    missing <- vec_detect_missing(x)
    x <- vec_assign(x, missing, "")
  }

  x
}
R/type-vctr.R:103

new_vctr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_vctr <- function(
  .data,
  ...,
  class = character(),
  inherit_base_type = NULL
) {
  if (!is_vector(.data)) {
    abort("`.data` must be a vector type.")
  }

  if (is_list(.data)) {
    if (is.data.frame(.data)) {
      abort("`.data` can't be a data frame.")
    }

    if (is.null(inherit_base_type)) {
      inherit_base_type <- TRUE
    } else if (is_false(inherit_base_type)) {
      abort("List `.data` must inherit from the base type.")
    }
  }

  # Default to `FALSE` in all cases except lists
  if (is.null(inherit_base_type)) {
    inherit_base_type <- FALSE
  }

  names <- names(.data)
  names <- names_repair_missing(names)

  class <- c(class, "vctrs_vctr", if (inherit_base_type) typeof(.data))
  attrib <- list(names = names, ..., class = class)

  vec_set_attributes(.data, attrib)
}
R/type-vctr.R:67

vec_proxy.vctrs_vctr untypeabletyped

unbound variable (line 121)
unbound: is_list — a name the prelude does not declare
error detail
name: is_list
gradual mode: typed
∀'a,'b. ((x: 'a & 'b<...>, ...: any) -> 'b<> | 'b<...> & 'a)<>
timing: 0.005 s
source
vec_proxy.vctrs_vctr <- function(x, ...) {
  if (is_list(x)) {
    unclass(x)
  } else {
    x
  }
}
R/type-vctr.R:120

vec_restore.vctrs_vctr untypeabletyped

unbound variable (line 131)
unbound: stop_incompatible_cast — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_cast
gradual mode: typed
((x: any, to: any, ...: any, i: any?) -> any)<>
timing: 4.78 s
source
vec_restore.vctrs_vctr <- function(x, to, ..., i = NULL) {
  if (typeof(x) != typeof(to)) {
    stop_incompatible_cast(x, to, x_arg = "", to_arg = "")
  }
  NextMethod()
}
R/type-vctr.R:129

vec_cast.vctrs_vctr untypeabletyped

unbound variable (line 139)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.vctrs_vctr <- function(x, to, ...) {
  UseMethod("vec_cast.vctrs_vctr")
}
R/type-vctr.R:138

vctr_cast untypeabletyped

unbound variable (line 148)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any_sexp, to: p(CHR) | <> | sym | null, ...: any, x_arg: any?, to_arg: any?, call: any?) -> any)<>
timing: 0.013 s
source
vctr_cast <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  # These are not strictly necessary, but make bootstrapping a new class
  # a bit simpler
  if (is.object(x)) {
    if (is_same_type(x, to)) {
      x
    } else {
      stop_incompatible_cast(
        x,
        to,
        x_arg = x_arg,
        to_arg = to_arg,
        call = call
      )
    }
  } else {
    # FIXME: `vec_restore()` should only be called on proxies
    vec_restore(x, to)
  }
}
R/type-vctr.R:142

c.vctrs_vctr untypeable

unbound variable (line 172)
unbound: is_false — a name the prelude does not declare
error detail
name: is_false
timing: 0.018 s
source
c.vctrs_vctr <- function(..., recursive = FALSE, use.names = TRUE) {
  if (!is_false(recursive)) {
    abort("`recursive` must be `FALSE` when concatenating vctrs classes.")
  }
  if (!is_true(use.names)) {
    abort("`use.names` must be `TRUE` when concatenating vctrs classes.")
  }
  vec_c(...)
}
R/type-vctr.R:171

print.vctrs_vctr untypeabletyped

unbound variable (line 185)
unbound: obj_print — one of the package’s own names, itself untyped
error detail
name: obj_print
gradual mode: typed
∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.003 s
source
print.vctrs_vctr <- function(x, ...) {
  obj_print(x, ...)
  invisible(x)
}
R/type-vctr.R:184

str.vctrs_vctr untypeabletyped

unbound variable (line 191)
unbound: obj_str — one of the package’s own names, itself untyped
error detail
name: obj_str
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
str.vctrs_vctr <- function(object, ...) {
  obj_str(object, ...)
}
R/type-vctr.R:190

format.vctrs_vctr untypeabletyped

unbound variable (line 196)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, ...: any) -> CHR<>)<>
timing: 0.003 s
source
format.vctrs_vctr <- function(x, ...) {
  format(vec_data(x), ...)
}
R/type-vctr.R:195

[.vctrs_vctr untypeabletyped

unbound variable (line 203)
unbound: vec_index — one of the package’s own names, itself untyped
error detail
name: vec_index
gradual mode: typed
((x: any, i: any, ...: any) -> any)<>
timing: 0.005 s
source
`[.vctrs_vctr` <- function(x, i, ...) {
  vec_index(x, i, ...)
}
R/type-vctr.R:202

[[.vctrs_vctr untypeabletyped

unbound variable (line 209)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, i: any, ...: any) -> any)<>
timing: 0.017 s
source
`[[.vctrs_vctr` <- function(x, i, ...) {
  if (is.list(x)) {
    NextMethod()
  } else {
    vec_restore(NextMethod(), x)
  }
}
R/type-vctr.R:207

$.vctrs_vctr untypeabletyped

unbound variable (line 218)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, i: any) -> any)<>
timing: 0.014 s
source
`$.vctrs_vctr` <- function(x, i) {
  if (is.list(x)) {
    NextMethod()
  } else {
    vec_restore(NextMethod(), x)
  }
}
R/type-vctr.R:216

rep.vctrs_vctr untypeabletyped

unbound variable (line 226)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
rep.vctrs_vctr <- function(x, ...) {
  vec_restore(NextMethod(), x)
}
R/type-vctr.R:225

length<-.vctrs_vctr untypeabletyped

unbound variable (line 231)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.002 s
source
`length<-.vctrs_vctr` <- function(x, value) {
  vec_restore(NextMethod(), x)
}
R/type-vctr.R:230

diff.vctrs_vctr untypeable

unbound variable (line 239)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
timing: 0.122 s
source
diff.vctrs_vctr <- function(x, lag = 1L, differences = 1L, ...) {
  stopifnot(length(lag) == 1L, lag >= 1L)
  stopifnot(length(differences) == 1L, differences >= 1L)

  n <- vec_size(x)
  if (lag * differences >= n) {
    return(vec_slice(x, 0L))
  }

  out <- x
  for (i in seq_len(differences)) {
    n <- vec_size(out)
    lhs <- (1L + lag):n
    rhs <- 1L:(n - lag)

    out <- vec_slice(out, lhs) - vec_slice(out, rhs)
  }

  out
}
R/type-vctr.R:235

[[<-.vctrs_vctr untypeabletyped

unbound variable (line 264)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, ...: any, value: any) -> any)<>
timing: 0.027 s
source
`[[<-.vctrs_vctr` <- function(x, ..., value) {
  if (!is.list(x)) {
    value <- vec_cast(value, x)
  }
  NextMethod()
}
R/type-vctr.R:260

$<-.vctrs_vctr untypeabletyped

unbound variable (line 270)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, i: any, value: any) -> any)<>
timing: 0.019 s
source
`$<-.vctrs_vctr` <- function(x, i, value) {
  if (is.list(x)) {
    NextMethod()
  } else {
    # Default behaviour is to cast LHS to a list
    abort("$ operator is invalid for atomic vectors.")
  }
}
R/type-vctr.R:268

[<-.vctrs_vctr untypeabletyped

unbound variable (line 279)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: any, i: any, value: any) -> any)<>
timing: 0.004 s
source
`[<-.vctrs_vctr` <- function(x, i, value) {
  value <- vec_cast(value, x)
  NextMethod()
}
R/type-vctr.R:278

names<-.vctrs_vctr untypeabletyped

unbound variable (line 286)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
((x: any, value: null) -> any)<>
timing: 0.025 s
source
`names<-.vctrs_vctr` <- function(x, value) {
  if (length(value) != 0 && length(value) != length(x)) {
    abort("`names()` must be the same length as x.")
  }

  value <- names_repair_missing(value)

  NextMethod()
}
R/type-vctr.R:284

as.logical.vctrs_vctr untypeabletyped

unbound variable (line 297)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.logical.vctrs_vctr <- function(x, ...) {
  vec_cast(x, logical())
}
R/type-vctr.R:296

as.integer.vctrs_vctr untypeabletyped

unbound variable (line 302)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.integer.vctrs_vctr <- function(x, ...) {
  vec_cast(x, integer())
}
R/type-vctr.R:301

as.double.vctrs_vctr untypeabletyped

unbound variable (line 307)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.double.vctrs_vctr <- function(x, ...) {
  vec_cast(x, double())
}
R/type-vctr.R:306

as.character.vctrs_vctr untypeabletyped

unbound variable (line 312)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.character.vctrs_vctr <- function(x, ...) {
  vec_cast(x, character())
}
R/type-vctr.R:311

as.list.vctrs_vctr untypeabletyped

unbound variable (line 317)
unbound: vec_chop — one of the package’s own names, itself untyped
error detail
name: vec_chop
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
as.list.vctrs_vctr <- function(x, ...) {
  out <- vec_chop(x)

  if (obj_is_list(x)) {
    out <- lapply(out, `[[`, 1)
  }

  out
}
R/type-vctr.R:316

as.Date.vctrs_vctr untypeabletyped

unbound variable (line 328)
unbound: new_date — one of the package’s own names, itself untyped
error detail
name: new_date
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as.Date.vctrs_vctr <- function(x, ...) {
  vec_cast(x, new_date())
}
R/type-vctr.R:327

as.POSIXct.vctrs_vctr untypeabletyped

unbound variable (line 333)
unbound: new_datetime — one of the package’s own names, itself untyped
error detail
name: new_datetime
gradual mode: typed
((x: any, tz: any?, ...: any) -> any)<>
timing: 0.005 s
source
as.POSIXct.vctrs_vctr <- function(x, tz = "", ...) {
  vec_cast(x, new_datetime(tzone = tz))
}
R/type-vctr.R:332

as.POSIXlt.vctrs_vctr untypeabletyped

unbound variable (line 338)
unbound: new_datetime — one of the package’s own names, itself untyped
error detail
name: new_datetime
gradual mode: typed
((x: any, tz: any?, ...: any) -> any)<>
timing: 0.005 s
source
as.POSIXlt.vctrs_vctr <- function(x, tz = "", ...) {
  to <- as.POSIXlt(new_datetime(), tz = tz)
  vec_cast(x, to)
}
R/type-vctr.R:337

as.data.frame2 untypeabletyped

unbound variable (line 349)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: <...>) -> any)<>
timing: 0.008 s
source
as.data.frame2 <- function(x) {
  # Unclass to avoid dispatching on `as.data.frame()` methods that break size
  # invariants, like `as.data.frame.table()` (#913). This also prevents infinite
  # recursion with shaped vctrs in `as.data.frame.vctrs_vctr()`.
  x <- unclass(x)

  out <- as.data.frame(x)

  if (vec_dim_n(x) == 1) {
    # 1D arrays are not stripped from their dimensions
    out[[1]] <- as.vector(out[[1]])

    # 1D arrays are auto-labelled with substitute()
    names(out) <- "V1"
  }

  out
}
R/type-vctr.R:343

as.data.frame.vctrs_vctr untypeable

unbound variable (line 368)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
timing: 0.026 s
source
as.data.frame.vctrs_vctr <- function(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  nm = paste(deparse(substitute(x), width.cutoff = 500L), collapse = " ")
) {
  force(nm)

  if (has_dim(x)) {
    return(as.data.frame2(x))
  }

  cols <- list(x)
  if (!optional) {
    names(cols) <- nm
  }

  new_data_frame(cols, n = vec_size(x))
}
R/type-vctr.R:363

as.factor.vctrs_vctr untypeabletyped

unbound variable (line 386)
unbound: new_factor — one of the package’s own names, itself untyped
error detail
name: new_factor
gradual mode: typed
((x: any, levels: any?, ...: any) -> any)<>
timing: 0.007 s
source
as.factor.vctrs_vctr <- function(x, levels = character(), ...) {
  vec_cast(x, new_factor(levels = levels))
}
R/type-vctr.R:385

as.ordered.vctrs_vctr untypeabletyped

unbound variable (line 391)
unbound: new_ordered — one of the package’s own names, itself untyped
error detail
name: new_ordered
gradual mode: typed
((x: any, levels: any?, ...: any) -> any)<>
timing: 0.007 s
source
as.ordered.vctrs_vctr <- function(x, levels = character(), ...) {
  vec_cast(x, new_ordered(levels = levels))
}
R/type-vctr.R:390

as.difftime.vctrs_vctr untypeabletyped

unbound variable (line 396)
unbound: new_duration — one of the package’s own names, itself untyped
error detail
name: new_duration
gradual mode: typed
((x: any, units: any?, ...: any) -> any)<>
timing: 0.005 s
source
as.difftime.vctrs_vctr <- function(x, units = "secs", ...) {
  vec_cast(x, new_duration(units = units))
}
R/type-vctr.R:395

==.vctrs_vctr typed fuzz ok

((e1: any_sexp, e2: any_sexp) -> any_sexp)<>
timing: 0.015 s
fuzzing: 8 inside (7 error pkg, 1 error type) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
==.vctrs_vctr("e1" = NULL, "e2" = as.name("x"))error_pkgvctrs::vec_equal: `y` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
==.vctrs_vctr(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "NA")error_pkgvctrs::vec_equal: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
==.vctrs_vctr(as.name("x"), NULL)error_pkgvctrs::vec_equal: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
==.vctrs_vctr("e1" = quote(f(x)), "e2" = function(...) NULL)error_pkgvctrs::vec_equal: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
==.vctrs_vctr(list(), c("NA", "é"))error_pkgvctrs::vec_equal: Can't combine `x` <list> and `y` <character>.
==.vctrs_vctr(NA_integer_, NULL)error_type::vec_equal: INTEGER() can only be applied to a 'integer', not a 'NULL'
and 2 more
source
`==.vctrs_vctr` <- function(e1, e2) {
  vec_equal(e1, e2)
}
R/type-vctr.R:402

!=.vctrs_vctr untypeable

untypeable application of base::! (line 407)
error detail
argument: @(any_sexp)
failing call: base::!(quote(x))
timing: 0.021 s
source
`!=.vctrs_vctr` <- function(e1, e2) {
  !vec_equal(e1, e2)
}
R/type-vctr.R:407

is.na.vctrs_vctr untypeabletyped

unbound variable (line 413)
unbound: vec_detect_missing — one of the package’s own names, itself untyped
error detail
name: vec_detect_missing
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
is.na.vctrs_vctr <- function(x) {
  vec_detect_missing(x)
}
R/type-vctr.R:412

na.fail.vctrs_vctr untypeabletyped

unbound variable (line 421)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
∀'a. ((object: 'a & any_sexp, ...: any) -> any_sexp & 'a)<>
timing: 0.009 s
source
na.fail.vctrs_vctr <- function(object, ...) {
  if (vec_any_missing(object)) {
    # Return the same error as `na.fail.default()`
    abort("missing values in object")
  }

  object
}
R/type-vctr.R:418

na_remove untypeable

unbound variable (line 448)
unbound: vec_detect_missing — one of the package’s own names, itself untyped
error detail
name: vec_detect_missing
timing: 0.040 s
source
na_remove <- function(x, type) {
  # The only difference between `na.omit()` and `na.exclude()` is the class
  # of the `na.action` attribute

  if (!vec_any_missing(x)) {
    return(x)
  }

  # `na.omit/exclude()` attach the locations of the omitted values to the result
  missing <- vec_detect_missing(x)
  loc <- which(missing)

  names <- vec_names(x)
  if (!is_null(names)) {
    # `na.omit/exclude()` retain the original names, if applicable
    names <- vec_slice(names, loc)
    loc <- vec_set_names(loc, names)
  }

  attr(loc, "class") <- type

  out <- vec_slice(x, !missing)
  attr(out, "na.action") <- loc
  out
}
R/type-vctr.R:439

na.omit.vctrs_vctr untypeabletyped

unbound variable (line 430)
unbound: na_remove — one of the package’s own names, itself untyped
error detail
name: na_remove
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.omit.vctrs_vctr <- function(object, ...) {
  na_remove(object, "omit")
}
R/type-vctr.R:429

na.exclude.vctrs_vctr untypeabletyped

unbound variable (line 436)
unbound: na_remove — one of the package’s own names, itself untyped
error detail
name: na_remove
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.002 s
source
na.exclude.vctrs_vctr <- function(object, ...) {
  na_remove(object, "exclude")
}
R/type-vctr.R:435

anyNA.vctrs_vctr typed any: x fuzz ok

((x: any, recursive: ff?) -> LGL1<>)<>
gradual mode: typed
(((x: any, recursive: any?) -> any)&((x: any, recursive: ff?) -> LGL1<>))<>
timing: 0.041 s
fuzzing: 8 inside (8 ok) · 7 outside (7 rejected)
source
anyNA.vctrs_vctr <- function(x, recursive = FALSE) {
  if (recursive && obj_is_list(x)) {
    any(map_lgl(x, anyNA, recursive = recursive))
  } else {
    any(is.na(x))
  }
}
R/type-vctr.R:466

unique.vctrs_vctr untypeabletyped

unbound variable (line 476)
unbound: vec_unique — one of the package’s own names, itself untyped
error detail
name: vec_unique
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.005 s
source
unique.vctrs_vctr <- function(x, incomparables = FALSE, ...) {
  vec_unique(x)
}
R/type-vctr.R:475

duplicated.vctrs_vctr untypeabletyped

unbound variable (line 481)
unbound: vec_duplicate_id — one of the package’s own names, itself untyped
error detail
name: vec_duplicate_id
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> ^lgl1)<>
timing: 0.005 s
source
duplicated.vctrs_vctr <- function(x, incomparables = FALSE, ...) {
  vec_duplicate_id(x) != seq_along(x)
}
R/type-vctr.R:480

anyDuplicated.vctrs_vctr typed any: incomparables fuzz ok

((x: any_sexp, incomparables: any?, ...: any) -> ^LGL1)<>
timing: 0.022 s
fuzzing: 8 inside (3 ok, 5 error type) · 4 outside (4 rejected)

Other calls inside the domain

callverdicterror
anyDuplicated.vctrs_vctr(new.env(), "incomparables" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = NULL)error_type::vec_size: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
anyDuplicated.vctrs_vctr(new.env(), NULL)error_type::vec_size: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
anyDuplicated.vctrs_vctr(new.env(), list(c("a", "x y")), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = new.env())error_type::vec_size: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
anyDuplicated.vctrs_vctr(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), new.env(), list())error_type::vec_size: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
anyDuplicated.vctrs_vctr("x" = quote(f(x)), "incomparables" = new.env(), "fuzz_dot1" = list())error_type::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
anyDuplicated.vctrs_vctr <- function(x, incomparables = FALSE, ...) {
  vec_duplicate_any(x)
}
R/type-vctr.R:485

<=.vctrs_vctr untypeabletyped

unbound variable (line 493)
unbound: vec_compare — one of the package’s own names, itself untyped
error detail
name: vec_compare
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.004 s
source
`<=.vctrs_vctr` <- function(e1, e2) {
  vec_compare(e1, e2) <= 0
}
R/type-vctr.R:492

<.vctrs_vctr untypeabletyped

unbound variable (line 498)
unbound: vec_compare — one of the package’s own names, itself untyped
error detail
name: vec_compare
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.004 s
source
`<.vctrs_vctr` <- function(e1, e2) {
  vec_compare(e1, e2) < 0
}
R/type-vctr.R:497

>=.vctrs_vctr untypeabletyped

unbound variable (line 503)
unbound: vec_compare — one of the package’s own names, itself untyped
error detail
name: vec_compare
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.004 s
source
`>=.vctrs_vctr` <- function(e1, e2) {
  vec_compare(e1, e2) >= 0
}
R/type-vctr.R:502

>.vctrs_vctr untypeabletyped

unbound variable (line 508)
unbound: vec_compare — one of the package’s own names, itself untyped
error detail
name: vec_compare
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.004 s
source
`>.vctrs_vctr` <- function(e1, e2) {
  vec_compare(e1, e2) > 0
}
R/type-vctr.R:507

xtfrm.vctrs_vctr untypeable

unbound variable (line 513)
unbound: vec_proxy_order — one of the package’s own names, itself untyped
error detail
name: vec_proxy_order
timing: 0.179 s
source
xtfrm.vctrs_vctr <- function(x) {
  proxy <- vec_proxy_order(x)
  type <- typeof(proxy)

  if (type == "logical") {
    proxy <- unstructure(proxy)
    proxy <- as.integer(proxy)
    return(proxy)
  }

  if (type %in% c("integer", "double")) {
    proxy <- unstructure(proxy)
    return(proxy)
  }

  vec_rank(proxy, ties = "dense", incomplete = "na")
}
R/type-vctr.R:512

median.vctrs_vctr untypeabletyped

unbound variable (line 534)
unbound: stop_unimplemented — one of the package’s own names, itself untyped
error detail
name: stop_unimplemented
gradual mode: typed
((x: any, ...: any, na.rm: any?) -> any)<>
timing: 0.004 s
source
median.vctrs_vctr <- function(x, ..., na.rm = FALSE) {
  # nocov start
  stop_unimplemented(x, "median")
  # nocov end
}
R/type-vctr.R:532

quantile.vctrs_vctr untypeabletyped

unbound variable (line 542)
unbound: stop_unimplemented — one of the package’s own names, itself untyped
error detail
name: stop_unimplemented
gradual mode: typed
((x: any, ...: any, type: any?, na.rm: any?) -> any)<>
timing: 0.005 s
source
quantile.vctrs_vctr <- function(x, ..., type = 1, na.rm = FALSE) {
  # nocov start
  stop_unimplemented(x, "quantile")
  # nocov end
}
R/type-vctr.R:540

vec_cast_or_na skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
vec_cast_or_na <- function(x, to, ...) {
  tryCatch(
    vctrs_error_incompatible_type = function(...) vec_init(to, length(x)),
    vec_cast(x, to)
  )
}
R/type-vctr.R:546

min.vctrs_vctr untypeabletyped

unbound variable (line 555)
unbound: vec_is_empty — one of the package’s own names, itself untyped
error detail
name: vec_is_empty
gradual mode: typed
((x: any, ...: any, na.rm: any?) -> any)<>
timing: 0.019 s
source
min.vctrs_vctr <- function(x, ..., na.rm = FALSE) {
  if (vec_is_empty(x)) {
    return(vec_cast_or_na(Inf, x))
  }

  # TODO: implement to do vec_arg_min()
  rank <- xtfrm(x)

  if (isTRUE(na.rm)) {
    idx <- which.min(rank)
    if (vec_is_empty(idx)) {
      return(vec_cast_or_na(Inf, x))
    }
  } else {
    idx <- which(vec_equal(rank, min(rank), na_equal = TRUE))
  }

  x[[idx[[1]]]]
}
R/type-vctr.R:554

max.vctrs_vctr untypeabletyped

unbound variable (line 576)
unbound: vec_is_empty — one of the package’s own names, itself untyped
error detail
name: vec_is_empty
gradual mode: typed
((x: any, ...: any, na.rm: any?) -> any)<>
timing: 0.020 s
source
max.vctrs_vctr <- function(x, ..., na.rm = FALSE) {
  if (vec_is_empty(x)) {
    return(vec_cast_or_na(-Inf, x))
  }

  # TODO: implement to do vec_arg_max()
  rank <- xtfrm(x)

  if (isTRUE(na.rm)) {
    idx <- which.max(rank)
    if (vec_is_empty(idx)) {
      return(vec_cast_or_na(-Inf, x))
    }
  } else {
    idx <- which(vec_equal(rank, max(rank), na_equal = TRUE))
  }

  x[[idx[[1]]]]
}
R/type-vctr.R:575

range.vctrs_vctr untypeabletyped

unbound variable (line 597)
unbound: vec_is_empty — one of the package’s own names, itself untyped
error detail
name: vec_is_empty
gradual mode: typed
((x: any, ...: any, na.rm: any?) -> any)<>
timing: 0.036 s
source
range.vctrs_vctr <- function(x, ..., na.rm = FALSE) {
  if (vec_is_empty(x)) {
    return(vec_cast_or_na(c(Inf, -Inf), x))
  }

  # Inline `min()` / `max()` to only call `xtfrm()` once
  rank <- xtfrm(x)

  if (isTRUE(na.rm)) {
    idx_min <- which.min(rank)
    idx_max <- which.max(rank)
    if (vec_is_empty(idx_min) && vec_is_empty(idx_max)) {
      return(vec_cast_or_na(c(Inf, -Inf), x))
    }
  } else {
    idx_min <- which(vec_equal(rank, min(rank), na_equal = TRUE))
    idx_max <- which(vec_equal(rank, max(rank), na_equal = TRUE))
  }

  c(x[[idx_min[[1]]]], x[[idx_max[[1]]]])
}
R/type-vctr.R:596

Math.vctrs_vctr untypeabletyped

unbound variable (line 622)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
Math.vctrs_vctr <- function(x, ...) {
  vec_math(.Generic, x, ...)
}
R/type-vctr.R:621

Summary.vctrs_vctr untypeable

unbound variable (line 627)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
timing: 0.002 s
source
Summary.vctrs_vctr <- function(..., na.rm = FALSE) {
  vec_math(.Generic, vec_c(...), na.rm = na.rm)
}
R/type-vctr.R:626

mean.vctrs_vctr untypeabletyped

unbound variable (line 632)
unbound: vec_math — one of the package’s own names, itself untyped
error detail
name: vec_math
gradual mode: typed
((x: any, ...: any, na.rm: any?) -> any)<>
timing: 0.004 s
source
mean.vctrs_vctr <- function(x, ..., na.rm = FALSE) {
  vec_math("mean", x, na.rm = na.rm)
}
R/type-vctr.R:631

is.finite.vctrs_vctr untypeabletyped

unbound variable (line 637)
unbound: vec_math — one of the package’s own names, itself untyped
error detail
name: vec_math
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
is.finite.vctrs_vctr <- function(x) {
  vec_math("is.finite", x)
}
R/type-vctr.R:636

is.infinite.vctrs_vctr untypeabletyped

unbound variable (line 642)
unbound: vec_math — one of the package’s own names, itself untyped
error detail
name: vec_math
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
is.infinite.vctrs_vctr <- function(x) {
  vec_math("is.infinite", x)
}
R/type-vctr.R:641

is.nan.vctrs_vctr untypeabletyped

unbound variable (line 647)
unbound: vec_math — one of the package’s own names, itself untyped
error detail
name: vec_math
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
is.nan.vctrs_vctr <- function(x) {
  vec_math("is.nan", x)
}
R/type-vctr.R:646

+.vctrs_vctr untypeabletyped

unbound variable (line 655)
unbound: MISSING — one of the package’s own names, itself untyped
error detail
name: MISSING
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.008 s
source
`+.vctrs_vctr` <- function(e1, e2) {
  if (missing(e2)) {
    vec_arith("+", e1, MISSING())
  } else {
    vec_arith("+", e1, e2)
  }
}
R/type-vctr.R:653

-.vctrs_vctr untypeabletyped

unbound variable (line 664)
unbound: MISSING — one of the package’s own names, itself untyped
error detail
name: MISSING
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.008 s
source
`-.vctrs_vctr` <- function(e1, e2) {
  if (missing(e2)) {
    vec_arith("-", e1, MISSING())
  } else {
    vec_arith("-", e1, e2)
  }
}
R/type-vctr.R:662

*.vctrs_vctr untypeabletyped

unbound variable (line 672)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`*.vctrs_vctr` <- function(e1, e2) {
  vec_arith("*", e1, e2)
}
R/type-vctr.R:671

/.vctrs_vctr untypeabletyped

unbound variable (line 677)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`/.vctrs_vctr` <- function(e1, e2) {
  vec_arith("/", e1, e2)
}
R/type-vctr.R:676

^.vctrs_vctr untypeabletyped

unbound variable (line 682)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`^.vctrs_vctr` <- function(e1, e2) {
  vec_arith("^", e1, e2)
}
R/type-vctr.R:681

%%.vctrs_vctr untypeabletyped

unbound variable (line 687)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`%%.vctrs_vctr` <- function(e1, e2) {
  vec_arith("%%", e1, e2)
}
R/type-vctr.R:686

%/%.vctrs_vctr untypeabletyped

unbound variable (line 692)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`%/%.vctrs_vctr` <- function(e1, e2) {
  vec_arith("%/%", e1, e2)
}
R/type-vctr.R:691

!.vctrs_vctr untypeabletyped

unbound variable (line 697)
unbound: MISSING — one of the package’s own names, itself untyped
error detail
name: MISSING
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
`!.vctrs_vctr` <- function(x) {
  vec_arith("!", x, MISSING())
}
R/type-vctr.R:696

&.vctrs_vctr untypeabletyped

unbound variable (line 702)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`&.vctrs_vctr` <- function(e1, e2) {
  vec_arith("&", e1, e2)
}
R/type-vctr.R:701

|.vctrs_vctr untypeabletyped

unbound variable (line 707)
unbound: vec_arith — one of the package’s own names, itself untyped
error detail
name: vec_arith
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.003 s
source
`|.vctrs_vctr` <- function(e1, e2) {
  vec_arith("|", e1, e2)
}
R/type-vctr.R:706

summary.vctrs_vctr untypeabletyped

unbound variable (line 715)
unbound: stop_unimplemented — one of the package’s own names, itself untyped
error detail
name: stop_unimplemented
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.002 s
source
summary.vctrs_vctr <- function(object, ...) {
  # nocov start
  stop_unimplemented(object, "summary")
  # nocov end
}
R/type-vctr.R:713

dim<-.vctrs_vctr untypeabletyped

unbound variable (line 723)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`dim<-.vctrs_vctr` <- function(x, value) {
  stop_unsupported(x, "dim<-")
}
R/type-vctr.R:722

dimnames<-.vctrs_vctr untypeabletyped

unbound variable (line 728)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.002 s
source
`dimnames<-.vctrs_vctr` <- function(x, value) {
  stop_unsupported(x, "dimnames<-")
}
R/type-vctr.R:727

levels.vctrs_vctr typed any: x accepts outside

((x: any) -> null)<>
timing: 0.003 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdroplevels.vctrs_vctr()null
source
levels.vctrs_vctr <- function(x) {
  NULL
}
R/type-vctr.R:732

levels<-.vctrs_vctr untypeabletyped

unbound variable (line 738)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`levels<-.vctrs_vctr` <- function(x, value) {
  stop_unsupported(x, "levels<-")
}
R/type-vctr.R:737

t.vctrs_vctr untypeabletyped

unbound variable (line 743)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
`t.vctrs_vctr` <- function(x) {
  stop_unsupported(x, "t")
}
R/type-vctr.R:742

is.na<-.vctrs_vctr untypeable

unbound variable (line 748)
unbound: vec_init — one of the package’s own names, itself untyped
error detail
name: vec_init
timing: 0.002 s
source
`is.na<-.vctrs_vctr` <- function(x, value) {
  vec_assign(x, value, vec_init(x))
}
R/type-vctr.R:747

new_hidden untypeabletyped

unbound variable (line 758)
unbound: vec_cast — one of the package’s own names, itself untyped
error detail
name: vec_cast
gradual mode: typed
((x: (DBL | INT)?) -> any)<>
timing: 0.024 s
source
new_hidden <- function(x = double()) {
  stopifnot(is.numeric(x))
  new_vctr(vec_cast(x, double()), class = "hidden", inherit_base_type = FALSE)
}
R/type-vctr.R:756

format.hidden typed any: x fuzz ok

((x: any, ...: any) -> CHR)<>
timing: 0.012 s
fuzzing: 8 inside (8 ok) · 4 outside (4 rejected)
source
format.hidden <- function(x, ...) rep("xxx", length(x))
R/type-vctr.R:762

local_hidden untypeabletyped

unbound variable (line 764)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((frame: any?) -> any)<>
timing: 0.014 s
source
local_hidden <- function(frame = caller_env()) {
  local_bindings(
    .env = global_env(),
    .frame = frame,
    vec_ptype2.hidden.hidden = function(x, y, ...) new_hidden(),
    vec_ptype2.hidden.double = function(x, y, ...) new_hidden(),
    vec_ptype2.double.hidden = function(x, y, ...) new_hidden(),
    vec_ptype2.hidden.logical = function(x, y, ...) new_hidden(),
    vec_ptype2.logical.hidden = function(x, y, ...) new_hidden(),

    vec_cast.hidden.hidden = function(x, to, ...) x,
    vec_cast.hidden.double = function(x, to, ...) new_hidden(vec_data(x)),
    vec_cast.double.hidden = function(x, to, ...) vec_data(x),
    vec_cast.hidden.logical = function(x, to, ...) new_hidden(as.double(x)),
    vec_cast.logical.hidden = function(x, to, ...) as.logical(vec_data(x))
  )
}
R/type-vctr.R:764
R/cast.R

vec_cast untypeable

unbound variable (line 73)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
timing: 0.020 s
source
vec_cast <- function(
  x,
  to,
  ...,
  x_arg = caller_arg(x),
  to_arg = "",
  call = caller_env()
) {
  if (!missing(...)) {
    check_ptype2_dots_empty(...)
  }
  return(.Call(ffi_cast, x, to, environment()))
  UseMethod("vec_cast", to)
}
R/cast.R:69

vec_cast_dispatch untypeabletyped

unbound variable (line 84)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.008 s
source
vec_cast_dispatch <- function(x, to, ..., x_arg = "", to_arg = "") {
  UseMethod("vec_cast", to)
}
R/cast.R:83

vec_cast_dispatch_native untypeabletyped

unbound variable (line 93)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: LGL<> | null, to: LGL<> | null, ...: any, x_arg: (CHR | null)?, to_arg: (CHR | null)?, call: any?) -> any_sexp)<>
timing: 0.011 s
source
vec_cast_dispatch_native <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  .Call(
    ffi_cast_dispatch_native,
    x,
    to,
    match_fallback_opts(...),
    x_arg,
    to_arg,
    environment()
  )
}
R/cast.R:87

vec_cast_common untypeabletyped

unbound variable (line 108)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((...: any, .to: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.006 s
source
vec_cast_common <- function(..., .to = NULL, .arg = "", .call = caller_env()) {
  .External2(ffi_cast_common, list2(...), .to)
}
R/cast.R:108

vec_cast_common_opts untypeabletyped

unbound variable (line 116)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((...: any, .to: any?, .opts: any?, .arg: any?, .call: any?) -> any)<>
timing: 0.009 s
source
vec_cast_common_opts <- function(
  ...,
  .to = NULL,
  .opts = fallback_opts(),
  .arg = "",
  .call = caller_env()
) {
  .External2(ffi_cast_common_opts, list2(...), .to, .opts)
}
R/cast.R:111

vec_cast_common_params skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_cast_common_params <- function(
  ...,
  .to = NULL,
  .s3_fallback = NULL,
  .arg = "",
  .call = caller_env()
) {
  opts <- fallback_opts(
    s3_fallback = .s3_fallback
  )
  vec_cast_common_opts(
    ...,
    .to = .to,
    .opts = opts,
    .arg = .arg,
    .call = .call
  )
}
R/cast.R:120

vec_cast_common_fallback skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_cast_common_fallback <- function(
  ...,
  .to = NULL,
  .arg = "",
  .call = caller_env()
) {
  vec_cast_common_opts(
    ...,
    .to = .to,
    .opts = enabled_fallback_opts(),
    .arg = .arg,
    .call = .call
  )
}
R/cast.R:138

vec_default_cast skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.002 s
source
vec_default_cast <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  if (is_asis(x)) {
    return(vec_cast_from_asis(
      x,
      to,
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    ))
  }
  if (is_asis(to)) {
    return(vec_cast_to_asis(
      x,
      to,
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    ))
  }

  if (
    inherits(to, "vctrs_vctr") &&
      !inherits(to, c("vctrs_rcrd", "vctrs_list_of"))
  ) {
    return(vctr_cast(
      x,
      to,
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    ))
  }

  opts <- match_fallback_opts(...)

  if (is_common_class_fallback(to) && length(common_class_suffix(x, to))) {
    return(x)
  }

  # Data frames have special bare class and same type fallbacks
  if (is.data.frame(x) && is.data.frame(to)) {
    out <- df_cast_opts(
      x,
      to,
      ...,
      opts = opts,
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    )

    # Same-type fallback for data frames. If attributes of the empty
    # data frames are congruent, just reproduce these attributes. This
    # eschews any constraints on rows and cols that `[` and `[<-`
    # methods might have. If that is a problem, the class needs to
    # implement vctrs methods.
    if (identical(non_df_attrib(x), non_df_attrib(to))) {
      attributes(out) <- c(df_attrib(out), non_df_attrib(to))
      return(out)
    }

    # Bare-class fallback for data frames.
    # FIXME: Should we only allow it when target is a bare df?
    if (inherits(to, "tbl_df")) {
      out <- df_as_tibble(out)
    }
    return(out)
  }

  if (is_same_type(x, to)) {
    return(x)
  }

  withRestarts(
    stop_incompatible_cast(
      x,
      to,
      x_arg = x_arg,
      to_arg = to_arg,
      `vctrs:::from_dispatch` = match_from_dispatch(...),
      call = call
    ),
    vctrs_restart_cast = function(out) {
      out
    }
  )
}
R/cast.R:156

is_bare_df untypeabletyped

unbound variable (line 252)
unbound: inherits_only — a name the prelude does not declare
error detail
name: inherits_only
gradual mode: typed
((x: any) -> ff<> | tt<>)<>
timing: 0.004 s
source
is_bare_df <- function(x) {
  inherits_only(x, "data.frame") ||
    inherits_only(x, c("tbl_df", "tbl", "data.frame"))
}
R/cast.R:251
R/type-unspecified.R

<statement> typed

timing: 0.000 s
source
NULL
R/type-unspecified.R:80

unspecified untypeable

untypeable application (line 86)
error detail
function: ((x1: ^INT1) --> LGL) & ((x1: null) --> empty)
argument: @(0.<> | 'n)
argument (not in the domain) may be: (new.env())
timing: 0.019 s
source
unspecified <- function(n = 0) {
  .Call(vctrs_unspecified, n)
}
R/type-unspecified.R:86

[.vctrs_unspecified untypeabletyped

unbound variable (line 92)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, i: any, ...: any) -> any)<>
timing: 0.004 s
source
`[.vctrs_unspecified` <- function(x, i, ...) {
  unspecified(length(NextMethod()))
}
R/type-unspecified.R:91

print.vctrs_unspecified typed any: x fuzz ok

((x: any, ...: any) -> null)<>
timing: 0.009 s
fuzzing: 8 inside (8 ok) · 3 outside (3 rejected)
source
print.vctrs_unspecified <- function(x, ...) {
  cat("<unspecified> [", length(x), "]\n", sep = "")
}
R/type-unspecified.R:96

vec_ptype_abbr.vctrs_unspecified typed any: x accepts outside

((x: any, ...: any) -> "???"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_abbr.vctrs_unspecified("fuzz_dot1" = NULL, "fuzz_dot2" = new.env())"???"<> with { }
xdropvec_ptype_abbr.vctrs_unspecified()"???"<> with { }
xdropvec_ptype_abbr.vctrs_unspecified("fuzz_dot1" = function(...) function(...) new.env())"???"<> with { }
xdropvec_ptype_abbr.vctrs_unspecified("fuzz_dot1" = list())"???"<> with { }
xdropvec_ptype_abbr.vctrs_unspecified("fuzz_dot1" = c(0L, 42L, 0L, 2L, -2147483647L), "fuzz_dot2" = list(NULL, as.raw(c(255, 0))))"???"<> with { }
source
vec_ptype_abbr.vctrs_unspecified <- function(x, ...) {
  "???"
}
R/type-unspecified.R:101

is_unspecified typed accepts outside

(((x: (LGL<> | <...>) | null) -> ^LGL1)&((x: null) -> ff))<>
timing: 0.022 s
fuzzing: 5 inside (5 ok) · 8 outside (2 rejected, 6 accepted)

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:envis_unspecified("x" = new.env())ff<> with { }
xkind:symis_unspecified(as.name("x"))ff<> with { }
xretype:lgl>rawis_unspecified(as.raw(c(0, 0, 0, 255, 255)))ff<> with { }
xretype:lgl>rawis_unspecified(as.raw(c(255)))ff<> with { }
xretype:lgl>rawis_unspecified("x" = as.raw(c(0)))ff<> with { }
xwrapis_unspecified(list(NULL))ff<> with { }
source
is_unspecified <- function(x) {
  .Call(vctrs_is_unspecified, x)
}
R/type-unspecified.R:105

ununspecify typed accepts outside

∀'a. ((x: 'a & null) -> null & 'a)<>
gradual mode: typed
∀'a. (((x: 'a & null) -> null & 'a)&((x: 'a & ((LGL<> | <...>) | null)) -> any))<>
timing: 0.022 s
fuzzing: 2 inside (2 ok) · 7 outside (1 rejected, 6 accepted)
type drawn from: ((x: 'x & null) -> null & 'x)<>

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:chrununspecify("fuzz")"fuzz"<> with { }
xkind:envununspecify("x" = new.env())env<> with { }
xkind:envununspecify(new.env())env<> with { }
xkind:langununspecify("x" = quote(f(x)))lang<> with { }
xwrapununspecify("x" = list(NULL)){ null }<> with { }
xwrapununspecify(list(NULL)){ null }<> with { }
source
ununspecify <- function(x) {
  if (is_unspecified(x)) {
    new_logical(length(x))
  } else {
    x
  }
}
R/type-unspecified.R:109

vec_ptype_finalise untypeabletyped

unbound variable (line 126)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
∀'a. ((x: 'a & null, ...: any) -> 'a)<>
timing: 0.004 s
source
vec_ptype_finalise <- function(x, ...) {
  check_dots_empty0(...)
  return(.Call(vctrs_ptype_finalise, x))
  UseMethod("vec_ptype_finalise")
}
R/type-unspecified.R:125

vec_ptype_finalise_dispatch untypeabletyped

unbound variable (line 132)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_ptype_finalise_dispatch <- function(x, ...) {
  UseMethod("vec_ptype_finalise")
}
R/type-unspecified.R:131

vec_ptype_finalise.default typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.005 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_ptype_finalise.default <- function(x, ...) {
  x
}
R/type-unspecified.R:136
R/assert.R

is_same_type untypeabletyped

unbound variable (line 482)
unbound: vec_slice — one of the package’s own names, itself untyped
error detail
name: vec_slice
gradual mode: typed
((x: any_sexp, ptype: any_sexp) -> LGL1<>)<>
timing: 0.006 s
source
is_same_type <- function(x, ptype) {
  x <- vec_slice(x, integer())
  ptype <- vec_slice(ptype, integer())

  # FIXME: Remove row names for matrices and arrays, and handle empty
  # but existing dimnames
  x <- vec_set_names(x, NULL)
  ptype <- vec_set_names(ptype, NULL)

  identical(x, ptype)
}
R/assert.R:481

obj_is_vector typed accepts outside

((x: p(CHR) | <> | sym | null) -> ^LGL1)<>
timing: 0.012 s
fuzzing: 8 inside (8 ok) · 5 outside (2 rejected, 3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xclass:addobj_is_vector("x" = structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), class = "fuzz_cls"))ff<> with { }
xclass:addobj_is_vector(structure(as.raw(c(255)), class = "fuzz_cls"))tt<> with { }
xclass:addobj_is_vector("x" = structure(function(...) function(...) function(...) quote(f(x)), class = "fuzz_cls"))ff<> with { }
source
obj_is_vector <- function(x) {
  .Call(ffi_obj_is_vector, x)
}
R/assert.R:277

stop_assert skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_assert <- function(
  message = NULL,
  class = NULL,
  ...,
  call = caller_env()
) {
  stop_vctrs(
    message,
    class = c(class, "vctrs_error_assert"),
    ...,
    call = call
  )
}
R/assert.R:122

stop_assert_size untypeabletyped

unbound variable (line 109)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((actual: any, required: any, arg: any, call: any?) -> any)<>
timing: 0.009 s
source
stop_assert_size <- function(actual, required, arg, call = caller_env()) {
  arg <- arg_backtick(arg)
  message <- glue::glue("{arg} must have size {required}, not size {actual}.")

  stop_assert(
    message,
    class = "vctrs_error_assert_size",
    actual = actual,
    required = required,
    call = call
  )
}
R/assert.R:109

layout_type untypeabletyped

unbound variable (line 516)
unbound: indent — one of the package’s own names, itself untyped
error detail
name: indent
gradual mode: typed
(((start: any, type: vec) -> CHR<>)&((start: vec1, type: vec1) -> CHR1<>))<>
timing: 0.044 s
source
layout_type <- function(start, type) {
  if (str_is_multiline(type)) {
    paste_line(
      paste0(start, ":"),
      "",
      paste0("  ", indent(type, 2))
    )
  } else {
    paste0(start, " ", type, ".")
  }
}
R/assert.R:511

vec_assert_type_explain untypeable

unbound variable (line 495)
unbound: vec_ptype_full — one of the package’s own names, itself untyped
error detail
name: vec_ptype_full
timing: 0.045 s
source
vec_assert_type_explain <- function(x, type, arg) {
  arg <- str_backtick(arg)
  x <- paste0("<", vec_ptype_full(x), ">")
  type <- paste0("<", vec_ptype_full(type), ">")

  intro <- paste0(arg, " must be a vector with type")
  intro <- layout_type(intro, type)

  outro <- paste0("Instead, it has type")
  outro <- layout_type(outro, x)

  paste_line(
    !!!intro,
    if (str_is_multiline(intro)) "",
    !!!outro
  )
}
R/assert.R:493

vec_assert untypeable

unbound variable (line 64)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
timing: 0.067 s
source
vec_assert <- function(
  x,
  ptype = NULL,
  size = NULL,
  arg = caller_arg(x),
  call = caller_env()
) {
  if (!obj_is_vector(x)) {
    stop_scalar_type(x, arg, call = call)
  }

  if (!is_null(ptype)) {
    ptype <- vec_ptype(ptype)
    x_type <- vec_ptype_finalise(vec_ptype(x))
    if (!is_same_type(x_type, ptype)) {
      msg <- vec_assert_type_explain(x_type, ptype, arg)
      abort(
        msg,
        class = c("vctrs_error_assert_ptype", "vctrs_error_assert"),
        required = ptype,
        actual = x_type,
        call = call
      )
    }
  }

  if (!is_null(size)) {
    size <- vec_cast(size, integer(), x_arg = "size")

    n_size <- length(size)
    if (n_size != 1L) {
      abort(glue::glue("`size` must be length 1, not length {n_size}."))
    }

    x_size <- vec_size(x)
    if (!identical(x_size, size)) {
      stop_assert_size(
        x_size,
        size,
        arg,
        call = call
      )
    }
  }

  invisible(x)
}
R/assert.R:60

vec_is untypeable

unbound variable (line 143)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.093 s
source
vec_is <- function(x, ptype = NULL, size = NULL) {
  if (!obj_is_vector(x)) {
    return(FALSE)
  }

  if (!is_null(ptype)) {
    ptype <- vec_ptype(ptype)
    x_type <- vec_ptype_finalise(vec_ptype(x))
    if (!is_same_type(x_type, ptype)) {
      return(FALSE)
    }
  }

  if (!is_null(size)) {
    size <- vec_recycle(vec_cast(size, integer()), 1L)
    x_size <- vec_size(x)
    if (!identical(x_size, size)) {
      return(FALSE)
    }
  }

  TRUE
}
R/assert.R:138

<statement> typed

timing: 0.000 s
source
NULL
R/assert.R:273

obj_check_vector untypeabletyped

unbound variable (line 283)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: any, ...: any, arg: any?, call: any?) -> any)<>
timing: 0.005 s
source
obj_check_vector <- function(x, ..., arg = caller_arg(x), call = caller_env()) {
  check_dots_empty0(...)
  invisible(.Call(ffi_obj_check_vector, x, environment()))
}
R/assert.R:283

vec_check_size untypeabletyped

unbound variable (line 294)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: any, size: any, ...: any, arg: any?, call: any?) -> any)<>
timing: 0.008 s
source
vec_check_size <- function(
  x,
  size,
  ...,
  arg = caller_arg(x),
  call = caller_env()
) {
  check_dots_empty0(...)
  invisible(.Call(ffi_vec_check_size, x, size, environment()))
}
R/assert.R:290

vec_check_recyclable untypeabletyped

unbound variable (line 307)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: any, size: any, ...: any, arg: any?, call: any?) -> any)<>
timing: 0.009 s
source
vec_check_recyclable <- function(
  x,
  size,
  ...,
  arg = caller_arg(x),
  call = caller_env()
) {
  check_dots_empty0(...)
  invisible(.Call(ffi_vec_check_recyclable, x, size, environment()))
}
R/assert.R:303

obj_is_list typed accepts outside

((x: p(CHR) | <> | sym | null) -> ^LGL1)<>
timing: 0.011 s
fuzzing: 6 inside (6 ok) · 7 outside (5 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xclass:addobj_is_list(structure(quote(f(x)), class = "fuzz_cls"))ff<> with { }
xclass:addobj_is_list("x" = structure(function(...) as.name("x"), class = "fuzz_cls"))ff<> with { }
source
obj_is_list <- function(x) {
  .Call(ffi_obj_is_list, x)
}
R/assert.R:387

obj_check_list untypeabletyped

unbound variable (line 392)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: p(CHR) | <> | sym | null, ...: any, arg: any?, call: any?) -> null)<>
timing: 0.006 s
source
obj_check_list <- function(x, ..., arg = caller_arg(x), call = caller_env()) {
  check_dots_empty0(...)
  invisible(.Call(ffi_check_list, x, environment()))
}
R/assert.R:392

list_all_vectors untypeabletyped

unbound variable (line 400)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: p(CHR) | <> | sym | null, ...: any, allow_null: LGL?) -> ^LGL1)<>
timing: 0.005 s
source
list_all_vectors <- function(x, ..., allow_null = FALSE) {
  check_dots_empty0(...)
  .Call(ffi_list_all_vectors, x, allow_null, environment())
}
R/assert.R:399

list_check_all_vectors untypeabletyped

unbound variable (line 410)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: p(CHR) | <> | sym | null, ...: any, allow_null: LGL?, arg: any?, call: any?) -> null)<>
timing: 0.007 s
source
list_check_all_vectors <- function(
  x,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  check_dots_empty0(...)
  invisible(.Call(ffi_list_check_all_vectors, x, allow_null, environment()))
}
R/assert.R:406

list_all_size untypeabletyped

unbound variable (line 420)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: p(CHR) | <> | sym | null, size: any_sexp, ...: any, allow_null: LGL?) -> ^LGL1)<>
timing: 0.007 s
source
list_all_size <- function(x, size, ..., allow_null = FALSE) {
  check_dots_empty0(...)
  .Call(ffi_list_all_size, x, size, allow_null, environment())
}
R/assert.R:419

list_check_all_size untypeabletyped

unbound variable (line 431)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: p(CHR) | <> | sym | null, size: any_sexp, ...: any, allow_null: LGL?, arg: any?, call: any?) -> null)<>
timing: 0.011 s
source
list_check_all_size <- function(
  x,
  size,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  check_dots_empty0(...)
  invisible(.Call(
    ffi_list_check_all_size,
    x,
    size,
    allow_null,
    environment()
  ))
}
R/assert.R:426

list_all_recyclable untypeabletyped

unbound variable (line 447)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: p(CHR) | <> | sym | null, size: any_sexp, ...: any, allow_null: LGL?) -> ^LGL1)<>
timing: 0.007 s
source
list_all_recyclable <- function(x, size, ..., allow_null = FALSE) {
  check_dots_empty0(...)
  .Call(ffi_list_all_recyclable, x, size, allow_null, environment())
}
R/assert.R:446

list_check_all_recyclable untypeabletyped

unbound variable (line 458)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: p(CHR) | <> | sym | null, size: any_sexp, ...: any, allow_null: LGL?, arg: any?, call: any?) -> null)<>
timing: 0.011 s
source
list_check_all_recyclable <- function(
  x,
  size,
  ...,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
) {
  check_dots_empty0(...)
  invisible(.Call(
    ffi_list_check_all_recyclable,
    x,
    size,
    allow_null,
    environment()
  ))
}
R/assert.R:453

stop_non_list_type untypeabletyped

unbound variable (line 473)
unbound: arg_backtick — one of the package’s own names, itself untyped
error detail
name: arg_backtick
gradual mode: typed
((x: any, arg: any, call: any) -> any)<>
timing: 0.005 s
source
stop_non_list_type <- function(x, arg, call) {
  arg <- arg_backtick(arg)

  cli::cli_abort(
    "{arg} must be a list, not {obj_type_friendly(x)}.",
    call = call
  )
}
R/assert.R:472
R/type-rcrd.R

new_rcrd skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_rcrd <- function(fields, ..., class = character()) {
  if (obj_is_list(fields) && length(vec_unique(list_sizes(fields))) > 1L) {
    abort("All fields must be the same size.")
  }

  fields <- df_list(!!!fields)
  if (!length(fields)) {
    abort("`fields` must be a list of length 1 or greater.")
  }
  structure(fields, ..., class = c(class, "vctrs_rcrd", "vctrs_vctr"))
}
R/type-rcrd.R:27

vec_proxy.vctrs_rcrd untypeable

unbound variable (line 41)
unbound: new_data_frame — one of the package’s own names, itself untyped
error detail
name: new_data_frame
timing: 0.002 s
source
vec_proxy.vctrs_rcrd <- function(x, ...) {
  new_data_frame(x)
}
R/type-rcrd.R:40

vec_restore.vctrs_rcrd untypeabletyped

unbound variable (line 45)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_restore.vctrs_rcrd <- function(x, to, ...) {
  x <- NextMethod()
  attr(x, "row.names") <- NULL
  x
}
R/type-rcrd.R:44

length.vctrs_rcrd untypeabletyped

unbound variable (line 52)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
length.vctrs_rcrd <- function(x) {
  vec_size(x)
}
R/type-rcrd.R:51

names.vctrs_rcrd typed any: x accepts outside

((x: any) -> null)<>
timing: 0.003 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropnames.vctrs_rcrd()null
source
names.vctrs_rcrd <- function(x) {
  NULL
}
R/type-rcrd.R:56

names<-.vctrs_rcrd untypeabletyped

unbound variable (line 62)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.004 s
source
`names<-.vctrs_rcrd` <- function(x, value) {
  if (is_null(value)) {
    x
  } else {
    abort("Can't assign names to a <vctrs_rcrd>.")
  }
}
R/type-rcrd.R:61

format.vctrs_rcrd untypeabletyped

unbound variable (line 73)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.016 s
source
format.vctrs_rcrd <- function(x, ...) {
  if (inherits(x, "vctrs_foobar")) {
    # For unit tests
    exec("paste", !!!vec_data(x), sep = ":")
  } else {
    stop_unimplemented(x, "format")
  }
}
R/type-rcrd.R:70

obj_str_data.vctrs_rcrd untypeabletyped

unbound variable (line 81)
unbound: obj_str_leaf — one of the package’s own names, itself untyped
error detail
name: obj_str_leaf
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
obj_str_data.vctrs_rcrd <- function(x, ...) {
  obj_str_leaf(x, ...)
}
R/type-rcrd.R:80

vec_cast.vctrs_rcrd untypeabletyped

unbound variable (line 86)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.vctrs_rcrd <- function(x, to, ...) UseMethod("vec_cast.vctrs_rcrd")
R/type-rcrd.R:86

vec_cast.vctrs_rcrd.vctrs_rcrd untypeabletyped

unbound variable (line 90)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.vctrs_rcrd.vctrs_rcrd <- function(x, to, ...) {
  out <- vec_cast(vec_data(x), vec_data(to), ...)
  new_rcrd(out)
}
R/type-rcrd.R:89

[.vctrs_rcrd untypeable

untypeable application of base::missing (line 99)
error detail
argument: @(...: ('_ell, empty? | `_ell))
failing call: base::missing()
timing: 0.016 s
source
`[.vctrs_rcrd` <- function(x, i, ...) {
  if (!missing(...)) {
    abort("Can't index record vectors on dimensions greater than 1.")
  }
  vec_slice(x, maybe_missing(i))
}
R/type-rcrd.R:98

[[.vctrs_rcrd untypeabletyped

unbound variable (line 107)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, i: any, ...: any) -> any)<>
timing: 0.004 s
source
`[[.vctrs_rcrd` <- function(x, i, ...) {
  out <- vec_slice(vec_data(x), i)
  vec_restore(out, x)
}
R/type-rcrd.R:106

$.vctrs_rcrd untypeabletyped

unbound variable (line 113)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, i: any, ...: any) -> any)<>
timing: 0.004 s
source
`$.vctrs_rcrd` <- function(x, i, ...) {
  stop_unsupported(x, "subsetting with $")
}
R/type-rcrd.R:112

rep.vctrs_rcrd untypeabletyped

unbound variable (line 118)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
rep.vctrs_rcrd <- function(x, ...) {
  out <- lapply(vec_data(x), base_vec_rep, ...)
  vec_restore(out, x)
}
R/type-rcrd.R:117

length<-.vctrs_rcrd untypeabletyped

unbound variable (line 124)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`length<-.vctrs_rcrd` <- function(x, value) {
  out <- vec_size_assign(vec_data(x), value)
  vec_restore(out, x)
}
R/type-rcrd.R:123

[[<-.vctrs_rcrd typed fuzz ok

∀'a,'b,`a,`b. (((x: v('b)<`b>, i: CHR | DBL | INT | LGL | RAW, value: v('b)) -> v('b)<`b>)&((x: { 'a }<`a>, i: CHR | DBL | INT | LGL | RAW, value: { 'a }) -> { 'a }<`a>))<>
timing: 0.157 s
fuzzing: 31 inside (18 ok, 2 unknown, 10 error type, 1 invalid) · 8 outside (8 rejected)
type drawn from: (((x: v('I119139)<`I975>, i: CHR | DBL | INT | LGL | RAW, value: v('I119139)) -> v('I119139)<`I975>) & ((x: { 'I119138 }<`I974>, i: CHR | DBL | INT | LGL | RAW, value: { 'I119138 }) -> { 'I119138 }<`I974>))<>

Other calls inside the domain

callverdicterror
[[<-.vctrs_rcrd("x" = list(), "i" = c("", "é", "x y", "x y", NA_character_), "value" = list(list("a" = function(...) as.name("x"))))invalid
[[<-.vctrs_rcrd("x y", c(0, 2, NaN, 1, 1), "value" = c(NA_character_, NA_character_))error_typebase::<-: NAs are not allowed in subscripted assignments
[[<-.vctrs_rcrd(list(), "i" = as.raw(c(255)), "value" = list(c(NA_integer_, -1L, 2147483647L, -1L, 2L)))error_typebase::<-: invalid subscript type 'raw'
[[<-.vctrs_rcrd("x" = 1000000L, "i" = as.raw(c(0)), "value" = 1000000L)error_typebase::<-: invalid subscript type 'raw'
[[<-.vctrs_rcrd(list(numeric(0), c(-2.5, 0, -Inf, -2.5, 2)), "i" = NA_character_, "value" = list())error_typebase::<-: replacement has length zero
[[<-.vctrs_rcrd("x" = list(), "i" = 42, "value" = list(as.raw(c(255, 0))))unknown
and 7 more
source
`[[<-.vctrs_rcrd` <- function(x, i, value) {
  force(i)
  x[i] <- value
  x
}
R/type-rcrd.R:131

$<-.vctrs_rcrd untypeabletyped

unbound variable (line 139)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, i: any, value: any) -> any)<>
timing: 0.005 s
source
`$<-.vctrs_rcrd` <- function(x, i, value) {
  stop_unsupported(x, "subset assignment with $")
}
R/type-rcrd.R:138

[<-.vctrs_rcrd untypeabletyped

unbound variable (line 144)
unbound: maybe_missing — a name the prelude does not declare
error detail
name: maybe_missing
gradual mode: typed
((x: any, i: any, value: any) -> any)<>
timing: 0.005 s
source
`[<-.vctrs_rcrd` <- function(x, i, value) {
  i <- maybe_missing(i, TRUE)
  value <- vec_cast(value, x)
  out <- vec_assign(vec_data(x), i, vec_data(value))
  vec_restore(out, x)
}
R/type-rcrd.R:143

vec_math.vctrs_rcrd untypeabletyped

unbound variable (line 154)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((.fn: any, .x: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_math.vctrs_rcrd <- function(.fn, .x, ...) {
  stop_unsupported(.x, "vec_math")
}
R/type-rcrd.R:153
R/group.R

<statement> typed

timing: 0.000 s
source
NULL
R/group.R:60

vec_group_id untypeabletyped

unbound variable (line 65)
unbound: vctrs_group_id — a native symbol tyr could not bind
error detail
name: vctrs_group_id
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_group_id <- function(x) {
  .Call(vctrs_group_id, x)
}
R/group.R:64

vec_group_loc untypeabletyped

unbound variable (line 71)
unbound: vctrs_group_loc — a native symbol tyr could not bind
error detail
name: vctrs_group_loc
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_group_loc <- function(x) {
  .Call(vctrs_group_loc, x)
}
R/group.R:70

vec_group_rle untypeabletyped

unbound variable (line 77)
unbound: vctrs_group_rle — a native symbol tyr could not bind
error detail
name: vctrs_group_rle
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_group_rle <- function(x) {
  .Call(vctrs_group_rle, x)
}
R/group.R:76

format.vctrs_group_rle typed empty return

((x: p(CHR) | (env | externalptr | lang | vec | arrow) | sym | null, ...: any) -> empty)<>
timing: 0.026 s
source
format.vctrs_group_rle <- function(x, ...) {
  group <- field(x, "group")
  length <- field(x, "length")
  paste0(group, "x", length)
}
R/group.R:81

obj_print_header.vctrs_group_rle untypeabletyped

unbound variable (line 89)
unbound: vec_size — one of the package’s own names, itself untyped
error detail
name: vec_size
gradual mode: typed
∀'a. ((x: 'a & any with { n: any, any }, ...: any) -> 'a)<>
timing: 0.004 s
source
obj_print_header.vctrs_group_rle <- function(x, ...) {
  size <- vec_size(x)
  n <- attr(x, "n")
  cat_line("<", vec_ptype_full(x), "[", size, "][n = ", n, "]>")
  invisible(x)
}
R/group.R:88

new_group_rle untypeabletyped

unbound variable (line 97)
unbound: is_integer — a name the prelude does not declare
error detail
name: is_integer
gradual mode: typed
((group: any, length: any, n: any) -> any)<>
timing: 0.007 s
source
new_group_rle <- function(group, length, n) {
  stopifnot(is_integer(group))
  stopifnot(is_integer(length))
  stopifnot(is_integer(n))
  vec_check_size(n, size = 1L)

  if (vec_size(group) != vec_size(length)) {
    abort("`group` and `length` must have the same size.")
  }

  new_rcrd(
    list(group = group, length = length),
    n = n,
    class = "vctrs_group_rle"
  )
}
R/group.R:96
R/conditions.R

<statement> typed

timing: 0.000 s
source
NULL
R/conditions.R:57

stop_vctrs skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_vctrs <- function(
  message = NULL,
  class = NULL,
  ...,
  call = caller_env()
) {
  abort(
    message,
    class = c(class, "vctrs_error"),
    ...,
    call = call
  )
}
R/conditions.R:59

warn_vctrs skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
warn_vctrs <- function(
  message = NULL,
  class = NULL,
  ...,
  call = caller_env()
) {
  warn(
    message,
    class = c(class, "vctrs_warning"),
    ...,
    call = call
  )
}
R/conditions.R:72

stop_incompatible skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_incompatible <- function(
  x,
  y,
  ...,
  details = NULL,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  stop_vctrs(
    message,
    class = c(class, "vctrs_error_incompatible"),
    x = x,
    y = y,
    details = details,
    ...,
    call = call
  )
}
R/conditions.R:86

arg_as_string untypeabletyped

unbound variable (line 1004)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((arg: any) -> any)<>
timing: 0.004 s
source
arg_as_string <- function(arg) {
  if (is_null(arg)) {
    ""
  } else if (is_string(arg)) {
    arg
  } else {
    as_label(arg)
  }
}
R/conditions.R:1003

cnd_type_message_df_label typed any: x fuzz ok

((x: any) -> CHR1<>)<>
timing: 0.015 s
fuzzing: 8 inside (8 ok) · 5 outside (5 rejected)
source
cnd_type_message_df_label <- function(x) {
  x <- class(x)[[1]]

  if (identical(x, "tbl_df")) {
    "tibble"
  } else {
    x
  }
}
R/conditions.R:322

cnd_type_message_type_label untypeabletyped

unbound variable (line 308)
unbound: is.data.frame — a name the prelude does not declare
error detail
name: is.data.frame
gradual mode: typed
((x: any) -> any)<>
timing: 0.004 s
source
cnd_type_message_type_label <- function(x) {
  if (is.data.frame(x)) {
    class(x)[[1]]
  } else {
    vec_ptype_full(x)
  }
}
R/conditions.R:307

cnd_type_separator untypeabletyped

unbound variable (line 224)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
((action: any) -> any)<>
timing: 0.009 s
source
cnd_type_separator <- function(action) {
  if (identical(action, "combine")) {
    "and"
  } else if (identical(action, "convert")) {
    "to"
  } else {
    abort("Internal error: Unknown `action`.")
  }
}
R/conditions.R:218

incompatible_attrib_bullets typed fuzz ok

(() -> CHR<>)<>
timing: 0.012 s
fuzzing: 1 inside (1 ok) · 1 outside (1 rejected)
source
incompatible_attrib_bullets <- function() {
  c(
    x = "Some attributes are incompatible.",
    i = "The author of the class should implement vctrs methods.",
    i = "See <https://vctrs.r-lib.org/reference/faq-error-incompatible-attributes.html>."
  )
}
R/conditions.R:314

cnd_type_message untypeable

unbound variable (line 239)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.162 s
source
cnd_type_message <- function(
  x,
  y,
  x_arg,
  y_arg,
  details,
  action,
  message,
  from_dispatch = FALSE,
  fallback = NULL
) {
  if (!is_null(message)) {
    if (!is_null(details)) {
      abort("Can't supply both `message` and `details`.")
    }
    return(message)
  }

  x_arg <- arg_as_string(x_arg)
  y_arg <- arg_as_string(y_arg)

  if (nzchar(x_arg)) {
    x_name <- paste0(" `", x_arg, "` ")
  } else {
    x_name <- " "
  }

  if (nzchar(y_arg)) {
    y_name <- paste0(" `", y_arg, "` ")
  } else {
    y_name <- " "
  }

  separator <- cnd_type_separator(action)

  if (is.data.frame(x) && is.data.frame(y)) {
    if (vec_is_coercible(new_data_frame(x), new_data_frame(y))) {
      x_type <- cnd_type_message_df_label(x)
      y_type <- cnd_type_message_df_label(y)
    } else {
      x_type <- vec_ptype_full(x)
      y_type <- vec_ptype_full(y)
    }
  } else {
    x_type <- cnd_type_message_type_label(x)
    y_type <- cnd_type_message_type_label(y)
  }

  converting <- action == "convert"

  # If we are here directly from dispatch, this means there is no
  # ptype2 method implemented and the is-same-class fallback has
  # failed because of diverging attributes. The author of the class
  # should implement a ptype2 method as documented in the FAQ
  # indicated below.
  if (from_dispatch && !converting && identical(class(x)[[1]], class(y)[[1]])) {
    details <- c(incompatible_attrib_bullets(), details)
    details <- format_error_bullets(details)
  }

  if (is_null(fallback)) {
    end <- "."
  } else {
    end <- glue::glue("; falling back to {fallback}.")
  }

  if (converting && nzchar(y_arg)) {
    header <- glue::glue(
      "Can't convert{x_name}<{x_type}> to match type of{y_name}<{y_type}>{end}"
    )
  } else {
    header <- glue::glue(
      "Can't {action}{x_name}<{x_type}> {separator}{y_name}<{y_type}>{end}"
    )
  }

  paste_line(header, details)
}
R/conditions.R:228

stop_incompatible_type skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_incompatible_type <- function(
  x,
  y,
  ...,
  x_arg,
  y_arg,
  action = c("combine", "convert"),
  details = NULL,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  obj_check_vector(x, arg = x_arg)
  obj_check_vector(y, arg = y_arg)

  action <- arg_match(action)

  message <- cnd_type_message(
    x,
    y,
    x_arg,
    y_arg,
    details,
    action,
    message,
    from_dispatch = match_from_dispatch(...)
  )

  subclass <- switch(
    action,
    combine = "vctrs_error_ptype2",
    convert = "vctrs_error_cast"
  )

  stop_incompatible(
    x,
    y,
    x_arg = x_arg,
    y_arg = y_arg,
    details = details,
    ...,
    message = message,
    class = c(class, subclass, "vctrs_error_incompatible_type"),
    call = call
  )
}
R/conditions.R:112

stop_incompatible_cast skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_incompatible_cast <- function(
  x,
  to,
  ...,
  x_arg,
  to_arg,
  details = NULL,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  stop_incompatible_type(
    x = x,
    y = to,
    to = to,
    ...,
    x_arg = x_arg,
    y_arg = to_arg,
    to_arg = to_arg,
    action = "convert",
    details = details,
    message = message,
    class = class,
    call = call
  )
}
R/conditions.R:161

stop_incompatible_shape untypeabletyped

unbound variable (line 196)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, y: any, x_size: any, y_size: any, axis: any, x_arg: any, y_arg: any, call: any?) -> any)<>
timing: 0.043 s
source
stop_incompatible_shape <- function(
  x,
  y,
  x_size,
  y_size,
  axis,
  x_arg,
  y_arg,
  call = caller_env()
) {
  details <- format_error_bullets(c(
    x = glue::glue(
      "Incompatible sizes {x_size} and {y_size} along axis {axis}."
    )
  ))
  stop_incompatible_type(
    x,
    y,
    x_arg = x_arg,
    y_arg = y_arg,
    details = details,
    call = call
  )
}
R/conditions.R:188

type_actions typed

CHR<>
timing: 0.011 s
source
type_actions <- c(
  "combine",
  "convert"
)
R/conditions.R:213

glue_lines untypeabletyped

unbound variable (line 982)
unbound: chr — a name the prelude does not declare
error detail
name: chr
gradual mode: typed
((...: any, env: any?) -> CHR1<>)<>
timing: 0.006 s
source
glue_lines <- function(..., env = parent.frame()) {
  out <- map_chr(chr(...), glue::glue, .envir = env)
  paste(out, collapse = "\n")
}
R/conditions.R:981

stop_incompatible_op skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_incompatible_op <- function(
  op,
  x,
  y,
  details = NULL,
  ...,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  message <- message %||%
    glue_lines(
      "<{vec_ptype_full(x)}> {op} <{vec_ptype_full(y)}> is not permitted",
      details
    )

  stop_incompatible(
    x,
    y,
    op = op,
    details = details,
    ...,
    message = message,
    class = c(class, "vctrs_error_incompatible_op"),
    call = call
  )
}
R/conditions.R:335

stop_incompatible_size skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_incompatible_size <- function(
  x,
  y,
  x_size,
  y_size,
  ...,
  x_arg,
  y_arg,
  details = NULL,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  stop_incompatible(
    x,
    y,
    x_size = x_size,
    y_size = y_size,
    ...,
    x_arg = x_arg,
    y_arg = y_arg,
    details = details,
    message = message,
    class = c(class, "vctrs_error_incompatible_size"),
    call = call
  )
}
R/conditions.R:365

cnd_header.vctrs_error_incompatible_size untypeabletyped

unbound variable (line 395)
unbound: is_string — a name the prelude does not declare
error detail
name: is_string
gradual mode: typed
((cnd: { x_arg: any, y_arg: any, message: any, y_size: any, x_size: any, any }, ...: any) -> any)<>
timing: 0.029 s
source
cnd_header.vctrs_error_incompatible_size <- function(cnd, ...) {
  if (is_string(cnd$message) && nzchar(cnd$message)) {
    return(cnd$message)
  }

  x_size <- vec_cast(cnd$x_size, int())
  y_size <- vec_cast(cnd$y_size, int())

  stopifnot(
    length(x_size) == 1,
    length(y_size) == 1
  )

  x_arg <- arg_as_string(cnd$x_arg)
  y_arg <- arg_as_string(cnd$y_arg)

  if (nzchar(x_arg)) {
    x_tag <- glue::glue("`{x_arg}` (size {x_size})")
  } else {
    x_tag <- glue::glue("input of size {x_size}")
  }
  if (nzchar(y_arg)) {
    y_tag <- glue::glue("to match `{y_arg}` (size {y_size})")
  } else {
    y_tag <- glue::glue("to size {y_size}")
  }

  glue::glue("Can't recycle {x_tag} {y_tag}.")
}
R/conditions.R:394

cnd_body.vctrs_error_incompatible_size typed fuzz ok

∀'a. ((cnd: { details: 'a, any }, ...: any) -> 'a)<>
timing: 0.020 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((cnd: { details: 'I119535, any }, ...: any) -> 'I119535)<>
source
cnd_body.vctrs_error_incompatible_size <- function(cnd, ...) {
  cnd$details
}
R/conditions.R:425

loss_type untypeabletyped

unbound variable (line 561)
unbound: is_character — a name the prelude does not declare
error detail
name: is_character
gradual mode: typed
∀'a. (((x: v('a)<~@"[[", ...>) -> v1('a)<>) & ((x: vec<@"[[", ...>) -> any))<>
timing: 0.007 s
source
loss_type <- function(x) {
  stopifnot(
    is_character(x),
    all(x %in% c("precision", "generality"))
  )
  x[[1]]
}
R/conditions.R:559

format_arg_label untypeabletyped

unbound variable (line 988)
unbound: nzchar — a name the prelude does not declare
error detail
name: nzchar
gradual mode: typed
(((type: any, arg: any?) -> CHR<>)&((type: vec1, arg: vec1?) -> CHR1<>))<>
timing: 0.019 s
source
format_arg_label <- function(type, arg = "") {
  type <- paste0("<", type, ">")
  if (nzchar(arg)) {
    paste0("`", arg, "` ", type)
  } else {
    type
  }
}
R/conditions.R:986

new_error_cast_lossy untypeabletyped

unbound variable (line 569)
unbound: error_cnd — a name the prelude does not declare
error detail
name: error_cnd
gradual mode: typed
((x: any, to: any, loss_type: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.027 s
source
new_error_cast_lossy <- function(x, to, loss_type, x_arg = "", to_arg = "") {
  error_cnd(
    c("vctrs_error_cast_lossy", "vctrs_error_incompatible_type"),
    x = x,
    y = to,
    loss_type = loss_type,
    x_arg = x_arg,
    y_arg = to_arg
  )
}
R/conditions.R:568

maybe_warn_deprecated_lossy_cast skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.002 s
source
maybe_warn_deprecated_lossy_cast <- function(
  x,
  to,
  loss_type,
  x_arg,
  to_arg,
  user_env = caller_env(2)
) {
  # Returns `TRUE` if `allow_lossy_cast()` is on the stack and accepts
  # to handle the condition
  handled <- withRestarts(
    vctrs_restart_error_cast_lossy = function() TRUE,
    {
      # Signal fully formed condition but strip the error classes in
      # case someone is catching: This is not an abortive condition.
      cnd <- new_error_cast_lossy(
        x,
        to,
        loss_type = loss_type,
        x_arg = x_arg,
        to_arg = to_arg
      )

      class(cnd) <- setdiff(class(cnd), c("error", "rlang_error"))
      signalCondition(cnd)
      FALSE
    }
  )

  if (handled) {
    return(invisible())
  }

  from <- format_arg_label(vec_ptype_abbr(x), x_arg)
  to <- format_arg_label(vec_ptype_abbr(to), to_arg)

  lifecycle::deprecate_warn(
    when = "0.2.0",
    what = I("Coercion with lossy casts"),
    with = "allow_lossy_cast()",
    details = paste0(
      glue::glue(
        "We detected a lossy transformation from { from } to { to }. "
      ),
      "The result will contain lower-resolution values or missing values. ",
      "To suppress this warning, wrap your code with `allow_lossy_cast()`."
    ),
    always = TRUE,
    user_env = user_env
  )

  invisible()
}
R/conditions.R:599

stop_lossy_cast skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.001 s
source
stop_lossy_cast <- function(
  x,
  to,
  result,
  locations = NULL,
  ...,
  loss_type,
  x_arg,
  to_arg,
  details = NULL,
  message = NULL,
  class = NULL,
  call = caller_env()
) {
  stop_incompatible_cast(
    x = x,
    to = to,
    result = result,
    locations = locations,
    ...,
    loss_type = loss_type,
    x_arg = x_arg,
    to_arg = to_arg,
    details = details,
    class = c(class, "vctrs_error_cast_lossy"),
    call = call
  )
}
R/conditions.R:512

maybe_lossy_cast skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
maybe_lossy_cast <- function(
  result,
  x,
  to,
  lossy = NULL,
  locations = NULL,
  ...,
  loss_type = c("precision", "generality"),
  x_arg,
  to_arg,
  call = caller_env(),
  details = NULL,
  message = NULL,
  class = NULL,
  .deprecation = FALSE
) {
  if (!any(lossy)) {
    return(result)
  }
  if (.deprecation) {
    maybe_warn_deprecated_lossy_cast(x, to, loss_type, x_arg, to_arg)
    return(result)
  }

  locations <- locations %||% which(lossy)

  withRestarts(
    vctrs_restart_error_cast_lossy = function() result,
    stop_lossy_cast(
      x = x,
      to = to,
      result = result,
      locations = locations,
      ...,
      loss_type = loss_type,
      x_arg = x_arg,
      to_arg = to_arg,
      details = details,
      message = message,
      class = class,
      call = call
    )
  )
}
R/conditions.R:468

cnd_header.vctrs_error_cast_lossy untypeabletyped

unbound variable (line 543)
unbound: vec_ptype_full — one of the package’s own names, itself untyped
error detail
name: vec_ptype_full
gradual mode: typed
((cnd: { x: any, y: any, x_arg: any, y_arg: any, loss_type: vec<@"[[", ...> | vec<~@"[[", ...>, any }, ...: any) -> any)<>
timing: 0.012 s
source
cnd_header.vctrs_error_cast_lossy <- function(cnd, ...) {
  x_label <- format_arg_label(vec_ptype_full(cnd$x), cnd$x_arg)
  to_label <- format_arg_label(vec_ptype_full(cnd$y), cnd$y_arg)
  loss_type <- loss_type(cnd$loss_type)
  glue::glue(
    "Can't convert from {x_label} to {to_label} due to loss of {loss_type}."
  )
}
R/conditions.R:542

cnd_body.vctrs_error_cast_lossy untypeabletyped

unbound variable (line 553)
unbound: inline_list — one of the package’s own names, itself untyped
error detail
name: inline_list
gradual mode: typed
((cnd: { locations: any, any }, ...: any) -> any)<>
timing: 0.030 s
source
cnd_body.vctrs_error_cast_lossy <- function(cnd, ...) {
  if (length(cnd$locations)) {
    format_error_bullets(inline_list("Locations: ", cnd$locations))
  } else {
    character()
  }
}
R/conditions.R:551

allow_lossy_cast skipped

error detail
File "Rsem/lang/PAst.ml", line 210, characters 14-20: Assertion failed
timing: 0.000 s
source
allow_lossy_cast <- function(expr, x_ptype = NULL, to_ptype = NULL) {
  withCallingHandlers(
    vctrs_error_cast_lossy = function(err) {
      if (!is_null(x_ptype) && !vec_is(err$x, x_ptype)) {
        return()
      }
      if (!is_null(to_ptype) && !vec_is(err$y, to_ptype)) {
        return()
      }

      invokeRestart("vctrs_restart_error_cast_lossy")
    },
    expr
  )
}
R/conditions.R:583

stop_unsupported untypeabletyped

unbound variable (line 653)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, method: any, call: any?) -> any)<>
timing: 0.006 s
source
stop_unsupported <- function(x, method, call = caller_env()) {
  msg <- glue::glue("`{method}.{class(x)[[1]]}()` not supported.")
  stop_vctrs(
    "vctrs_error_unsupported",
    message = msg,
    x = x,
    method = method,
    call = call
  )
}
R/conditions.R:653

stop_unimplemented untypeabletyped

unbound variable (line 664)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, method: any, call: any?) -> any)<>
timing: 0.006 s
source
stop_unimplemented <- function(x, method, call = caller_env()) {
  msg <- glue::glue("`{method}.{class(x)[[1]]}()` not implemented.")
  stop_vctrs(
    "vctrs_error_unimplemented",
    message = msg,
    x = x,
    method = method,
    call = call
  )
}
R/conditions.R:664

with_incompatible_data_frame_bullets untypeabletyped

unbound variable (line 757)
unbound: cli::format_inline — a name the prelude does not declare
error detail
name: cli::format_inline
gradual mode: typed
((message: any, x: any) -> any)<>
timing: 0.092 s
source
with_incompatible_data_frame_bullets <- function(message, x) {
  classes <- class(x)
  n_classes <- length(classes)

  contains_data_frame_class <- any(classes == "data.frame")

  if (n_classes == 0L) {
    # Edge case of `NULL` or `character()` classes
    last_class_is_not_data_frame <- TRUE
  } else {
    last_class_is_not_data_frame <- classes[n_classes] != "data.frame"
  }

  is_incompatible_data_frame <-
    contains_data_frame_class && last_class_is_not_data_frame

  if (!is_incompatible_data_frame) {
    return(NULL)
  }

  subclasses <- setdiff(classes, "data.frame")

  c(
    message,
    x = cli::format_inline(paste(
      "Detected incompatible data frame structure.",
      "A data frame is normally treated as a vector, but an incompatible class ordering was detected.",
      "To be compatible, the subclass {.cls {subclasses}} must come before {.cls data.frame}, not after.",
      "Class: {.cls {classes}}."
    )),
    i = "If this object comes from a package, please report this error to the package author.",
    i = cli::format_inline(paste(
      "Read our FAQ about",
      "{.topic [creating vector types](vctrs::howto_faq_fix_scalar_type_error)}",
      "to learn more."
    ))
  )
}
R/conditions.R:733

with_incompatible_s3_list_bullets typed any: message accepts outside

((message: any, x: CHR) | (message: any, x: CLX) | (message: any, x: DBL) | (message: any, x: INT) | (message: any, x: LGL) | (message: any, x: null) | (message: any, x: raw) -> null)<>
gradual mode: typed
(((message: any, x: CHR) | (message: any, x: CLX) | (message: any, x: DBL) | (message: any, x: INT) | (message: any, x: LGL) | (message: any, x: null) | (message: any, x: raw) -> null)&((message: any, x: any) -> any))<>
timing: 1.37 s
fuzzing: 8 inside (8 ok) · 8 outside (4 rejected, 4 accepted)

Accepted outside the domain x: 4

parameterchangecallreturned
xkind:envwith_incompatible_s3_list_bullets(new.env(), "x" = new.env())null
xkind:listwith_incompatible_s3_list_bullets(as.name("x"), "x" = list())null
xwrapwith_incompatible_s3_list_bullets(c("x y", ""), "x" = list(0.5))null
xwrapwith_incompatible_s3_list_bullets(quote(f(x)), "x" = list(c(-1L, 42L)))null
source
with_incompatible_s3_list_bullets <- function(message, x) {
  is_list_typeof <- typeof(x) == "list"

  classes <- class(x)
  doesnt_contain_explicit_list_class <- !any(classes == "list")
  doesnt_contain_data_frame_class <- !any(classes == "data.frame")

  # We also assume no `vec_proxy()` method exists, otherwise one would have
  # been invoked, avoiding the error
  is_incompatible_s3_list <-
    is_list_typeof &&
    doesnt_contain_explicit_list_class &&
    doesnt_contain_data_frame_class

  if (!is_incompatible_s3_list) {
    return(NULL)
  }

  c(
    message,
    x = cli::format_inline(paste(
      "Detected incompatible scalar S3 list.",
      "To be treated as a vector, the object must explicitly inherit from {.cls list}",
      "or should implement a {.fn vec_proxy} method.",
      "Class: {.cls {classes}}."
    )),
    i = "If this object comes from a package, please report this error to the package author.",
    i = cli::format_inline(paste(
      "Read our FAQ about",
      "{.topic [creating vector types](vctrs::howto_faq_fix_scalar_type_error)}",
      "to learn more."
    ))
  )
}
R/conditions.R:698

with_scalar_faq_bullet untypeabletyped

unbound variable (line 775)
unbound: cli::format_inline — a name the prelude does not declare
error detail
name: cli::format_inline
gradual mode: typed
((message: any) -> any)<>
timing: 0.006 s
source
with_scalar_faq_bullet <- function(message) {
  c(
    message,
    i = cli::format_inline(paste(
      "Read our FAQ about {.topic [scalar types](vctrs::faq_error_scalar_type)}",
      "to learn more."
    ))
  )
}
R/conditions.R:772

stop_scalar_type untypeabletyped

unbound variable (line 675)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, arg: any?, call: any?) -> any)<>
timing: 0.023 s
source
stop_scalar_type <- function(x, arg = NULL, call = caller_env()) {
  if (is_null(arg) || !nzchar(arg)) {
    arg <- "Input"
  } else {
    arg <- glue::backtick(arg)
  }

  message <- glue::glue("{arg} must be a vector, not {obj_type_friendly(x)}.")

  # Use the first detected issue, with a fallthrough to point to our scalar FAQ
  message <-
    with_incompatible_s3_list_bullets(message, x) %||%
    with_incompatible_data_frame_bullets(message, x) %||%
    with_scalar_faq_bullet(message)

  stop_vctrs(
    message,
    "vctrs_error_scalar_type",
    actual = x,
    call = call
  )
}
R/conditions.R:675

stop_corrupt_factor_levels untypeabletyped

unbound variable (line 782)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, arg: any?, call: any?) -> any)<>
timing: 0.007 s
source
stop_corrupt_factor_levels <- function(x, arg = "x", call = caller_env()) {
  msg <- glue::glue("`{arg}` is a corrupt factor with non-character levels")
  abort(msg, call = call)
}
R/conditions.R:782

stop_corrupt_ordered_levels untypeabletyped

unbound variable (line 787)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, arg: any?, call: any?) -> any)<>
timing: 0.007 s
source
stop_corrupt_ordered_levels <- function(x, arg = "x", call = caller_env()) {
  msg <- glue::glue(
    "`{arg}` is a corrupt ordered factor with non-character levels"
  )
  abort(msg, call = call)
}
R/conditions.R:787

stop_recycle_incompatible_size untypeabletyped

unbound variable (line 798)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x_size: any, size: any, x_arg: any?, call: any?) -> any)<>
timing: 0.012 s
source
stop_recycle_incompatible_size <- function(
  x_size,
  size,
  x_arg = "x",
  call = caller_env()
) {
  stop_vctrs(
    x_size = x_size,
    y_size = size,
    x_arg = x_arg,
    # FIXME: tibble is the only package that uses `vctrs_error_recycle_incompatible_size`
    class = c(
      "vctrs_error_incompatible_size",
      "vctrs_error_recycle_incompatible_size"
    ),
    call = call
  )
}
R/conditions.R:794

stop_names skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_names <- function(class = NULL, ..., call = caller_env()) {
  stop_vctrs(
    class = c(class, "vctrs_error_names"),
    ...,
    call = call
  )
}
R/conditions.R:816

stop_names_cannot_be_empty untypeabletyped

unbound variable (line 824)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((names: any, call: any?) -> any)<>
timing: 0.003 s
source
stop_names_cannot_be_empty <- function(names, call = caller_env()) {
  stop_names(
    class = "vctrs_error_names_cannot_be_empty",
    names = names,
    call = call
  )
}
R/conditions.R:824

cnd_header.vctrs_error_names_cannot_be_empty typed any: cnd accepts outside

((cnd: any, ...: any) -> "Names can't be empty."<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 3 outside (3 accepted)

Accepted outside the domain cnd: 3

parameterchangecallreturned
cnddropcnd_header.vctrs_error_names_cannot_be_empty()"Names can't be empty."<> with { }
cnddropcnd_header.vctrs_error_names_cannot_be_empty("fuzz_dot1" = list(function(...) as.name("x")))"Names can't be empty."<> with { }
cnddropcnd_header.vctrs_error_names_cannot_be_empty("fuzz_dot1" = as.name("x"))"Names can't be empty."<> with { }
source
cnd_header.vctrs_error_names_cannot_be_empty <- function(cnd, ...) {
  "Names can't be empty."
}
R/conditions.R:833

cnd_body.vctrs_error_names_cannot_be_empty untypeable

unbound variable (line 842)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
timing: 0.023 s
source
cnd_body.vctrs_error_names_cannot_be_empty <- function(cnd, ...) {
  locations <- detect_empty_names(cnd$names)

  if (length(locations) == 1) {
    bullet <- glue::glue("Empty name found at location {locations}.")
  } else {
    bullet <- glue::glue(
      "Empty names found at locations {ensure_full_stop(enumerate(locations))}"
    )
  }

  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/conditions.R:838

stop_names_cannot_be_dot_dot untypeabletyped

unbound variable (line 853)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((names: any, call: any?) -> any)<>
timing: 0.003 s
source
stop_names_cannot_be_dot_dot <- function(names, call = caller_env()) {
  stop_names(
    class = "vctrs_error_names_cannot_be_dot_dot",
    names = names,
    call = call
  )
}
R/conditions.R:853

cnd_header.vctrs_error_names_cannot_be_dot_dot typed any: cnd accepts outside

((cnd: any, ...: any) -> "Names can't be of the form `...` or `..j`."<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 4 outside (4 accepted)

Accepted outside the domain cnd: 4

parameterchangecallreturned
cnddropcnd_header.vctrs_error_names_cannot_be_dot_dot("fuzz_dot1" = as.name("x"), "fuzz_dot2" = quote(f(x)))"Names can't be of the form `...` or `..j`."<> with { }
cnddropcnd_header.vctrs_error_names_cannot_be_dot_dot()"Names can't be of the form `...` or `..j`."<> with { }
cnddropcnd_header.vctrs_error_names_cannot_be_dot_dot("fuzz_dot1" = "", "fuzz_dot2" = NULL)"Names can't be of the form `...` or `..j`."<> with { }
cnddropcnd_header.vctrs_error_names_cannot_be_dot_dot("fuzz_dot1" = NULL)"Names can't be of the form `...` or `..j`."<> with { }
source
cnd_header.vctrs_error_names_cannot_be_dot_dot <- function(cnd, ...) {
  "Names can't be of the form `...` or `..j`."
}
R/conditions.R:862

make_names_loc_bullet untypeabletyped

unbound variable (line 932)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((x: any, loc: any) -> any)<>
timing: 0.010 s
source
make_names_loc_bullet <- function(x, loc) {
  if (length(loc) == 1) {
    glue::glue("{glue::double_quote(x)} at location {loc}.")
  } else {
    glue::glue(
      "{glue::double_quote(x)} at locations {ensure_full_stop(enumerate(loc))}"
    )
  }
}
R/conditions.R:930

cnd_body.vctrs_error_names_cannot_be_dot_dot untypeable

unbound variable (line 870)
unbound: detect_dot_dot — one of the package’s own names, itself untyped
error detail
name: detect_dot_dot
timing: 0.012 s
source
cnd_body.vctrs_error_names_cannot_be_dot_dot <- function(cnd, ...) {
  names <- cnd$names

  locations <- detect_dot_dot(names)
  names <- names[locations]

  split <- vec_group_loc(names)

  info <- map2_chr(split$key, split$loc, make_names_loc_bullet)

  header <- "These names are invalid:"
  header <- c(x = header)
  header <- format_error_bullets(header)

  message <- bullets(info, header = header)
  message <- indent(message, 2)

  message
}
R/conditions.R:867

stop_names_must_be_unique untypeabletyped

unbound variable (line 887)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((names: any, arg: any?, call: any?) -> any)<>
timing: 0.007 s
source
stop_names_must_be_unique <- function(names, arg = "", call = caller_env()) {
  stop_names(
    class = "vctrs_error_names_must_be_unique",
    arg = arg,
    names = names,
    call = call
  )
}
R/conditions.R:887

cnd_header.vctrs_error_names_must_be_unique typed any: cnd accepts outside

((cnd: any, ...: any) -> "Names must be unique."<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 4 outside (4 accepted)

Accepted outside the domain cnd: 4

parameterchangecallreturned
cnddropcnd_header.vctrs_error_names_must_be_unique()"Names must be unique."<> with { }
cnddropcnd_header.vctrs_error_names_must_be_unique("fuzz_dot1" = function(...) new.env(), "fuzz_dot2" = c(NA_complex_, complex(real = 0, imaginary = 0)))"Names must be unique."<> with { }
cnddropcnd_header.vctrs_error_names_must_be_unique("fuzz_dot1" = quote(f(x)))"Names must be unique."<> with { }
cnddropcnd_header.vctrs_error_names_must_be_unique("fuzz_dot1" = as.name("x"), "fuzz_dot2" = NULL)"Names must be unique."<> with { }
source
cnd_header.vctrs_error_names_must_be_unique <- function(cnd, ...) {
  "Names must be unique."
}
R/conditions.R:897

cnd_body.vctrs_error_names_must_be_unique untypeable

unbound variable (line 905)
unbound: vec_group_loc — one of the package’s own names, itself untyped
error detail
name: vec_group_loc
timing: 0.017 s
source
cnd_body.vctrs_error_names_must_be_unique <- function(cnd, ...) {
  names <- cnd$names

  dups <- vec_group_loc(names)
  dup_indicator <- map_lgl(dups$loc, function(x) length(x) != 1L)
  dups <- vec_slice(dups, dup_indicator)

  header <- "These names are duplicated:"
  header <- c(x = header)
  header <- format_error_bullets(header)

  info <- map2_chr(dups$key, dups$loc, make_names_loc_bullet)

  message <- bullets(info, header = header)
  message <- indent(message, 2)

  arg <- arg_as_string(cnd$arg)
  if (arg != "") {
    hint <- c(
      i = glue::glue("Use argument `{cnd$arg}` to specify repair strategy.")
    )
    message <- c(message, format_error_bullets(hint))
  }

  message
}
R/conditions.R:902

enumerate untypeabletyped

unbound variable (line 944)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
((x: any, max: vec?, allow_empty: dbl?) -> any)<>
timing: 0.086 s
source
enumerate <- function(x, max = 5L, allow_empty = FALSE) {
  n <- length(x)

  if (n == 0L && !allow_empty) {
    abort("Internal error: Enumeration can't be empty.")
  }
  if (n > max) {
    paste0(glue::glue_collapse(x[seq2(1, max)], ", "), ", etc.")
  } else {
    if (n == 2) {
      last <- " and "
    } else {
      last <- ", and "
    }
    glue::glue_collapse(x, ", ", last = last)
  }
}
R/conditions.R:940

ensure_full_stop typed accepts outside

∀'a. (((x: 'a & vec) -> CHR<> | vec & 'a)&((x: 'a & vec1) -> CHR1<> | vec1 & 'a))<>
timing: 0.070 s
fuzzing: 20 inside (12 ok, 8 error type) · 8 outside (4 rejected, 4 accepted)
type drawn from: (((x: 'x & vec) -> CHR<> | vec & 'x) & ((x: 'x & vec1) -> CHR1<> | vec1 & 'x))<>

Accepted outside the domain x: 4

parameterchangecallreturned
xkind:symensure_full_stop("x" = as.name("x"))"x."<> with { }
xwrapensure_full_stop("x" = list(TRUE))"TRUE."<> with { }
xwrapensure_full_stop(list(c(1000000L, 0L)))"c(1000000, 0)."<> with { }
xwrapensure_full_stop(list(Inf))"Inf."<> with { }

Other calls inside the domain

callverdicterror
ensure_full_stop(NA)error_typebase::if: missing value where TRUE/FALSE needed
ensure_full_stop(c(1000000L, 0L))error_typebase::if: the condition has length > 1
ensure_full_stop(NA_integer_)error_typebase::if: missing value where TRUE/FALSE needed
ensure_full_stop(numeric(0))error_typebase::if: argument is of length zero
ensure_full_stop("x" = c(complex(real = 1, imaginary = -2), NA_complex_))error_typebase::if: the condition has length > 1
ensure_full_stop(raw(0))error_typebase::if: argument is of length zero
and 2 more
source
ensure_full_stop <- function(x) {
  n <- nchar(x)
  if (substr(x, n, n) == ".") {
    x
  } else {
    paste0(x, ".")
  }
}
R/conditions.R:958

stop_native_implementation untypeabletyped

unbound variable (line 969)
unbound: cli::cli_abort — a name the prelude does not declare
error detail
name: cli::cli_abort
gradual mode: typed
((fn: any) -> any)<>
timing: 0.011 s
source
stop_native_implementation <- function(fn) {
  cli::cli_abort(
    c(
      "{.fn {fn}} is implemented at C level.",
      " " = "This R function is purely indicative and should never be called."
    ),
    .internal = TRUE
  )
}
R/conditions.R:968

arg_backtick untypeabletyped

unbound variable (line 996)
unbound: nzchar — a name the prelude does not declare
error detail
name: nzchar
gradual mode: typed
((arg: any, or: any?) -> any)<>
timing: 0.005 s
source
arg_backtick <- function(arg, or = "Input") {
  if (nzchar(arg)) {
    glue::backtick(arg)
  } else {
    or
  }
}
R/conditions.R:995

append_arg untypeabletyped

unbound variable (line 1013)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any, arg: any) -> any)<>
timing: 0.006 s
source
append_arg <- function(x, arg) {
  if (is_null(arg)) {
    return(x)
  }

  arg <- arg_as_string(arg)
  if (nzchar(arg)) {
    glue::glue("{x} `{arg}`")
  } else {
    x
  }
}
R/conditions.R:1012
R/arith.R

vec_arith untypeabletyped

unbound variable (line 43)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.007 s
source
vec_arith <- function(op, x, y, ...) {
  check_dots_empty0(...)
  UseMethod("vec_arith", x)
}
R/arith.R:42

vec_arith.default untypeabletyped

unbound variable (line 50)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/arith.R:49

vec_arith.logical untypeabletyped

unbound variable (line 59)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.logical <- function(op, x, y, ...) UseMethod("vec_arith.logical", y)
R/arith.R:59

vec_arith.logical.default untypeabletyped

unbound variable (line 63)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.logical.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/arith.R:62

vec_arith_base untypeable

unbound variable (line 94)
unbound: vec_recycle_common — one of the package’s own names, itself untyped
error detail
name: vec_recycle_common
timing: 0.007 s
source
vec_arith_base <- function(op, x, y) {
  args <- vec_recycle_common(x, y)

  op_fn <- getExportedValue("base", op)
  op_fn(vec_data(args[[1L]]), vec_data(args[[2L]]))
}
R/arith.R:93

vec_arith.logical.logical untypeabletyped

unbound variable (line 67)
unbound: vec_arith_base — one of the package’s own names, itself untyped
error detail
name: vec_arith_base
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.logical.logical <- function(op, x, y, ...) vec_arith_base(op, x, y)
R/arith.R:67

vec_arith.logical.numeric untypeabletyped

unbound variable (line 70)
unbound: vec_arith_base — one of the package’s own names, itself untyped
error detail
name: vec_arith_base
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.logical.numeric <- function(op, x, y, ...) vec_arith_base(op, x, y)
R/arith.R:70

vec_arith.numeric untypeabletyped

unbound variable (line 76)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.numeric <- function(op, x, y, ...) UseMethod("vec_arith.numeric", y)
R/arith.R:76

vec_arith.numeric.default untypeabletyped

unbound variable (line 80)
unbound: stop_incompatible_op — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_op
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.numeric.default <- function(op, x, y, ...) {
  stop_incompatible_op(op, x, y)
}
R/arith.R:79

vec_arith.numeric.logical untypeabletyped

unbound variable (line 84)
unbound: vec_arith_base — one of the package’s own names, itself untyped
error detail
name: vec_arith_base
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.numeric.logical <- function(op, x, y, ...) vec_arith_base(op, x, y)
R/arith.R:84

vec_arith.numeric.numeric untypeabletyped

unbound variable (line 87)
unbound: vec_arith_base — one of the package’s own names, itself untyped
error detail
name: vec_arith_base
gradual mode: typed
((op: any, x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_arith.numeric.numeric <- function(op, x, y, ...) vec_arith_base(op, x, y)
R/arith.R:87

MISSING typed fuzz ok

(() -> { })<>
timing: 0.008 s
fuzzing: 1 inside (1 ok) · 1 outside (1 rejected)
source
MISSING <- function() {
  structure(list(), class = "MISSING")
}
R/arith.R:102
R/bind.R

<statement> typed

timing: 0.000 s
source
NULL
R/bind.R:169

vec_rbind untypeabletyped

unbound variable (line 183)
unbound: rlang::zap — a name the prelude does not declare
error detail
name: rlang::zap
gradual mode: typed
((...: any, .ptype: any?, .names_to: any?, .name_repair: any?, .name_spec: any?, .error_call: any?) -> any)<>
timing: 0.007 s
source
vec_rbind <- function(
  ...,
  .ptype = NULL,
  .names_to = rlang::zap(),
  .name_repair = c(
    "unique",
    "universal",
    "check_unique",
    "unique_quiet",
    "universal_quiet"
  ),
  .name_spec = NULL,
  .error_call = current_env()
) {
  .External2(ffi_rbind, list2(...), .ptype, .names_to, .name_repair, .name_spec)
}
R/bind.R:180

vec_rbind untypeabletyped

unbound variable (line 196)
unbound: vec_rbind — one of the package’s own names, itself untyped
error detail
name: vec_rbind
gradual mode: typed
any
timing: 0.000 s
source
vec_rbind <- fn_inline_formals(vec_rbind, ".name_repair")
R/bind.R:196

vec_cbind untypeabletyped

unbound variable (line 218)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .ptype: any?, .size: any?, .name_repair: any?, .error_call: any?) -> any)<>
timing: 0.020 s
source
vec_cbind <- function(
  ...,
  .ptype = NULL,
  .size = NULL,
  .name_repair = c(
    "unique",
    "universal",
    "check_unique",
    "minimal",
    "unique_quiet",
    "universal_quiet"
  ),
  .error_call = current_env()
) {
  .External2(ffi_cbind, list2(...), .ptype, .size, .name_repair)
}
R/bind.R:206

vec_cbind untypeabletyped

unbound variable (line 222)
unbound: vec_cbind — one of the package’s own names, itself untyped
error detail
name: vec_cbind
gradual mode: typed
any
timing: 0.000 s
source
vec_cbind <- fn_inline_formals(vec_cbind, ".name_repair")
R/bind.R:222

as_df_row typed accepts outside

∀'a. ((x: 'a & null, quiet: LGL?) -> null & 'a)<>
timing: 0.027 s
fuzzing: 12 inside (9 ok, 3 crash) · 8 outside (6 rejected, 2 accepted)
type drawn from: ((x: 'x & null, quiet: LGL?) -> null & 'x)<>

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapas_df_row("x" = list(NULL)){ ...1: { null }<> with { } }<data.frame> with { names: "...1"<> with { }, row.names: 1L<> with { } }
xwrapas_df_row(list(NULL)){ ...1: { null }<> with { } }<data.frame> with { names: "...1"<> with { }, row.names: 1L<> with { } }

Other calls inside the domain

callverdicterror
as_df_row("x" = NULL, "quiet" = logical(0))crash
as_df_row(NULL, "quiet" = logical(0))crash
as_df_row(NULL, logical(0))crash

Side effects

Sys.setenv, Sys.unsetenv, file, gzfile
source
as_df_row <- function(x, quiet = FALSE) {
  .Call(ffi_as_df_row, x, quiet, environment())
}
R/bind.R:224

as_df_col typed fuzz ok

((x: any_sexp, outer_name: CHR) -> any_sexp)<>
timing: 0.020 s
fuzzing: 8 inside (4 ok, 1 error pkg, 3 invalid) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
as_df_col(new.env(), "outer_name" = NA_character_)invalid
as_df_col(quote(f(x)), c(NA_character_, "a"))invalid
as_df_col(FALSE, "outer_name" = character(0))error_pkgvctrs::as_df_col: attempt access index 0/0 in STRING_ELT
as_df_col("x" = as.name("x"), "outer_name" = c(NA_character_, ""))invalid
source
as_df_col <- function(x, outer_name) {
  .Call(ffi_as_df_col, x, outer_name, environment())
}
R/bind.R:227

vec_cbind_frame_ptype untypeabletyped

unbound variable (line 247)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cbind_frame_ptype <- function(x, ...) {
  UseMethod("vec_cbind_frame_ptype")
}
R/bind.R:246

vec_cbind_frame_ptype.default typed accepts outside

∀'a,'b. (((x: <@"[", ...>, ...: any) -> any) & ((x: v('b)<~@"[", ...>, ...: any) -> v('b)<>) & ((x: { 'a }<~@"[", ...>, ...: any) -> { 'a }<>))<>
timing: 0.062 s
fuzzing: 13 inside (13 ok) · 8 outside (6 rejected, 2 accepted)
type drawn from: (((x: <@"[", ...>, ...: any) -> any) & ((x: v('I120242)<~@"[", ...>, ...: any) -> v('I120242)<>) & ((x: { 'I120241 }<~@"[", ...>, ...: any) -> { 'I120241 }<>))<>

Accepted outside the domain x: 2

parameterchangecallreturned
xdropvec_cbind_frame_ptype.default(quote(f(x)))null
xkind:nullvec_cbind_frame_ptype.default(NULL, as.name("x"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = quote(f(x)))null
source
vec_cbind_frame_ptype.default <- function(x, ...) {
  x[0]
}
R/bind.R:250

vec_cbind_frame_ptype.sf untypeabletyped

unbound variable (line 256)
unbound: data.frame — one of the package’s own names, itself untyped
error detail
name: data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_cbind_frame_ptype.sf <- function(x, ...) {
  data.frame()
}
R/bind.R:255
R/case-when.R

<statement> typed

timing: 0.000 s
source
NULL
R/case-when.R:170

vec_case_when untypeabletyped

unbound variable (line 185)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((conditions: { any_sexp }<> | null, values: p(CHR) | <> | sym | null, ...: any, default: any_sexp?, unmatched: (CHR | null)?, ptype: any_sexp?, size: any_sexp?, conditions_arg: any?, values_arg: any?, default_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.033 s
source
vec_case_when <- function(
  conditions,
  values,
  ...,
  default = NULL,
  unmatched = "default",
  ptype = NULL,
  size = NULL,
  conditions_arg = "conditions",
  values_arg = "values",
  default_arg = "default",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_case_when,
    conditions,
    values,
    default,
    unmatched,
    ptype,
    size,
    environment()
  )
}
R/case-when.R:174

vec_replace_when untypeabletyped

unbound variable (line 210)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, conditions: any_sexp, values: any_sexp, ...: any, x_arg: any?, conditions_arg: any?, values_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.019 s
source
vec_replace_when <- function(
  x,
  conditions,
  values,
  ...,
  x_arg = "x",
  conditions_arg = "conditions",
  values_arg = "values",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_replace_when,
    x,
    conditions,
    values,
    environment()
  )
}
R/case-when.R:202
R/complete.R

vec_detect_complete untypeabletyped

unbound variable (line 44)
unbound: vctrs_detect_complete — a native symbol tyr could not bind
error detail
name: vctrs_detect_complete
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_detect_complete <- function(x) {
  .Call(vctrs_detect_complete, x)
}
R/complete.R:43

vec_slice_complete untypeabletyped

unbound variable (line 48)
unbound: vctrs_slice_complete — a native symbol tyr could not bind
error detail
name: vctrs_slice_complete
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_slice_complete <- function(x) {
  .Call(vctrs_slice_complete, x)
}
R/complete.R:47

vec_locate_complete untypeabletyped

unbound variable (line 52)
unbound: vctrs_locate_complete — a native symbol tyr could not bind
error detail
name: vctrs_locate_complete
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_locate_complete <- function(x) {
  .Call(vctrs_locate_complete, x)
}
R/complete.R:51
R/empty.R

list_drop_empty untypeabletyped

unbound variable (line 17)
unbound: vctrs_list_drop_empty — a native symbol tyr could not bind
error detail
name: vctrs_list_drop_empty
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
list_drop_empty <- function(x) {
  .Call(vctrs_list_drop_empty, x)
}
R/empty.R:16
R/encoding.R

obj_encode_utf8 untypeabletyped

unbound variable (line 2)
unbound: ffi_obj_encode_utf8 — a native symbol tyr could not bind
error detail
name: ffi_obj_encode_utf8
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
obj_encode_utf8 <- function(x) {
  .Call(ffi_obj_encode_utf8, x)
}
R/encoding.R:1

chr_is_ascii_or_utf8 typed fuzz ok

(((x: CHR) -> LGL)&((x: CHR1) -> LGL1))<>
timing: 0.022 s
fuzzing: 6 inside (6 ok) · 8 outside (8 rejected)
source
chr_is_ascii_or_utf8 <- function(x) {
  .Call(ffi_chr_is_ascii_or_utf8, x)
}
R/encoding.R:5
R/expand.R

vec_expand_grid untypeabletyped

unbound variable (line 59)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .vary: any?, .name_repair: any?, .error_call: any?) -> any)<>
timing: 0.007 s
source
vec_expand_grid <- function(
  ...,
  .vary = "slowest",
  .name_repair = "check_unique",
  .error_call = current_env()
) {
  .vary <- arg_match0(
    arg = .vary,
    values = c("slowest", "fastest"),
    error_call = .error_call
  )

  .Call(ffi_vec_expand_grid, list2(...), .vary, .name_repair, environment())
}
R/expand.R:55
R/faq-developer.R

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:6

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:13

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:24

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:31

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:38

<statement> typed

timing: 0.000 s
source
NULL
R/faq-developer.R:46
R/faq-internal.R

<statement> typed

timing: 0.000 s
source
NULL
R/faq-internal.R:6
R/faq.R

<statement> typed

timing: 0.000 s
source
NULL
R/faq.R:6

<statement> typed

timing: 0.000 s
source
NULL
R/faq.R:23

<statement> typed

timing: 0.000 s
source
NULL
R/faq.R:32
R/fill.R

vec_fill_missing typed fuzz ok

((x: any_sexp, direction: CHR?, max_fill: null?) -> any_sexp)<>
timing: 0.048 s
fuzzing: 8 inside (5 error pkg, 3 error type) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
vec_fill_missing(quote(f(x)), c("x y", "NA"), NULL)error_pkgvctrs::vec_fill_missing: `direction` must be one of "down", "up", "downup", or "updown".
vec_fill_missing(function(...) new.env(), "max_fill" = NULL)error_type::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_fill_missing("x" = function(...) new.env())error_type::vec_size: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_fill_missing(quote(f(x)))error_type::vec_size: `x` must be a vector, not a call. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_fill_missing(list(), c("NA", "NA", "NA", "x y", "é"), NULL)error_pkgvctrs::vec_fill_missing: `direction` must be one of "down", "up", "downup", or "updown".
vec_fill_missing(as.name("x"), c("a", NA_character_, "", "é", NA_character_))error_pkgvctrs::vec_fill_missing: `direction` must be one of "down", "up", "downup", or "updown".
and 2 more
source
vec_fill_missing <- function(
  x,
  direction = c("down", "up", "downup", "updown"),
  max_fill = NULL
) {
  .Call(vctrs_fill_missing, x, direction, max_fill)
}
R/fill.R:34
R/hash.R

vec_hash untypeabletyped

unbound variable (line 6)
unbound: ffi_vec_hash — a native symbol tyr could not bind
error detail
name: ffi_vec_hash
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
vec_hash <- function(x) {
  .Call(ffi_vec_hash, x)
}
R/hash.R:5

obj_hash typed fuzz ok

((x: any_sexp) -> raw)<>
timing: 0.010 s
fuzzing: 6 inside (6 ok) · 7 outside (7 rejected)
source
obj_hash <- function(x) {
  .Call(ffi_obj_hash, x)
}
R/hash.R:9
R/if-else.R

vec_if_else untypeabletyped

unbound variable (line 68)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((condition: any_sexp, true: any_sexp, false: any_sexp, ...: any, missing: any_sexp?, ptype: any_sexp?, condition_arg: any?, true_arg: any?, false_arg: any?, missing_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.032 s
source
vec_if_else <- function(
  condition,
  true,
  false,
  ...,
  missing = NULL,
  ptype = NULL,
  condition_arg = "condition",
  true_arg = "true",
  false_arg = "false",
  missing_arg = "missing",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_if_else,
    condition,
    true,
    false,
    missing,
    ptype,
    environment()
  )
}
R/if-else.R:57
R/import-standalone-linked-version.R

check_linked_version untypeable

unbound variable (line 19)
unbound: Sys.info — a name the prelude does not declare
error detail
name: Sys.info
timing: 0.735 s
source
check_linked_version <- local({

  # Keep in sync with standalone-downstream-deps.R
  howto_reinstall_msg <- function(pkg) {
    os <- tolower(Sys.info()[["sysname"]])

    if (os == "windows") {
      url <- "https://github.com/jennybc/what-they-forgot/issues/62"
      c(
        i = sprintf("Please update %s to the latest version.", pkg),
        i = sprintf("Updating packages on Windows requires precautions:\n  <%s>", url)
      )
    } else {
      c(
        i = sprintf("Please update %s with `install.packages(\"%s\")` and restart R.", pkg, pkg)
      )
    }
  }

  function(pkg, with_rlang = requireNamespace("rlang", quietly = TRUE)) {
    ver <- utils::packageVersion(pkg)

    ns <- asNamespace(pkg)
    linked_ver_ptr <- ns[[paste0(pkg, "_linked_version")]]
    if (is.null(linked_ver_ptr)) {
      linked_ver <- ""
    } else {
      # Construct call to avoid NOTE when argument to `.Call()` is not
      # statically analysable
      linked_ver <- do.call(".Call", list(linked_ver_ptr))
    }

    if (nzchar(linked_ver) && ver == linked_ver) {
      return(invisible(NULL))
    }

    header <- sprintf("The %s package is not properly installed.", pkg)

    if (nzchar(linked_ver)) {
      msg <- c(x = sprintf(
        "The DLL version (%s) does not correspond to the package version (%s).",
        linked_ver,
        ver
      ))
    } else {
      # Package does not have a version pointer. This happens when DLL
      # updating fails for the first version that includes the pointer.
      msg <- c(x = "The DLL version does not correspond to the package version.")
    }

    msg <- c(msg, howto_reinstall_msg(pkg))

    if (with_rlang) {
      msg <- paste(header, rlang::format_error_bullets(msg), sep = "\n")
      rlang::abort(msg)
    } else {
      msg <- paste(c(header, msg), collapse = "\n")
      stop(msg, call. = FALSE)
    }
  }
})
R/import-standalone-linked-version.R:15
R/interval.R

vec_interval_groups untypeabletyped

unbound variable (line 103)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((start: any, end: any, ...: any, abutting: any?, missing: any?) -> any)<>
timing: 0.009 s
source
vec_interval_groups <- function(
  start,
  end,
  ...,
  abutting = TRUE,
  missing = "group"
) {
  check_dots_empty0(...)
  .Call(ffi_interval_groups, start, end, abutting, missing)
}
R/interval.R:96

vec_interval_locate_groups untypeabletyped

unbound variable (line 116)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((start: any, end: any, ...: any, abutting: any?, missing: any?) -> any)<>
timing: 0.009 s
source
vec_interval_locate_groups <- function(
  start,
  end,
  ...,
  abutting = TRUE,
  missing = "group"
) {
  check_dots_empty0(...)
  .Call(ffi_interval_locate_groups, start, end, abutting, missing)
}
R/interval.R:109

vec_interval_complement untypeabletyped

unbound variable (line 179)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((start: any, end: any, ...: any, lower: any?, upper: any?) -> any)<>
timing: 0.009 s
source
vec_interval_complement <- function(
  start,
  end,
  ...,
  lower = NULL,
  upper = NULL
) {
  check_dots_empty0(...)
  .Call(ffi_interval_complement, start, end, lower, upper)
}
R/interval.R:172

vec_interval_locate_containers untypeabletyped

unbound variable (line 234)
unbound: ffi_interval_locate_containers — a native symbol tyr could not bind
error detail
name: ffi_interval_locate_containers
gradual mode: typed
((start: any, end: any) -> any)<>
timing: 0.002 s
source
vec_interval_locate_containers <- function(start, end) {
  .Call(ffi_interval_locate_containers, start, end)
}
R/interval.R:233

exp_vec_interval_groups skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
exp_vec_interval_groups <- function(
  start,
  end,
  ...,
  abutting = TRUE,
  missing = "group"
) {
  vec_interval_groups(
    start = start,
    end = end,
    ...,
    abutting = abutting,
    missing = missing
  )
}
R/interval.R:250

exp_vec_interval_locate_groups skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
exp_vec_interval_locate_groups <- function(
  start,
  end,
  ...,
  abutting = TRUE,
  missing = "group"
) {
  vec_interval_locate_groups(
    start = start,
    end = end,
    ...,
    abutting = abutting,
    missing = missing
  )
}
R/interval.R:266

exp_vec_interval_complement skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
exp_vec_interval_complement <- function(
  start,
  end,
  ...,
  lower = NULL,
  upper = NULL
) {
  vec_interval_complement(
    start = start,
    end = end,
    ...,
    lower = lower,
    upper = upper
  )
}
R/interval.R:282

exp_vec_interval_locate_containers untypeabletyped

unbound variable (line 299)
unbound: vec_interval_locate_containers — one of the package’s own names, itself untyped
error detail
name: vec_interval_locate_containers
gradual mode: typed
((start: any, end: any) -> any)<>
timing: 0.002 s
source
exp_vec_interval_locate_containers <- function(start, end) {
  vec_interval_locate_containers(
    start = start,
    end = end
  )
}
R/interval.R:298
R/list-combine.R

list_combine untypeabletyped

unbound variable (line 177)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, ...: any, indices: any_sexp, size: any_sexp, default: any_sexp?, unmatched: (CHR | null)?, multiple: (CHR | null)?, slice_x: LGL?, ptype: any_sexp?, name_spec: any_sexp?, name_repair: (CHR | null)?, x_arg: any?, indices_arg: any?, default_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.046 s
source
list_combine <- function(
  x,
  ...,
  indices,
  size,
  default = NULL,
  unmatched = "default",
  multiple = "last",
  slice_x = FALSE,
  ptype = NULL,
  name_spec = NULL,
  name_repair = c(
    "minimal",
    "unique",
    "check_unique",
    "universal",
    "unique_quiet",
    "universal_quiet"
  ),
  x_arg = "x",
  indices_arg = "indices",
  default_arg = "default",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_list_combine,
    x,
    indices,
    size,
    default,
    unmatched,
    multiple,
    slice_x,
    ptype,
    name_spec,
    name_repair,
    environment()
  )
}
R/list-combine.R:155

list_combine untypeabletyped

unbound variable (line 195)
unbound: list_combine — one of the package’s own names, itself untyped
error detail
name: list_combine
gradual mode: typed
any
timing: 0.000 s
source
list_combine <- fn_inline_formals(list_combine, "name_repair")
R/list-combine.R:195

stop_combine skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_combine <- function(
  message = NULL,
  class = NULL,
  ...,
  call = caller_env()
) {
  stop_vctrs(
    message = message,
    class = c(class, "vctrs_error_combine"),
    ...,
    call = call
  )
}
R/list-combine.R:199

stop_combine_unmatched untypeabletyped

unbound variable (line 216)
unbound: stop_combine — one of the package’s own names, itself untyped
error detail
name: stop_combine
gradual mode: typed
((loc: any, call: any) -> any)<>
timing: 0.003 s
source
stop_combine_unmatched <- function(loc, call) {
  stop_combine(
    class = "vctrs_error_combine_unmatched",
    loc = loc,
    call = call
  )
}
R/list-combine.R:215

cnd_header.vctrs_error_combine_unmatched typed any: cnd accepts outside

((cnd: any, ...: any) -> "Each location must be matched."<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 4 outside (4 accepted)

Accepted outside the domain cnd: 4

parameterchangecallreturned
cnddropcnd_header.vctrs_error_combine_unmatched("fuzz_dot1" = NULL, "fuzz_dot2" = new.env())"Each location must be matched."<> with { }
cnddropcnd_header.vctrs_error_combine_unmatched()"Each location must be matched."<> with { }
cnddropcnd_header.vctrs_error_combine_unmatched("fuzz_dot1" = quote(f(x)))"Each location must be matched."<> with { }
cnddropcnd_header.vctrs_error_combine_unmatched("fuzz_dot1" = FALSE, "fuzz_dot2" = NULL)"Each location must be matched."<> with { }
source
cnd_header.vctrs_error_combine_unmatched <- function(cnd, ...) {
  "Each location must be matched."
}
R/list-combine.R:224

cnd_body.vctrs_error_combine_unmatched untypeabletyped

unbound variable (line 232)
unbound: cli::format_inline — a name the prelude does not declare
error detail
name: cli::format_inline
gradual mode: typed
((cnd: { loc: vec | null, any }, ...: any) -> any)<>
timing: 0.024 s
source
cnd_body.vctrs_error_combine_unmatched <- function(cnd, ...) {
  # cli's pluralization length feature only kicks in on character vectors
  loc <- as.character(cnd$loc)
  bullet <- cli::format_inline("Location{?s} {loc} {?is/are} unmatched.")
  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/list-combine.R:229

base_c_invoke untypeable

unbound variable (line 241)
unbound: local_options — a name the prelude does not declare
error detail
name: local_options
timing: 0.029 s
source
base_c_invoke <- function(xs) {
  local_options("vctrs:::base_c_in_progress" = TRUE)

  # Remove all `NULL` arguments which prevent dispatch if in first
  # position and might not be handled correctly by methods
  xs <- compact(xs)

  unspecified <- map_lgl(xs, fallback_is_unspecified)
  if (!any(unspecified)) {
    return(base_c(xs))
  }

  # First concatenate without the unspecified chunks. This way the
  # `c()` method doesn't need to handle unspecified inputs correctly,
  # and we're guaranteed to dispatch on the correct class even if the
  # first input is unspecified.
  out <- base_c(xs[!unspecified])

  # Create index vector with `NA` locations for unspecified chunks
  locs <- c_locs(xs)
  locs[unspecified] <- map(locs[unspecified], rep_along, na_int)
  locs[!unspecified] <- c_locs(xs[!unspecified])
  locs <- vec_c(!!!locs, .ptype = int())

  # Expand the concatenated vector with unspecified chunks
  out[locs]
}
R/list-combine.R:240

base_c untypeabletyped

unbound variable (line 270)
unbound: ns_env — a name the prelude does not declare
error detail
name: ns_env
gradual mode: typed
((xs: dbl) -> any)<>
timing: 0.067 s
source
base_c <- function(xs) {
  # Dispatch in the base namespace which inherits from the global env
  exec("c", !!!xs, .env = ns_env("base"))
}
R/list-combine.R:268

fallback_is_unspecified untypeabletyped

unbound variable (line 279)
unbound: is_true — a name the prelude does not declare
error detail
name: is_true
gradual mode: typed
((x: LGL<> with { vctrs:::unspecified: any, any } | <...> with { vctrs:::unspecified: any, any }) -> ff<> | tt<>)<>
timing: 0.029 s
source
fallback_is_unspecified <- function(x) {
  is_unspecified(x) || is_true(attr(x, "vctrs:::unspecified"))
}
R/list-combine.R:278

c_locs skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.002 s
source
c_locs <- function(xs) {
  locs <- reduce(lengths(xs), .init = list(0), function(output, input) {
    n <- last(last(output))
    c(output, list(seq(n + 1, n + input)))
  })

  locs[-1]
}
R/list-combine.R:282
R/rep.R

<statement> typed

timing: 0.000 s
source
NULL
R/rep.R:85

vec_rep untypeabletyped

unbound variable (line 93)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any, times: any, ...: any, error_call: any?, x_arg: any?, times_arg: any?) -> any)<>
timing: 0.010 s
source
vec_rep <- function(
  x,
  times,
  ...,
  error_call = current_env(),
  x_arg = "x",
  times_arg = "times"
) {
  check_dots_empty0(...)
  .Call(ffi_vec_rep, x, times, environment())
}
R/rep.R:89

vec_rep_each untypeabletyped

unbound variable (line 107)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, times: any_sexp, ...: any, error_call: any?, x_arg: any?, times_arg: any?) -> any_sexp)<>
timing: 0.010 s
source
vec_rep_each <- function(
  x,
  times,
  ...,
  error_call = current_env(),
  x_arg = "x",
  times_arg = "times"
) {
  check_dots_empty0(...)
  .Call(ffi_vec_rep_each, x, times, environment())
}
R/rep.R:103

vec_unrep typed fuzz ok

((x: any_sexp) -> any_sexp)<>
timing: 0.010 s
fuzzing: 8 inside (3 ok, 5 error pkg) · 5 outside (5 rejected)

Other calls inside the domain

callverdicterror
vec_unrep(as.name("x"))error_pkgvctrs::vec_unrep: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_unrep(new.env())error_pkgvctrs::vec_unrep: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_unrep(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_unrep: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_unrep("x" = as.name("x"))error_pkgvctrs::vec_unrep: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_unrep("x" = new.env())error_pkgvctrs::vec_unrep: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
vec_unrep <- function(x) {
  .Call(ffi_vec_unrep, x, environment())
}
R/rep.R:117
R/slice-interleave.R

list_interleave untypeabletyped

unbound variable (line 94)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: any_sexp, ...: any, size: null?, ptype: any_sexp?, name_spec: any_sexp?, name_repair: (CHR | null)?, x_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.028 s
source
list_interleave <- function(
  x,
  ...,
  size = NULL,
  ptype = NULL,
  name_spec = NULL,
  name_repair = c(
    "minimal",
    "unique",
    "check_unique",
    "universal",
    "unique_quiet",
    "universal_quiet"
  ),
  x_arg = caller_arg(x),
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_list_interleave,
    x,
    size,
    ptype,
    name_spec,
    name_repair,
    environment()
  )
}
R/slice-interleave.R:80

vec_interleave untypeabletyped

unbound variable (line 64)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .size: any?, .ptype: any?, .name_spec: any?, .name_repair: any?, .error_call: any?) -> any)<>
timing: 0.022 s
source
vec_interleave <- function(
  ...,
  .size = NULL,
  .ptype = NULL,
  .name_spec = NULL,
  .name_repair = c(
    "minimal",
    "unique",
    "check_unique",
    "universal",
    "unique_quiet",
    "universal_quiet"
  ),
  .error_call = current_env()
) {
  list_interleave(
    x = list2(...),
    size = .size,
    ptype = .ptype,
    name_spec = .name_spec,
    name_repair = .name_repair,
    x_arg = "",
    error_call = .error_call
  )
}
R/slice-interleave.R:51
R/type-list-of.R

new_list_of0 skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_list_of0 <- function(x, ptype, size, ..., class = character()) {
  new_vctr(
    x,
    ...,
    ptype = ptype,
    size = size,
    class = c(class, "vctrs_list_of")
  )
}
R/type-list-of.R:177

list_as_list_of untypeable

unbound variable (line 555)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.050 s
source
list_as_list_of <- function(x, ptype, size, error_call = caller_env()) {
  free_ptype <- is_zap(ptype)
  free_size <- is_zap(size)

  if (free_ptype && free_size) {
    abort("Can't set both `ptype` and `size` to `<zap>`.", call = error_call)
  }

  if (free_ptype) {
    # Not locked
    ptype <- NULL
  } else {
    # Lock to a type or die trying
    ptype <- vec_ptype_common(
      !!!x,
      .ptype = ptype,
      .call = error_call
    )
    if (is_null(ptype)) {
      abort("Can't find common type for elements of `x`.", call = error_call)
    }
    x <- vec_cast_common(!!!x, .to = ptype, .call = error_call)
  }

  if (free_size) {
    # Not locked
    size <- NULL
  } else {
    # Lock to a size or die trying
    size <- vec_size_common(
      !!!x,
      .size = size,
      .absent = -1L,
      .call = error_call
    )
    if (size == -1L) {
      abort("Can't find common size for elements of `x`.", call = error_call)
    }
    x <- vec_recycle_common(!!!x, .size = size, .call = error_call)
  }

  new_list_of0(x = x, ptype = ptype, size = size)
}
R/type-list-of.R:555

list_of untypeabletyped

unbound variable (line 116)
unbound: zap — a name the prelude does not declare
error detail
name: zap
gradual mode: typed
((...: any, .ptype: any?, .size: any?) -> any)<>
timing: 0.003 s
source
list_of <- function(..., .ptype = NULL, .size = zap()) {
  args <- list2(...)
  list_as_list_of(args, ptype = .ptype, size = .size)
}
R/type-list-of.R:116

as_list_of untypeabletyped

unbound variable (line 124)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as_list_of <- function(x, ...) {
  UseMethod("as_list_of")
}
R/type-list-of.R:123

as_list_of.vctrs_list_of typed unsound

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.006 s
fuzzing: 20 inside (19 ok, 1 unsound) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>

Counterexamples

callpredictedreturned
as_list_of.vctrs_list_of(structure(list("a" = NULL), "row.names" = c(NA_integer_, NA_integer_), class = "data.frame"), function(...) new.env()){ a: any }<data.frame> with { names: CHR<> with { }, row.names: INT<> with { } }{ a: null }<data.frame> with { names: "a"<> with { }, row.names: (DBL & ~vec1)<> with { } }
source
as_list_of.vctrs_list_of <- function(x, ...) {
  x
}
R/type-list-of.R:128

as_list_of.list untypeabletyped

unbound variable (line 133)
unbound: zap — a name the prelude does not declare
error detail
name: zap
gradual mode: typed
((x: any, ...: any, .ptype: any?, .size: any?) -> any)<>
timing: 0.005 s
source
as_list_of.list <- function(x, ..., .ptype = NULL, .size = zap()) {
  list_as_list_of(x, ptype = .ptype, size = .size)
}
R/type-list-of.R:133

new_list_of skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
new_list_of <- function(
  x = list(),
  ptype = logical(),
  size = NULL,
  ...,
  class = character()
) {
  obj_check_list(x)

  has_ptype <- !is_null(ptype)
  has_size <- !is_null(size)

  if (!has_ptype && !has_size) {
    abort("Must specify at least one of `ptype` or `size`.")
  }

  if (has_ptype) {
    ptype <- vec_ptype(ptype, x_arg = "ptype")
    ptype <- vec_ptype_finalise(ptype)
  }

  if (has_size) {
    check_number_whole(size, min = 0)
    size <- vec_cast(size, integer())
  }

  new_list_of0(x = x, ptype = ptype, size = size, ..., class = class)
}
R/type-list-of.R:148

list_of_unstructure untypeabletyped

unbound variable (line 188)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
list_of_unstructure <- function(x) {
  attr(x, "ptype") <- NULL
  attr(x, "size") <- NULL
  attr(x, "class") <- NULL
  x
}
R/type-list-of.R:187

<statement> typed

timing: 0.000 s
source
NULL
R/type-list-of.R:215

is_list_of typed any: x fuzz ok

((x: any) -> LGL1<>)<>
timing: 0.008 s
fuzzing: 8 inside (8 ok) · 4 outside (4 rejected)
source
is_list_of <- function(x) {
  inherits(x, "vctrs_list_of")
}
R/type-list-of.R:241

check_list_of skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.001 s
source
check_list_of <- function(x, ..., arg = caller_arg(x), call = caller_env()) {
  if (is_list_of(x)) {
    return(invisible(NULL))
  }

  stop_input_type(
    x,
    "a `<list_of>`",
    ...,
    arg = arg,
    call = call
  )
}
R/type-list-of.R:245

list_of_ptype0 typed accepts outside

∀'a. ((x: any with { ptype: 'a, any }) -> 'a)<>
timing: 0.015 s
fuzzing: 20 inside (20 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: ((x: any with { ptype: 'I120740, any }) -> 'I120740)<>

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:ptypelist_of_ptype0(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
xattr:drop:ptypelist_of_ptype0("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
xattr:drop:ptypelist_of_ptype0(function(...) quote(f(x)))null
xattr:drop:ptypelist_of_ptype0(quote(f(x)))null
xkind:langlist_of_ptype0("x" = quote(f(x)))null
xkind:symlist_of_ptype0("x" = as.name("x"))null
source
list_of_ptype0 <- function(x) {
  attr(x, "ptype", exact = TRUE)
}
R/type-list-of.R:231

list_of_ptype untypeabletyped

unbound variable (line 220)
unbound: check_list_of — one of the package’s own names, itself untyped
error detail
name: check_list_of
gradual mode: typed
∀'a. ((x: any with { ptype: 'a, any }) -> 'a)<>
timing: 0.002 s
source
list_of_ptype <- function(x) {
  check_list_of(x)
  list_of_ptype0(x)
}
R/type-list-of.R:219

list_of_size0 typed accepts outside

∀'a. ((x: any with { size: 'a, any }) -> 'a)<>
timing: 0.015 s
fuzzing: 20 inside (20 ok) · 8 outside (3 rejected, 5 accepted)
type drawn from: ((x: any with { size: 'I120751, any }) -> 'I120751)<>

Accepted outside the domain x: 5

parameterchangecallreturned
xkind:envlist_of_size0("x" = new.env())null
xkind:funlist_of_size0("x" = function(...) NULL)null
xkind:nulllist_of_size0(NULL)null
xwraplist_of_size0("x" = list(structure(integer(0), "size" = 42L)))null
xwraplist_of_size0("x" = list(structure(new.env(), "size" = complex(0))))null
source
list_of_size0 <- function(x) {
  attr(x, "size", exact = TRUE)
}
R/type-list-of.R:235

list_of_size untypeabletyped

unbound variable (line 227)
unbound: check_list_of — one of the package’s own names, itself untyped
error detail
name: check_list_of
gradual mode: typed
∀'a. ((x: any with { size: 'a, any }) -> 'a)<>
timing: 0.002 s
source
list_of_size <- function(x) {
  check_list_of(x)
  list_of_size0(x)
}
R/type-list-of.R:226

vec_proxy.vctrs_list_of typed no call in domain

∀'a. ((x: 'a<...>, ...: any) -> 'a<>)<>
timing: 0.013 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: ((x: 'I120764<...>, ...: any) -> 'I120764<>)<>
source
vec_proxy.vctrs_list_of <- function(x, ...) {
  unclass(x)
}
R/type-list-of.R:260

obj_print_data.vctrs_list_of skipped

error detail
File "Rsem/lang/PAst.ml", line 210, characters 14-20: Assertion failed
timing: 0.000 s
source
obj_print_data.vctrs_list_of <- function(x, ...) {
  if (length(x) == 0) {
    return()
  }

  print(vec_data(x))
}
R/type-list-of.R:267

format.vctrs_list_of untypeabletyped

unbound variable (line 277)
unbound: format.default — a name the prelude does not declare
error detail
name: format.default
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
format.vctrs_list_of <- function(x, ...) {
  format.default(x)
}
R/type-list-of.R:276

vec_ptype_full.vctrs_list_of untypeabletyped

unbound variable (line 283)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any with { size: any, ptype: any, any }, ...: any) -> CHR<>)<>
timing: 0.037 s
source
vec_ptype_full.vctrs_list_of <- function(x, ...) {
  size <- list_of_size0(x)
  if (is_null(size)) {
    size <- ""
  } else {
    size <- paste0("[", size, "]")
  }

  ptype <- list_of_ptype0(x)
  if (is_null(ptype)) {
    ptype <- "any"
  } else {
    ptype <- vec_ptype_full(ptype)
  }

  ptype <- paste0(ptype, size)

  if (grepl("\n", ptype)) {
    ptype <- paste0(indent(paste0("\n", ptype), 2), "\n")
  }

  paste0("list_of<", ptype, ">")
}
R/type-list-of.R:281

vec_ptype_abbr.vctrs_list_of untypeabletyped

unbound variable (line 308)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any with { size: any, ptype: any, any }, ...: any) -> CHR<>)<>
timing: 0.021 s
source
vec_ptype_abbr.vctrs_list_of <- function(x, ...) {
  size <- list_of_size0(x)
  if (is_null(size)) {
    size <- ""
  } else {
    size <- paste0("[", size, "]")
  }

  ptype <- list_of_ptype0(x)
  if (is_null(ptype)) {
    ptype <- "any"
  } else {
    ptype <- vec_ptype_abbr(ptype)
  }

  ptype <- paste0(ptype, size)

  paste0("list<", ptype, ">")
}
R/type-list-of.R:306

as.list.vctrs_list_of untypeabletyped

unbound variable (line 330)
unbound: list_of_unstructure — one of the package’s own names, itself untyped
error detail
name: list_of_unstructure
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
as.list.vctrs_list_of <- function(x, ...) {
  list_of_unstructure(x)
}
R/type-list-of.R:329

as.character.vctrs_list_of untypeabletyped

unbound variable (line 336)
unbound: vec_ptype_abbr — one of the package’s own names, itself untyped
error detail
name: vec_ptype_abbr
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.006 s
source
as.character.vctrs_list_of <- function(x, ...) {
  # For compatibility with the RStudio Viewer. See tidyverse/tidyr#654.
  map_chr(x, function(elt) paste0("<", vec_ptype_abbr(elt), ">"))
}
R/type-list-of.R:334

[[.vctrs_list_of typed fuzz ok

∀'a. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty)&((x: { 'a }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'a))<>
timing: 0.060 s
fuzzing: 20 inside (19 ok, 1 error type) · 8 outside (8 rejected)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty) & ((x: { 'I120833 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'I120833))<>

Other calls inside the domain

callverdicterror
[[.vctrs_list_of("x" = list(as.raw(c(0))), "i" = -2147483647L, "fuzz_dot1" = c(-2147483647, 2147483647, -2147483647, NA_real_, 42), "fuzz_dot2" = function(...) list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_typeInvalid index: out of bounds
source
`[[.vctrs_list_of` <- function(x, i, ...) {
  .Call(vctrs_list_get, x, i)
}
R/type-list-of.R:340

$.vctrs_list_of typed fuzz ok

∀'a. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty)&((x: { 'a }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'a))<>
timing: 0.054 s
fuzzing: 20 inside (18 ok, 2 error type) · 8 outside (8 rejected)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty) & ((x: { 'I120843 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'I120843))<>

Other calls inside the domain

callverdicterror
$.vctrs_list_of(list(), "i" = 1L)error_typeInvalid index: out of bounds
$.vctrs_list_of("x" = list(as.raw(c(0))), "i" = -2147483647L)error_typeInvalid index: out of bounds
source
`$.vctrs_list_of` <- function(x, i, ...) {
  .Call(vctrs_list_get, x, i)
}
R/type-list-of.R:345

[<-.vctrs_list_of untypeable

unbound variable (line 351)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.029 s
source
`[<-.vctrs_list_of` <- function(x, i, value) {
  if (is_null(value)) {
    return(NextMethod())
  }

  if (!obj_is_list(value)) {
    # Ideally the user provides a list, but if `value` is not a list, we chop
    # it. This matches list semantics where this works:
    #
    # ```
    # x <- list(1, 2, 3)
    # x[1:2] <- c(4, 5)
    # ```
    value <- vec_chop(value)
  }

  ptype <- list_of_ptype0(x)
  if (!is_null(ptype)) {
    value <- map(value, vec_cast, to = ptype)
  }

  size <- list_of_size0(x)
  if (!is_null(size)) {
    value <- map(value, vec_recycle, size = size)
  }

  value <- new_list_of0(value, ptype = ptype, size = size)

  NextMethod()
}
R/type-list-of.R:350

[[<-.vctrs_list_of untypeable

unbound variable (line 383)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.021 s
source
`[[<-.vctrs_list_of` <- function(x, i, value) {
  if (is_null(value)) {
    return(NextMethod())
  }

  ptype <- list_of_ptype0(x)
  if (!is_null(ptype)) {
    value <- vec_cast(value, ptype)
  }

  size <- list_of_size0(x)
  if (!is_null(size)) {
    value <- vec_recycle(value, size)
  }

  NextMethod()
}
R/type-list-of.R:382

$<-.vctrs_list_of untypeable

unbound variable (line 402)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
timing: 0.021 s
source
`$<-.vctrs_list_of` <- function(x, i, value) {
  if (is_null(value)) {
    return(NextMethod())
  }

  ptype <- list_of_ptype0(x)
  if (!is_null(ptype)) {
    value <- vec_cast(value, ptype)
  }

  size <- list_of_size0(x)
  if (!is_null(size)) {
    value <- vec_recycle(value, size)
  }

  NextMethod()
}
R/type-list-of.R:401

vec_ptype2.vctrs_list_of untypeabletyped

unbound variable (line 427)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.vctrs_list_of <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.vctrs_list_of")
}
R/type-list-of.R:426

vec_ptype2.vctrs_list_of.vctrs_list_of untypeabletyped

unbound variable (line 465)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
((x: any with { size: dbl1, ptype: any, any }, y: any with { size: dbl1, ptype: any, any }, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.194 s
source
vec_ptype2.vctrs_list_of.vctrs_list_of <- function(
  x,
  y,
  ...,
  x_arg = "",
  y_arg = ""
) {
  x_ptype <- list_of_ptype0(x)
  y_ptype <- list_of_ptype0(y)

  x_size <- list_of_size0(x)
  y_size <- list_of_size0(y)

  if (identical(x_ptype, y_ptype) && identical(x_size, y_size)) {
    return(x)
  }

  # Common type always goes towards more lenient type
  #
  # Element type:
  # - If either `x_ptype` or `y_ptype` are `NULL`, fall back to `NULL`
  # - If both `x_ptype` and `y_ptype` are specified, try common type but fall
  #   back to `NULL`
  #
  # Element size:
  # - If either `x_size` or `y_size` are `NULL`, fall back to `NULL`
  # - If both `x_ptype` and `y_ptype` are specified, try common size but fall
  #   back to `NULL`
  #
  # If both `ptype` and `size` are `NULL` after this, return bare `list()`,
  # otherwise return `list_of()` with appropriate restrictions. Note that with
  # this set up we may fail a ptype2 determination but pass a size2
  # determination and still return a list-of.
  if (is_null(x_ptype) || is_null(y_ptype)) {
    ptype <- NULL
  } else {
    ptype <- tryCatch(
      vec_ptype2(x_ptype, y_ptype),
      vctrs_error_incompatible_type = function(cnd) NULL
    )
  }

  if (is_null(x_size) || is_null(y_size)) {
    size <- NULL
  } else {
    # No `vec_size2()`. This uses ALTREP to be efficient.
    size <- tryCatch(
      vec_size_common(seq_len(x_size), seq_len(y_size)),
      vctrs_error_incompatible_size = function(cnd) NULL
    )
  }

  if (is_null(ptype) && is_null(size)) {
    list()
  } else {
    new_list_of0(x = list(), ptype = ptype, size = size)
  }
}
R/type-list-of.R:432

vec_ptype2.list.vctrs_list_of typed any: x, y accepts outside

((x: any, y: any, ...: any) -> { }<>)<>
timing: 0.010 s
fuzzing: 8 inside (8 ok) · 8 outside (8 accepted)

Accepted outside the domain x: 2, y: 6

parameterchangecallreturned
xdropvec_ptype2.list.vctrs_list_of("y" = new.env()){ }<> with { }
xdropvec_ptype2.list.vctrs_list_of(NULL, "fuzz_dot1" = list(function(...) integer(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))){ }<> with { }
ydropvec_ptype2.list.vctrs_list_of(new.env()){ }<> with { }
ydropvec_ptype2.list.vctrs_list_of(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = function(...) as.name("x")){ }<> with { }
ydropvec_ptype2.list.vctrs_list_of(as.raw(c(0))){ }<> with { }
ydropvec_ptype2.list.vctrs_list_of("x" = quote(f(x))){ }<> with { }
and 2 more
source
vec_ptype2.list.vctrs_list_of <- function(x, y, ...) {
  list()
}
R/type-list-of.R:492

vec_ptype2.vctrs_list_of.list typed any: x, y accepts outside

((x: any, y: any, ...: any) -> { }<>)<>
timing: 0.010 s
fuzzing: 8 inside (8 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 3, y: 2

parameterchangecallreturned
xdropvec_ptype2.vctrs_list_of.list("y" = NULL, "fuzz_dot1" = TRUE){ }<> with { }
xdropvec_ptype2.vctrs_list_of.list("y" = numeric(0)){ }<> with { }
xdropvec_ptype2.vctrs_list_of.list("y" = list(new.env()), "fuzz_dot1" = NA){ }<> with { }
ydropvec_ptype2.vctrs_list_of.list("x" = function(...) quote(f(x))){ }<> with { }
ydropvec_ptype2.vctrs_list_of.list(new.env(), "fuzz_dot1" = list(), "fuzz_dot2" = list()){ }<> with { }
source
vec_ptype2.vctrs_list_of.list <- function(x, y, ...) {
  list()
}
R/type-list-of.R:496

vec_cast.vctrs_list_of untypeabletyped

unbound variable (line 505)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.vctrs_list_of <- function(x, to, ...) {
  UseMethod("vec_cast.vctrs_list_of")
}
R/type-list-of.R:504

vec_cast.vctrs_list_of.vctrs_list_of untypeabletyped

unbound variable (line 514)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any with { size: any, ptype: any, any }, to: any with { size: any, ptype: any, any }, ...: any, call: any?) -> any)<>
timing: 0.019 s
source
vec_cast.vctrs_list_of.vctrs_list_of <- function(
  x,
  to,
  ...,
  call = caller_env()
) {
  x_ptype <- list_of_ptype0(x)
  to_ptype <- list_of_ptype0(to)

  x_size <- list_of_size0(x)
  to_size <- list_of_size0(to)

  if (identical(x_ptype, to_ptype) && identical(x_size, to_size)) {
    # FIXME: Suboptimal check for "same type", but should be good enough for the
    # common case of unchopping a list of identically generated list-ofs (#875).
    # Would be fixed by https://github.com/r-lib/vctrs/issues/1688.
    return(x)
  }

  x <- list_of_unstructure(x)

  ptype <- to_ptype %||% zap()
  size <- to_size %||% zap()

  list_as_list_of(
    x = x,
    ptype = ptype,
    size = size,
    error_call = call
  )
}
R/type-list-of.R:510

vec_cast.list.vctrs_list_of untypeabletyped

unbound variable (line 544)
unbound: list_of_unstructure — one of the package’s own names, itself untyped
error detail
name: list_of_unstructure
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.list.vctrs_list_of <- function(x, to, ...) {
  list_of_unstructure(x)
}
R/type-list-of.R:543

vec_cast.vctrs_list_of.list untypeabletyped

unbound variable (line 547)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, to: any with { size: any, ptype: any, any }, ...: any, call: any?) -> any)<>
timing: 0.006 s
source
vec_cast.vctrs_list_of.list <- function(x, to, ..., call = caller_env()) {
  ptype <- list_of_ptype0(to) %||% zap()
  size <- list_of_size0(to) %||% zap()
  list_as_list_of(x, ptype = ptype, size = size, error_call = call)
}
R/type-list-of.R:547
R/list-of-transpose.R

list_of_transpose untypeabletyped

unbound variable (line 117)
unbound: caller_arg — a name the prelude does not declare
error detail
name: caller_arg
gradual mode: typed
((x: any with { size: any, ptype: any, any }, ...: any, x_arg: absent, error_call: any?) | (x: any with { size: any, ptype: any, any }, ...: any, x_arg: any?, error_call: absent) | (x: any with { size: null, ptype: any_sexp, any }, ...: any, x_arg: any?, error_call: any?) -> any)<>
timing: 0.013 s
source
list_of_transpose <- function(
  x,
  ...,
  x_arg = caller_arg(x),
  error_call = current_env()
) {
  check_dots_empty0(...)

  check_list_of(x, arg = x_arg, call = error_call)

  if (vec_any_missing(x)) {
    abort(
      cli::format_inline(
        "{arg_backtick(x_arg)} can't contain `NULL` values."
      ),
      call = error_call
    )
  }

  size <- list_of_size0(x)
  ptype <- list_of_ptype0(x)

  if (is_null(size)) {
    abort(
      c(
        cli::format_inline(
          "{arg_backtick(x_arg)} must be a fully specified `<list_of>`."
        ),
        i = "`size` is not specified."
      ),
      call = error_call
    )
  }
  if (is_null(ptype)) {
    abort(
      c(
        cli::format_inline(
          "{arg_backtick(x_arg)} must be a fully specified `<list_of>`."
        ),
        i = "`ptype` is not specified."
      ),
      call = error_call
    )
  }

  x_size <- vec_size(x)
  sizes <- vec_rep(x_size, times = size)

  # Flatten pieces into one big vector
  out <- list_interleave(
    x,
    size = size,
    ptype = ptype,
    name_spec = "inner",
    x_arg = x_arg,
    error_call = error_call
  )

  # Chop the one big vector into transposed pieces of size `x_size`
  out <- vec_chop(out, sizes = sizes)

  new_list_of0(out, ptype = ptype, size = x_size)
}
R/list-of-transpose.R:114
R/list-unchop.R

list_unchop untypeabletyped

unbound variable (line 82)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, ...: any, indices: any_sexp?, ptype: any_sexp?, name_spec: any_sexp?, name_repair: (CHR | null)?, error_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.029 s
source
list_unchop <- function(
  x,
  ...,
  indices = NULL,
  ptype = NULL,
  name_spec = NULL,
  name_repair = c(
    "minimal",
    "unique",
    "check_unique",
    "universal",
    "unique_quiet",
    "universal_quiet"
  ),
  error_arg = "x",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_list_unchop,
    x,
    indices,
    ptype,
    name_spec,
    name_repair,
    environment()
  )
}
R/list-unchop.R:67
R/match.R

vec_locate_matches untypeabletyped

unbound variable (line 315)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((needles: any, haystack: any, ...: any, condition: any?, filter: any?, incomplete: any?, no_match: any?, remaining: any?, multiple: any?, relationship: any?, nan_distinct: any?, chr_proxy_collate: any?, needles_arg: any?, haystack_arg: any?, error_call: any?) -> any)<>
timing: 0.047 s
source
vec_locate_matches <- function(
  needles,
  haystack,
  ...,
  condition = "==",
  filter = "none",
  incomplete = "compare",
  no_match = NA_integer_,
  remaining = "drop",
  multiple = "all",
  relationship = "none",
  nan_distinct = FALSE,
  chr_proxy_collate = NULL,
  needles_arg = "needles",
  haystack_arg = "haystack",
  error_call = current_env()
) {
  check_dots_empty0(...)
  frame <- environment()

  .Call(
    ffi_locate_matches,
    needles,
    haystack,
    condition,
    filter,
    incomplete,
    no_match,
    remaining,
    multiple,
    relationship,
    nan_distinct,
    chr_proxy_collate,
    needles_arg,
    haystack_arg,
    frame
  )
}
R/match.R:300

<statement> typed

timing: 0.001 s
source
NULL
R/match.R:347

compute_nesting_container_info untypeabletyped

unbound variable (line 354)
unbound: ffi_compute_nesting_container_info — a native symbol tyr could not bind
error detail
name: ffi_compute_nesting_container_info
gradual mode: typed
((x: any, condition: any) -> any)<>
timing: 0.002 s
source
compute_nesting_container_info <- function(x, condition) {
  .Call(ffi_compute_nesting_container_info, x, condition)
}
R/match.R:353

stop_matches skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_matches <- function(
  message = NULL,
  class = NULL,
  ...,
  call = caller_env()
) {
  stop_vctrs(
    message = message,
    class = c(class, "vctrs_error_matches"),
    ...,
    call = call
  )
}
R/match.R:359

warn_matches skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
warn_matches <- function(message, class = NULL, ..., call = caller_env()) {
  warn_vctrs(
    message = message,
    class = c(class, "vctrs_warning_matches"),
    ...,
    call = call
  )
}
R/match.R:373

stop_matches_overflow untypeabletyped

unbound variable (line 391)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((size: any, call: any) -> any)<>
timing: 0.012 s
source
stop_matches_overflow <- function(size, call) {
  size <- format(size, scientific = FALSE)

  # Pre-generating the message in this case because we want to use
  # `.internal = TRUE` and that doesn't work with lazy messages
  message <- c(
    "Match procedure results in an allocation larger than 2^31-1 elements.",
    i = glue::glue("Attempted allocation size was {size}.")
  )

  stop_matches(
    message = message,
    class = "vctrs_error_matches_overflow",
    size = size,
    call = call,
    .internal = TRUE
  )
}
R/match.R:384

stop_matches_nothing untypeabletyped

unbound variable (line 406)
unbound: stop_matches — one of the package’s own names, itself untyped
error detail
name: stop_matches
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.008 s
source
stop_matches_nothing <- function(i, needles_arg, haystack_arg, call) {
  stop_matches(
    class = "vctrs_error_matches_nothing",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:405

cnd_header.vctrs_error_matches_nothing untypeabletyped

unbound variable (line 417)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.002 s
source
cnd_header.vctrs_error_matches_nothing <- function(cnd, ...) {
  glue::glue(
    "Each value of `{cnd$needles_arg}` must have a match in `{cnd$haystack_arg}`."
  )
}
R/match.R:416

cnd_body.vctrs_error_matches_nothing untypeabletyped

unbound variable (line 424)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.003 s
source
cnd_body.vctrs_error_matches_nothing <- function(cnd, ...) {
  bullet <- glue::glue(
    "Location {cnd$i} of `{cnd$needles_arg}` does not have a match."
  )
  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/match.R:423

stop_matches_remaining untypeabletyped

unbound variable (line 434)
unbound: stop_matches — one of the package’s own names, itself untyped
error detail
name: stop_matches
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.008 s
source
stop_matches_remaining <- function(i, needles_arg, haystack_arg, call) {
  stop_matches(
    class = "vctrs_error_matches_remaining",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:433

cnd_header.vctrs_error_matches_remaining untypeabletyped

unbound variable (line 445)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.002 s
source
cnd_header.vctrs_error_matches_remaining <- function(cnd, ...) {
  glue::glue(
    "Each value of `{cnd$haystack_arg}` must be matched by `{cnd$needles_arg}`."
  )
}
R/match.R:444

cnd_body.vctrs_error_matches_remaining untypeabletyped

unbound variable (line 452)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.003 s
source
cnd_body.vctrs_error_matches_remaining <- function(cnd, ...) {
  bullet <- glue::glue(
    "Location {cnd$i} of `{cnd$haystack_arg}` was not matched."
  )
  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/match.R:451

stop_matches_incomplete untypeabletyped

unbound variable (line 462)
unbound: stop_matches — one of the package’s own names, itself untyped
error detail
name: stop_matches
gradual mode: typed
((i: any, needles_arg: any, call: any) -> any)<>
timing: 0.005 s
source
stop_matches_incomplete <- function(i, needles_arg, call) {
  stop_matches(
    class = "vctrs_error_matches_incomplete",
    i = i,
    needles_arg = needles_arg,
    call = call
  )
}
R/match.R:461

cnd_header.vctrs_error_matches_incomplete untypeabletyped

unbound variable (line 472)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.002 s
source
cnd_header.vctrs_error_matches_incomplete <- function(cnd, ...) {
  glue::glue("`{cnd$needles_arg}` can't contain missing values.")
}
R/match.R:471

cnd_body.vctrs_error_matches_incomplete untypeabletyped

unbound variable (line 477)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((cnd: any, ...: any) -> any)<>
timing: 0.003 s
source
cnd_body.vctrs_error_matches_incomplete <- function(cnd, ...) {
  bullet <- glue::glue("Location {cnd$i} contains missing values.")
  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/match.R:476

stop_matches_multiple untypeabletyped

unbound variable (line 485)
unbound: stop_matches — one of the package’s own names, itself untyped
error detail
name: stop_matches
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.008 s
source
stop_matches_multiple <- function(i, needles_arg, haystack_arg, call) {
  stop_matches(
    class = "vctrs_error_matches_multiple",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:484

cnd_matches_multiple_header untypeabletyped

unbound variable (line 622)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((x_arg: any, y_arg: any) -> any)<>
timing: 0.002 s
source
cnd_matches_multiple_header <- function(x_arg, y_arg) {
  glue::glue(
    "Each value of `{x_arg}` can match at most 1 value from `{y_arg}`."
  )
}
R/match.R:621

cnd_header.vctrs_error_matches_multiple untypeabletyped

unbound variable (line 496)
unbound: cnd_matches_multiple_header — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_header
gradual mode: typed
((cnd: { haystack_arg: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.022 s
source
cnd_header.vctrs_error_matches_multiple <- function(cnd, ...) {
  cnd_matches_multiple_header(cnd$needles_arg, cnd$haystack_arg)
}
R/match.R:495

cnd_matches_multiple_body untypeabletyped

unbound variable (line 628)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((i: any, name: any) -> any)<>
timing: 0.004 s
source
cnd_matches_multiple_body <- function(i, name) {
  bullet <- glue::glue("Location {i} of `{name}` matches multiple values.")
  bullet <- c(x = bullet)
  format_error_bullets(bullet)
}
R/match.R:627

cnd_body.vctrs_error_matches_multiple untypeabletyped

unbound variable (line 501)
unbound: cnd_matches_multiple_body — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_body
gradual mode: typed
((cnd: { i: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.022 s
source
cnd_body.vctrs_error_matches_multiple <- function(cnd, ...) {
  cnd_matches_multiple_body(cnd$i, cnd$needles_arg)
}
R/match.R:500

warn_matches_multiple untypeabletyped

unbound variable (line 508)
unbound: cnd_matches_multiple_header — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_header
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.009 s
source
warn_matches_multiple <- function(i, needles_arg, haystack_arg, call) {
  message <- paste(
    cnd_matches_multiple_header(needles_arg, haystack_arg),
    cnd_matches_multiple_body(i, needles_arg),
    sep = "\n"
  )

  warn_matches(
    message = message,
    class = "vctrs_warning_matches_multiple",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:506

stop_matches_relationship skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
stop_matches_relationship <- function(class = NULL, ..., call = caller_env()) {
  stop_matches(
    class = c(class, "vctrs_error_matches_relationship"),
    ...,
    call = call
  )
}
R/match.R:613

stop_matches_relationship_one_to_one untypeabletyped

unbound variable (line 532)
unbound: stop_matches_relationship — one of the package’s own names, itself untyped
error detail
name: stop_matches_relationship
gradual mode: typed
((i: any, which: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.012 s
source
stop_matches_relationship_one_to_one <- function(
  i,
  which,
  needles_arg,
  haystack_arg,
  call
) {
  stop_matches_relationship(
    class = "vctrs_error_matches_relationship_one_to_one",
    i = i,
    which = which,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:525

cnd_header.vctrs_error_matches_relationship_one_to_one untypeabletyped

unbound variable (line 545)
unbound: cnd_matches_multiple_header — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_header
gradual mode: typed
((cnd: { which: "needles", haystack_arg: any, needles_arg: any, any }, ...: any) | (cnd: { which: ~"needles", haystack_arg: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.218 s
source
cnd_header.vctrs_error_matches_relationship_one_to_one <- function(cnd, ...) {
  if (cnd$which == "needles") {
    cnd_matches_multiple_header(cnd$needles_arg, cnd$haystack_arg)
  } else {
    cnd_matches_multiple_header(cnd$haystack_arg, cnd$needles_arg)
  }
}
R/match.R:543

cnd_body.vctrs_error_matches_relationship_one_to_one untypeabletyped

unbound variable (line 554)
unbound: cnd_matches_multiple_body — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_body
gradual mode: typed
((cnd: { i: any, which: "needles", needles_arg: any, any }, ...: any) | (cnd: { i: any, which: ~"needles", haystack_arg: any, any }, ...: any) -> any)<>
timing: 0.212 s
source
cnd_body.vctrs_error_matches_relationship_one_to_one <- function(cnd, ...) {
  if (cnd$which == "needles") {
    cnd_matches_multiple_body(cnd$i, cnd$needles_arg)
  } else {
    cnd_matches_multiple_body(cnd$i, cnd$haystack_arg)
  }
}
R/match.R:552

stop_matches_relationship_one_to_many untypeabletyped

unbound variable (line 567)
unbound: stop_matches_relationship — one of the package’s own names, itself untyped
error detail
name: stop_matches_relationship
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.008 s
source
stop_matches_relationship_one_to_many <- function(
  i,
  needles_arg,
  haystack_arg,
  call
) {
  stop_matches_relationship(
    class = "vctrs_error_matches_relationship_one_to_many",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:561

cnd_header.vctrs_error_matches_relationship_one_to_many untypeabletyped

unbound variable (line 578)
unbound: cnd_matches_multiple_header — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_header
gradual mode: typed
((cnd: { haystack_arg: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.023 s
source
cnd_header.vctrs_error_matches_relationship_one_to_many <- function(cnd, ...) {
  cnd_matches_multiple_header(cnd$haystack_arg, cnd$needles_arg)
}
R/match.R:577

cnd_body.vctrs_error_matches_relationship_one_to_many untypeabletyped

unbound variable (line 583)
unbound: cnd_matches_multiple_body — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_body
gradual mode: typed
((cnd: { i: any, haystack_arg: any, any }, ...: any) -> any)<>
timing: 0.022 s
source
cnd_body.vctrs_error_matches_relationship_one_to_many <- function(cnd, ...) {
  cnd_matches_multiple_body(cnd$i, cnd$haystack_arg)
}
R/match.R:582

stop_matches_relationship_many_to_one untypeabletyped

unbound variable (line 593)
unbound: stop_matches_relationship — one of the package’s own names, itself untyped
error detail
name: stop_matches_relationship
gradual mode: typed
((i: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.008 s
source
stop_matches_relationship_many_to_one <- function(
  i,
  needles_arg,
  haystack_arg,
  call
) {
  stop_matches_relationship(
    class = "vctrs_error_matches_relationship_many_to_one",
    i = i,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:587

cnd_header.vctrs_error_matches_relationship_many_to_one untypeabletyped

unbound variable (line 604)
unbound: cnd_matches_multiple_header — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_header
gradual mode: typed
((cnd: { haystack_arg: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.022 s
source
cnd_header.vctrs_error_matches_relationship_many_to_one <- function(cnd, ...) {
  cnd_matches_multiple_header(cnd$needles_arg, cnd$haystack_arg)
}
R/match.R:603

cnd_body.vctrs_error_matches_relationship_many_to_one untypeabletyped

unbound variable (line 609)
unbound: cnd_matches_multiple_body — one of the package’s own names, itself untyped
error detail
name: cnd_matches_multiple_body
gradual mode: typed
((cnd: { i: any, needles_arg: any, any }, ...: any) -> any)<>
timing: 0.021 s
source
cnd_body.vctrs_error_matches_relationship_many_to_one <- function(cnd, ...) {
  cnd_matches_multiple_body(cnd$i, cnd$needles_arg)
}
R/match.R:608

warn_matches_relationship skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
warn_matches_relationship <- function(
  message,
  class = NULL,
  ...,
  call = caller_env()
) {
  warn_matches(
    message = message,
    class = c(class, "vctrs_warning_matches_relationship"),
    ...,
    call = call
  )
}
R/match.R:662

warn_matches_relationship_many_to_many untypeabletyped

unbound variable (line 643)
unbound: glue::glue — a name the prelude does not declare
error detail
name: glue::glue
gradual mode: typed
((i: any, j: any, needles_arg: any, haystack_arg: any, call: any) -> any)<>
timing: 0.013 s
source
warn_matches_relationship_many_to_many <- function(
  i,
  j,
  needles_arg,
  haystack_arg,
  call
) {
  message <- paste(
    glue::glue(
      "Detected an unexpected many-to-many relationship between `{needles_arg}` and `{haystack_arg}`."
    ),
    cnd_matches_multiple_body(i, needles_arg),
    cnd_matches_multiple_body(j, haystack_arg),
    sep = "\n"
  )

  warn_matches_relationship(
    message = message,
    class = "vctrs_warning_matches_relationship_many_to_many",
    i = i,
    j = j,
    needles_arg = needles_arg,
    haystack_arg = haystack_arg,
    call = call
  )
}
R/match.R:635
R/parallel.R

<statement> typed

timing: 0.001 s
source
NULL
R/parallel.R:80

vec_pany untypeabletyped

unbound variable (line 89)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .missing: any?, .size: any?, .arg: any?, .error_call: any?) -> any)<>
timing: 0.006 s
source
vec_pany <- function(
  ...,
  .missing = NA,
  .size = NULL,
  .arg = "",
  .error_call = current_env()
) {
  .Call(ffi_vec_pany, list2(...), .missing, .size, environment())
}
R/parallel.R:84

vec_pall untypeabletyped

unbound variable (line 101)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((...: any, .missing: any?, .size: any?, .arg: any?, .error_call: any?) -> any)<>
timing: 0.006 s
source
vec_pall <- function(
  ...,
  .missing = NA,
  .size = NULL,
  .arg = "",
  .error_call = current_env()
) {
  .Call(ffi_vec_pall, list2(...), .missing, .size, environment())
}
R/parallel.R:96
R/recode.R

<statement> typed

timing: 0.000 s
source
NULL
R/recode.R:180

vec_recode_values untypeabletyped

unbound variable (line 198)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, ...: any, from: any_sexp, to: any_sexp, default: any_sexp?, unmatched: (CHR | null)?, from_as_list_of_vectors: LGL?, to_as_list_of_vectors: LGL?, ptype: any_sexp?, x_arg: any?, from_arg: any?, to_arg: any?, default_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.027 s
source
vec_recode_values <- function(
  x,
  ...,
  from,
  to,
  default = NULL,
  unmatched = "default",
  from_as_list_of_vectors = FALSE,
  to_as_list_of_vectors = FALSE,
  ptype = NULL,
  x_arg = "x",
  from_arg = "from",
  to_arg = "to",
  default_arg = "default",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_recode_values,
    x,
    from,
    to,
    default,
    unmatched,
    from_as_list_of_vectors,
    to_as_list_of_vectors,
    ptype,
    environment()
  )
}
R/recode.R:184

vec_replace_values untypeabletyped

unbound variable (line 227)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, ...: any, from: any_sexp, to: any_sexp, from_as_list_of_vectors: LGL?, to_as_list_of_vectors: LGL?, x_arg: any?, from_arg: any?, to_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.016 s
source
vec_replace_values <- function(
  x,
  ...,
  from,
  to,
  from_as_list_of_vectors = FALSE,
  to_as_list_of_vectors = FALSE,
  x_arg = "x",
  from_arg = "from",
  to_arg = "to",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(
    ffi_vec_replace_values,
    x,
    from,
    to,
    from_as_list_of_vectors,
    to_as_list_of_vectors,
    environment()
  )
}
R/recode.R:217
R/register-s3.R

.rlang_s3_register_compat typed any: fn, try_rlang fuzz ok

((fn: any, try_rlang: any?) -> ((pkg: vec1) -> LGL1<>)<>)<>
timing: 0.075 s
fuzzing: 8 inside (8 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
.rlang_s3_register_compat(list(new.env(), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), function(...) new.env())error_typebase::switch: EXPR must be a length 1 vector
.rlang_s3_register_compat(NULL)error_typebase::switch: EXPR must be a length 1 vector
.rlang_s3_register_compat(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), function(...) function(...) NULL)error_typebase::switch: EXPR must be a length 1 vector
.rlang_s3_register_compat(function(...) integer(0), "try_rlang" = NULL)error_typebase::switch: EXPR must be a length 1 vector
.rlang_s3_register_compat("fn" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::switch: EXPR must be a length 1 vector
.rlang_s3_register_compat(as.raw(c(255, 255)), list(as.name("x"), NULL))error_typebase::switch: EXPR must be a length 1 vector
and 2 more
source
.rlang_s3_register_compat <- function(fn, try_rlang = TRUE) {
  # Compats that behave the same independently of rlang's presence
  out <- switch(
    fn,
    is_installed = return(function(pkg) requireNamespace(pkg, quietly = TRUE))
  )

  # Only use rlang if it is fully loaded (#1482)
  if (
    try_rlang &&
      requireNamespace("rlang", quietly = TRUE) &&
      environmentIsLocked(asNamespace("rlang"))
  ) {
    switch(
      fn,
      is_interactive = return(rlang::is_interactive)
    )

    # Make sure rlang knows about "x" and "i" bullets
    if (utils::packageVersion("rlang") >= "0.4.2") {
      switch(
        fn,
        abort = return(rlang::abort),
        warn = return((rlang::warn)),
        inform = return(rlang::inform)
      )
    }
  }

  # Fall back to base compats

  is_interactive_compat <- function() {
    opt <- getOption("rlang_interactive")
    if (!is.null(opt)) {
      opt
    } else {
      interactive()
    }
  }

  format_msg <- function(x) paste(x, collapse = "\n")
  switch(
    fn,
    is_interactive = return(is_interactive_compat),
    abort = return(function(msg) stop(format_msg(msg), call. = FALSE)),
    warn = return(function(msg) warning(format_msg(msg), call. = FALSE)),
    inform = return(function(msg) message(format_msg(msg)))
  )

  stop(sprintf("Internal error in rlang shims: Unknown function `%s()`.", fn))
}
R/register-s3.R:136

s3_register untypeabletyped

unbound variable (line 71)
unbound: isNamespace — a name the prelude does not declare
error detail
name: isNamespace
gradual mode: typed
((generic: CHR1, class: CHR1, method: any?) | (generic: CHR1, class: clx1, method: any?) -> null)<>
timing: 0.361 s
source
s3_register <- function(generic, class, method = NULL) {
  stopifnot(is.character(generic), length(generic) == 1)
  stopifnot(is.character(class), length(class) == 1)

  pieces <- strsplit(generic, "::")[[1]]
  stopifnot(length(pieces) == 2)
  package <- pieces[[1]]
  generic <- pieces[[2]]

  caller <- parent.frame()

  get_method_env <- function() {
    top <- topenv(caller)
    if (isNamespace(top)) {
      asNamespace(environmentName(top))
    } else {
      caller
    }
  }
  get_method <- function(method) {
    if (is.null(method)) {
      get(paste0(generic, ".", class), envir = get_method_env())
    } else {
      method
    }
  }

  register <- function(...) {
    envir <- asNamespace(package)

    # Refresh the method each time, it might have been updated by
    # `devtools::load_all()`
    method_fn <- get_method(method)
    stopifnot(is.function(method_fn))

    # Only register if generic can be accessed
    if (exists(generic, envir)) {
      registerS3method(generic, class, method_fn, envir = envir)
    } else if (identical(Sys.getenv("NOT_CRAN"), "true")) {
      warn <- .rlang_s3_register_compat("warn")

      warn(c(
        sprintf(
          "Can't find generic `%s` in package %s to register S3 method.",
          generic,
          package
        ),
        "i" = "This message is only shown to developers using devtools.",
        "i" = sprintf(
          "Do you need to update %s to the latest version?",
          package
        )
      ))
    }
  }

  # Always register hook in case package is later unloaded & reloaded
  setHook(packageEvent(package, "onLoad"), function(...) {
    register()
  })

  # For compatibility with R < 4.0 where base isn't locked
  is_sealed <- function(pkg) {
    identical(pkg, "base") || environmentIsLocked(asNamespace(pkg))
  }

  # Avoid registration failures during loading (pkgload or regular).
  # Check that environment is locked because the registering package
  # might be a dependency of the package that exports the generic. In
  # that case, the exports (and the generic) might not be populated
  # yet (#1225).
  if (isNamespaceLoaded(package) && is_sealed(package)) {
    register()
  }

  invisible()
}
R/register-s3.R:58

<statement> untypeabletyped

unbound variable (line 189)
unbound: replace_from — one of the package’s own names, itself untyped
error detail
name: replace_from
gradual mode: typed
timing: 0.002 s
source
on_load({
  s3_register <- replace_from("s3_register", "rlang")
})
R/register-s3.R:188

blast untypeabletyped

unbound variable (line 203)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((expr: any, env: any?) -> any)<>
timing: 0.003 s
source
blast <- function(expr, env = caller_env()) {
  eval_bare(enexpr(expr), env)
}
R/register-s3.R:203

knitr_defer untypeabletyped

unbound variable (line 192)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((expr: any, env: any?) -> any)<>
timing: 0.011 s
source
knitr_defer <- function(expr, env = caller_env()) {
  roxy_caller <- detect(sys.frames(), env_inherits, ns_env("knitr"))
  if (is_null(roxy_caller)) {
    abort("Internal error: can't find knitr on the stack.")
  }

  blast(
    withr::defer(!!substitute(expr), !!roxy_caller),
    env
  )
}
R/register-s3.R:192

knitr_local_registration untypeable

unbound variable (line 207)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.019 s
source
knitr_local_registration <- function(generic, class, env = caller_env()) {
  stopifnot(is.character(generic), length(generic) == 1)
  stopifnot(is.character(class), length(class) == 1)

  pieces <- strsplit(generic, "::")[[1]]
  stopifnot(length(pieces) == 2)
  package <- pieces[[1]]
  generic <- pieces[[2]]

  name <- paste0(generic, ".", class)
  method <- env_get(env, name)

  old <- env_bind(global_env(), !!name := method)
  knitr_defer(env_bind(global_env(), !!!old))
}
R/register-s3.R:207
R/runs.R

<statement> typed

timing: 0.001 s
source
NULL
R/runs.R:52

vec_identify_runs typed fuzz ok

((x: any_sexp) -> any_sexp)<>
timing: 0.010 s
fuzzing: 6 inside (1 ok, 5 error pkg) · 7 outside (7 rejected)

Other calls inside the domain

callverdicterror
vec_identify_runs(new.env())error_pkgvctrs::vec_identify_runs: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_identify_runs(NULL)error_pkgvctrs::vec_identify_runs: `x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_identify_runs("x" = new.env())error_pkgvctrs::vec_identify_runs: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_identify_runs(as.name("x"))error_pkgvctrs::vec_identify_runs: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_identify_runs(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_identify_runs: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
vec_identify_runs <- function(x) {
  .Call(ffi_vec_identify_runs, x, environment())
}
R/runs.R:56

vec_run_sizes typed fuzz ok

((x: any_sexp) -> INT)<>
timing: 0.013 s
fuzzing: 8 inside (2 ok, 6 error pkg) · 2 outside (2 rejected)

Other calls inside the domain

callverdicterror
vec_run_sizes(function(...) new.env())error_pkgvctrs::vec_run_sizes: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_run_sizes("x" = as.name("x"))error_pkgvctrs::vec_run_sizes: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_run_sizes(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_run_sizes: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_run_sizes(NULL)error_pkgvctrs::vec_run_sizes: `x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_run_sizes("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_run_sizes: `x` must be a vector, not a pointer. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_run_sizes(as.name("x"))error_pkgvctrs::vec_run_sizes: `x` must be a vector, not a symbol. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
source
vec_run_sizes <- function(x) {
  .Call(ffi_vec_run_sizes, x, environment())
}
R/runs.R:62

vec_locate_run_bounds typed fuzz ok

((x: any_sexp, which: any_sexp?) -> INT)<>
timing: 0.037 s
fuzzing: 8 inside (1 ok, 7 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
vec_locate_run_bounds("x" = new.env(), "which" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_pkgvctrs::vec_locate_run_bounds: `which` must be a string or character vector.
vec_locate_run_bounds(NULL, as.name("x"))error_pkgvctrs::vec_locate_run_bounds: `which` must be one of "start" or "end", not "x".
vec_locate_run_bounds("x" = function(...) new.env(), "which" = NA_complex_)error_pkgvctrs::vec_locate_run_bounds: `which` must be a string or character vector.
vec_locate_run_bounds(new.env())error_pkgvctrs::vec_locate_run_bounds: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_locate_run_bounds("x" = new.env())error_pkgvctrs::vec_locate_run_bounds: `x` must be a vector, not an environment. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_locate_run_bounds(NULL, "which" = new.env())error_pkgvctrs::vec_locate_run_bounds: `which` must be a string or character vector.
and 1 more
source
vec_locate_run_bounds <- function(x, which = c("start", "end")) {
  .Call(ffi_vec_locate_run_bounds, x, which, environment())
}
R/runs.R:66

vec_detect_run_bounds typed fuzz ok

((x: any_sexp, which: any_sexp?) -> any_sexp)<>
timing: 0.037 s
fuzzing: 8 inside (8 error pkg) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
vec_detect_run_bounds(quote(f(x)), as.name("x"))error_pkgvctrs::vec_detect_run_bounds: `which` must be one of "start" or "end", not "x".
vec_detect_run_bounds(as.name("x"), new.env())error_pkgvctrs::vec_detect_run_bounds: `which` must be a string or character vector.
vec_detect_run_bounds("x" = NULL)error_pkgvctrs::vec_detect_run_bounds: `x` must be a vector, not `NULL`. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_detect_run_bounds(integer(0), "which" = function(...) function(...) NULL)error_pkgvctrs::vec_detect_run_bounds: `which` must be a string or character vector.
vec_detect_run_bounds("x" = function(...) list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_pkgvctrs::vec_detect_run_bounds: `x` must be a vector, not a function. ℹ Read our FAQ about scalar types (`?vctrs::faq_error_scalar_type`) to learn more.
vec_detect_run_bounds(new.env(), NULL)error_pkgvctrs::vec_detect_run_bounds: `which` must be a string or character vector.
and 2 more
source
vec_detect_run_bounds <- function(x, which = c("start", "end")) {
  .Call(ffi_vec_detect_run_bounds, x, which, environment())
}
R/runs.R:70
R/set.R

<statement> typed

timing: 0.001 s
source
NULL
R/set.R:114

vec_set_intersect untypeabletyped

unbound variable (line 125)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, ptype: any_sexp?, x_arg: any?, y_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.018 s
source
vec_set_intersect <- function(
  x,
  y,
  ...,
  ptype = NULL,
  x_arg = "x",
  y_arg = "y",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(ffi_vec_set_intersect, x, y, ptype, environment())
}
R/set.R:118

vec_set_difference untypeabletyped

unbound variable (line 140)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, ptype: any_sexp?, x_arg: any?, y_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.014 s
source
vec_set_difference <- function(
  x,
  y,
  ...,
  ptype = NULL,
  x_arg = "x",
  y_arg = "y",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(ffi_vec_set_difference, x, y, ptype, environment())
}
R/set.R:133

vec_set_union untypeabletyped

unbound variable (line 155)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, ptype: any_sexp?, x_arg: any?, y_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.014 s
source
vec_set_union <- function(
  x,
  y,
  ...,
  ptype = NULL,
  x_arg = "x",
  y_arg = "y",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(ffi_vec_set_union, x, y, ptype, environment())
}
R/set.R:148

vec_set_symmetric_difference untypeabletyped

unbound variable (line 170)
unbound: current_env — a name the prelude does not declare
error detail
name: current_env
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, ptype: any_sexp?, x_arg: any?, y_arg: any?, error_call: any?) -> any_sexp)<>
timing: 0.014 s
source
vec_set_symmetric_difference <- function(
  x,
  y,
  ...,
  ptype = NULL,
  x_arg = "x",
  y_arg = "y",
  error_call = current_env()
) {
  check_dots_empty0(...)
  .Call(ffi_vec_set_symmetric_difference, x, y, ptype, environment())
}
R/set.R:163
R/shape.R

new_shape typed any: type fuzz ok

∀'a,'b. (((type: any, shape: (vec | null)?) -> any)&((type: v('b), shape: (vec | null)?) -> v('b))&((type: { 'a }, shape: (vec | null)?) -> { 'a }))<>
timing: 0.123 s
fuzzing: 20 inside (6 ok, 14 error type) · 8 outside (8 rejected)
type drawn from: (((type: any, shape: (vec | null)?) -> any) & ((type: v('I121895), shape: (vec | null)?) -> v('I121895)) & ((type: { 'I121894 }, shape: (vec | null)?) -> { 'I121894 }))<>

Other calls inside the domain

callverdicterror
new_shape(list(NULL), c(complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2)))error_typebase::<-: dims [product 0] do not match the length of object [1]
new_shape("type" = c(complex(real = 0, imaginary = 0), NA_complex_, complex(real = 1, imaginary = -2), NA_complex_, NA_complex_))error_typebase::<-: dims [product 0] do not match the length of object [5]
new_shape(as.raw(c(0, 255, 255, 0, 0)), c("", "x y"))error_typebase::<-: the dims contain missing values
new_shape(list(1L), "shape" = as.raw(c(255)))error_typebase::<-: dims [product 0] do not match the length of object [1]
new_shape(NULL, 1000000)error_type::structure: attempt to set an attribute on NULL
new_shape("type" = list(c(-2.5, 2, -Inf, 42, -1), c(NaN, -Inf)), "shape" = -Inf)error_typebase::<-: the dims contain missing values
and 8 more
source
new_shape <- function(type, shape = integer()) {
  structure(type, dim = c(0L, shape))
}
R/shape.R:6

vec_shaped_ptype untypeabletyped

unbound variable (line 11)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
∀'a. ((ptype: 'a & any_sexp, x: any_sexp, y: any_sexp, ...: any, x_arg: any?, y_arg: any?) -> any_sexp & 'a)<>
timing: 0.014 s
source
vec_shaped_ptype <- function(ptype, x, y, ..., x_arg = "", y_arg = "") {
  check_dots_empty0(...)
  .Call(ffi_vec_shaped_ptype, ptype, x, y, environment())
}
R/shape.R:10

vec_shape2 untypeabletyped

unbound variable (line 16)
unbound: check_dots_empty0 — a name the prelude does not declare
error detail
name: check_dots_empty0
gradual mode: typed
((x: any_sexp, y: any_sexp, ...: any, x_arg: any?, y_arg: any?) -> any_sexp)<>
timing: 0.010 s
source
vec_shape2 <- function(x, y, ..., x_arg = "", y_arg = "") {
  check_dots_empty0(...)
  .Call(ffi_vec_shape2, x, y, environment())
}
R/shape.R:15

n_dim2 typed accepts outside

∀'a,'b,'c,'d,`a,`b. (((x: 'b & ((INT | v('c)) | null), y: 'a & ((INT | v('d)) | null)) -> { x: 'b, y: (INT | v('d)) | null }<> | { x: (INT | v('c)) | null, y: 'a & ((INT | v('d)) | null) }<>)&((x: 'b & ((INT | v('c)) | null), y: 'a & (INT | v('d))<`b>) -> { x: 'b, y: (INT | v('d))<`b> }<> | { x: (INT | v('c)) | null, y: 'a & (INT | v('d))<`b> }<>)&((x: 'b & (INT | v('c))<`a>, y: 'a & ((INT | v('d)) | null)) -> { x: 'b, y: (INT | v('d)) | null }<> | { x: (INT | v('c))<`a>, y: 'a & ((INT | v('d)) | null) }<>))<>
timing: 0.883 s
fuzzing: 31 inside (31 ok) · 8 outside (6 rejected, 2 accepted)
type drawn from: (((x: 'x & ((INT | v('I121975)) | null), y: 'y & ((INT | v('I122003)) | null)) -> { x: 'x, y: (INT | v('I122003)) | null }<> | { x: (INT | v('I121975)) | null, y: 'y & ((INT | v('I122003)) | null) }<>) & ((x: 'x & ((INT | v('I121975)) | null), y: 'y & (INT | v('I122003))<`I1334>) -> { x: 'x, y: (INT | v('I122003))<`I1334> }<> | { x: (INT | v('I121975)) | null, y: 'y & (INT | v('I122003))<`I1334> }<>) & ((x: 'x & (INT | v('I121975))<`I1332>, y: 'y & ((INT | v('I122003)) | null)) -> { x: 'x, y: (INT | v('I122003)) | null }<> | { x: (INT | v('I121975))<`I1332>, y: 'y & ((INT | v('I122003)) | null) }<>))<>

Accepted outside the domain x: 1, y: 1

parameterchangecallreturned
xwrapn_dim2(list(structure(c(-2147483647L, -2147483647L), "levels" = character(0), class = "factor")), "y" = structure(c(-1, 42), "fuzz_attr" = NA_character_)){ x: { 1L<> with { } | (INT & ~vec1)<factor> with { levels: (CHR & ~vec1)<> with { } } }<> with { }, y: (DBL & ~vec1)<> with { fuzz_attr: na_string<> with { } } }<> with { names: (CHR & ~vec1)<> with { } }
ykind:listn_dim2("x" = -2147483647L, "y" = list()){ x: -2147483647L<> with { }, y: { 1L<> with { } }<> with { } }<> with { names: (CHR & ~vec1)<> with { } }
source
n_dim2 <- function(x, y) {
  nx <- length(x)
  ny <- length(y)

  if (nx == ny) {
    list(x = x, y = y)
  } else if (nx < ny) {
    list(x = c(x, rep(1L, ny - nx)), y = y)
  } else {
    list(x = x, y = c(y, rep(1L, nx - ny)))
  }
}
R/shape.R:84

shape_broadcast untypeabletyped

unbound variable (line 21)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
∀'a. ((x: 'a & null, to: any, ...: any, x_arg: any, to_arg: any, call: any?) | (x: 'a \ null, to: null, ...: any, x_arg: any, to_arg: any, call: any?) -> 'a)<>
timing: 0.085 s
source
shape_broadcast <- function(x, to, ..., x_arg, to_arg, call = caller_env()) {
  if (is.null(x) || is.null(to)) {
    return(x)
  }

  dim_x <- vec_dim(x)
  dim_to <- vec_dim(to)

  # Don't set dimensions for vectors
  if (length(dim_x) == 1L && length(dim_to) == 1L) {
    return(x)
  }

  if (length(dim_x) > length(dim_to)) {
    details <- sprintf(
      "Can't decrease dimensionality from %s to %s.",
      length(dim_x),
      length(dim_to)
    )
    stop_incompatible_cast(
      x,
      to,
      details = details,
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    )
  }

  dim_x <- n_dim2(dim_x, dim_to)$x
  dim_to[[1]] <- dim_x[[1]] # don't change number of observations
  ok <- dim_x == dim_to | dim_x == 1
  if (any(!ok)) {
    stop_incompatible_cast(
      x,
      to,
      details = "Non-recyclable dimensions.",
      x_arg = x_arg,
      to_arg = to_arg,
      call = call
    )
  }

  # Increase dimensionality if required
  if (vec_dim_n(x) != length(dim_x)) {
    dim(x) <- dim_x
  }

  recycle <- dim_x != dim_to

  # Avoid expensive subset
  if (all(!recycle)) {
    return(x)
  }

  indices <- rep(list(missing_arg()), length(dim_to))
  indices[recycle] <- map(dim_to[recycle], rep_len, x = 1L)

  eval_bare(expr(x[!!!indices, drop = FALSE]))
}
R/shape.R:21
R/split.R

vec_split untypeabletyped

unbound variable (line 32)
unbound: vctrs_split — a native symbol tyr could not bind
error detail
name: vctrs_split
gradual mode: typed
((x: any, by: any) -> any)<>
timing: 0.002 s
source
vec_split <- function(x, by) {
  .Call(vctrs_split, x, by)
}
R/split.R:31
R/type-bare.R

vec_ptype2.logical untypeabletyped

unbound variable (line 10)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.logical <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.logical")
}
R/type-bare.R:9

vec_ptype2.integer untypeabletyped

unbound variable (line 17)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.integer <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.integer")
}
R/type-bare.R:16

vec_ptype2.double untypeabletyped

unbound variable (line 24)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.double <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.double")
}
R/type-bare.R:23

vec_ptype2.complex untypeabletyped

unbound variable (line 31)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.complex <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.complex")
}
R/type-bare.R:30

vec_ptype2.character untypeabletyped

unbound variable (line 38)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.character <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.character")
}
R/type-bare.R:37

vec_ptype2.raw untypeabletyped

unbound variable (line 45)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.raw <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.raw")
}
R/type-bare.R:44

vec_ptype2.list untypeabletyped

unbound variable (line 52)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.list <- function(x, y, ..., x_arg = "", y_arg = "") {
  UseMethod("vec_ptype2.list")
}
R/type-bare.R:51

vec_ptype2.logical.logical untypeabletyped

unbound variable (line 61)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.logical.logical <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.logical.logical")
}
R/type-bare.R:60

vec_ptype2.integer.integer untypeabletyped

unbound variable (line 67)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.integer.integer <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.integer.integer")
}
R/type-bare.R:66

vec_ptype2.logical.integer untypeabletyped

unbound variable (line 72)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.logical.integer <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.logical.integer")
}
R/type-bare.R:71

vec_ptype2.integer.logical untypeabletyped

unbound variable (line 77)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.integer.logical <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.integer.logical")
}
R/type-bare.R:76

vec_ptype2.double.double untypeabletyped

unbound variable (line 83)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.double.double <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.double.double")
}
R/type-bare.R:82

vec_ptype2.logical.double untypeabletyped

unbound variable (line 88)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.logical.double <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.logical.double")
}
R/type-bare.R:87

vec_ptype2.double.logical untypeabletyped

unbound variable (line 93)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.double.logical <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.double.logical")
}
R/type-bare.R:92

vec_ptype2.integer.double untypeabletyped

unbound variable (line 98)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.integer.double <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.integer.double")
}
R/type-bare.R:97

vec_ptype2.double.integer untypeabletyped

unbound variable (line 103)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.double.integer <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.double.integer")
}
R/type-bare.R:102

vec_ptype2.complex.complex untypeabletyped

unbound variable (line 109)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.complex.complex <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.complex.complex")
}
R/type-bare.R:108

vec_ptype2.integer.complex untypeabletyped

unbound variable (line 114)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.integer.complex <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.integer.complex")
}
R/type-bare.R:113

vec_ptype2.complex.integer untypeabletyped

unbound variable (line 119)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.complex.integer <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.complex.integer")
}
R/type-bare.R:118

vec_ptype2.double.complex untypeabletyped

unbound variable (line 124)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.double.complex <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.double.complex")
}
R/type-bare.R:123

vec_ptype2.complex.double untypeabletyped

unbound variable (line 129)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.complex.double <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.complex.double")
}
R/type-bare.R:128

vec_ptype2.character.character untypeabletyped

unbound variable (line 138)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.character.character <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.character.character")
}
R/type-bare.R:137

vec_ptype2.raw.raw untypeabletyped

unbound variable (line 147)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.raw.raw <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.raw.raw")
}
R/type-bare.R:146

vec_ptype2.list.list untypeabletyped

unbound variable (line 156)
unbound: stop_native_implementation — one of the package’s own names, itself untyped
error detail
name: stop_native_implementation
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.008 s
source
vec_ptype2.list.list <- function(x, y, ..., x_arg = "", y_arg = "") {
  stop_native_implementation("vec_ptype2.list.list")
}
R/type-bare.R:155

vec_cast.logical untypeabletyped

unbound variable (line 170)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.logical <- function(x, to, ...) {
  UseMethod("vec_cast.logical")
}
R/type-bare.R:169

vec_cast.logical.logical untypeable

unbound variable (line 175)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.005 s
source
vec_cast.logical.logical <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:174

vec_cast.logical.integer untypeabletyped

unbound variable (line 185)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: vec | null, to: null, ...: any, x_arg: any?, to_arg: any?, call: any?) | (x: vec | null, to: any, ...: any, x_arg: any?, to_arg: any?, call: absent) -> any)<>
timing: 0.017 s
source
vec_cast.logical.integer <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  out <- vec_coerce_bare(x, "logical")
  out <- shape_broadcast(
    out,
    to,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
  lossy <- !x %in% c(0L, 1L, NA_integer_)
  maybe_lossy_cast(
    out,
    x,
    to,
    lossy,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
}
R/type-bare.R:179

vec_cast.logical.double untypeabletyped

unbound variable (line 214)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: vec | null, to: null, ...: any, x_arg: any?, to_arg: any?, call: any?) | (x: vec | null, to: any, ...: any, x_arg: any?, to_arg: any?, call: absent) -> any)<>
timing: 0.017 s
source
vec_cast.logical.double <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  out <- vec_coerce_bare(x, "logical")
  out <- shape_broadcast(
    out,
    to,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
  lossy <- !x %in% c(0, 1, NA_real_)
  maybe_lossy_cast(
    out,
    x,
    to,
    lossy,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
}
R/type-bare.R:208

vec_cast.integer untypeabletyped

unbound variable (line 241)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer <- function(x, to, ...) {
  UseMethod("vec_cast.integer")
}
R/type-bare.R:240

vec_cast.integer.logical untypeable

unbound variable (line 246)
unbound: vec_coerce_bare — one of the package’s own names, itself untyped
error detail
name: vec_coerce_bare
timing: 0.005 s
source
vec_cast.integer.logical <- function(x, to, ...) {
  x <- vec_coerce_bare(x, "integer")
  shape_broadcast(x, to, ...)
}
R/type-bare.R:245

vec_cast.integer.integer untypeable

unbound variable (line 252)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.006 s
source
vec_cast.integer.integer <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:251

vec_cast.integer.double untypeabletyped

unbound variable (line 262)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?, call: any?) -> any)<>
timing: 0.020 s
source
vec_cast.integer.double <- function(
  x,
  to,
  ...,
  x_arg = "",
  to_arg = "",
  call = caller_env()
) {
  out <- suppressWarnings(vec_coerce_bare(x, "integer"))
  x_na <- is.na(x)
  lossy <- (out != x & !x_na) | xor(x_na, is.na(out))

  out <- shape_broadcast(
    out,
    to,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
  maybe_lossy_cast(
    out,
    x,
    to,
    lossy,
    x_arg = x_arg,
    to_arg = to_arg,
    call = call
  )
}
R/type-bare.R:256

vec_cast.double untypeabletyped

unbound variable (line 291)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.double <- function(x, to, ...) {
  UseMethod("vec_cast.double")
}
R/type-bare.R:290

vec_cast.double.logical untypeable

unbound variable (line 296)
unbound: vec_coerce_bare — one of the package’s own names, itself untyped
error detail
name: vec_coerce_bare
timing: 0.005 s
source
vec_cast.double.logical <- function(x, to, ...) {
  x <- vec_coerce_bare(x, "double")
  shape_broadcast(x, to, ...)
}
R/type-bare.R:295

vec_cast.double.integer untypeabletyped

unbound variable (line 301)
unbound: vec_cast.double.logical — one of the package’s own names, itself untyped
error detail
name: vec_cast.double.logical
gradual mode: typed
any
timing: 0.000 s
source
vec_cast.double.integer <- vec_cast.double.logical
R/type-bare.R:301

vec_cast.double.double untypeable

unbound variable (line 305)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.005 s
source
vec_cast.double.double <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:304

vec_cast.complex untypeabletyped

unbound variable (line 313)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.complex <- function(x, to, ...) {
  UseMethod("vec_cast.complex")
}
R/type-bare.R:312

vec_cast.complex.logical untypeable

unbound variable (line 318)
unbound: vec_coerce_bare — one of the package’s own names, itself untyped
error detail
name: vec_coerce_bare
timing: 0.005 s
source
vec_cast.complex.logical <- function(x, to, ...) {
  x <- vec_coerce_bare(x, "complex")
  shape_broadcast(x, to, ...)
}
R/type-bare.R:317

vec_cast.complex.integer untypeabletyped

unbound variable (line 323)
unbound: vec_cast.complex.logical — one of the package’s own names, itself untyped
error detail
name: vec_cast.complex.logical
gradual mode: typed
any
timing: 0.000 s
source
vec_cast.complex.integer <- vec_cast.complex.logical
R/type-bare.R:323

vec_cast.complex.double untypeabletyped

unbound variable (line 326)
unbound: vec_cast.complex.logical — one of the package’s own names, itself untyped
error detail
name: vec_cast.complex.logical
gradual mode: typed
any
timing: 0.000 s
source
vec_cast.complex.double <- vec_cast.complex.logical
R/type-bare.R:326

vec_cast.complex.complex untypeable

unbound variable (line 330)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.005 s
source
vec_cast.complex.complex <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:329

vec_cast.raw untypeabletyped

unbound variable (line 338)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.raw <- function(x, to, ...) {
  UseMethod("vec_cast.raw")
}
R/type-bare.R:337

vec_cast.raw.raw untypeable

unbound variable (line 343)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.005 s
source
vec_cast.raw.raw <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:342

vec_cast.character untypeabletyped

unbound variable (line 351)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.character <- function(x, to, ...) {
  UseMethod("vec_cast.character")
}
R/type-bare.R:350

vec_cast.character.character untypeable

unbound variable (line 356)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.006 s
source
vec_cast.character.character <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:355

vec_cast.list untypeabletyped

unbound variable (line 364)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.list <- function(x, to, ...) {
  UseMethod("vec_cast.list")
}
R/type-bare.R:363

vec_cast.list.list untypeable

unbound variable (line 369)
unbound: shape_broadcast — one of the package’s own names, itself untyped
error detail
name: shape_broadcast
timing: 0.005 s
source
vec_cast.list.list <- function(x, to, ...) {
  shape_broadcast(x, to, ...)
}
R/type-bare.R:368

vec_proxy_equal.array untypeabletyped

unbound variable (line 379)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_equal.array <- function(x, ...) {
  # The conversion to data frame is only a stopgap, in the long
  # term, we'll hash arrays natively. Note that hashing functions
  # similarly convert to data frames.
  x <- as.data.frame(x)
  vec_proxy_equal(x)
}
R/type-bare.R:375

vec_proxy_compare.raw typed accepts outside

(((x: vec | null, ...: any) -> INT<>)&((x: vec1, ...: any) -> INT1<>))<>
timing: 0.038 s
fuzzing: 8 inside (8 ok) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapvec_proxy_compare.raw(list(42L), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = NULL)42L<> with { }
xwrapvec_proxy_compare.raw(list(as.raw(c(0))), raw(0), quote(f(x)), "fuzz_dot1" = NULL)0L<> with { }
source
vec_proxy_compare.raw <- function(x, ...) {
  # because:
  # order(as.raw(1:3))
  # #> Error in order(as.raw(1:3)): unimplemented type 'raw' in 'orderVector1'
  as.integer(x)
}
R/type-bare.R:386

vec_proxy_compare.list untypeabletyped

unbound variable (line 395)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_proxy_compare.list <- function(x, ...) {
  stop_unsupported(x, "vec_proxy_compare")
}
R/type-bare.R:394

vec_proxy_compare.array untypeabletyped

unbound variable (line 403)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_compare.array <- function(x, ...) {
  # The conversion to data frame is only a stopgap, in the long
  # term, we'll hash arrays natively. Note that hashing functions
  # similarly convert to data frames.
  x <- as.data.frame(x)
  vec_proxy_compare(x)
}
R/type-bare.R:399

vec_proxy_order.raw untypeabletyped

unbound variable (line 413)
unbound: vec_proxy_compare — one of the package’s own names, itself untyped
error detail
name: vec_proxy_compare
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_order.raw <- function(x, ...) {
  # Can't rely on fallthrough behavior to `vec_proxy_compare()` because this
  # isn't an S3 object. Have to call it manually.
  vec_proxy_compare(x)
}
R/type-bare.R:410

vec_proxy_order.list untypeable

unbound variable (line 421)
unbound: vec_duplicate_id — one of the package’s own names, itself untyped
error detail
name: vec_duplicate_id
timing: 0.004 s
source
vec_proxy_order.list <- function(x, ...) {
  # Order lists by first appearance.
  # This allows list elements to be grouped in `vec_order()`.
  # Have to separately ensure missing values are propagated.
  out <- vec_duplicate_id(x)

  if (vec_any_missing(x)) {
    missing <- vec_detect_missing(x)
    out <- vec_assign(out, missing, NA_integer_)
  }

  out
}
R/type-bare.R:417

vec_proxy_order.array untypeabletyped

unbound variable (line 436)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_order.array <- function(x, ...) {
  # The conversion to data frame is only a stopgap, in the long
  # term, we'll hash arrays natively. Note that hashing functions
  # similarly convert to data frames.
  x <- as.data.frame(x)
  vec_proxy_order(x)
}
R/type-bare.R:432
R/type-data-table.R

<statement> untypeabletyped

unbound variable (line 2)
unbound: is_installed — a name the prelude does not declare
error detail
name: is_installed
gradual mode: typed
timing: 0.003 s
source
delayedAssign("as.data.table", {
  if (is_installed("data.table")) {
    env_get(ns_env("data.table"), "as.data.table")
  } else {
    function(...) abort("`data.table` must be installed.")
  }
})
R/type-data-table.R:1

dt_ptype2 untypeabletyped

unbound variable (line 10)
unbound: df_ptype2 — one of the package’s own names, itself untyped
error detail
name: df_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
dt_ptype2 <- function(x, y, ...) {
  as.data.table(df_ptype2(x, y, ...))
}
R/type-data-table.R:9

dt_cast untypeabletyped

unbound variable (line 13)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
dt_cast <- function(x, to, ...) {
  as.data.table(df_cast(x, to, ...))
}
R/type-data-table.R:12

vec_ptype2.data.table.data.table untypeabletyped

unbound variable (line 18)
unbound: dt_ptype2 — one of the package’s own names, itself untyped
error detail
name: dt_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2.data.table.data.table <- function(x, y, ...) {
  dt_ptype2(x, y, ...)
}
R/type-data-table.R:17

vec_ptype2.data.table.data.frame untypeabletyped

unbound variable (line 22)
unbound: dt_ptype2 — one of the package’s own names, itself untyped
error detail
name: dt_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_ptype2.data.table.data.frame <- function(x, y, ...) {
  dt_ptype2(x, y, ...)
}
R/type-data-table.R:21

vec_ptype2.data.frame.data.table untypeabletyped

unbound variable (line 26)
unbound: dt_ptype2 — one of the package’s own names, itself untyped
error detail
name: dt_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2.data.frame.data.table <- function(x, y, ...) {
  dt_ptype2(x, y, ...)
}
R/type-data-table.R:25

vec_cast.data.table.data.table untypeabletyped

unbound variable (line 31)
unbound: dt_cast — one of the package’s own names, itself untyped
error detail
name: dt_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast.data.table.data.table <- function(x, to, ...) {
  dt_cast(x, to, ...)
}
R/type-data-table.R:30

vec_cast.data.table.data.frame untypeabletyped

unbound variable (line 35)
unbound: dt_cast — one of the package’s own names, itself untyped
error detail
name: dt_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast.data.table.data.frame <- function(x, to, ...) {
  dt_cast(x, to, ...)
}
R/type-data-table.R:34

vec_cast.data.frame.data.table untypeabletyped

unbound variable (line 39)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast.data.frame.data.table <- function(x, to, ...) {
  df_cast(x, to, ...)
}
R/type-data-table.R:38

vec_ptype_abbr.data.table typed any: x accepts outside

((x: any, ...: any) -> "dt"<>)<>
timing: 0.009 s
fuzzing: 8 inside (8 ok) · 2 outside (2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xdropvec_ptype_abbr.data.table()"dt"<> with { }
xdropvec_ptype_abbr.data.table("fuzz_dot1" = as.raw(c(0, 0, 255, 255, 255)), "fuzz_dot2" = function(...) function(...) quote(f(x)))"dt"<> with { }
source
vec_ptype_abbr.data.table <- function(x, ...) {
  "dt"
}
R/type-data-table.R:43
R/type-dplyr.R

group_intersect untypeabletyped

unbound variable (line 6)
unbound: dplyr::group_vars — a name the prelude does not declare
error detail
name: dplyr::group_vars
gradual mode: typed
((x: any, new: any) -> any)<>
timing: 0.006 s
source
group_intersect <- function(x, new) {
  intersect(dplyr::group_vars(x), names(new))
}
R/type-dplyr.R:5

vec_restore_grouped_df untypeabletyped

unbound variable (line 10)
unbound: group_intersect — one of the package’s own names, itself untyped
error detail
name: group_intersect
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_restore_grouped_df <- function(x, to, ...) {
  vars <- group_intersect(to, x)
  drop <- dplyr::group_by_drop_default(to)
  dplyr::grouped_df(x, vars, drop = drop)
}
R/type-dplyr.R:9

gdf_ptype2 untypeabletyped

unbound variable (line 37)
unbound: df_ptype2 — one of the package’s own names, itself untyped
error detail
name: df_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.009 s
source
gdf_ptype2 <- function(x, y, ...) {
  common <- df_ptype2(x, y, ...)

  x_vars <- dplyr::group_vars(x)
  y_vars <- dplyr::group_vars(y)
  vars <- union(x_vars, y_vars)

  drop <- dplyr::group_by_drop_default(x) && dplyr::group_by_drop_default(y)

  dplyr::grouped_df(common, vars, drop = drop)
}
R/type-dplyr.R:36

vec_ptype2_grouped_df_grouped_df untypeabletyped

unbound variable (line 19)
unbound: gdf_ptype2 — one of the package’s own names, itself untyped
error detail
name: gdf_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_grouped_df_grouped_df <- function(x, y, ...) {
  gdf_ptype2(x, y, ...)
}
R/type-dplyr.R:18

vec_ptype2_grouped_df_data.frame untypeabletyped

unbound variable (line 23)
unbound: gdf_ptype2 — one of the package’s own names, itself untyped
error detail
name: gdf_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_grouped_df_data.frame <- function(x, y, ...) {
  gdf_ptype2(x, y, ...)
}
R/type-dplyr.R:22

vec_ptype2_data.frame_grouped_df untypeabletyped

unbound variable (line 26)
unbound: gdf_ptype2 — one of the package’s own names, itself untyped
error detail
name: gdf_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_data.frame_grouped_df <- function(x, y, ...) {
  gdf_ptype2(x, y, ...)
}
R/type-dplyr.R:25

vec_ptype2_grouped_df_tbl_df untypeabletyped

unbound variable (line 30)
unbound: gdf_ptype2 — one of the package’s own names, itself untyped
error detail
name: gdf_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_grouped_df_tbl_df <- function(x, y, ...) {
  gdf_ptype2(x, y, ...)
}
R/type-dplyr.R:29

vec_ptype2_tbl_df_grouped_df untypeabletyped

unbound variable (line 33)
unbound: gdf_ptype2 — one of the package’s own names, itself untyped
error detail
name: gdf_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_tbl_df_grouped_df <- function(x, y, ...) {
  gdf_ptype2(x, y, ...)
}
R/type-dplyr.R:32

gdf_cast untypeabletyped

unbound variable (line 70)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
gdf_cast <- function(x, to, ...) {
  df <- df_cast(x, to, ...)

  vars <- dplyr::group_vars(to)
  drop <- dplyr::group_by_drop_default(to)

  dplyr::grouped_df(df, vars, drop = drop)
}
R/type-dplyr.R:69

vec_cast_grouped_df_grouped_df untypeabletyped

unbound variable (line 52)
unbound: gdf_cast — one of the package’s own names, itself untyped
error detail
name: gdf_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_grouped_df_grouped_df <- function(x, to, ...) {
  gdf_cast(x, to, ...)
}
R/type-dplyr.R:51

vec_cast_grouped_df_data.frame untypeabletyped

unbound variable (line 56)
unbound: gdf_cast — one of the package’s own names, itself untyped
error detail
name: gdf_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_grouped_df_data.frame <- function(x, to, ...) {
  gdf_cast(x, to, ...)
}
R/type-dplyr.R:55

vec_cast_data.frame_grouped_df untypeabletyped

unbound variable (line 59)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_data.frame_grouped_df <- function(x, to, ...) {
  df_cast(x, to, ...)
}
R/type-dplyr.R:58

vec_cast_grouped_df_tbl_df untypeabletyped

unbound variable (line 63)
unbound: gdf_cast — one of the package’s own names, itself untyped
error detail
name: gdf_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_grouped_df_tbl_df <- function(x, to, ...) {
  gdf_cast(x, to, ...)
}
R/type-dplyr.R:62

vec_cast_tbl_df_grouped_df untypeabletyped

unbound variable (line 66)
unbound: tib_cast — one of the package’s own names, itself untyped
error detail
name: tib_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_tbl_df_grouped_df <- function(x, to, ...) {
  tib_cast(x, to, ...)
}
R/type-dplyr.R:65

vec_restore_rowwise_df untypeabletyped

unbound variable (line 82)
unbound: dplyr::rowwise — a name the prelude does not declare
error detail
name: dplyr::rowwise
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_restore_rowwise_df <- function(x, to, ...) {
  dplyr::rowwise(x)
}
R/type-dplyr.R:81

rww_ptype2 untypeabletyped

unbound variable (line 107)
unbound: df_ptype2 — one of the package’s own names, itself untyped
error detail
name: df_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
rww_ptype2 <- function(x, y, ...) {
  dplyr::rowwise(df_ptype2(x, y, ...))
}
R/type-dplyr.R:106

vec_ptype2_rowwise_df_rowwise_df untypeabletyped

unbound variable (line 89)
unbound: rww_ptype2 — one of the package’s own names, itself untyped
error detail
name: rww_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_rowwise_df_rowwise_df <- function(x, y, ...) {
  rww_ptype2(x, y, ...)
}
R/type-dplyr.R:88

vec_ptype2_rowwise_df_data.frame untypeabletyped

unbound variable (line 93)
unbound: rww_ptype2 — one of the package’s own names, itself untyped
error detail
name: rww_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_rowwise_df_data.frame <- function(x, y, ...) {
  rww_ptype2(x, y, ...)
}
R/type-dplyr.R:92

vec_ptype2_data.frame_rowwise_df untypeabletyped

unbound variable (line 96)
unbound: rww_ptype2 — one of the package’s own names, itself untyped
error detail
name: rww_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_data.frame_rowwise_df <- function(x, y, ...) {
  rww_ptype2(x, y, ...)
}
R/type-dplyr.R:95

vec_ptype2_rowwise_df_tbl_df untypeabletyped

unbound variable (line 100)
unbound: rww_ptype2 — one of the package’s own names, itself untyped
error detail
name: rww_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_rowwise_df_tbl_df <- function(x, y, ...) {
  rww_ptype2(x, y, ...)
}
R/type-dplyr.R:99

vec_ptype2_tbl_df_rowwise_df untypeabletyped

unbound variable (line 103)
unbound: rww_ptype2 — one of the package’s own names, itself untyped
error detail
name: rww_ptype2
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2_tbl_df_rowwise_df <- function(x, y, ...) {
  rww_ptype2(x, y, ...)
}
R/type-dplyr.R:102

rww_cast untypeabletyped

unbound variable (line 132)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
rww_cast <- function(x, to, ...) {
  dplyr::rowwise(df_cast(x, to, ...))
}
R/type-dplyr.R:131

vec_cast_rowwise_df_rowwise_df untypeabletyped

unbound variable (line 114)
unbound: rww_cast — one of the package’s own names, itself untyped
error detail
name: rww_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_rowwise_df_rowwise_df <- function(x, to, ...) {
  rww_cast(x, to, ...)
}
R/type-dplyr.R:113

vec_cast_rowwise_df_data.frame untypeabletyped

unbound variable (line 118)
unbound: rww_cast — one of the package’s own names, itself untyped
error detail
name: rww_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_rowwise_df_data.frame <- function(x, to, ...) {
  rww_cast(x, to, ...)
}
R/type-dplyr.R:117

vec_cast_data.frame_rowwise_df untypeabletyped

unbound variable (line 121)
unbound: df_cast — one of the package’s own names, itself untyped
error detail
name: df_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_data.frame_rowwise_df <- function(x, to, ...) {
  df_cast(x, to, ...)
}
R/type-dplyr.R:120

vec_cast_rowwise_df_tbl_df untypeabletyped

unbound variable (line 125)
unbound: rww_cast — one of the package’s own names, itself untyped
error detail
name: rww_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_rowwise_df_tbl_df <- function(x, to, ...) {
  rww_cast(x, to, ...)
}
R/type-dplyr.R:124

vec_cast_tbl_df_rowwise_df untypeabletyped

unbound variable (line 128)
unbound: tib_cast — one of the package’s own names, itself untyped
error detail
name: tib_cast
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_cast_tbl_df_rowwise_df <- function(x, to, ...) {
  tib_cast(x, to, ...)
}
R/type-dplyr.R:127
R/type-explore.R

coerces_to untypeabletyped

unbound variable (line 4)
unbound: vec_ptype2 — one of the package’s own names, itself untyped
error detail
name: vec_ptype2
gradual mode: typed
((x: any, y: any, using: any?) -> any)<>
timing: 0.065 s
source
coerces_to <- function(x, y, using = "strict") {
  type_max <- switch(
    using,
    strict = vec_ptype2,
    base_c = c,
    base_unlist = function(x, y) unlist(list(x, y)),
    base_modify = function(x, y) `[<-`(x, 2, value = y)
  )

  tryCatch(
    {
      type <- suppressWarnings(type_max(x, y))
      vec_ptype_full(type)
    },
    error = function(e) {
      NA_character_
    }
  )
}
R/type-explore.R:1

maxtype_mat untypeable

unbound variable (line 22)
unbound: vec_ptype — one of the package’s own names, itself untyped
error detail
name: vec_ptype
timing: 0.009 s
source
maxtype_mat <- function(types, using = "strict") {
  names(types) <- map_chr(types, function(x) vec_ptype_full(vec_ptype(x)))

  grid <- expand.grid(x = types, y = types)
  grid$max <- map2_chr(grid$x, grid$y, coerces_to, using = using)

  matrix(
    grid$max,
    nrow = length(types),
    dimnames = list(names(types), names(types))
  )
}
R/type-explore.R:21
R/type-idate.R

vec_proxy_IDate typed fuzz ok

∀'a. ((x: 'a & INT, ...: any) -> INT & 'a)<>
gradual mode: typed
∀'a. (((x: 'a & CHR, ...: any) -> CHR & 'a)&((x: 'a & CLX, ...: any) -> CLX & 'a)&((x: 'a & DBL, ...: any) -> DBL & 'a)&((x: 'a & INT, ...: any) -> INT & 'a)&((x: 'a & LGL, ...: any) -> LGL & 'a)&((x: 'a & list, ...: any) -> list & 'a)&((x: 'a & null, ...: any) -> null & 'a)&((x: 'a & raw, ...: any) -> raw & 'a)&((x: 'a, ...: any) -> 'a))<>
timing: 1.01 s
fuzzing: 19 inside (19 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x & INT, ...: any) -> INT & 'x)<>
source
vec_proxy_IDate <- function(x, ...) {
  if (typeof(x) != "integer") {
    type <- typeof(x)
    cli::cli_abort(
      "Corrupt <IDate>. Expected integer storage, not {type} storage."
    )
  }

  x
}
R/type-idate.R:12

vec_restore_IDate untypeabletyped

unbound variable (line 28)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_restore_IDate <- function(x, to, ...) {
  NextMethod()
}
R/type-idate.R:27
R/type-integer64.R

as_data_frame_from_array untypeable

untypeable application of base::[[]] (line 145)
error detail
argument: @(INT | 'I122908 & (INT | dbl & v('I122923)), 1L<>)
failing call: base::[[]](NA_integer_, 1L)
timing: 0.381 s
source
as_data_frame_from_array <- function(x) {
  # Alternative to `as.data.frame.array()` that always strips 1-D arrays
  # of their dimensions. Unlike `as.data.frame2()`, it doesn't unclass the
  # input, which means that each column retains its original class.
  # This function doesn't attempt to keep the names of `x` at all.

  dim <- dim(x)
  n_dim <- length(dim)

  if (n_dim == 1) {
    # Treat 1-D arrays as 1 column matrices
    dim(x) <- c(dim, 1L)
    n_dim <- 2L
  }

  n_row <- dim[[1L]]
  n_col <- prod(dim[-1L])
  n_col_seq <- seq_len(n_col)

  dim(x) <- c(n_row, n_col)

  out <- vector("list", n_col)
  names(out) <- as_unique_names(rep("", n_col), quiet = TRUE)

  for (i in n_col_seq) {
    out[[i]] <- x[, i, drop = TRUE]
  }

  new_data_frame(out, n = n_row)
}
R/type-integer64.R:130

integer64_proxy untypeabletyped

unbound variable (line 122)
unbound: vctrs_integer64_proxy — a native symbol tyr could not bind
error detail
name: vctrs_integer64_proxy
gradual mode: typed
((x: any) -> any)<>
timing: 0.001 s
source
integer64_proxy <- function(x) {
  .Call(vctrs_integer64_proxy, x)
}
R/type-integer64.R:121

vec_proxy_equal.integer64 untypeabletyped

unbound variable (line 3)
unbound: is.array — a name the prelude does not declare
error detail
name: is.array
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_proxy_equal.integer64 <- function(x, ...) {
  if (is.array(x)) {
    # Stopgap to convert arrays to data frames, then run them through
    # `vec_proxy_equal()` again, which will proxy each column
    x <- as_data_frame_from_array(x)
    x <- vec_proxy_equal(x)
    return(x)
  }

  integer64_proxy(x)
}
R/type-integer64.R:2

vec_ptype_full.integer64 typed any: x accepts outside

((x: any, ...: any) -> "integer64"<>)<>
timing: 0.007 s
fuzzing: 7 inside (7 ok) · 5 outside (5 accepted)

Accepted outside the domain x: 5

parameterchangecallreturned
xdropvec_ptype_full.integer64("fuzz_dot1" = function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = NULL)"integer64"<> with { }
xdropvec_ptype_full.integer64("fuzz_dot1" = NULL, "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"integer64"<> with { }
xdropvec_ptype_full.integer64("fuzz_dot1" = NULL)"integer64"<> with { }
xdropvec_ptype_full.integer64("fuzz_dot1" = new.env(), "fuzz_dot2" = function(...) function(...) NULL)"integer64"<> with { }
xdropvec_ptype_full.integer64()"integer64"<> with { }
source
vec_ptype_full.integer64 <- function(x, ...) {
  "integer64"
}
R/type-integer64.R:27

vec_ptype_abbr.integer64 typed any: x accepts outside

((x: any, ...: any) -> "int64"<>)<>
timing: 0.009 s
fuzzing: 8 inside (8 ok) · 3 outside (3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xdropvec_ptype_abbr.integer64()"int64"<> with { }
xdropvec_ptype_abbr.integer64("fuzz_dot1" = quote(f(x)))"int64"<> with { }
xdropvec_ptype_abbr.integer64("fuzz_dot1" = quote(f(x)), "fuzz_dot2" = integer(0))"int64"<> with { }
source
vec_ptype_abbr.integer64 <- function(x, ...) {
  "int64"
}
R/type-integer64.R:33

vec_ptype2.integer64 untypeabletyped

unbound variable (line 45)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2.integer64 <- function(x, y, ...) {
  UseMethod("vec_ptype2.integer64")
}
R/type-integer64.R:44

vec_ptype2.integer64.integer64 untypeabletyped

unbound variable (line 50)
unbound: bit64::integer64 — a name the prelude does not declare
error detail
name: bit64::integer64
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.005 s
source
vec_ptype2.integer64.integer64 <- function(x, y, ...) bit64::integer64()
R/type-integer64.R:50

vec_ptype2.integer64.integer untypeabletyped

unbound variable (line 54)
unbound: bit64::integer64 — a name the prelude does not declare
error detail
name: bit64::integer64
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.integer64.integer <- function(x, y, ...) bit64::integer64()
R/type-integer64.R:54

vec_ptype2.integer.integer64 untypeabletyped

unbound variable (line 57)
unbound: bit64::integer64 — a name the prelude does not declare
error detail
name: bit64::integer64
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.integer.integer64 <- function(x, y, ...) bit64::integer64()
R/type-integer64.R:57

vec_ptype2.integer64.logical untypeabletyped

unbound variable (line 61)
unbound: bit64::integer64 — a name the prelude does not declare
error detail
name: bit64::integer64
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.integer64.logical <- function(x, y, ...) bit64::integer64()
R/type-integer64.R:61

vec_ptype2.logical.integer64 untypeabletyped

unbound variable (line 64)
unbound: bit64::integer64 — a name the prelude does not declare
error detail
name: bit64::integer64
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_ptype2.logical.integer64 <- function(x, y, ...) bit64::integer64()
R/type-integer64.R:64

vec_cast.integer64 untypeabletyped

unbound variable (line 74)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.003 s
source
vec_cast.integer64 <- function(x, to, ...) {
  UseMethod("vec_cast.integer64")
}
R/type-integer64.R:73

vec_cast.integer64.integer64 typed any: to accepts outside

∀'a. ((x: 'a, to: any, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: 'x, to: any, ...: any) -> 'x)<>

Accepted outside the domain to: 4

parameterchangecallreturned
todropvec_cast.integer64.integer64(c(1000000, 0))(DBL & ~vec1)<> with { }
todropvec_cast.integer64.integer64(-1, "fuzz_dot1" = list(quote(f(x))))-1.<> with { }
todropvec_cast.integer64.integer64("x" = "x y", "fuzz_dot1" = as.name("x"), "fuzz_dot2" = quote(f(x)))"x y"<> with { }
todropvec_cast.integer64.integer64("x" = as.name("x"))sym
source
vec_cast.integer64.integer64 <- function(x, to, ...) {
  x
}
R/type-integer64.R:79

vec_cast.integer64.integer untypeabletyped

unbound variable (line 86)
unbound: bit64::as.integer64 — a name the prelude does not declare
error detail
name: bit64::as.integer64
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer64.integer <- function(x, to, ...) {
  bit64::as.integer64(x)
}
R/type-integer64.R:85

vec_cast.integer.integer64 typed any: to accepts outside

(((x: vec | null, to: any, ...: any) -> INT<>)&((x: vec1, to: any, ...: any) -> INT1<>))<>
timing: 0.039 s
fuzzing: 8 inside (8 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xwrapvec_cast.integer.integer64(list(as.raw(c(255))), as.name("x"), new.env(), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = new.env())255L<> with { }
xwrapvec_cast.integer.integer64(list("NA"), "to" = list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), integer(0)), "fuzz_dot1" = new.env())(INT1 \ ^INT1)<> with { }
xwrapvec_cast.integer.integer64(list(-1L), "to" = NULL)-1L<> with { }
source
vec_cast.integer.integer64 <- function(x, to, ...) {
  as.integer(x)
}
R/type-integer64.R:91

vec_cast.integer64.logical untypeabletyped

unbound variable (line 98)
unbound: bit64::as.integer64 — a name the prelude does not declare
error detail
name: bit64::as.integer64
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer64.logical <- function(x, to, ...) {
  bit64::as.integer64(x)
}
R/type-integer64.R:97

vec_cast.logical.integer64 typed any: to accepts outside

(((x: vec | null, to: any, ...: any) -> LGL<>)&((x: vec1, to: any, ...: any) -> LGL1<>))<>
timing: 0.039 s
fuzzing: 8 inside (8 ok) · 8 outside (3 rejected, 5 accepted)

Accepted outside the domain to: 3, x: 2

parameterchangecallreturned
todropvec_cast.logical.integer64(complex(0), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))(LGL & ~vec1)<> with { }
todropvec_cast.logical.integer64(-1L, "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = NULL)tt<> with { }
todropvec_cast.logical.integer64(as.raw(c(255)))tt<> with { }
xwrapvec_cast.logical.integer64(list(complex(real = 0, imaginary = 0)), "to" = quote(f(x)), "fuzz_dot1" = c(FALSE, NA, FALSE, TRUE, FALSE))ff<> with { }
xwrapvec_cast.logical.integer64(list(integer(0)), "to" = as.name("x"), "fuzz_dot1" = new.env())(LGL1 \ ^LGL1)<> with { }
source
vec_cast.logical.integer64 <- function(x, to, ...) {
  as.logical(x)
}
R/type-integer64.R:103

vec_cast.integer64.double untypeabletyped

unbound variable (line 110)
unbound: bit64::as.integer64 — a name the prelude does not declare
error detail
name: bit64::as.integer64
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer64.double <- function(x, to, ...) {
  bit64::as.integer64(x)
}
R/type-integer64.R:109

vec_cast.double.integer64 typed any: to accepts outside

(((x: vec | null, to: any, ...: any) -> DBL<>)&((x: vec1, to: any, ...: any) -> DBL1<>))<>
timing: 0.040 s
fuzzing: 8 inside (8 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xwrapvec_cast.double.integer64(list(NA_character_), "to" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = list(c(NA_complex_, complex(real = 0, imaginary = 0), complex(real = 1, imaginary = -2), NA_complex_, complex(real = 0, imaginary = 0)), NULL))(DBL1 \ ^DBL1)<> with { }
source
vec_cast.double.integer64 <- function(x, to, ...) {
  as.double(x)
}
R/type-integer64.R:115

integer64_restore typed empty return

((x: p(CHR) | <> | sym | null) -> empty)<>
timing: 0.008 s
source
integer64_restore <- function(x) {
  .Call(vctrs_integer64_restore, x)
}
R/type-integer64.R:124
R/type-misc.R

vec_proxy.numeric_version typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.006 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.numeric_version <- function(x, ...) {
  x
}
R/type-misc.R:4

proxy_equal_numeric_version untypeable

unbound variable (line 17)
unbound: caller_env — a name the prelude does not declare
error detail
name: caller_env
timing: 0.111 s
source
proxy_equal_numeric_version <- function(x, error_call = caller_env()) {
  N_COMPONENTS <- 8L

  x <- unclass(x)

  size <- length(x)
  sizes <- lengths(x)

  if (length(sizes) != 0L) {
    max <- max(sizes)
  } else {
    max <- N_COMPONENTS
  }

  if (max > N_COMPONENTS) {
    cli::cli_abort(
      "`x` can't contain more than {N_COMPONENTS} version components.",
      call = error_call
    )
  }

  if (any(sizes != max)) {
    # Pad with zeros where needed to be able to transpose.
    # This is somewhat slow if required.
    pad_sizes <- max - sizes
    pad_needed <- which(pad_sizes != 0L)

    x[pad_needed] <- map2(
      x[pad_needed],
      pad_sizes[pad_needed],
      function(elt, pad_size) {
        c(elt, vec_rep(0L, times = pad_size))
      }
    )
  }

  # Transpose with combination of `vec_interleave()` and `vec_chop()`
  x <- vec_interleave(!!!x, .ptype = integer())
  out <- vec_chop(x, sizes = vec_rep(size, times = max))

  n_zeros <- N_COMPONENTS - max

  if (n_zeros != 0L) {
    # Pad columns of zeros out to `N_COMPONENTS` columns
    zero <- list(vec_rep(0L, times = size))
    out <- c(out, vec_rep(zero, times = n_zeros))
  }

  # Use a data frame as the proxy
  names(out) <- paste0("...", seq_len(N_COMPONENTS))
  out <- new_data_frame(out, n = size)

  # A `<numeric_version>` internally stored as `integer()` is considered the
  # `NA` value. We patch that in at the very end if needed. It is hard to create
  # so should be very uncommon.
  missing <- sizes == 0L

  if (any(missing)) {
    na <- vec_init(out)
    out <- vec_assign(out, missing, na)
  }

  out
}
R/type-misc.R:17

vec_proxy_equal.numeric_version untypeabletyped

unbound variable (line 10)
unbound: proxy_equal_numeric_version — one of the package’s own names, itself untyped
error detail
name: proxy_equal_numeric_version
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
vec_proxy_equal.numeric_version <- function(x, ...) {
  proxy_equal_numeric_version(x)
}
R/type-misc.R:9

vec_proxy.omit typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.005 s
fuzzing: 20 inside (20 ok) · 7 outside (7 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.omit <- function(x, ...) {
  x
}
R/type-misc.R:85

vec_restore.omit typed any: x fuzz ok

∀'a,'b. (((x: any, ...: any) -> any)&((x: v('b), ...: any) -> v('b))&((x: { 'a }, ...: any) -> { 'a }))<>
timing: 0.046 s
fuzzing: 20 inside (17 ok, 3 error type) · 8 outside (8 rejected)
type drawn from: (((x: any, ...: any) -> any) & ((x: v('I123118), ...: any) -> v('I123118)) & ((x: { 'I123117 }, ...: any) -> { 'I123117 }))<>

Other calls inside the domain

callverdicterror
vec_restore.omit(NULL, "fuzz_dot1" = c(-1, 1000000))error_type::structure: attempt to set an attribute on NULL
vec_restore.omit("x" = as.name("x"))error_typebase::<-: cannot set an attribute on a 'symbol'
vec_restore.omit("x" = as.name("x"), "fuzz_dot1" = as.name("x"))error_typebase::<-: cannot set an attribute on a 'symbol'
source
vec_restore.omit <- function(x, ...) {
  structure(x, class = "omit")
}
R/type-misc.R:89

vec_ptype2.omit.omit typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.010 s
fuzzing: 20 inside (20 ok) · 8 outside (1 rejected, 7 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain x: 2, y: 5

parameterchangecallreturned
xdropvec_ptype2.omit.omit(quote(f(x)), "fuzz_dot1" = function(...) NULL, "fuzz_dot2" = as.name("x"))lang<> with { }
xdropvec_ptype2.omit.omit(c("é", "", "", "a", NA_character_))(CHR & ~vec1)<> with { }
ydropvec_ptype2.omit.omit("x" = logical(0))(LGL & ~vec1)<> with { }
ydropvec_ptype2.omit.omit(integer(0), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))(INT & ~vec1)<> with { }
ydropvec_ptype2.omit.omit(as.raw(c(255)))raw1<> with { }
ydropvec_ptype2.omit.omit("")""<> with { }
and 1 more
source
vec_ptype2.omit.omit <- function(x, y, ...) {
  x
}
R/type-misc.R:94

vec_ptype2.integer.omit typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain y: 4

parameterchangecallreturned
ydropvec_ptype2.integer.omit("x" = c(NaN, 2147483647, 2147483647, 2, NA_real_), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = list(as.name("x")))(DBL & ~vec1)<> with { }
ydropvec_ptype2.integer.omit("", "fuzz_dot1" = new.env(), "fuzz_dot2" = NULL)""<> with { }
ydropvec_ptype2.integer.omit(list(), "fuzz_dot1" = list(as.name("x")), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })){ }<> with { }
ydropvec_ptype2.integer.omit(structure(c(NaN, 1, -2147483647, -2.5, Inf), "dim" = c(5L, 1L)), "fuzz_dot1" = function(...) quote(f(x)))(DBL & ~vec1)<> with { dim: (INT & ~vec1)<> with { } }
source
vec_ptype2.integer.omit <- function(x, y, ...) {
  x
}
R/type-misc.R:98

vec_ptype2.omit.integer typed any: x accepts outside

∀'a. ((x: any, y: 'a, ...: any) -> 'a)<>
timing: 0.010 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: any, y: 'y, ...: any) -> 'y)<>

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype2.omit.integer("y" = c(1000000, NaN))(DBL & ~vec1)<> with { }
xdropvec_ptype2.omit.integer("y" = c("", "NA"), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = new.env())(CHR & ~vec1)<> with { }
xdropvec_ptype2.omit.integer("y" = raw(0), "fuzz_dot1" = NULL)(raw & ~vec1)<> with { }
xdropvec_ptype2.omit.integer("y" = as.name("x"))sym
source
vec_ptype2.omit.integer <- function(x, y, ...) {
  y
}
R/type-misc.R:102

vec_ptype2.double.omit typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.010 s
fuzzing: 20 inside (20 ok) · 8 outside (3 rejected, 5 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain x: 1, y: 4

parameterchangecallreturned
xdropvec_ptype2.double.omit(NULL)null
ydropvec_ptype2.double.omit("x" = -2.5, "fuzz_dot1" = function(...) quote(f(x)), "fuzz_dot2" = list())(^DBL1 \ (..))<> with { }
ydropvec_ptype2.double.omit("x" = c("", "NA"), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = quote(f(x)))(CHR & ~vec1)<> with { }
ydropvec_ptype2.double.omit(0.5, "fuzz_dot1" = function(...) new.env(), "fuzz_dot2" = list())(^DBL1 \ (..))<> with { }
ydropvec_ptype2.double.omit("x y")"x y"<> with { }
source
vec_ptype2.double.omit <- function(x, y, ...) {
  x
}
R/type-misc.R:106

vec_ptype2.omit.double typed any: x accepts outside

∀'a. ((x: any, y: 'a, ...: any) -> 'a)<>
timing: 0.010 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: any, y: 'y, ...: any) -> 'y)<>

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype2.omit.double("y" = c(2147483647, -Inf))(DBL & ~vec1)<> with { }
xdropvec_ptype2.omit.double("y" = NULL, "fuzz_dot1" = NULL)null
xdropvec_ptype2.omit.double("y" = as.name("x"))sym
xdropvec_ptype2.omit.double("y" = list(function(...) NULL, quote(f(x)))){ lang<> with { } | arrow<> with { } }<> with { }
source
vec_ptype2.omit.double <- function(x, y, ...) {
  y
}
R/type-misc.R:110

vec_cast.omit.omit typed any: to accepts outside

∀'a. ((x: 'a, to: any, ...: any) -> 'a)<>
timing: 0.011 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: 'x, to: any, ...: any) -> 'x)<>

Accepted outside the domain to: 4

parameterchangecallreturned
todropvec_cast.omit.omit(c(TRUE, NA, NA, NA, FALSE), "fuzz_dot1" = as.name("x"))(LGL & ~vec1)<> with { }
todropvec_cast.omit.omit("x" = -2.5, "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = NULL)(^DBL1 \ (..))<> with { }
todropvec_cast.omit.omit("x" = NULL, "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = character(0))null
todropvec_cast.omit.omit("x" = as.name("x"), "fuzz_dot1" = complex(real = 1, imaginary = -2), "fuzz_dot2" = c(2147483647L, -2147483647L))sym
source
vec_cast.omit.omit <- function(x, to, ...) {
  x
}
R/type-misc.R:115

vec_cast.integer.omit untypeabletyped

unbound variable (line 120)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer.omit <- function(x, to, ...) {
  vec_cast(vec_data(x), to, ...)
}
R/type-misc.R:119

vec_cast.omit.integer untypeabletyped

unbound variable (line 124)
unbound: stop_incompatible_cast — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_cast
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.009 s
source
vec_cast.omit.integer <- function(x, to, ..., x_arg = "", to_arg = "") {
  stop_incompatible_cast(x, to, x_arg = x_arg, to_arg = to_arg)
}
R/type-misc.R:123

vec_cast.double.omit untypeabletyped

unbound variable (line 128)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.double.omit <- function(x, to, ...) {
  vec_cast(vec_data(x), to, ...)
}
R/type-misc.R:127

vec_cast.omit.double untypeabletyped

unbound variable (line 132)
unbound: stop_incompatible_cast — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_cast
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.009 s
source
vec_cast.omit.double <- function(x, to, ..., x_arg = "", to_arg = "") {
  stop_incompatible_cast(x, to, x_arg = x_arg, to_arg = to_arg)
}
R/type-misc.R:131

vec_proxy.exclude typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.006 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
vec_proxy.exclude <- function(x, ...) {
  x
}
R/type-misc.R:139

vec_restore.exclude typed any: x fuzz ok

∀'a,'b. (((x: any, ...: any) -> any)&((x: v('b), ...: any) -> v('b))&((x: { 'a }, ...: any) -> { 'a }))<>
timing: 0.055 s
fuzzing: 20 inside (18 ok, 2 error type) · 8 outside (8 rejected)
type drawn from: (((x: any, ...: any) -> any) & ((x: v('I123217), ...: any) -> v('I123217)) & ((x: { 'I123216 }, ...: any) -> { 'I123216 }))<>

Other calls inside the domain

callverdicterror
vec_restore.exclude(as.name("x"), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = as.raw(c(255)))error_typebase::<-: cannot set an attribute on a 'symbol'
vec_restore.exclude(NULL, NULL, as.name("x"))error_type::structure: attempt to set an attribute on NULL
source
vec_restore.exclude <- function(x, ...) {
  structure(x, class = "exclude")
}
R/type-misc.R:143

vec_ptype2.exclude.exclude typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.014 s
fuzzing: 20 inside (20 ok) · 8 outside (5 rejected, 3 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain x: 2, y: 1

parameterchangecallreturned
xdropvec_ptype2.exclude.exclude(quote(f(x)))lang<> with { }
xdropvec_ptype2.exclude.exclude(new.env(), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))env<> with { }
ydropvec_ptype2.exclude.exclude(-2.5, "fuzz_dot1" = as.raw(c(255, 255)))(^DBL1 \ (..))<> with { }
source
vec_ptype2.exclude.exclude <- function(x, y, ...) {
  x
}
R/type-misc.R:148

vec_ptype2.integer.exclude typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.013 s
fuzzing: 20 inside (20 ok) · 8 outside (5 rejected, 3 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain y: 3

parameterchangecallreturned
ydropvec_ptype2.integer.exclude(NA, "fuzz_dot1" = function(...) as.name("x"), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))(LGL1 \ ^LGL1)<> with { }
ydropvec_ptype2.integer.exclude("x" = 2147483647L)2147483647L<> with { }
ydropvec_ptype2.integer.exclude(-1, "fuzz_dot1" = new.env(), "fuzz_dot2" = quote(f(x)))-1.<> with { }
source
vec_ptype2.integer.exclude <- function(x, y, ...) {
  x
}
R/type-misc.R:152

vec_ptype2.exclude.integer typed any: x accepts outside

∀'a. ((x: any, y: 'a, ...: any) -> 'a)<>
timing: 0.010 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: any, y: 'y, ...: any) -> 'y)<>

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype2.exclude.integer("y" = -2147483647L)-2147483647L<> with { }
xdropvec_ptype2.exclude.integer("y" = c("", "x y", "é", "a", NA_character_), "fuzz_dot1" = quote(f(x)))(CHR & ~vec1)<> with { }
xdropvec_ptype2.exclude.integer("y" = as.raw(c(0, 255, 0, 255, 0)), "fuzz_dot1" = as.raw(c(0, 0, 255, 255, 255)), "fuzz_dot2" = NULL)(raw & ~vec1)<> with { }
xdropvec_ptype2.exclude.integer("y" = NULL, "fuzz_dot1" = function(...) as.name("x"))null
source
vec_ptype2.exclude.integer <- function(x, y, ...) {
  y
}
R/type-misc.R:156

vec_ptype2.double.exclude typed any: y accepts outside

∀'a. ((x: 'a, y: any, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (3 rejected, 5 accepted)
type drawn from: ((x: 'x, y: any, ...: any) -> 'x)<>

Accepted outside the domain y: 5

parameterchangecallreturned
ydropvec_ptype2.double.exclude(1000000L, "fuzz_dot1" = as.name("x"))1000000L<> with { }
ydropvec_ptype2.double.exclude("x" = NA_character_, "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))na_string<> with { }
ydropvec_ptype2.double.exclude(2147483647)2147483647.<> with { }
ydropvec_ptype2.double.exclude(NULL, "fuzz_dot1" = list(quote(f(x))))null
ydropvec_ptype2.double.exclude("x" = as.name("x"), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = function(...) new.env())sym
source
vec_ptype2.double.exclude <- function(x, y, ...) {
  x
}
R/type-misc.R:160

vec_ptype2.exclude.double typed any: x accepts outside

∀'a. ((x: any, y: 'a, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: any, y: 'y, ...: any) -> 'y)<>

Accepted outside the domain x: 4

parameterchangecallreturned
xdropvec_ptype2.exclude.double("y" = c(2147483647L, -2147483647L, 2L, -2147483647L, 1000000L))(INT & ~vec1)<> with { }
xdropvec_ptype2.exclude.double("y" = character(0), "fuzz_dot1" = logical(0))(CHR & ~vec1)<> with { }
xdropvec_ptype2.exclude.double("y" = NaN, "fuzz_dot1" = new.env())(^DBL1 \ (..))<> with { }
xdropvec_ptype2.exclude.double("y" = "NA", "fuzz_dot1" = function(...) function(...) list(), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"NA"<> with { }
source
vec_ptype2.exclude.double <- function(x, y, ...) {
  y
}
R/type-misc.R:164

vec_cast.exclude.exclude typed any: to accepts outside

∀'a. ((x: 'a, to: any, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: ((x: 'x, to: any, ...: any) -> 'x)<>

Accepted outside the domain to: 3, x: 1

parameterchangecallreturned
todropvec_cast.exclude.exclude(1)1.<> with { }
todropvec_cast.exclude.exclude("x" = -Inf)(^DBL1 \ (..))<> with { }
todropvec_cast.exclude.exclude("x" = NULL, "fuzz_dot1" = logical(0))null
xdropvec_cast.exclude.exclude(NULL, "fuzz_dot1" = new.env())null
source
vec_cast.exclude.exclude <- function(x, to, ...) {
  x
}
R/type-misc.R:169

vec_cast.integer.exclude untypeabletyped

unbound variable (line 174)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.integer.exclude <- function(x, to, ...) {
  vec_cast(vec_data(x), to, ...)
}
R/type-misc.R:173

vec_cast.exclude.integer untypeabletyped

unbound variable (line 178)
unbound: stop_incompatible_cast — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_cast
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.009 s
source
vec_cast.exclude.integer <- function(x, to, ..., x_arg = "", to_arg = "") {
  stop_incompatible_cast(x, to, x_arg = x_arg, to_arg = to_arg)
}
R/type-misc.R:177

vec_cast.double.exclude untypeabletyped

unbound variable (line 182)
unbound: vec_data — one of the package’s own names, itself untyped
error detail
name: vec_data
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_cast.double.exclude <- function(x, to, ...) {
  vec_cast(vec_data(x), to, ...)
}
R/type-misc.R:181

vec_cast.exclude.double untypeabletyped

unbound variable (line 186)
unbound: stop_incompatible_cast — one of the package’s own names, itself untyped
error detail
name: stop_incompatible_cast
gradual mode: typed
((x: any, to: any, ...: any, x_arg: any?, to_arg: any?) -> any)<>
timing: 0.009 s
source
vec_cast.exclude.double <- function(x, to, ..., x_arg = "", to_arg = "") {
  stop_incompatible_cast(x, to, x_arg = x_arg, to_arg = to_arg)
}
R/type-misc.R:185
R/type-sclr.R

new_sclr untypeabletyped

unbound variable (line 3)
unbound: has_unique_names — one of the package’s own names, itself untyped
error detail
name: has_unique_names
gradual mode: typed
∀'a. ((...: 'a, class: (vec | null)?) -> { 'a })<>
timing: 0.011 s
source
new_sclr <- function(..., class = character()) {
  fields <- list(...)
  stopifnot(has_unique_names(fields))

  structure(
    list(...),
    class = c(class, "vctrs_sclr")
  )
}
R/type-sclr.R:1

[[.vctrs_sclr typed fuzz ok

∀'a. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty)&((x: { 'a }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'a))<>
timing: 0.054 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty) & ((x: { 'I123321 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'I123321))<>
source
`[[.vctrs_sclr` <- function(x, i, ...) {
  .Call(vctrs_list_get, x, i)
}
R/type-sclr.R:14

$.vctrs_sclr typed accepts outside

∀'a. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty)&((x: { 'a }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'a))<>
timing: 0.054 s
fuzzing: 20 inside (20 ok) · 8 outside (7 rejected, 1 accepted)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, ...: any) -> empty) & ((x: { 'I123331 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, ...: any) -> 'I123331))<>

Accepted outside the domain i: 1

parameterchangecallreturned
ikind:dbl$.vctrs_sclr(list(complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0)), 1.5, NULL)^CLX1<> with { }
source
`$.vctrs_sclr` <- function(x, i, ...) {
  .Call(vctrs_list_get, x, i)
}
R/type-sclr.R:19

[[<-.vctrs_sclr typed fuzz ok

∀'a,'b. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'a & any_sexp) -> empty)&((x: expr, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & (lang | sym)) -> expr)&((x: { 'b }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & any_sexp) -> { 'b | 'a }))<>
timing: 0.180 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'value & any_sexp) -> empty) & ((x: expr, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & (lang | sym)) -> expr) & ((x: { 'I123345 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & any_sexp) -> { 'I123345 | 'value }))<>
source
`[[<-.vctrs_sclr` <- function(x, i, value) {
  .Call(vctrs_list_set, x, i, value)
}
R/type-sclr.R:24

$<-.vctrs_sclr typed fuzz ok

∀'a,'b. (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'a & any_sexp) -> empty)&((x: expr, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & (lang | sym)) -> expr)&((x: { 'b }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'a & any_sexp) -> { 'b | 'a }))<>
timing: 0.185 s
fuzzing: 20 inside (18 ok, 2 error type) · 8 outside (8 rejected)
type drawn from: (((x: any_sexp, i: (~(CHR | DBL | INT))<...> | sym | null, value: 'value & any_sexp) -> empty) & ((x: expr, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & (lang | sym)) -> expr) & ((x: { 'I123359 }, i: (~((CHR | DBL | INT) & ~^INT1))<...> | sym | null, value: 'value & any_sexp) -> { 'I123359 | 'value }))<>

Other calls inside the domain

callverdicterror
$<-.vctrs_sclr(list(), 1L, "value" = quote(f(x)))error_typeInvalid index: out of bounds
$<-.vctrs_sclr("x" = list(as.name("x"), as.name("x")), "i" = 0L, "value" = as.name("x"))error_typeInvalid index: out of bounds
source
`$<-.vctrs_sclr` <- function(x, i, value) {
  .Call(vctrs_list_set, x, i, value)
}
R/type-sclr.R:29

print.vctrs_sclr untypeabletyped

unbound variable (line 37)
unbound: obj_print — one of the package’s own names, itself untyped
error detail
name: obj_print
gradual mode: typed
∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.003 s
source
print.vctrs_sclr <- function(x, ...) {
  obj_print(x, ...)
  invisible(x)
}
R/type-sclr.R:36

as.list.vctrs_sclr untypeabletyped

unbound variable (line 43)
unbound: vec_set_attributes — one of the package’s own names, itself untyped
error detail
name: vec_set_attributes
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.008 s
source
as.list.vctrs_sclr <- function(x, ...) {
  vec_set_attributes(x, list(names = names(x)))
}
R/type-sclr.R:42

as.data.frame.vctrs_sclr untypeable

unbound variable (line 52)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
timing: 0.021 s
source
as.data.frame.vctrs_sclr <- function(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  nm = paste(deparse(substitute(x), width.cutoff = 500L), collapse = " ")
) {
  force(nm)
  cols <- list(list(x))
  if (!optional) {
    names(cols) <- nm
  }

  new_data_frame(cols, n = 1L)
}
R/type-sclr.R:47

[.vctrs_sclr untypeabletyped

unbound variable (line 67)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
`[.vctrs_sclr` <- function(x, ...) {
  stop_unsupported(x, "[")
}
R/type-sclr.R:66

[<-.vctrs_sclr untypeabletyped

unbound variable (line 72)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any, value: any) -> any)<>
timing: 0.003 s
source
`[<-.vctrs_sclr` <- function(x, ..., value) {
  stop_unsupported(x, "[<-")
}
R/type-sclr.R:71

c.vctrs_sclr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
c.vctrs_sclr <- function(...) {
  stop_unsupported(..1, "c")
}
R/type-sclr.R:76

Math.vctrs_sclr untypeabletyped

unbound variable (line 82)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
Math.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, .Generic)
}
R/type-sclr.R:81

Ops.vctrs_sclr untypeabletyped

unbound variable (line 87)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
gradual mode: typed
((e1: any, e2: any) -> any)<>
timing: 0.002 s
source
Ops.vctrs_sclr <- function(e1, e2) {
  stop_unsupported(e1, .Generic)
}
R/type-sclr.R:86

Complex.vctrs_sclr untypeabletyped

unbound variable (line 92)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
gradual mode: typed
((z: any) -> any)<>
timing: 0.001 s
source
Complex.vctrs_sclr <- function(z) {
  stop_unsupported(z, .Generic)
}
R/type-sclr.R:91

Summary.vctrs_sclr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
Summary.vctrs_sclr <- function(..., na.rm = TRUE) {
  stop_unsupported(..1, .Generic)
}
R/type-sclr.R:96

names<-.vctrs_sclr untypeabletyped

unbound variable (line 102)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`names<-.vctrs_sclr` <- function(x, value) {
  stop_unsupported(x, "names<-")
}
R/type-sclr.R:101

xtfrm.vctrs_sclr untypeabletyped

unbound variable (line 107)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
xtfrm.vctrs_sclr <- function(x) {
  stop_unsupported(x, "xtfrm")
}
R/type-sclr.R:106

dim<-.vctrs_sclr untypeabletyped

unbound variable (line 112)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`dim<-.vctrs_sclr` <- function(x, value) {
  stop_unsupported(x, "dim<-")
}
R/type-sclr.R:111

dimnames<-.vctrs_sclr untypeabletyped

unbound variable (line 117)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`dimnames<-.vctrs_sclr` <- function(x, value) {
  stop_unsupported(x, "dimnames<-")
}
R/type-sclr.R:116

levels.vctrs_sclr untypeabletyped

unbound variable (line 122)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
levels.vctrs_sclr <- function(x) {
  stop_unsupported(x, "levels")
}
R/type-sclr.R:121

levels<-.vctrs_sclr untypeabletyped

unbound variable (line 127)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`levels<-.vctrs_sclr` <- function(x, value) {
  stop_unsupported(x, "levels<-")
}
R/type-sclr.R:126

t.vctrs_sclr untypeabletyped

unbound variable (line 132)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
`t.vctrs_sclr` <- function(x) {
  stop_unsupported(x, "t")
}
R/type-sclr.R:131

is.na<-.vctrs_sclr untypeabletyped

unbound variable (line 137)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
`is.na<-.vctrs_sclr` <- function(x, value) {
  stop_unsupported(x, "is.na<-")
}
R/type-sclr.R:136

unique.vctrs_sclr untypeabletyped

unbound variable (line 142)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.005 s
source
unique.vctrs_sclr <- function(x, incomparables = FALSE, ...) {
  stop_unsupported(x, "unique")
}
R/type-sclr.R:141

duplicated.vctrs_sclr untypeabletyped

unbound variable (line 147)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.005 s
source
duplicated.vctrs_sclr <- function(x, incomparables = FALSE, ...) {
  stop_unsupported(x, "unique")
}
R/type-sclr.R:146

anyDuplicated.vctrs_sclr untypeabletyped

unbound variable (line 152)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.005 s
source
anyDuplicated.vctrs_sclr <- function(x, incomparables = FALSE, ...) {
  stop_unsupported(x, "unique")
}
R/type-sclr.R:151

as.logical.vctrs_sclr untypeabletyped

unbound variable (line 157)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as.logical.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, "as.logical")
}
R/type-sclr.R:156

as.integer.vctrs_sclr untypeabletyped

unbound variable (line 162)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as.integer.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, "as.integer")
}
R/type-sclr.R:161

as.double.vctrs_sclr untypeabletyped

unbound variable (line 167)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as.double.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, "as.double")
}
R/type-sclr.R:166

as.character.vctrs_sclr untypeabletyped

unbound variable (line 172)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
as.character.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, "as.character")
}
R/type-sclr.R:171

as.Date.vctrs_sclr untypeabletyped

unbound variable (line 177)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.002 s
source
as.Date.vctrs_sclr <- function(x, ...) {
  stop_unsupported(x, "as.Date")
}
R/type-sclr.R:176

as.POSIXct.vctrs_sclr untypeabletyped

unbound variable (line 182)
unbound: stop_unsupported — one of the package’s own names, itself untyped
error detail
name: stop_unsupported
gradual mode: typed
((x: any, tz: any?, ...: any) -> any)<>
timing: 0.005 s
source
as.POSIXct.vctrs_sclr <- function(x, tz = "", ...) {
  stop_unsupported(x, "as.POSIXct")
}
R/type-sclr.R:181

summary.vctrs_sclr untypeabletyped

unbound variable (line 191)
unbound: stop_unimplemented — one of the package’s own names, itself untyped
error detail
name: stop_unimplemented
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.002 s
source
summary.vctrs_sclr <- function(object, ...) {
  # nocov start
  stop_unimplemented(object, "summary")
  # nocov end
}
R/type-sclr.R:189
R/type-sf.R

stop_sf untypeabletyped

unbound variable (line 5)
unbound: abort — a name the prelude does not declare
error detail
name: abort
gradual mode: typed
(() -> any)<>
timing: 0.001 s
source
stop_sf = function() abort("Internal error: Failed sf import.")
R/type-sf.R:5

st_crs untypeabletyped

unbound variable (line 2)
unbound: stop_sf — one of the package’s own names, itself untyped
error detail
name: stop_sf
gradual mode: typed
((...: any) -> any)<>
timing: 0.001 s
source
st_crs = function(...) stop_sf()
R/type-sf.R:2

st_precision untypeabletyped

unbound variable (line 3)
unbound: stop_sf — one of the package’s own names, itself untyped
error detail
name: stop_sf
gradual mode: typed
((...: any) -> any)<>
timing: 0.001 s
source
st_precision = function(...) stop_sf()
R/type-sf.R:3

st_as_sf untypeabletyped

unbound variable (line 4)
unbound: stop_sf — one of the package’s own names, itself untyped
error detail
name: stop_sf
gradual mode: typed
((...: any) -> any)<>
timing: 0.001 s
source
st_as_sf = function(...) stop_sf()
R/type-sf.R:4

sf_deps typed

CHR<>
timing: 0.012 s
source
sf_deps = c(
  "st_crs",
  "st_precision",
  "st_as_sf"
)
R/type-sf.R:7

sf_env untypeabletyped

unbound variable (line 12)
unbound: env — a name the prelude does not declare
error detail
name: env
gradual mode: typed
any
timing: 0.001 s
source
sf_env = env()
R/type-sf.R:12

<statement> skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
local(envir = sf_env, {
  # Registered at load-time (same for all other methods)
  vec_proxy_sf = function(x, ...) {
    x
  }

  vec_restore_sf = function(x, to, ...) {
    sfc_name = attr(to, "sf_column")
    crs = st_crs(to)
    prec = st_precision(to)

    st_as_sf(
      x,
      sf_column_name = sfc_name,
      crs = crs,
      precision = prec,
      stringsAsFactors = FALSE
    )
  }

  sf_ptype2 = function(x, y, ...) {
    data = vctrs::df_ptype2(x, y, ...)

    # Workaround for `c()` fallback sentinels. Must be fixed before
    # moving the methods downstream.
    opts <- match_fallback_opts(...)
    if (identical(opts$s3_fallback, S3_FALLBACK_true)) {
      return(data)
    }

    x_sf <- inherits(x, "sf")
    y_sf <- inherits(y, "sf")

    if (x_sf && y_sf) {
      # Take active geometry from left-hand side
      sfc_name = attr(x, "sf_column")

      # CRS and precision must match
      crs = common_crs(x, y)
      prec = common_prec(x, y)
    } else if (x_sf) {
      sfc_name = attr(x, "sf_column")
      crs = st_crs(x)
      prec = st_precision(x)
    } else if (y_sf) {
      sfc_name = attr(y, "sf_column")
      crs = st_crs(y)
      prec = st_precision(y)
    } else {
      stop("Internal error: Expected at least one `sf` input.")
    }

    st_as_sf(
      data,
      sf_column_name = sfc_name,
      crs = crs,
      precision = prec,
      stringsAsFactors = FALSE
    )
  }

  vec_ptype2_sf_sf = function(x, y, ...) {
    sf_ptype2(x, y, ...)
  }
  vec_ptype2_sf_data.frame = function(x, y, ...) {
    sf_ptype2(x, y, ...)
  }
  vec_ptype2_data.frame_sf = function(x, y, ...) {
    sf_ptype2(x, y, ...)
  }

  # Maybe we should not have these methods, but they are currently
  # required to avoid the base-df fallback
  vec_ptype2_sf_tbl_df = function(x, y, ...) {
    new_data_frame(sf_ptype2(x, y, ...))
  }
  vec_ptype2_tbl_df_sf = function(x, y, ...) {
    new_data_frame(sf_ptype2(x, y, ...))
  }

  sf_cast = function(x, to, ...) {
    data = vctrs::df_cast(x, to, ...)

    # Workaround for `c()` fallback sentinels. Must be fixed before
    # moving the methods downstream.
    opts <- match_fallback_opts(...)
    if (identical(opts$s3_fallback, S3_FALLBACK_true)) {
      return(data)
    }

    sfc_name = attr(to, "sf_column")
    crs = st_crs(to)
    prec = st_precision(to)

    st_as_sf(
      data,
      sf_column_name = sfc_name,
      crs = crs,
      precision = prec,
      stringsAsFactors = FALSE
    )
  }

  vec_cast_sf_sf = function(x, to, ...) {
    sf_cast(x, to, ...)
  }
  vec_cast_sf_data.frame = function(x, to, ...) {
    sf_cast(x, to, ...)
  }
  vec_cast_data.frame_sf = function(x, to, ...) {
    df_cast(x, to, ...)
  }

  vec_proxy_order_sfc <- function(x, ...) {
    # These are list columns, so they need to use the order-by-appearance proxy
    # that is defined by `vec_proxy_order.list()`
    x <- unstructure(x)
    vec_proxy_order(x)
  }

  # take conservative approach of requiring equal CRS and precision
  common_crs = function(x, y) {
    lhs = st_crs(x)
    rhs = st_crs(y)

    if (lhs != rhs) {
      stop("coordinate reference systems not equal: use st_transform() first?")
    }

    lhs
  }
  common_prec = function(x, y) {
    lhs = st_precision(x)
    rhs = st_precision(y)

    if (lhs != rhs) {
      stop("precisions not equal")
    }

    lhs
  }
}) # local(envir = sf_env)
R/type-sf.R:16

<statement> untypeable

unbound variable (line 159)
unbound: ns_env — a name the prelude does not declare
error detail
name: ns_env
timing: 0.006 s
source
env_bind(ns_env("vctrs"), !!!as.list(sf_env))
R/type-sf.R:159
R/type-table.R

<statement> typed

timing: 0.000 s
source
NULL
R/type-table.R:8

new_table untypeabletyped

unbound variable (line 45)
unbound: is_null — a name the prelude does not declare
error detail
name: is_null
gradual mode: typed
∀'a. (((x: (INT | v('a))?, dim: any?, dimnames: any?) -> INT | v('a))&((x: any?, dim: any?, dimnames: any?) -> any))<>
timing: 0.023 s
source
new_table <- function(x = integer(), dim = NULL, dimnames = NULL) {
  if (is_null(dim)) {
    dim <- length(x)
  } else if (!is.integer(dim)) {
    abort("`dim` must be an integer vector.")
  }

  n_elements <- prod(dim)
  n_x <- length(x)

  if (n_elements != n_x) {
    abort(glue::glue(
      "Length implied by `dim`, {n_elements}, must match the length of `x`, {n_x}."
    ))
  }

  structure(x, dim = dim, dimnames = dimnames, class = "table")
}
R/type-table.R:44

vec_restore.table untypeabletyped

unbound variable (line 12)
unbound: dimnames — a name the prelude does not declare
error detail
name: dimnames
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.026 s
source
vec_restore.table <- function(x, to, ...) {
  new_table(x, dim = dim(x), dimnames = dimnames(x))
}
R/type-table.R:11

vec_ptype_full.table untypeabletyped

unbound variable (line 19)
unbound: vec_ptype_shape — one of the package’s own names, itself untyped
error detail
name: vec_ptype_shape
gradual mode: typed
((x: any, ...: any) -> CHR1<>)<>
timing: 0.004 s
source
vec_ptype_full.table <- function(x, ...) {
  paste0("table", vec_ptype_shape(x))
}
R/type-table.R:18

vec_ptype_abbr.table typed any: x accepts outside

((x: any, ...: any) -> "table"<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 3 outside (3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xdropvec_ptype_abbr.table("fuzz_dot1" = function(...) as.name("x"))"table"<> with { }
xdropvec_ptype_abbr.table()"table"<> with { }
xdropvec_ptype_abbr.table("fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"table"<> with { }
source
vec_ptype_abbr.table <- function(x, ...) {
  "table"
}
R/type-table.R:23

vec_ptype2.table.table untypeabletyped

unbound variable (line 31)
unbound: unstructure — one of the package’s own names, itself untyped
error detail
name: unstructure
gradual mode: typed
((x: any, y: any, ...: any, x_arg: any?, y_arg: any?) -> any)<>
timing: 0.009 s
source
vec_ptype2.table.table <- function(x, y, ..., x_arg = "", y_arg = "") {
  ptype <- vec_ptype2(unstructure(x), unstructure(y))
  vec_shaped_ptype(new_table(ptype), x, y, x_arg = x_arg, y_arg = y_arg)
}
R/type-table.R:30

vec_cast.table.table untypeabletyped

unbound variable (line 37)
unbound: unstructure — one of the package’s own names, itself untyped
error detail
name: unstructure
gradual mode: typed
((x: any, to: any, ...: any) -> any)<>
timing: 0.006 s
source
vec_cast.table.table <- function(x, to, ...) {
  out <- vec_cast(unstructure(x), unstructure(to))
  out <- new_table(out, dim = dim(x), dimnames = dimnames(x))
  shape_broadcast(out, to, ...)
}
R/type-table.R:36

is_bare_table typed any: x fuzz ok

((x: any) -> LGL1<>)<>
timing: 0.008 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
is_bare_table <- function(x) {
  identical(class(x), "table")
}
R/type-table.R:63
R/vctrs-deprecated.R

vec_empty untypeabletyped

unbound variable (line 15)
unbound: lifecycle::deprecate_stop — a name the prelude does not declare
error detail
name: lifecycle::deprecate_stop
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
vec_empty <- function(x) {
  # Defunct: 2019-06
  lifecycle::deprecate_stop(
    when = "0.2.0",
    what = "vec_empty()",
    with = "vec_is_empty()"
  )
}
R/vctrs-deprecated.R:13

vec_type untypeabletyped

unbound variable (line 40)
unbound: lifecycle::deprecate_warn — a name the prelude does not declare
error detail
name: lifecycle::deprecate_warn
gradual mode: typed
((x: any_sexp) -> any_sexp)<>
timing: 0.002 s
source
vec_type <- function(x) {
  # Deprecated: 2019-06
  lifecycle::deprecate_warn(
    when = "0.2.0",
    what = "vec_type()",
    with = "vec_ptype()",
    always = TRUE
  )
  vec_ptype(x)
}
R/vctrs-deprecated.R:38

vec_type_common skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_type_common <- function(..., .ptype = NULL) {
  # Deprecated: 2019-06
  lifecycle::deprecate_warn(
    when = "0.2.0",
    what = "vec_type_common()",
    with = "vec_ptype_common()",
    always = TRUE
  )
  vec_ptype_common(..., .ptype = .ptype)
}
R/vctrs-deprecated.R:50

vec_type2 untypeabletyped

unbound variable (line 64)
unbound: lifecycle::deprecate_warn — a name the prelude does not declare
error detail
name: lifecycle::deprecate_warn
gradual mode: typed
((x: any, y: any, ...: any) -> any)<>
timing: 0.004 s
source
vec_type2 <- function(x, y, ...) {
  # Deprecated: 2019-06
  lifecycle::deprecate_warn(
    when = "0.2.0",
    what = "vec_type2()",
    with = "vec_ptype2()",
    always = TRUE
  )
  vec_ptype2(x, y, ...)
}
R/vctrs-deprecated.R:62

vec_as_index untypeabletyped

unbound variable (line 88)
unbound: lifecycle::deprecate_soft — a name the prelude does not declare
error detail
name: lifecycle::deprecate_soft
gradual mode: typed
((i: any, n: any, names: any?) -> any)<>
timing: 0.008 s
source
vec_as_index <- function(i, n, names = NULL) {
  # Soft-deprecated: 2020-01
  lifecycle::deprecate_soft(
    when = "0.2.2",
    what = "vec_as_index()",
    with = "vec_as_location()"
  )
  n <- vec_cast(n, integer())
  vec_check_size(n, size = 1L)
  i <- vec_as_subscript(i)

  # Picked up from the environment at the C level
  arg <- NULL

  .Call(
    ffi_as_location,
    i = i,
    n = n,
    names = names,
    loc_negative = "invert",
    loc_oob = "error",
    loc_zero = "remove",
    missing = "propagate",
    env = environment()
  )
}
R/vctrs-deprecated.R:86

vec_repeat untypeabletyped

unbound variable (line 132)
unbound: I — a name the prelude does not declare
error detail
name: I
gradual mode: typed
((x: any, each: any?, times: any?) -> any)<>
timing: 0.009 s
source
vec_repeat <- function(x, each = 1L, times = 1L) {
  # Soft-deprecated: 2020-03
  lifecycle::deprecate_soft(
    when = "0.3.0",
    what = "vec_repeat()",
    with = I("either `vec_rep()` or `vec_rep_each()`")
  )

  vec_check_size(each, size = 1L)
  vec_check_size(times, size = 1L)

  idx <- rep(vec_seq_along(x), times = times, each = each)
  vec_slice(x, idx)
}
R/vctrs-deprecated.R:127

vec_unchop untypeabletyped

unbound variable (line 163)
unbound: lifecycle::deprecate_soft — a name the prelude does not declare
error detail
name: lifecycle::deprecate_soft
gradual mode: typed
((x: any_sexp, indices: any_sexp?, ptype: any_sexp?, name_spec: any_sexp?, name_repair: (CHR | null)?) -> any_sexp)<>
timing: 0.033 s
source
vec_unchop <- function(
  x,
  indices = NULL,
  ptype = NULL,
  name_spec = NULL,
  name_repair = c("minimal", "unique", "check_unique", "universal")
) {
  # Soft-deprecated: 2022-09
  lifecycle::deprecate_soft("0.5.0", "vec_unchop()", "list_unchop()")

  list_unchop(
    x = x,
    indices = indices,
    ptype = ptype,
    name_spec = name_spec,
    name_repair = name_repair
  )
}
R/vctrs-deprecated.R:155

vec_equal_na untypeabletyped

unbound variable (line 191)
unbound: lifecycle::deprecate_soft — a name the prelude does not declare
error detail
name: lifecycle::deprecate_soft
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
vec_equal_na <- function(x) {
  # Soft-deprecated: 2022-09
  lifecycle::deprecate_soft("0.5.0", "vec_equal_na()", "vec_detect_missing()")
  vec_detect_missing(x)
}
R/vctrs-deprecated.R:189

vec_is_list typed accepts outside

((x: p(CHR) | <> | sym | null) -> ^LGL1)<>
timing: 0.011 s
fuzzing: 6 inside (6 ok) · 7 outside (4 rejected, 3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xclass:addvec_is_list("x" = structure(new.env(), class = "fuzz_cls"))ff<> with { }
xclass:addvec_is_list(structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), class = "fuzz_cls"))ff<> with { }
xclass:addvec_is_list(structure(new.env(), class = "fuzz_cls"))ff<> with { }
source
vec_is_list <- function(x) {
  # Silently-deprecated: 2023-03
  # lifecycle::deprecate_soft("0.6.0", "vec_is_list()", "obj_is_list()")
  obj_is_list(x)
}
R/vctrs-deprecated.R:209

vec_check_list skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
vec_check_list <- function(x, ..., arg = caller_arg(x), call = caller_env()) {
  # Silently-deprecated: 2023-03
  # lifecycle::deprecate_soft("0.6.0", "vec_check_list()", "obj_check_list()")
  obj_check_list(x, ..., arg = arg, call = call)
}
R/vctrs-deprecated.R:217
R/vctrs-package.R

<statement> typed

timing: 0.002 s
source
"_PACKAGE"
R/vctrs-package.R:12

release_extra_revdeps typed fuzz ok

(() -> CHR<>)<>
timing: 0.014 s
fuzzing: 1 inside (1 ok) · 1 outside (1 rejected)
source
release_extra_revdeps <- function() {
  # Extra revdeps to run before release.
  # Recognized by `usethis::use_release_issue()`.
  c("dplyr", "tidyr", "purrr")
}
R/vctrs-package.R:14
R/zzz.R

.onLoad untypeable

unbound variable (line 4)
unbound: check_linked_version — one of the package’s own names, itself untyped
error detail
name: check_linked_version
timing: 0.111 s
source
.onLoad <- function(libname, pkgname) {
  check_linked_version(pkgname)
  ns <- ns_env("vctrs")

  run_on_load()

  s3_register("generics::as.factor", "vctrs_vctr")
  s3_register("generics::as.ordered", "vctrs_vctr")
  s3_register("generics::as.difftime", "vctrs_vctr")

  # Remove once tibble has implemented the methods
  on_package_load("tibble", {
    if (!env_has(ns_env("tibble"), "vec_ptype2.tbl_df.tbl_df")) {
      s3_register(
        "vctrs::vec_ptype2",
        "tbl_df.tbl_df",
        vec_ptype2_tbl_df_tbl_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "tbl_df.data.frame",
        vec_ptype2_tbl_df_data.frame
      )
      s3_register(
        "vctrs::vec_ptype2",
        "data.frame.tbl_df",
        vec_ptype2_data.frame_tbl_df
      )
    }

    if (!env_has(ns_env("tibble"), "vec_cast.tbl_df.tbl_df")) {
      s3_register("vctrs::vec_cast", "tbl_df.tbl_df", vec_cast_tbl_df_tbl_df)
      s3_register(
        "vctrs::vec_cast",
        "tbl_df.data.frame",
        vec_cast_tbl_df_data.frame
      )
      s3_register(
        "vctrs::vec_cast",
        "data.frame.tbl_df",
        vec_cast_data.frame_tbl_df
      )
    }
  })

  on_package_load("dplyr", {
    if (!env_has(ns_env("dplyr"), "vec_restore.grouped_df")) {
      s3_register("vctrs::vec_restore", "grouped_df", vec_restore_grouped_df)
    }

    if (!env_has(ns_env("dplyr"), "vec_ptype2.grouped_df.grouped_df")) {
      s3_register(
        "vctrs::vec_ptype2",
        "grouped_df.grouped_df",
        vec_ptype2_grouped_df_grouped_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "grouped_df.data.frame",
        vec_ptype2_grouped_df_data.frame
      )
      s3_register(
        "vctrs::vec_ptype2",
        "grouped_df.tbl_df",
        vec_ptype2_grouped_df_tbl_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "data.frame.grouped_df",
        vec_ptype2_data.frame_grouped_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "tbl_df.grouped_df",
        vec_ptype2_tbl_df_grouped_df
      )
    }

    if (!env_has(ns_env("dplyr"), "vec_cast.grouped_df.grouped_df")) {
      s3_register(
        "vctrs::vec_cast",
        "grouped_df.grouped_df",
        vec_cast_grouped_df_grouped_df
      )
      s3_register(
        "vctrs::vec_cast",
        "grouped_df.data.frame",
        vec_cast_grouped_df_data.frame
      )
      s3_register(
        "vctrs::vec_cast",
        "grouped_df.tbl_df",
        vec_cast_grouped_df_tbl_df
      )
      s3_register(
        "vctrs::vec_cast",
        "data.frame.grouped_df",
        vec_cast_data.frame_grouped_df
      )
      s3_register(
        "vctrs::vec_cast",
        "tbl_df.grouped_df",
        vec_cast_tbl_df_grouped_df
      )
    }

    if (!env_has(ns_env("dplyr"), "vec_restore.rowwise_df")) {
      s3_register("vctrs::vec_restore", "rowwise_df", vec_restore_rowwise_df)
    }

    if (!env_has(ns_env("dplyr"), "vec_ptype2.rowwise_df.rowwise_df")) {
      s3_register(
        "vctrs::vec_ptype2",
        "rowwise_df.rowwise_df",
        vec_ptype2_rowwise_df_rowwise_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "rowwise_df.data.frame",
        vec_ptype2_rowwise_df_data.frame
      )
      s3_register(
        "vctrs::vec_ptype2",
        "rowwise_df.tbl_df",
        vec_ptype2_rowwise_df_tbl_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "data.frame.rowwise_df",
        vec_ptype2_data.frame_rowwise_df
      )
      s3_register(
        "vctrs::vec_ptype2",
        "tbl_df.rowwise_df",
        vec_ptype2_tbl_df_rowwise_df
      )
    }

    if (!env_has(ns_env("dplyr"), "vec_cast.rowwise_df.rowwise_df")) {
      s3_register(
        "vctrs::vec_cast",
        "rowwise_df.rowwise_df",
        vec_cast_rowwise_df_rowwise_df
      )
      s3_register(
        "vctrs::vec_cast",
        "rowwise_df.data.frame",
        vec_cast_rowwise_df_data.frame
      )
      s3_register(
        "vctrs::vec_cast",
        "rowwise_df.tbl_df",
        vec_cast_rowwise_df_tbl_df
      )
      s3_register(
        "vctrs::vec_cast",
        "data.frame.rowwise_df",
        vec_cast_data.frame_rowwise_df
      )
      s3_register(
        "vctrs::vec_cast",
        "tbl_df.rowwise_df",
        vec_cast_tbl_df_rowwise_df
      )
    }
  })

  on_package_load("sf", {
    import_from("sf", sf_deps, env = sf_env)

    if (!env_has(ns_env("sf"), "vec_restore.sf")) {
      s3_register("vctrs::vec_proxy", "sf", vec_proxy_sf)
      s3_register("vctrs::vec_restore", "sf", vec_restore_sf)
    }
    if (!env_has(ns_env("sf"), "vec_ptype2.sf.sf")) {
      s3_register("vctrs::vec_ptype2", "sf.sf", vec_ptype2_sf_sf)
      s3_register(
        "vctrs::vec_ptype2",
        "sf.data.frame",
        vec_ptype2_sf_data.frame
      )
      s3_register(
        "vctrs::vec_ptype2",
        "data.frame.sf",
        vec_ptype2_data.frame_sf
      )
      s3_register("vctrs::vec_ptype2", "sf.tbl_df", vec_ptype2_sf_tbl_df)
      s3_register("vctrs::vec_ptype2", "tbl_df.sf", vec_ptype2_tbl_df_sf)
      s3_register("vctrs::vec_cast", "sf.sf", vec_cast_sf_sf)
      s3_register("vctrs::vec_cast", "sf.data.frame", vec_cast_sf_data.frame)
      s3_register("vctrs::vec_cast", "data.frame.sf", vec_cast_data.frame_sf)
    }
    if (!env_has(ns_env("sf"), "vec_proxy_order.sfc")) {
      s3_register("vctrs::vec_proxy_order", "sfc", vec_proxy_order_sfc)
    }
  })

  on_package_load("data.table", {
    if (!env_has(ns_env("data.table"), "vec_proxy.IDate")) {
      s3_register("vctrs::vec_proxy", "IDate", vec_proxy_IDate)
      s3_register("vctrs::vec_restore", "IDate", vec_restore_IDate)
R/zzz.R:3