[asp.net] Optimize memory usage a bit. String hashes are cached in thread-local storage.
[mono.git] / mcs / tests / gtest-named-01.cs
1 // Compiler options: -langversion:future
2
3 using System;
4
5 static class C
6 {
7         public static int Test (this int a, int b = 5, string s = "")
8         {
9                 return a * 3 + b;
10         }
11         
12         static T Foo<T> (T t, int a)
13         {
14                 return t;
15         }
16         
17         static void Lambda (Func<int, int> a)
18         {
19                 a (6);
20         }
21         
22         public static int Main ()
23         {
24                 if (2.Test () != 11)
25                         return 1;
26                         
27                 if (1.Test (b : 2) != 5)
28                         return 2;
29                 
30                 if (Foo ("n", a : 4) != "n")
31                         return 3;
32                 
33                 if (Foo (t : "x", a : 4) != "x")
34                         return 4;
35                 
36                 Lambda (a : (a) => 1);
37                 
38                 // Hoisted variable
39                 int var = 8;
40                 Lambda (a : (a) => var);
41                 
42                 Console.WriteLine ("ok");
43                 return 0;
44         }
45 }