Last active
August 29, 2015 14:23
-
-
Save primaryobjects/a7cfb9217d586a759767 to your computer and use it in GitHub Desktop.
Declaring an enum with a getter and no setter compiles in VS2015, but no in VS2013.
This file contains hidden or 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
| Why does this code compile in Visual Studio 2015, but not in Visual Studio 2013? Hmmm? | |
| ------ | |
| VS2013: | |
| 'EnumTest.Dude.thing.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors. |
This file contains hidden or 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
| namespace EnumTest | |
| { | |
| public enum Thing | |
| { | |
| One, | |
| Two, | |
| Three | |
| }; | |
| public class Dude | |
| { | |
| Thing thing { get; } | |
| } | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment