Cloneable
Cloneable copied to clipboard
Doesn't support inheritance
Would be nice if this could handle something like:
[Clonable]
class A {
string Name { get; set; }
}
class B : A {
...
}
class C : A {
...
}
var c = new C();
c.Clone();
I'd been thinking about it, but I've been busy at university. If you could implement a PR would be welcome. It does require some more thought because when you clone the child object what should happen to properties and fields of the child if it does not have Cloneable attribute?
The other challenge is that when you call clone method what type should be returned? The base class or the child class? Because the child class inherits the clone method of its parent.