Hi.
Is there any way for a (mutable) struct to inherit fields from others?
For example, what I’m trying to do is:
mutable struct Parent
foo
bar
end
mutable struct Child <: Parent
end
and use child = Child(); child.foo = 1
(struct field inheritance).
However, an error was raised from the above code: invalid subtyping in definition of Child
.
Is there something I missed?
12 posts - 4 participants