Related to #413
The validator is also not triggered when new_class derives from a base type as showcased in this example e.g.:
list_derived_class <- new_class(
"list_derived_class",
parent = class_list,
validator = function(self) {
if(length(self) > 0)
"raising non-empty test error"
}
)
x <- list_derived_class()
x[["A"]] = 1
x[["B"]] = 2
This is rather counter intuitive behavior when deriving from a class.
One suggestion would be that S7_base_class provided by e.g. class_list would overwrite the base setters installing a hook to trigger the validator.