pub(crate) fn effective_r_defaults(
param_defaults: &HashMap<String, String>,
per_param: &HashMap<String, ParamAttrs>,
c_ident: &str,
) -> HashMap<String, String>Expand description
Effective R-formal defaults for a method.
Layers defaults in priority order:
#[miniextendr(match_arg)]→ ALWAYS a write-time placeholder that the cdylib resolves toc("a", "b", ...)at package-load time. Any user- supplieddefault = "X"is consumed elsewhere (rotates X to the front of the choice list at write time) rather than overriding the formal.#[miniextendr(choices("a", "b", ...))]→c("a", "b", ...)formal default.- User-provided
#[miniextendr(defaults(param = "..."))]for non-match_arg params.
This formal default is load-bearing for match.arg(), not just cosmetic:
base::match.arg(arg) (no explicit choices=) reads the choice list from
the formal default of the calling function’s arg parameter — a
match_arg/choices param with no formal default makes match.arg()
fail with “argument is missing, with no default” even when the caller
passed a value. Shared by MethodContext::new (inherent impls) and
TraitMethodContext::new (trait impls, miniextendr_impl_trait/method_context.rs).