Consider the following structure in C#:
public struct TestStruct
{
public int Number { get; set; }
public TestStruct(int num)
{
Number = num;
}
}
I'm very familiar with the compilation error which occurs if one tries to compile this (this and that questions provide an example).
However, I've recently noticed that such structure is compiled perfectly in Visual Studio 2015.
I wasn't able to find any change log for the compiler which would include the aforementioned behaviour. Could anyone provide any guidance as to where to find such information? I've found the mentions of something similar here.
Furthermore, the page about the compiler error CS0188 states:
Auto-implemented properties should be avoided in structs because they have no backing field and therefore cannot be initialized in any way from the constructor.
However, I was not able to observe the inability to initialise the property from the constructor.