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:
authorBernhard Urban <bernhard.urban@xamarin.com>2017-02-27 19:55:53 +0300
committerBernhard Urban <bernhard.urban@xamarin.com>2017-03-01 00:59:28 +0300
commit84e9a10987fa04bd2c3b7e81d27888a6b9096e6a (patch)
tree5b0bf76c73b4a07b592f61b23387459c5ce9014c
parentca8f94773d58262228071e9edf81aee6df3a287c (diff)
[objects.cs] testcase for delegate with instance method that uses `this'
-rw-r--r--mono/mini/objects.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/mono/mini/objects.cs b/mono/mini/objects.cs
index 3aa8a24aaf4..9cbbcd28f54 100644
--- a/mono/mini/objects.cs
+++ b/mono/mini/objects.cs
@@ -876,6 +876,23 @@ class Tests {
return 2;
}
+ class InstanceDelegateTest {
+ public int a;
+
+ public int return_field () {
+ return a;
+ }
+ }
+
+ public static int test_2_instance_delegate_with_field () {
+ InstanceDelegateTest t = new InstanceDelegateTest () { a = 1337 };
+ GetIntDel del = new GetIntDel (t.return_field);
+ int v = del ();
+ if (v != 1337)
+ return 0;
+ return 2;
+ }
+
interface IFaceVirtualDel {
int return_field ();
}