Spun out from #592.
parent.frame() inside an S7 method currently differs from S3:
library(S7)
foo <- new_generic("foo", "x")
method(foo, class_any) <- function(x) parent.frame()
bar <- function(x) UseMethod("bar")
bar.default <- function(x) parent.frame()
foo(1)
#> <environment: 0x117954580>
bar(1)
#> <environment: R_GlobalEnv>
It would be nice if parent.frame() in an S7 method matched S3 here.
Spun out from #592.
parent.frame()inside an S7 method currently differs from S3:It would be nice if
parent.frame()in an S7 method matched S3 here.