Skip to content

Commit 5574b19

Browse files
committed
fix use of inherits
1 parent 55d9427 commit 5574b19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/entity_class.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ entity = function(
7777
if (!check) {
7878
msg=c(
7979
msg,
80-
paste0('Entity "',object$name,
80+
paste0('"',object$name,
8181
'" is not valid because ',
8282
eval(k$msg,env=list2env(slots(object)))
8383
)
@@ -211,7 +211,7 @@ slots=function(object){
211211

212212
# function to expand inherits to vectors/lists
213213
elements_inherit = function(x, class_name) {
214-
sapply(x, function(el) inherits(el, class_name))
214+
sapply(x, function(el) inherits(el, class_name,which=TRUE))
215215
}
216216

217217
# check that all elements of a vector inherit one of the classes in 'type' INCLUDES LISTS
@@ -221,7 +221,7 @@ vector_type_equals = entity_constraint(
221221

222222
# check that the value is of the correct type
223223
type_equals = entity_constraint(
224-
ex = inherits(value,type) | ('ANY' %in% type),
224+
ex = inherits(value,type,which = TRUE) | ('ANY' %in% type),
225225
msg = paste0('"value" must be ', paste0('"',type,'"',collapse=' or '),'.')
226226
)
227227

0 commit comments

Comments
 (0)