Skip to main content

coerce_tightened

Function coerce_tightened 

Source
fn coerce_tightened(check: RTypeCheck, ty: &Type) -> RTypeCheck
Expand description

Tighten the check for a coerced parameter, given the declared Rust type.

Under coerce (per-param, function-wide, or coerce-default), bool converts from R’s native integer type (CoercionMapping::from_type: booli32, INTSXP-only), so its R gate must be is.integer — keeping the is.logical gate makes the parameter unusable: R rejects the integers Rust accepts, and passes the logicals Rust rejects (same boundary-mismatch class as #616; surfaced by the feature-legs coerce-default run). Rbool/Rboolean have no coercion mapping and keep the logical gate. Everything else defers to RTypeCheck::coerced.