1 /* This test is extracted from System.Core tests, that happens to be
2 * problematic if *all* assemblies are full-aot'd, but the interpreter is still
6 using System
.Collections
.Generic
;
7 using System
.Reflection
;
9 using System
.Linq
.Expressions
;
18 public Gazonk Gazoo { get; set; }
20 public string Gruik { get; set; }
24 Gazoo
= new Gazonk ();
34 public string Couic { get; set; }
36 public string Bang () { return ""; }
39 public static int CompiledMemberBinding ()
41 var getfoo
= Expression
.Lambda
<Func
<Foo
>> (
42 Expression
.MemberInit (
43 Expression
.New (typeof (Foo
)),
44 Expression
.MemberBind (
45 typeof (Foo
).GetProperty ("Gazoo"),
46 Expression
.Bind (typeof (Gazonk
).GetField ("Tzap"),
47 Expression
.Constant ("tzap")),
48 Expression
.Bind (typeof (Gazonk
).GetField ("Klang"),
49 Expression
.Constant (42))))).Compile ();
55 if (foo
.Gazoo
.Klang
!= 42)
57 if (foo
.Gazoo
.Tzap
!= "tzap")
63 public static int Main (string []args
)
65 return CompiledMemberBinding ();