2010-05-25 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-named-01.cs
blob49b23efe9c77ae276d5487254df06b46cef01703
1 // Compiler options: -langversion:future
3 using System;
5 static class C
7 public static int Test (this int a, int b = 5, string s = "")
9 return a * 3 + b;
12 static T Foo<T> (T t, int a)
14 return t;
17 static void Lambda (Func<int, int> a)
19 a (6);
22 public static int Main ()
24 if (2.Test () != 11)
25 return 1;
27 if (1.Test (b : 2) != 5)
28 return 2;
30 if (Foo ("n", a : 4) != "n")
31 return 3;
33 if (Foo (t : "x", a : 4) != "x")
34 return 4;
36 Lambda (a : (a) => 1);
38 // Hoisted variable
39 int var = 8;
40 Lambda (a : (a) => var);
42 Console.WriteLine ("ok");
43 return 0;