Skip to content
Discussion options

You must be logged in to vote

This would produce unintended behavior as the backing field is regenerated for Child. A get operation would call Child.getProperty() while set would call Parent.setProperty(value) and write to the other backing field:

var c = new Child();
c.Property = true;
Console.WriteLine(c.Property); // "False"

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #1539 on October 15, 2020 13:03.