@@ -68,20 +68,20 @@ r_obj* vec_ptype2_impl(
6868 // When `x` and `y` are `NULL`, keep using `x` name (1)
6969 // When `x` is `NULL` but `y` isn't, switch to `y` name (0)
7070 * left = y_type == VCTRS_TYPE_null ;
71- return vec_ptype2_from_unspecified (y , p_y_arg , x_type , call , s3_fallback );
71+ return vec_ptype_or_s3_fallback (y , p_y_arg , x_type , call , s3_fallback );
7272 }
7373 if (y_type == VCTRS_TYPE_null ) {
7474 // When `x` and `y` are `NULL`, keep using `x` name (1)
7575 // When `y` is `NULL` but `x` isn't, keep using `x` name (1)
7676 * left = 1 ;
77- return vec_ptype2_from_unspecified (x , p_x_arg , x_type , call , s3_fallback );
77+ return vec_ptype_or_s3_fallback (x , p_x_arg , x_type , call , s3_fallback );
7878 }
7979
8080 if (x_type == VCTRS_TYPE_unspecified ) {
81- return vec_ptype2_from_unspecified (y , p_y_arg , y_type , call , s3_fallback );
81+ return vec_ptype_or_s3_fallback (y , p_y_arg , y_type , call , s3_fallback );
8282 }
8383 if (y_type == VCTRS_TYPE_unspecified ) {
84- return vec_ptype2_from_unspecified (x , p_x_arg , x_type , call , s3_fallback );
84+ return vec_ptype_or_s3_fallback (x , p_x_arg , x_type , call , s3_fallback );
8585 }
8686
8787 if (x_type == VCTRS_TYPE_scalar ) {
@@ -225,25 +225,21 @@ r_obj* vec_ptype2_switch_native(
225225}
226226
227227/**
228- * Return non-unspecified type.
228+ * Return `vec_ptype()`, allowing for common class fallback
229229 *
230- * This is normally the `vec_ptype()` of the other input, but if the
231- * common class fallback is enabled we return the `vec_ptype2()` of
232- * this input with itself. This way we may return a fallback sentinel which can be
233- * treated specially, for instance in `vec_c(NA, x, NA)`.
230+ * This is normally the `vec_ptype()` of the input, but if the common class
231+ * fallback is enabled we return the `vec_ptype2()` of this input with itself.
232+ * This way we may return a fallback sentinel which can be treated specially,
233+ * for instance in `vec_c(NA, x, NA)`.
234234 */
235- r_obj * vec_ptype2_from_unspecified (
235+ r_obj * vec_ptype_or_s3_fallback (
236236 r_obj * x ,
237237 struct vctrs_arg * p_x_arg ,
238238 enum vctrs_type x_type ,
239239 struct r_lazy call ,
240240 enum s3_fallback s3_fallback
241241) {
242- if (x_type == VCTRS_TYPE_unspecified || x_type == VCTRS_TYPE_null ) {
243- return vec_ptype (x , p_x_arg , call );
244- }
245-
246- if (s3_fallback ) {
242+ if (s3_fallback == S3_FALLBACK_true && x_type == VCTRS_TYPE_s3 ) {
247243 int _ ;
248244 return vec_ptype2 (
249245 x ,
0 commit comments