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
I got into a situation that can be simplified like this :
# in development with devtools
old_ns <- asNamespace("mypkg")
pkgload::load_all()
#> ℹ Loading mypkg
new_ns <- asNamespace("mypkg")
old_ns
#> <environment: namespace:mypkg>
new_ns
#> <environment: namespace:mypkg>
identical(old_ns, new_ns)
#> [1] FALSE
(and then had some code evaluating in the wrong not reloaded namespace)
I first though load_all() could repopulate the namespace rather than creating a new one, but we could for instance have a binding to old_ns$some_env and new_ns might not even have some_env so that won't work.
Maybe we could have a warning (in unload() ?) that the old namespace couldn't be garbage collected, presumably because some objects are still pointing to it, and advise to restart the session if it was not intended ?
The text was updated successfully, but these errors were encountered:
I got into a situation that can be simplified like this :
(and then had some code evaluating in the wrong not reloaded namespace)
I first though
load_all()
could repopulate the namespace rather than creating a new one, but we could for instance have a binding toold_ns$some_env
andnew_ns
might not even havesome_env
so that won't work.Maybe we could have a warning (in
unload()
?) that the old namespace couldn't be garbage collected, presumably because some objects are still pointing to it, and advise to restart the session if it was not intended ?The text was updated successfully, but these errors were encountered: