Merge pull request #5560 from kumpera/wasm-work-p3
[mono.git] / mcs / tests / gtest-named-01.cs
1 using System;
2
3 static class C
4 {
5         public static int Test (this int a, int b = 5, string s = "")
6         {
7                 return a * 3 + b;
8         }
9         
10         static T Foo<T> (T t, int a)
11         {
12                 return t;
13         }
14         
15         static void Lambda (Func<int, int> a)
16         {
17                 a (6);
18         }
19         
20         public static int Main ()
21         {
22                 if (2.Test () != 11)
23                         return 1;
24                         
25                 if (1.Test (b : 2) != 5)
26                         return 2;
27                 
28                 if (Foo ("n", a : 4) != "n")
29                         return 3;
30                 
31                 if (Foo (t : "x", a : 4) != "x")
32                         return 4;
33                 
34                 Lambda (a : (a) => 1);
35                 
36                 // Hoisted variable
37                 int var = 8;
38                 Lambda (a : (a) => var);
39                 
40                 Console.WriteLine ("ok");
41                 return 0;
42         }
43 }