Merge pull request #4938 from kumpera/optimize_ref_queries
[mono.git] / mono / tests / delegate10.cs
1 using System;
2 using System.Reflection;
3
4 public class Tests
5 {
6         public struct Test {
7                 public string MyProp {get; set;}
8         }
9
10         delegate string GetterDelegate (ref Test arg);
11
12         public static int Main (String[] args) {
13                 var m = typeof (Tests.Test).GetProperty ("MyProp").GetMethod;
14
15                 var d = (GetterDelegate)m.CreateDelegate (typeof (GetterDelegate));
16
17                 var s = new Test () { MyProp = "A" };
18                 if (d (ref s) == "A")
19                         return 0;
20                 else
21                         return 1;
22         }
23 }