You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Annotated7<-R7::new_class("Annotated7",
properties=list(
metadata="list"
)
)
setClassUnion("DataFrame_OR_NULL7", "NULL")
Vector7<-R7::new_class("Vector7",
parent=Annotated7,
properties=list(
elementMetadata="DataFrame_OR_NULL7"
)
)
v<- Vector7()
# Error in do.call(base::`@`, list(object, name)) :# trying to get slot "parent" from an object of a basic class ("character") with no slots
A brief investigation revealed that when the parent constructor (constructor of Annotated7)
is run from the constructor of Vector7, it incorrectly interprets object_class(sys.function(-1))
as "function" (a character string) instead of an R7 class, and tries to access a slot of that string.
(The problem doesn't occur when the constructor of Annotated7 is executed directly.) sys.function(-1) seems to be the culprit.
The text was updated successfully, but these errors were encountered:
library(R7)
Annotated7<- new_class("Annotated7", properties=list(metadata="list"))
union<- setClassUnion("DataFrame_OR_NULL7", "NULL")
Vector7<-R7::new_class("Vector7",
parent=Annotated7,
properties=list(
elementMetadata=union
)
)
Vector7(metadata=list(), elementMetadata=NULL)
#> Error: <Vector7>@elementMetadata must be of class <DataFrame_OR_NULL7>, not NULL
Reproducible example:
A brief investigation revealed that when the parent constructor (constructor of
Annotated7
)is run from the constructor of
Vector7
, it incorrectly interprets object_class(sys.function(-1))as "function" (a character string) instead of an R7 class, and tries to access a slot of that string.
(The problem doesn't occur when the constructor of
Annotated7
is executed directly.)sys.function(-1)
seems to be the culprit.The text was updated successfully, but these errors were encountered: