Why does this function call `UseMethod` after `return`?

25 Views Asked by At

Here's the body of vctrs::vec_cast:

function (x, to, ..., x_arg = "", to_arg = "") 
{
    if (!missing(...)) {
        check_ptype2_dots_empty(...)
    }
    return(.Call(vctrs_cast, x, to, x_arg, to_arg))
    UseMethod("vec_cast", to)
}
<bytecode: 0x7f8f431528f0>
<environment: namespace:vctrs>

There's a call to UseMethod. But it's after the line which returns from the function. What deep magic is this?

0

There are 0 best solutions below