diff options
author | Marek Safar <marek.safar@gmail.com> | 2011-10-04 12:33:40 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2011-10-04 12:34:31 +0400 |
commit | f12b1658129ec997be4dd221578f161c3129005d (patch) | |
tree | 9173f67e85dcee3c075d9fefaac211ea056a0363 /mcs/tests/test-829.cs | |
parent | 729b27e7e6826a3f42507b0dff1d5d630ba3221d (diff) |
Fix recent regression caused by changes to assignment of struct fields
Diffstat (limited to 'mcs/tests/test-829.cs')
-rw-r--r-- | mcs/tests/test-829.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mcs/tests/test-829.cs b/mcs/tests/test-829.cs new file mode 100644 index 00000000000..6a7e2c8a9c5 --- /dev/null +++ b/mcs/tests/test-829.cs @@ -0,0 +1,34 @@ +using System; + +struct S2 +{ + public float f1; +} + +struct S +{ + public S2 s2; + public float F; +} + +class C +{ + static void Test (bool b, out S s) + { + if (b) { + s.s2 = new S2 (); + s.F = 1.0f; + } else { + s.s2.f1 = 2.1f; + s.F = 1.0f; + } + } + + public static int Main () + { + S s; + Test (true, out s); + Test (false, out s); + return 0; + } +} |