This is somewhat discussed in #250 (in particular here), but before fully solving that issue it feels like it would be helpful to point out that a class needs to be defined earlier in a script or package if you want to use it as a property in another class. This is particularly confusing in a package context, so perhaps add it to the packages vignette?
# Causes the package to fail to build.
s7_parent <- S7::new_class(
"s7_parent",
package = "newS7fanciness",
properties = list(name = s7_child)
)
#> Error in eval(expr, envir, enclos): object 's7_child' not found
s7_child <- S7::new_class(
"s7_child",
package = "newS7fanciness",
properties = list(x = S7::class_character)
)
This is somewhat discussed in #250 (in particular here), but before fully solving that issue it feels like it would be helpful to point out that a class needs to be defined earlier in a script or package if you want to use it as a property in another class. This is particularly confusing in a package context, so perhaps add it to the packages vignette?
Created on 2023-08-25 with reprex v2.0.2
Created on 2023-08-25 with reprex v2.0.2