Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

39
mcs/tests/test-469.cs Normal file
View File

@@ -0,0 +1,39 @@
//
// Do not extend this test
//
// This test copes with the case where a parameter was already captured
// and a second anonymous method on the same scope captured a parameter
//
using System;
delegate void Del (int n);
class Lambda {
static int v;
static void f (int va)
{
v = va;
}
static Del[] Make2 (int x) {
return new Del[] {
delegate (int a) { f(x += a); },
delegate (int b) { f(x += b); }
};
}
public static int Main () {
Del[] d = Make2(10);
d[0](10);
if (v != 20)
return 1;
d[1](11);
if (v != 31)
return 2;
Console.WriteLine ("OK");
return 0;
}
}