Skip to content

Commit 67d76ed

Browse files
committed
when non-unique names are passed to decorators, throw a warning from assert_decorators, and let it pass through normalize_decorators
1 parent 80c6991 commit 67d76ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/utils.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ select_decorators <- function(decorators, scope) {
414414
#' @keywords internal
415415
normalize_decorators <- function(decorators) {
416416
if (checkmate::test_list(decorators, "teal_transform_module")) {
417-
decorators_names <- setdiff(names(decorators), "")
417+
decorators_names <- names(decorators)[!names(decorators) %in% ""]
418+
# Above is equivalent to decorators_names <- setdiff(names(decorators), "")
419+
# but can return non-unique values. Non-unique values are checked in assert_decorators.
418420
if (length(decorators_names) == 0) {
419421
list(default = decorators)
420422
} else if (length(decorators_names) == length(decorators)) {

0 commit comments

Comments
 (0)