You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while verifying the evolution vignette scenarios (#143), in the gen-move-package and gen-rename scenarios of tools/evolution/.
When pkgB has a deferred method registration whose generic no longer exists as a direct binding in the recorded package, loading pkgB fails hard:
Error: package or namespace load failed for 'evoB':
.onLoad failed in loadNamespace() for 'evoB', details:
call: get(generic$name, envir = ns, inherits = FALSE)
error: object 'gen' not found
Two problems in resolve_generic_opt():
It errors instead of returning NULL.resolve_generic() is written to warn "[S7] Failed to find generic %s() in package %s" when resolution fails, but resolve_generic_opt() uses get() rather than get0(), so a missing generic throws from inside the load hook and takes down library(pkgB) entirely. An installed pkgB should degrade to a warning when pkgA renames a generic, not become unloadable.
It can't see re-exports.get(..., envir = ns, inherits = FALSE) misses bindings that pkgA re-exports from another package (they live in the imports environment, not the namespace proper). So when pkgA moves a generic to pkgAcore and re-exports it every already-installed downstream package fails to load. Resolving via getExportedValue() (falling back to the namespace itself for own, unexported generics) would make the move seamless for stale installs too.
changed the title [-]resolve_generic_opt() breaks package load for stale downstream installs; can't resolve re-exported generics[/-][+]Can't move generics to another package[/+]on Jul 27, 2026
Activity
[-]resolve_generic_opt() breaks package load for stale downstream installs; can't resolve re-exported generics[/-][+]Can't move generics to another package[/+]Update evolution vignette for #726, #728, #729 fixes
Make deferred generic resolution robust to upstream changes (RConsort…