If the calling environment does not have the next method to be invoked
in the inheritance chain cached yet, this will find the next method
(using findNextMethod()
, and cache it in the calling environment such
that a subsequent call to methods::callNextMethod()
will find and use
it.
Details
As per the description, what this function does would normally already
be done by invoking methods::callNextMethod()
, so in theory this should
be entirely redundant at best. However, methods::addNextMethod()
, which
is invoked by callNextMethod()
if a next method isn't cached yet, is
broken (errors out) if one of the classes in the signature name-clashes
with a class defined in another package. Calling this function prior to
callNextMethod()
is meant to work around that.