Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support inheritance #5

Open
wihrl opened this issue Feb 4, 2021 · 2 comments
Open

Doesn't support inheritance #5

wihrl opened this issue Feb 4, 2021 · 2 comments

Comments

@wihrl
Copy link

wihrl commented Feb 4, 2021

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();
@mostmand
Copy link
Owner

mostmand commented Feb 4, 2021

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?

@mostmand
Copy link
Owner

mostmand commented Feb 4, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants