Skip to content

Commit

Permalink
Qualify methods calls with namespace (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgirlich authored Sep 20, 2023
1 parent 08da4cd commit 541de58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/remove-s4-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ contains_backrefs <- function(classname, pkgname, contains) {

# Get a named vector of 'contains', where each item's name is the class,
# and the value is the package.
contain_pkgs <- sapply(contains, "slot", "package")
contain_pkgs <- sapply(contains, methods::slot, "package")

mapply(has_subclass_ref, names(contain_pkgs), contain_pkgs, classname, pkgname)
}
4 changes: 2 additions & 2 deletions tests/testthat/test-s4-unload.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local_load_all_quiet()
# Results are sorted so they can be compared easily to a vector.
# A contains B == A is a superclass of B
get_superclasses <- function(class) {
superclasses <- vapply(getClass(class)@contains, slot, "superClass",
superclasses <- vapply(getClass(class)@contains, methods::slot, "superClass",
FUN.VALUE = character(1))

sort(unname(superclasses))
Expand All @@ -14,7 +14,7 @@ get_superclasses <- function(class) {
# Results are sorted so they can be compared easily to a vector.
# A extends B == A is a subclass of B
get_subclasses <- function(class) {
subclasses <- vapply(getClass(class)@subclasses, slot, "subClass",
subclasses <- vapply(getClass(class)@subclasses, methods::slot, "subClass",
FUN.VALUE = character(1))

sort(unname(subclasses))
Expand Down

0 comments on commit 541de58

Please sign in to comment.