linux-packaging-mono/mcs/tests/test-async-84.cs
Xamarin Public Jenkins a632333cc7 Imported Upstream version 4.4.0.40
Former-commit-id: 6427cc082e74df30afc535fd906a3494b74b0817
2016-03-16 12:38:19 -04:00

35 lines
417 B
C#

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;
}
}