Created
March 11, 2016 22:28
-
-
Save nguerrera/2bd18614c14993e7e367 to your computer and use it in GitHub Desktop.
Partial property override
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class X { } | |
class Foo { | |
public virtual X Y { get; set; } | |
public virtual X Z { get; set; } | |
} | |
class Bar : Foo { | |
public override X Y { set { } } | |
public override X Z { get { return null; } } | |
} | |
class P { | |
static void Main() { | |
var b = new Bar(); | |
b.Y = b.Y; | |
b.Z = b.Z; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment