[System.Data] Try to fix random DataViewTest.DefaultColumnNameAddListChangedTest...
[mono-project.git] / mcs / tests / test-469.cs
blob5d62dbf895ce6c906d13851fae6bf57702bf5c4b
1 //
2 // Do not extend this test
3 //
4 // This test copes with the case where a parameter was already captured
5 // and a second anonymous method on the same scope captured a parameter
6 //
7 using System;
9 delegate void Del (int n);
11 class Lambda {
13 static int v;
15 static void f (int va)
17 v = va;
20 static Del[] Make2 (int x) {
21 return new Del[] {
22 delegate (int a) { f(x += a); },
23 delegate (int b) { f(x += b); }
27 public static int Main () {
28 Del[] d = Make2(10);
29 d[0](10);
30 if (v != 20)
31 return 1;
33 d[1](11);
34 if (v != 31)
35 return 2;
36 Console.WriteLine ("OK");
37 return 0;