diff options
author | Bernhard Urban <bernhard.urban@xamarin.com> | 2017-02-27 19:55:53 +0300 |
---|---|---|
committer | Bernhard Urban <bernhard.urban@xamarin.com> | 2017-03-01 00:59:28 +0300 |
commit | 84e9a10987fa04bd2c3b7e81d27888a6b9096e6a (patch) | |
tree | 5b0bf76c73b4a07b592f61b23387459c5ce9014c | |
parent | ca8f94773d58262228071e9edf81aee6df3a287c (diff) |
[objects.cs] testcase for delegate with instance method that uses `this'
-rw-r--r-- | mono/mini/objects.cs | 17 |
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 (); } |