21 lines
255 B
C#
Raw Normal View History

// CS1918: Members of value type `S' cannot be assigned using a property `C.Value' object initializer
// Line: 18
struct S
{
public int X;
}
class C
{
public S Value {
set; get;
}
static void Main ()
{
C c = new C { Value = { X = 2 } };
}
}