diff options
Diffstat (limited to 'mcs/errors/cs1650-2.cs')
-rw-r--r-- | mcs/errors/cs1650-2.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mcs/errors/cs1650-2.cs b/mcs/errors/cs1650-2.cs new file mode 100644 index 0000000000..9aa902d435 --- /dev/null +++ b/mcs/errors/cs1650-2.cs @@ -0,0 +1,18 @@ +// CS1650: Fields of static readonly field `C.s' cannot be assigned to (except in a static constructor or a variable initializer) +// Line: 15 + +struct S +{ + public int x { get; set; } +} + +class C +{ + static readonly S s; + + public static void Main (string[] args) + { + s.x = 42; + } +} + |