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>2011-09-05 15:11:41 +0400
committerMarek Safar <marek.safar@gmail.com>2011-09-05 22:02:32 +0400
commitab89771a4892d8c1641da6b68278be3a41dc08f9 (patch)
tree53006c624ab9d85fd2517b24cb0b9177c24d3f3c /mcs/tests/test-anon-154.cs
parent1bb13c6a6852359e9bf296abe878c2548420277a (diff)
Unify anonymous method test names
Diffstat (limited to 'mcs/tests/test-anon-154.cs')
-rw-r--r--mcs/tests/test-anon-154.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/mcs/tests/test-anon-154.cs b/mcs/tests/test-anon-154.cs
new file mode 100644
index 00000000000..55407219850
--- /dev/null
+++ b/mcs/tests/test-anon-154.cs
@@ -0,0 +1,40 @@
+using System;
+
+public class Class
+{
+ string Property { get { return " Property"; } }
+
+ string Method ()
+ {
+ string methodVariable = "method variable";
+
+ Func<string> outerAction = () => {
+ // If methodVariable is not accessed here, the compiler does not crash
+ string unused = methodVariable;
+
+ string innerVariable = "inner variable";
+
+ Func<string, string> middleAction = lambdaParameter => {
+ // If any of the variables referenced are removed, the compiler does not crash.
+ Func<string> innerFunc = () => lambdaParameter + innerVariable + Property;
+ return innerFunc ();
+ };
+
+ return middleAction ("> ");
+ };
+
+ return outerAction ();
+ }
+
+ public static int Main ()
+ {
+ Class c = new Class ();
+ string s = c.Method ();
+ Console.WriteLine (s);
+ if (s != "> inner variable Property")
+ return 1;
+
+ return 0;
+ }
+}
+