blob: 405da3c3f9269be3b27bb7cb696cd03bfcf0d4c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
using System;
using System.Threading.Tasks;
class C : IDisposable
{
public void Dispose ()
{
Console.WriteLine ("Disposed");
TestClass.Passed++;
}
}
public class TestClass
{
public static int Passed;
public static async Task Test ()
{
using (var device_resource = new C ()) {
try {
Console.WriteLine ("aa");
return;
} finally {
await Task.Delay (0);
}
}
}
public static int Main()
{
Test ().Wait ();
if (Passed != 1)
return 1;
Console.WriteLine ("PASSED");
return 0;
}
}
|