/Less restrictive setter Secret
Created
December 5, 2013 22:05
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
public class Foo | |
{ | |
public object _test; | |
protected object Test | |
{ | |
get | |
{ | |
return _test; | |
} | |
public set //Compile time error. The setter is more accessible than the property itself. | |
{ | |
_test = value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment