Conversation
Rather calling `setOldClass()` during method registeration (which feels too magical) or on class creation (which feels to eager), we now require the user to explicitly call S4_register().
Conflicts: NAMESPACE _pkgdown.yml
Conflicts: R/S4.R
|
@lawremi Does this look like what you expect? Are there other S4 usage scenarios that you think I should test? |
| R7_base = double_to_numeric(x$class), | ||
| R7_S3 = x$class[[1]], | ||
| R7_union = "ANY", | ||
| stop("Unsupported") |
There was a problem hiding this comment.
I guess you could have an R7 property of class_missing, and that would trigger this? That would be somewhat weird though. Everything else seems to be handled
tests/testthat/test-S4.R
Outdated
| foo <- new_class("foo") | ||
| foo2 <- new_class("foo2", foo) | ||
|
|
||
| S4_register(foo) | ||
| S4_register(foo2) |
There was a problem hiding this comment.
Do you get an error if you reverse the order of the S4_register() calls?
Co-authored-by: Davis Vaughan <davis@rstudio.com>
|
What about setting the S4 class prototype using the default values from the R7 properties? I guess we don't support virtual classes in R7 yet, but if we did, we'd obviously want to translate that, as well. |
|
Do you have an example of what |
|
The prototype can be constructed with |
No description provided.