[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / gtest-107.cs
blobb56bed969b2efe4eb8868ba65d7931df2725ccd5
1 using System;
3 public delegate V Mapper<T,V> (T item);
5 public interface ITree<T>
7 void Map<V> (Mapper<T,V> mapper);
10 public class Tree<T> : ITree<T>
12 T item;
14 public Tree (T item)
16 this.item = item;
19 public void Map<V> (Mapper<T,V> mapper)
21 V new_item = mapper (item);
25 class X
27 private string themap (int i)
29 return String.Format ("AA {0,4} BB", i);
32 void Test ()
34 Tree<int> tree = new Tree<int> (3);
35 tree.Map (new Mapper<int,string> (themap));
38 public static void Main ()
40 X x = new X ();
41 x.Test ();