diff options
Diffstat (limited to 'mcs/tests/test-async-84.cs')
-rw-r--r-- | mcs/tests/test-async-84.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mcs/tests/test-async-84.cs b/mcs/tests/test-async-84.cs new file mode 100644 index 00000000000..03825613f1f --- /dev/null +++ b/mcs/tests/test-async-84.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading.Tasks; + +struct S +{ + public int value; + public string str; +} + +public class Program +{ + async Task<S> Foo () + { + return new S { + value = 1, + str = await DoAsync () + }; + + } + + static async Task<string> DoAsync () + { + await Task.Yield (); + return "asdafs"; + } + + static int Main () + { + var res = new Program ().Foo ().Result; + if (res.value != 1) + return 1; + + return 0; + } +}
\ No newline at end of file |