[mcs] C#7 type pattern matching
[mono.git] / mcs / tests / test-183.cs
1 //
2 // This test just verifies that we generate the proper signature for
3 // EndInvoke, something that we were not doing before in the presence
4 // of out parameters
5
6 using System;
7
8 class Test
9 {
10         delegate int D (int x, out int y);
11         
12         static int M (int x, out int y)
13         {
14                 y = x + 2;
15                 return ++x;
16         }
17         
18         public static int Main ()
19         {
20                 int x = 1;
21                 int y = 0;
22
23                 D del = new D (M);
24                 IAsyncResult ar = del.BeginInvoke (x, out y, null, null);
25                 if (del.EndInvoke (out y, ar) != 2)
26                         return 1;
27                 if (y != 3)
28                         return 2;
29
30                 Console.WriteLine ("Test ok");
31                 return 0;
32         }
33 }