Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / gtest-lambda-08.cs
1
2
3 using System;
4 using System.Linq;
5 using System.Collections.Generic;
6
7 public class C
8 {
9         static void Test<T, R> (Func<T, R> d)
10         {
11         }
12         
13         public static int Main ()
14         {
15                 Test ((int x) => { return x + 1; });
16                 
17                 int[] source = new int[] { 2, 1, 0 };
18                 IEnumerable<int> e = source.Where((i) => i == 0).Select((i) => i + 1);
19
20                 if (e.ToList ()[0] != 1)
21                         return 1;
22
23                 e = source.Where((int i) => i == 0).Select((int i) => i + 1);
24
25                 if (e.ToList ()[0] != 1)
26                         return 2;
27                 
28                 e = source.Where(delegate (int i) { return i == 0; }).Select(delegate (int i) { return i + 1; });
29                 
30                 if (e.ToList ()[0] != 1)
31                         return 3;
32                         
33                 return 0;
34         }
35 }