2 using System
.Reflection
;
3 using System
.Globalization
;
4 using System
.Diagnostics
;
6 /* Regression test for https://github.com/mono/mono/issues/7944 */
9 public string Prop1 { get; set; }
10 public string Prop2 { get; set; }
14 var prop1Setter
= this.GetType ().GetProperty (nameof (Prop1
)).GetSetMethod ();
15 var prop2Setter
= this.GetType ().GetProperty (nameof (Prop2
)).GetSetMethod ();
16 var prop1Delegate
= (Action
<MyClass
, string>) prop1Setter
.CreateDelegate(typeof (Action
<MyClass
, string>));
17 var prop2Delegate
= (Action
<MyClass
, string>) prop2Setter
.CreateDelegate(typeof (Action
<MyClass
, string>));
18 prop1Delegate (this, "prop1Value");
19 prop2Delegate (this, "prop2Value");
21 // Console.WriteLine ($"prop1: {Prop1}");
22 // Console.WriteLine ($"prop2: {Prop2}");
25 public static int Main (string []args
) {
26 var o
= new MyClass ();
29 if (o
.Prop1
!= "prop1Value")
32 if (o
.Prop2
!= "prop2Value")