diff options
author | Marek Safar <marek.safar@gmail.com> | 2010-10-07 22:14:48 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2010-10-07 22:15:52 +0400 |
commit | 28e9fa14f3331c6dcc4b799d6748ddb172d84ae1 (patch) | |
tree | 359e58a1ef99dba91088b5dca3438876ab8b7bd6 /mcs/tests/dtest-036.cs | |
parent | f0e9b848d822239055053a51e8f35c04c74a456f (diff) |
Fix compound event assigments with dynamic side effect
Diffstat (limited to 'mcs/tests/dtest-036.cs')
-rw-r--r-- | mcs/tests/dtest-036.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mcs/tests/dtest-036.cs b/mcs/tests/dtest-036.cs new file mode 100644 index 00000000000..9b5bbc095bc --- /dev/null +++ b/mcs/tests/dtest-036.cs @@ -0,0 +1,29 @@ +using System; + +public class C +{ + event Func<int, int> E; + Func<int, int> D; + + public static int Main () + { + var c = new C (); + Func<int, int> v = Foo; + dynamic[] arr = new dynamic [] { v }; + + c.E += arr [0]; + if (c.E.GetInvocationList ().Length != 1) + return 1; + + c.D += arr [0]; + if (c.D.GetInvocationList ().Length != 1) + return 2; + + return 0; + } + + static int Foo (int ii) + { + return 9; + } +} |