Merge pull request #487 from mayerwin/patch-1
[mono.git] / mcs / tests / gtest-lambda-13.cs
1 using System;
2
3 class TestUnary
4 {
5         static void Foo (Action<int> a)
6         {
7         }
8
9         static void Bar ()
10         {
11                 Foo (str => ++str);
12         }
13 }
14
15 class Program
16 {
17
18         static void Foo (Action<string> a)
19         {
20                 a ("action");
21         }
22
23         static T Foo<T> (Func<string, T> f)
24         {
25                 return f ("function");
26         }
27         
28     static string Bar ()
29         {
30                 return Foo (str => str.ToLower ());
31         }
32
33         public static void Main ()
34         {
35                 var str = Foo (s => s);
36                 Console.WriteLine (str);
37                 Foo (s => Console.WriteLine (s));
38         }
39 }