Switch to compiler-tester
[mono.git] / mcs / tests / gtest-107.cs
1 using System;
2
3 public delegate V Mapper<T,V> (T item);
4
5 public interface ITree<T>
6 {
7         void Map<V> (Mapper<T,V> mapper);
8 }
9
10 public class Tree<T> : ITree<T>
11 {
12         T item;
13
14         public Tree (T item)
15         {
16                 this.item = item;
17         }
18
19         public void Map<V> (Mapper<T,V> mapper)
20         {
21                 V new_item = mapper (item);
22         }
23 }
24
25 class X
26 {
27         private string themap (int i)
28         {
29                 return String.Format ("AA {0,4} BB", i);
30         }
31
32         void Test ()
33         {
34                 Tree<int> tree = new Tree<int> (3);
35                 tree.Map (new Mapper<int,string> (themap));
36         }
37
38         static void Main ()
39         {
40                 X x = new X ();
41                 x.Test ();
42         }
43 }