Since R 3.6, I got an error when calling S3 functions from an attached environment (see below). Am I missing something? Thanks in advance for any tip.
Best, G
env <- namespace::makeNamespace('testspace')
de <- 'doit <- function (x, ...) UseMethod("doit",x)
doit.default <- function(x,...) print(x)
doit.character <- function(x,...) cat(x,"\n")'
eval(parse(text=de),envir=env)
base::namespaceExport(env, ls(env))
attachNamespace('testspace')
methods("doit")
# [1] doit.character doit.default
doit("lala")
# Error in UseMethod("doit", x) :
# no applicable method for 'doit' applied to an object of class "character"