r-devel / r-dev-day

Repo to organize tasks for R Dev Days
7 stars 2 forks source link

Bug 18369: enable isGeneric() to work from function definition for functions in base #74

Open hturner opened 3 weeks ago

hturner commented 3 weeks ago

For functions outside of the base package, isGeneric() works when the function is passed to the fdef argument

> methods::isGeneric(fdef = Matrix::cbind2)
[1] TRUE

This doesn't work for functions in base:

> methods::isGeneric(fdef = length)
Error in methods::isGeneric(fdef = length) : 
  argument "f" is missing, with no default

though it will work if you pass the function name instead:

methods::isGeneric(f = "length")
[1] TRUE

Gabe Becker (@gmbecker) raised this in Bug 18639 with the outline of a fix and R Core member Martin Maechler gave some feedback. This issue is to work with Gabe on developing and testing the patch.