diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-12-30 01:38:40 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-01-02 17:05:20 +0300 |
commit | eb3f9147ae855e1bbc7e5fa63ac2a37b41abe5e0 (patch) | |
tree | e3cb97406e4d41967521e110e12edc5b29fcc2f4 /mcs/tests | |
parent | e5246d94ab9907e66e76c1a5baa9240ea3fe52f5 (diff) |
[mcs] readonly struct this can be reassigned within ctor
Diffstat (limited to 'mcs/tests')
-rw-r--r-- | mcs/tests/test-readonly-03.cs | 16 | ||||
-rw-r--r-- | mcs/tests/ver-il-net_4_x.xml | 13 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mcs/tests/test-readonly-03.cs b/mcs/tests/test-readonly-03.cs new file mode 100644 index 00000000000..14cb958b41a --- /dev/null +++ b/mcs/tests/test-readonly-03.cs @@ -0,0 +1,16 @@ +// Compiler options: -langversion:latest +using System; + +readonly struct S +{ + static S shared = new S (); + + public S (int arg) + { + this = shared; + } + + public static void Main () + { + } +}
\ No newline at end of file diff --git a/mcs/tests/ver-il-net_4_x.xml b/mcs/tests/ver-il-net_4_x.xml index 09b8c637e18..741335b568d 100644 --- a/mcs/tests/ver-il-net_4_x.xml +++ b/mcs/tests/ver-il-net_4_x.xml @@ -72975,6 +72975,19 @@ </method> </type> </test> + <test name="test-readonly-03.cs"> + <type name="S"> + <method name="Void Main()" attrs="150"> + <size>2</size> + </method> + <method name="Void .ctor(Int32)" attrs="6278"> + <size>13</size> + </method> + <method name="Void .cctor()" attrs="6289"> + <size>15</size> + </method> + </type> + </test> <test name="test-ref-01.cs"> <type name="X"> <method name="Void Main()" attrs="150"> |