Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2009-07-29 17:53:27 +0400
committerMarek Safar <marek.safar@gmail.com>2009-07-29 17:53:27 +0400
commit907bca6614f5f4bc245b75d4edda60e935d2ee3a (patch)
tree3260b6bdc6b39cb97edd5bedee94bec2838d30e8 /mcs/tests/gtest-lambda-08.cs
parente1198af4d6215699be97ff91c026eaf941d57bea (diff)
parenta73150931d8c1d2c5e46f2a2135fcf4026f59009 (diff)
Use correct naming, add 4.0 profile
svn path=/trunk/mcs/; revision=138957
Diffstat (limited to 'mcs/tests/gtest-lambda-08.cs')
-rw-r--r--mcs/tests/gtest-lambda-08.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/mcs/tests/gtest-lambda-08.cs b/mcs/tests/gtest-lambda-08.cs
new file mode 100644
index 00000000000..80b27c3a728
--- /dev/null
+++ b/mcs/tests/gtest-lambda-08.cs
@@ -0,0 +1,35 @@
+
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+
+public class C
+{
+ static void Test<T, R> (Func<T, R> d)
+ {
+ }
+
+ public static int Main ()
+ {
+ Test ((int x) => { return x + 1; });
+
+ int[] source = new int[] { 2, 1, 0 };
+ IEnumerable<int> e = source.Where((i) => i == 0).Select((i) => i + 1);
+
+ if (e.ToList ()[0] != 1)
+ return 1;
+
+ e = source.Where((int i) => i == 0).Select((int i) => i + 1);
+
+ if (e.ToList ()[0] != 1)
+ return 2;
+
+ e = source.Where(delegate (int i) { return i == 0; }).Select(delegate (int i) { return i + 1; });
+
+ if (e.ToList ()[0] != 1)
+ return 3;
+
+ return 0;
+ }
+}