Given a set of child-parent classes, where the child masks a parent property and adds a custom setter such as
parent <- new_class(
"parent",
properties = list(
"x" = class_integer,
"y" = class_character,
"z" = class_any
)
)
child <- new_class(
"child",
parent = parent,
properties = list(
"z" = new_property(
class_double,
setter = function(self, value) {
stop("hey! don't set that!")
self
}
)
)
)
Calling the child constructor does not ever hit the child property setter.
<child>
@ x: int(0)
@ y: chr(0)
@ z: num 1
I would expect that calling child(z = 1) would use the child property setter and throw the error, but it seems that the parent constructor is used then the value is type checked against the child property class without ever using the child setter.