You've already forked linux-packaging-mono
Imported Upstream version 4.4.0.40
Former-commit-id: 6427cc082e74df30afc535fd906a3494b74b0817
This commit is contained in:
35
mcs/tests/test-async-84.cs
Normal file
35
mcs/tests/test-async-84.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user