diff options
author | Marek Safar <marek.safar@gmail.com> | 2013-01-31 15:31:35 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2013-01-31 15:32:06 +0400 |
commit | 7ae364c9c3c974d813f74e09d3d1c482bb0e4a6f (patch) | |
tree | 0ccf9aecd135637281d6288c8603709367db644a /mcs/tests/dtest-058.cs | |
parent | c7b3142f7ae1e03b34a2810681d1c5f3cb6da9d5 (diff) |
Emit field initializers when the ctor has dynamic arguments. Fixes #9683
Diffstat (limited to 'mcs/tests/dtest-058.cs')
-rw-r--r-- | mcs/tests/dtest-058.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mcs/tests/dtest-058.cs b/mcs/tests/dtest-058.cs new file mode 100644 index 00000000000..23dedf09af2 --- /dev/null +++ b/mcs/tests/dtest-058.cs @@ -0,0 +1,30 @@ +using System; + +class Test +{ + int a; + int b; + + Test (int i) + { + a = 10; + } + + static Test Foo (dynamic d) + { + return new Test (d) { + b = 20 + }; + } + + public static int Main () + { + var t = Foo (44); + if (t.a != 10) + return 1; + if (t.b != 20) + return 2; + + return 0; + } +} |